Vous êtes sur la page 1sur 82

Login.

php $accesslevel = $resultarray[0];

<?php $_SESSION['empID'] = $uname;

include("config.php"); $log = mysql_query("UPDATE


empaccount SET log_lastlogin = now()
if(isset($_POST['submit'])){ where empID = '$uname'");
session_start(); if($accesslevel == "1")
$uname = ""; { session_start();
$pword = ""; $_SESSION['login'] = "1";
$errorMessage = ""; header ("Location:
$num_rows = 0; /kms/kmsadmin/Home.php");

$uname = $_POST['empID']; } else if($accesslevel == "2")

$pword = $_POST['password']; { session_start();

$uname = htmlspecialchars($uname); $_SESSION['login'] = "1";

$pword = htmlspecialchars($pword); header ("Location:


/kms/unit/Home.php");
$_SESSION['empID'] = $uname;
} else if($accesslevel=="3")
if ($db) {
{ session_start();
$query = mysql_query ("SELECT EmpID
from empaccount where EmpID='$uname' $_SESSION['login'] = "1";
AND password='$pword'"); header ("Location:
$num = mysql_num_rows($query); /kms/chairperson/Home.php");

if ($num > 0) //login was successful } else if($accesslevel=="4")

{ // Check Access Level { session_start();

$query1 = "SELECT accessLevel from $_SESSION['login'] = "1";


empaccount where empID ='$uname'"; header ("Location:
$res = @mysql_query($query1); /kms/employee/Home.php");

$resultarray = array(); }}

$resultarray = mysql_fetch_assoc($res, else // Login unsuccessful


MYSQL_NUM);
{ $errormessage = "Log-in not successful, <table align="center" bgcolor="white"
please try again!"; frame="box">

echo "<SCRIPT> <form action='' method='POST'>

alert('$errormessage'); <tr> <th colspan="3"><h3> LPU


window.location.href='login.php'; KNOWLEDGE MANAGEMENT
SYSTEM </h3></th>
</SCRIPT>";
</tr> <tr>
include("login.php");
<td height="40" width="40"><center><font
}} color="black"><b>Username:</b></font></
mysql_close($db); center></td>

}// End of PHP Code <td height="40"


width="40"><center><input type='text'
//Below is the html code for it placeholder="Employee ID"
name='empID'></center></td>
?>
</tr> <tr>
<!DOCTYPE html>
<td height="40"
<html>
width="40"><center><font
<head> color="black"><b>Password:</b></font></
center></td>
<link rel="stylesheet" type="text/css"
href="./css/style.css"> <td height="40"
width="40"><center><input
<title>LPU Knowledge Management type='password' name='password'
System</title> placeholder="Password"></center></td>
</head> </tr> <tr> <td></td>
<body background="./images/lpu1.png"> <td width="5"><input type='submit'
class="button" name="submit" value='Log
<?php
in'> &nbsp;
include('header.php');
<input type='reset' class="button"
?> value='Cancel'></td>

<center> </tr> <tr>

<div class="login"> <td height="5" colspan="3"></td>

<br><br> </tr> </form></table></center>


</div></body></html> color: #4d4d4d;

Style.css }

body{ .header{

background-color: #e1f2ea; font-family: Arial;

background-repeat:no-repeat; background: #e1f2ea;

background-size: 100%; position: fixed;

} width:100%;

select{ overflow:hidden;

border: 2px solid #ccc; margin: 0px;

font-size: 14px; padding-right: 0px;

height: 34px; top:0;

width: 268px; left:0;

} }

.form input::-webkit-input-placeholder, .header img{


textarea::-webkit-input-placeholder {
width:100%;
color: #4d4d4d;
height:100px;
}
}
.form input:-moz-placeholder, textarea:-
moz-placeholder { .header ul {

color: #4d4d4d; list-style-type: none;

} margin: 0;

.form input::-moz-placeholder, textarea::- padding: 0;


moz-placeholder { overflow: hidden;
color: #4d4d4d; border: 2px solid #e7e7e7;
} background-color:#f3f3f3;
.form input:-ms-input-placeholder, textarea:- font-size: 12px;
ms-input-placeholder{
top: 0; /* Position the navbar at the top of display: block;
the page */
color: black;
width: 100%; /* Full width */
text-align: center;
}
padding: 14px 16px;
.header li {
text-decoration: none;
border-right: 1px solid #bbb;
}
float: left;
.header h3{
}
background-color: grey;
.header li a {
color:black;
display: block;
}
color: black;
.header li:float-right{
text-align: center;
font-family: cursive;
padding: 14px 16px;
}
text-decoration: none;
.button {
}
padding: 8px 16px;
.header li a:hover:not(.active) {
font-size: 14px;
background-color: #ddd;
text-align: center;
color:black;
cursor: pointer;
}
outline: none;
.header li a.active {
color: #fff;
color: white;
background-color: #b32400;
background-color: #b32400;
border: none;
}
border-radius: 15px;
.header li:last-child {
box-shadow: 0 3px #999;
border-left: none;
}
.button:hover {background-color:#4CAF50} outline: none;

.button:active { display: block;

background-color: #3e8e41; width: 100%;

box-shadow: 0 5px #666; padding: 7px;

transform: translateY(4px); border: none;

} border-bottom: 1px solid #ddd;

.contains{ background: transparent;

font-family: Arial; margin-bottom: 10px;

padding-top: 12%; font: 15px Arial, Helvetica, sans-serif;

padding-left: 1%; height: 45px;

padding-right: 1%; }

/*margin-left: 1%; #myInput {

margin-right: 1%;*/ background-image:


url('../../images/searchicon.png'); /* Add a
float:center; search icon to input */
background-color: white; background-position: 10px 12px; /*
} Position the search icon */

.contains h2.headings, h3.headings, background-repeat: no-repeat; /* Do not


h4.headings{ repeat the icon image */

font-weight: bold; width: 20%; /* Full-width */

border-bottom: 1px solid #ddd; font-size: 16px; /* Increase font-size */

} padding: 12px 20px 12px 40px; /* Add


some padding */
.form input[type=text], textarea{
border: 1px solid #ddd; /* Add a grey
box-sizing: border-box; border */

-webkit-box-sizing: border-box; margin-bottom: 12px; /* Add some space


below the input */
-moz-box-sizing: border-box;
}
#myTable { border-bottom: 1px solid #ddd;

border-collapse: collapse; /* Collapse }


borders */
#myTable tr.headings, #myTable tr:hover {
width: 100%; /* Full-width */
/* Add a grey background color to the
border: 1px solid #ddd; /* Add a grey table header and on hover */
border */
background-color: #f1f1f1;
font-family: arial;
}
background-color: transparent;
.kmsid{
border: none;
font-family: arial;
color: black;
background-color: transparent;
cursor: pointer;
border: none;
font-size: 14px;
color: black;
}
cursor: pointer;
#myTable th{
font-size: 14px;
background-color: #b32400;
}
text-align: left; /* Left-align text */
#myTablekms {
padding: 10px; /* Add padding */
border-collapse: collapse; /* Collapse
color:white; borders */

} width: 100%; /* Full-width */

#myTable td { border: 1px solid #ddd; /* Add a grey


border */
text-align: left; /* Left-align text */
font-family: arial;
padding: 3px; /* Add padding */
background-color: transparent;
}
border: none;
#myTable tr {
color: black;
/* Add a bottom border to all table rows
*/ cursor: pointer;
font-size: 14px; if (!(isset($_SESSION['login']) &&
$_SESSION['login'] != '')) {
table-layout: fixed;
header ("Location: ../../kms/login.php");
}
}
#myTablekms th{
include('./includes/config.php');
text-align: center; /* Left-align text */
$empID = $_SESSION['empID'];
padding: 10px; /* Add padding */
$queryac = "SELECT Firstname,Lastname
color:black; from empinfo where EmpID='$empID'";
} $resultac = @mysql_query ($queryac);
#myTablekms td { $queryresultac = array();
text-align: center; /* Left-align text */ $queryresultac =
padding: 3px; /* Add padding */ mysql_fetch_array($resultac,
MYSQL_NUM);
}
$fname = $queryresultac[0];
#myTablekms tr {
$lname = $queryresultac[1];
/* Add a bottom border to all table rows
*/ ?>

border-bottom: 1px solid #ddd; <!DOCTYPE html>

} <html>

#myTablekms tr.headings, #myTablekms <head>


tr:hover { <link rel="stylesheet" type="text/css"
/* Add a grey background color to the href="./includes/style.css">
table header and on hover */ <title>LPU Knowledge Management
background-color: #f1f1f1; System</title>

} </head>

Home.php <body>

<?PHP <div class="header">

session_start(); <img src="../images/logo.png">


<b><ul> formertrans, lasttrans FROM kms INNER
JOIN eventinfo on kms.eventID =
<li><a class="active" eventinfo.eventID where (empID='$empID')
href="home.php">Dashboard</a></li> OR status='$empID'";
<li><a href="createevent.php">Create $result = @mysql_query($query);
Event</a></li>
if($result)
<li><a href="reports.php">Reports</a></li>
{echo '<br>
<li><a
href="recommendations.php">Recommenda <form action="showinfo.php"
tions</a></li> method="POST">

<li><a href="empmngt.php">Employee <script src="sorttable.js"></script>


Management</a></li>
<br>
<li><a
href="changepwsd.php">Password</a></li> <table border="1" class="sortable"
id="myTable" align="center"
<li style=float:right><a class="logout" cellspacing="5" cellpadding="5" sortable>';
href="logout.php">Log-out</a></li>
// Table headers
<li style=float:right><?php echo "".
$fname." ".$lname." (".$empID.")";?></li> echo'<b><tr class="headings">

</ul></b><br></div> <th align="center" height="28"


width="200"><b>Event Title</th>
<div class="contains">
<th align="Center" height="28"
<h4><?php echo''.$fname.' '.$lname.''; ? width="30"><b>KMS ID </th>
></h4><hr>
<th align="center" height="28"
<h2><center>MY KMS</h2> width="50"><b>Employee</th>

<input type="text" id="myInput" <th align="center" height="28"


onkeyup="myFunction()" width="50"><b>Status</th>
placeholder="Search for Event Title..">
</tr></b>';
<script src="filter.js"></script>
//Table content
<?php
$ifsentback ="";
$query = "SELECT kmsID, empID,
eventinfo.eventName, formerstatus, $total = mysql_num_rows($result);
Sentback, log_transaction, status, for ($num=0; $num < $total; $num++ )
{ $row = {$querysup = "SELECT FirstName,
mysql_fetch_array($result, MYSQL_NUM); LastName from empinfo where empID
='$row[7]'";
$queryname = "SELECT FirstName,
LastName from empinfo where empID $resultsup = @mysql_query($querysup);
='$row[1]'";
$resultarraysup = array();
$resultname = @mysql_query($queryname);
$resultarraysup =
$resultarrayname = array(); mysql_fetch_assoc($resultsup,
MYSQL_NUM);
$resultarrayname =
mysql_fetch_assoc($resultname, $Fsup = $resultarraysup[0];
MYSQL_NUM);
$Lsup = $resultarraysup[1];
$Fname = $resultarrayname[0];
$stat = $row[8];
$Lname = $resultarrayname[1];
}echo'<tr>
$queryac = "SELECT accessLevel from
empaccount where empID ='$row[1]'"; <td align="left" height="30" width="30">'.
$row[2].'</td>
$resultac = @mysql_query($queryac);
<td align="left" height="30"
$resultarrayac = array(); width="30"><input type="submit" value="'.
$row[0].'" class="kmsid"
$resultarrayac = name="search"></td>
mysql_fetch_assoc($resultac,
MYSQL_NUM); <td align="left" height="30" width="30">'.
$Fname.' '.$Lname.'</td>
$Level = $resultarrayac[0];
<td align="left" height="30" width="30">'.
if($row[6] == "New" || $row[6] == $stat.''.$Fsup.' '.$Lsup.'<br><font
"Approved") size="2">'.$row[5].'</td>';
{ $Lsup = $row[6]; }echo "</tr>\n";
$Fsup = " "; echo'</table>
$stat = ""; </form><br>';
} }else{echo "No result";}
else $querys = "SELECT eventName, Topic,
eventType, Venue, eventID from eventinfo
where creator='$empID'";
$results = @mysql_query($querys); <td align="left" height="30" width="30">'.
$rows[0].' - <input type="submit" value="'.
if($results) $rows[4].'" class="kmsid"
{ echo '<br><br><hr> name="event"></td>

<center><h3> Created Events <td align="left" height="30" width="30">'.


</h3></center> $rows[1].'</td>

<form action="eventmngt.php" <td align="left" height="30" width="30">'.


method="POST"> $rows[2].'</td>

<script src="sorttable.js"></script> <td align="left" height="30" width="30">'.


$rows[3].'</td>';
<br>
} echo "</tr>\n";
<table border="1" class="sortable"
id="myTable" align="center" echo'</table>
cellspacing="5" cellpadding="5" sortable>'; </form>
// Table headers <br>';
echo'<b><tr class="headings"> }mysql_close();
<th align="center" height="28" ?>
width="200"><b>Event Name</th>
ApproverKMS.php
<th align="Center" height="28"
width="30"><b>Topic</th> <?php

<th align="center" height="28" session_start();


width="50"><b>Event Type</th>
include("./includes/config.php");
<th align="center" height="28"
width="50"><b>Venue</th> $Search = $_SESSION['search'];

</tr></b>'; $EmpID = $_SESSION['empID'];

//Table content $queryuser = "SELECT empID,Status,


submitdate, eventID from KMS where
$totals = mysql_num_rows($results); kmsID='$Search'";

for ($nums=0; $nums < $totals; $nums++ ) $resultuser = @mysql_query ($queryuser);

{$rows = mysql_fetch_array($results, $queryresult = array();


MYSQL_NUM); echo'<tr>
$queryresult = $queryresultac = array();
mysql_fetch_array($resultuser,
MYSQL_NUM); $queryresultac =
mysql_fetch_array($resultac,
$Sender = $queryresult[0]; MYSQL_NUM);

$Approver = $queryresult[1]; $fname = $queryresultac[0];

$submitdate = $queryresult[2]; $lname = $queryresultac[1];

$event = $queryresult[3]; $query = mysql_query("SELECT


eventName, Topic, eventType, eventStart,
$querysend = "SELECT lastName, eventEnd, HostOrg, Venue from eventinfo
firstName from empinfo where
empID='$Sender'"; where eventID='$event'");

$resultsend = @mysql_query ($querysend); $KMS = array();

$queryressend = array(); echo '

$queryressend = <!DOCTYPE html>


mysql_fetch_array($resultsend,
MYSQL_NUM); <html>

$SenderL = $queryressend[0]; <head>

$SenderF = $queryressend[1]; <link rel="stylesheet" type="text/css"


href="./includes/style.css">
$queryapp = "SELECT lastName, firstName
from empinfo where empID='$Approver'"; <title>LPU KMS - '.$Search.'</title>

$resultapp = @mysql_query ($queryapp); </head>

$queryresapp = array(); <body>

$queryresapp = <div class="header">


mysql_fetch_array($resultapp, <img src="../images/logo.png">
MYSQL_NUM);
<b><ul> <li><a
$ApproverL = $queryresapp[0]; href="home.php">Dashboard</a></li>
$ApproverF = $queryresapp[1]; <li><a href="createevent.php">Create
$queryac = "SELECT Firstname,Lastname Event</a></li>
from empinfo where EmpID='$EmpID'"; <li><a href="reports.php">Reports</a></li>
$resultac = @mysql_query ($queryac);
<li><a <th align="center" ><b>Supervisor</th>
href="recommendations.php">Recommenda
tions</a></li> <th align="center" ><b>Submission
Date</th></tr></b>';
<li><a href="empmngt.php">Employee
Management</a></li> echo'<tr>

<li><a <td align="left" height="30" width="30">'.


href="changepwsd.php">Password</a></li> $Search.'</td>

<li><a href="logout.php">Log-out</a></li> <td align="left" height="30" width="30">'.


$SenderL.', '.$SenderF.'</td>
<li style=float:right><a class="logout"
href="logout.php">Log-out</a></li> <td align="left" height="30" width="30">'.
$ApproverL.', '.$ApproverF.'</td>
<li style=float:right>'.$fname.' '.$lname.' ('.
$EmpID.')</li> <td align="left" height="30" width="30">'.
$submitdate.'</td>
</ul></b><br>
</tr></table>';
</div>
echo "<center><br><br>
<div class="contains">';
<table border='1' class='sortable'
while ($row = mysql_fetch_assoc($query)) id='myTablekms' align='center'
cellspacing='5' cellpadding='5' sortable>";
$KMS[] = $row;
echo'<b><tr>
foreach($KMS as $x)
<th align="center" ><b>Event Type</th>
{ echo "<center>
<th align="Center" ><b>Event Date (Start -
<h2 class='headings'>". End) </th>
$x['eventName']."<br><font size='3'>".
$x['Topic']."</font></h2> <th align="center" ><b>Venue</th>

<table border='1' <th align="center" ><b>Host


class='sortable' id='myTablekms' Organization</th>
align='center' cellspacing='5' cellpadding='5'
sortable>"; </tr></b>';

echo'<b><tr> echo'<tr>

<th align="center" <td align="left" height="30" width="30">'.


><b>KMS ID</th> $x["eventType"].'</td>

<th align="Center" ><b>Employee </th>


<td align="left" height="30" width="30">'. $resultarray = mysql_fetch_assoc($result,
$x["eventStart"].' - '.$x["eventEnd"].'</td> MYSQL_NUM);

<td align="left" height="30" width="30">'. $Sender = $resultarray[0];


$x["HostOrg"].'</td>
$KMS_Status = $resultarray[1];
<td align="left" height="30" width="30">'.
$x["Venue"].'</td> $Comment = $resultarray[2];

</tr></table>'; $SentBack = $resultarray[3];

echo "<br><br />"; foreach($KMS1 as $x1)

} $query3 = mysql_query("SELECT {echo '<form action="Approval.php"


Approach, Deployment, Learning, method="POST">
Integration, Timeline from kmsadli <center><h4 class="headings">Process
where kmsID='$Search'"); (ADLI)<br><font size="3">Within the
Unit</font></h4>
$KMS1 = array();
</center><table align="center"><tr>
while ($row = mysql_fetch_assoc($query3))
<td height="40" width="120"><font
$KMS1[] = $row; color="black">Approach:</font></td>

$query4 = mysql_query("SELECT UnitR, <td height="30"


ApproachR, DeploymentR, LearningR, width="600"><br><textarea readonly
IntegrationR, TimelineR from class="textinput" readonly
recommendations name="Approach" id="Approach"
cols="40" rows="4" size="5000"
where kmsID='$Search'"); placeholder="Not filled up by Employee">'.
$KMS2 = array(); $x1['Approach'].'</textarea></td></tr>

while ($row2 = <tr> <td height="40"


mysql_fetch_assoc($query4)) width="120"><font
color="black">Deployment:</font></td>
$KMS2[] = $row2;
<td height="30"
$query2 = "SELECT EmpID, Status, width="600"><br><textarea readonly
Comments, SentBack from kms where class="textinput" readonly
kmsID ='$Search'"; name="Deployment" id="Deployment"
cols="40" rows="4" size="5000"
$result = @mysql_query($query2);
placeholder="Not filled up by Employee">'.
$resultarray = array(); $x1['Deployment'].'</textarea></td> </tr>
<tr> </center>

<td height="40" width="120"><font <table align="center">


color="black">Learning:</font></td>
<tr>
<td height="30"
width="600"><br><textarea readonly <td height="40" width="120"><font
class="textinput" readonly color="black">Unit:</font></td>
name="Learning" id="Learning" cols="40" <td height="30"
rows="4" size="5000" placeholder="Not width="600"><br><textarea readonly
filled up by Employee">'. class="textinput"readonly name="UnitR"
$x1['Learning'].'</textarea></td> id="UnitR" cols="40" rows="1"
</tr><tr> size="5000" placeholder="Not filled up by
Employee">'.$x1['UnitR'].'</textarea></td>
<td height="40" width="120"><font
color="black">Integration:</font></td> </tr> <tr>

<td height="30" <td height="40" width="120"><font


width="600"><br><textarea readonly color="black">Approach:</font></td>
class="textinput" readonly <td height="30"
name="Integration" id="Integration" width="600"><br><textarea readonly
cols="40" rows="4" size="5000" class="textinput"readonly
placeholder="Not filled up by Employee">'. name="ApproachR" id="ApproachR"
$x1['Integration'].'</textarea></td></tr><tr> cols="40" rows="4" size="5000"
<td height="40" width="120"><font placeholder="Not filled up by Employee">'.
color="black">Timeline:</font></td> $x1['ApproachR'].'</textarea></td>

<td height="30" </tr><tr>


width="600"><br><textarea readonly <td height="40" width="120"><font
class="textinput" readonly name="Timeline" color="black">Deployment:</font></td>
id="Timeline" placeholder="Not filled up by
Employee">'. <td height="30"
$x1['Timeline'].'</textarea></td> width="600"><br><textarea readonly
class="textinput"readonly
</tr></table>'; } name="DeploymentR" id="DeploymentR"
foreach($KMS2 as $x1) cols="40" rows="4" size="5000"
placeholder="Not filled up by Employee">'.
{ echo' <br> $x1['DeploymentR'].'</textarea></td></tr>
<tr>
<center><h4
class="headings">Recommendations<br><f <td height="40" width="120"><font
ont size="3">for other units</font></h4> color="black">Learning:</font></td>
<td height="30" <br><center><table><td><tr>
width="600"><br><textarea readonly
class="textinput"readonly <input type="submit" class="button"
name="LearningR" id="LearningR" id="sendback" name="sendback"
cols="40" rows="4" size="5000" value="Send Back">
placeholder="Not filled up by Employee">'. </tr><tr>&nbsp; &nbsp;
$x1['LearningR'].'</textarea></td></tr><tr>
<input type="submit" class="button"
<td height="40" width="120"><font id="approve" name="approve"
color="black">Integration:</font></td> value="Approve"></tr></table></form><br
<td height="30" ><br> <hr> </form>
width="600"><br><textarea readonly <form action="Home.php">
class="textinput"readonly
name="IntegrationR" id="IntegrationR" <center><input type="submit"
cols="40" rows="4" size="5000" class="button" value="Back"></center>
placeholder="Not filled up by Employee">'.
</form><br> <br>
$x1['IntegrationR'].'</textarea></td></tr><tr
> </div> ';
<td height="40" width="120"><br><font mysql_close();
color="black">Timeline:</font></td>
?>
<td height="30"
width="600"><br><textarea readonly SenderKMS.php
class="textinput"readonly
<?php
name="TimelineR" id="TimelineR">'.
$x1['TimelineR'].'</textarea include(".\includes\config.php");
placeholder="Not filled up by
Employee"></td></tr> session_start();

</table><br>'; $Search = $_SESSION['search'];

} echo' $EmpID = $_SESSION['empID'];

<hr><br><h4 $querysend = "SELECT lastName,


class="headings">Comments</h4> firstName, supervisor from empinfo where
empID='$EmpID'";
<textarea name="comments"
class="textinput" id="comments" cols="40" $resultsend = @mysql_query ($querysend);
rows="3" placeholder="Write your $queryressend = array();
comments here" size="5000">'.
$Comment.'</textarea>
$queryressend = $queryrkms = array();
mysql_fetch_array($resultsend,
MYSQL_NUM); $queryrkms =
mysql_fetch_array($resultkms,
$SenderL = $queryressend[0]; MYSQL_NUM);

$SenderF = $queryressend[1]; $event = $queryrkms[0];

$SupervisorID = $queryressend[2]; $status = $queryrkms[1];

$queryac = "SELECT Firstname,Lastname $submitDate = $queryrkms[2];


from empinfo where EmpID='$empID'";
$query = mysql_query("SELECT
$resultac = @mysql_query ($queryac); EventName, Topic, eventType, eventStart,
eventEnd, HostOrg, Venue from eventInfo
$queryresultac = array();
where eventID ='$event'");
$queryresultac =
mysql_fetch_array($resultac, $KMS = array();
MYSQL_NUM);
echo '
$fname = $queryresultac[0];
<!DOCTYPE html>
$lname = $queryresultac[1];
<html>
$queryapp = "SELECT lastName, firstName
from empinfo where empID = <head>
'$SupervisorID'"; <link rel="stylesheet" type="text/css"
$resultapp = @mysql_query ($queryapp); href="./includes/style.css">

$queryresapp = array(); <title>LPU KMS - '.$Search.'</title>

$queryresapp = </head>
mysql_fetch_array($resultapp, <body>
MYSQL_NUM);
<div class="header">
$ApproverL = $queryresapp[0];
<img src="../images/logo.png">
$ApproverF = $queryresapp[1];
<b><ul> <li><a
$querykms = "SELECT eventID, status, href="home.php">Dashboard</a></li>
submitDate from kms where kmsID =
'$Search'"; <li><a href="createevent.php">Create
Event</a></li>
$resultkms = @mysql_query ($querykms);
<li><a href="reports.php">Reports</a></li>
<li><a <th align="center" ><b>Submission
href="recommendations.php">Recommenda Date</th>
tions</a></li>
</tr></b>';
<li><a href="empmngt.php">Employee
Management</a></li> echo'<tr>

<li><a <td align="left" height="30" width="30">'.


href="changepwsd.php">Password</a></li> $Search.'</td>

<li><a href="logout.php">Log-out</a></li> <td align="left" height="30" width="30">'.


$SenderL.', '.$SenderF.'</td>
<li style=float:right><a class="logout"
href="logout.php">Log-out</a></li> <td align="left"
height="30" width="30">'.$ApproverL.', '.
<li style=float:right>'.$fname.' '.$lname.' ('. $ApproverF.'</td>
$EmpID.')</li>
<td align="left" height="30" width="30">'.
</b><br></div> $submitDate.'</td>

<div class="contains">'; </tr></table>';

while ($row = mysql_fetch_assoc($query)) echo "<center><br><br>

$KMS[] = $row; <table border='1' class='sortable'


id='myTablekms' align='center'
foreach($KMS as $x) cellspacing='5' cellpadding='5' sortable>";
{ echo "<center> echo'<b><tr>
<h2 class='headings'>". <th align="center" ><b>Event Type</th>
$x['EventName']."<br><font size='3'>".
$x['Topic']."</font></h2> <th align="Center" ><b>Event Date (Start -
End) </th>
<table border='1' class='sortable'
id='myTablekms' align='center' <th align="center" ><b>Venue</th>
cellspacing='5' cellpadding='5' sortable>";
<th align="center" ><b>Host
echo'<b><tr> Organization</th>

<th align="center" ><b>KMS ID</th> </tr></b>';

<th align="Center" ><b>Employee </th> echo'<tr>

<th align="center" ><b>Supervisor</th> <td align="left" height="30" width="30">'.


$x["eventType"].'</td>
<td align="left" height="30" width="30">'. where kmsID='$Search'");
$x["eventStart"].' - '.$x["eventEnd"].'</td>
$ADLIR = array();
<td align="left" height="30" width="30">'.
$x["HostOrg"].'</td> while ($row4 =
mysql_fetch_assoc($query4))
<td align="left" height="30" width="30">'.
$x["Venue"].'</td> $ADLIR[] = $row4;

</tr></table>'; if ($Stat == "New" || $Stat == "$Sender")

echo "<br><br />"; {foreach($ADLI as $adli)

} $query2 = "SELECT status,empID, {echo '<form action="SendKMS.php"


comments from kms where kmsID method="POST">
='$Search'"; <center><h4 class="headings">Process
$result = @mysql_query($query2); (ADLI)<br><font size="3">Within the
Unit</font></h4>
$resultarray = array();
</center>
$resultarray = mysql_fetch_assoc($result,
MYSQL_NUM); <table align="center">

$Stat = $resultarray[0]; <tr>

$Sender = $resultarray[1]; <td height="40" width="120"><font


color="black">Approach:</font></td>
$Comment = $resultarray[2];
<td height="30"
$query3 = mysql_query("SELECT width="600"><br><textarea
Approach, Deployment, Learning, name="Approach" id="Approach"
Integration, Timeline from kmsadli cols="40" rows="4" size="5000"
placeholder="What approach is (are)
where kmsID='$Search'"); appropiate to realize the desired KPI of this
$ADLI = array(); activity(ies)?">'.
$adli['Approach'].'</textarea></td></tr>
while ($row3 =
mysql_fetch_assoc($query3)) <tr>

$ADLI[] = $row3; <td height="40" width="120"><font


color="black">Deployment:</font></td>
$query4 = mysql_query("SELECT UnitR,
ApproachR, DeploymentR, LearningR, <td height="30"
IntegrationR, TimelineR from width="600"><br><textarea
recommendations name="Deployment" id="Deployment"
cols="40" rows="4" size="5000" </table>';
placeholder="How will you deploy your
approaches? To what extent is the } foreach($ADLIR as $adlir)
deployment?">'. { echo'
$adli['Deployment'].'</textarea></td></tr>
<br><hr><br>
<tr>
<center><h4
<td height="40" width="120"><font class="headings">Recommendations<br><f
color="black">Learning:</font></td> ont size="3">for other units</font></h4>
<td height="30" </center>
width="600"><br><textarea
name="Learning" id="Learning" cols="40" <table align="center">
rows="4" size="5000" placeholder="How
<tr>
will the results of the activities be utilized to
ensure personal learning and organizational <td height="40" width="120"><font
learning?">'. color="black">Unit:</font></td>
$adli['Learning'].'</textarea></td></tr><tr>
<td height="30"
<td height="40" width="120"><font width="600"><br><textarea name="UnitR"
color="black">Integration:</font></td> id="UnitR" cols="40" rows="1"
size="5000" placeholder="Unit to
<td height="30"
Recommend to">'.
width="600"><br><textarea
$adlir['UnitR'].'</textarea></td></tr>
name="Integration" id="Integration"
cols="40" rows="4" size="5000" <tr>
placeholder="How can the strength and
OFIs be integratedin the operational plan of <td height="40" width="120"><font
the concerned unit/stakeholders?">'. color="black">Approach:</font></td>
$adli['Integration'].'</textarea></td></tr>
<td height="30"
<tr>
width="600"><br><textarea
<td height="40" width="120"><font name="ApproachR" id="ApproachR"
color="black">Timeline:</font></td> cols="40" rows="4" size="5000"
placeholder="What approach is (are)
<td height="30" appropiate to realize the desired KPI of this
width="600"><br><textarea activity(ies)?">'.
name="Timeline" id="Timeline" $adlir['ApproachR'].'</textarea></td></tr>
placeholder="Timeline">'.
$adli['Timeline'].'</textarea></td> <tr>

</tr> <td height="40" width="120"><font


color="black">Deployment:</font></td>
<td height="30" placeholder="Timeline">'.
width="600"><br><textarea $adlir['TimelineR'].'</textarea></td>
name="DeploymentR" id="DeploymentR"
cols="40" rows="4" size="5000" </tr></table><br>
placeholder="How will you deploy your <input name = "submit" class="button" type
approaches? To what extent is the = "submit" alt="submit" value ="Save and
deployment?">'. Send"> &nbsp;
$adlir['DeploymentR'].'</textarea></td></tr
><tr> <input name = "save" type = "submit"
class="button" alt = "save" value = "Save">
<td height="40" width="120"><font &nbsp;';
color="black">Learning:</font></td>
}if ($Stat == "New") {
<td height="30"
width="600"><br><textarea echo' <input type="reset" class="button"
name="LearningR" id="LearningR" value="Clear">
cols="40" rows="4" size="5000"
</form>';
placeholder="How will the results of the
activities be utilized to ensure personal } else{
learning and organizational learning?">'.
$adlir['LearningR'].'</textarea></td></tr><t echo '
r>
<br><br>
<td height="40" width="120"><font
<textarea readonly name="comments"
color="black">Integration:</font></td>
id="comments" cols="40" rows="3"
<td height="30" placeholder="Write your comments here"
width="600"><br><textarea size="5000">'.$Comment.'</textarea>
name="IntegrationR" id="IntegrationR"
</form>';
cols="40" rows="4" size="5000"
placeholder="How can the strength and }echo'
OFIs be integratedin the operational plan of
the concerned unit/stakeholders?">'. <br><hr>
$adlir['IntegrationR'].'</textarea></td> <form action="Home.php">
</tr><tr> <center><input type="submit"
<td height="40" width="120"><br><font class="button" value="Back"></center>
color="black">Timeline:</font></td> </form>';}
<td height="30" Create Event.php
width="600"><br><textarea
name="TimelineR" id="TimelineR" <?PHP
session_start(); if(isset($_POST['eventType']))

if (!(isset($_SESSION['login']) && { $eventType = $_POST['eventType'];


$_SESSION['login'] != '')) {
if($eventType == "Others")
header ("Location: ../../kms/login.php");
$eventType = $_POST['Type'];
}$EmpID = $_SESSION['empID'];
} if(isset($_POST['Topic']))
require_once("./includes/config.php");
$Topic = $_POST['Topic'];
$queryac = "SELECT Firstname,Lastname
from empinfo where EmpID='$EmpID'"; if(isset($_POST['eventStart']))

$resultac = @mysql_query ($queryac); $eventStart = $_POST['eventStart'];

$queryresultac = array(); if(isset($_POST['eventEnd']))

$queryresultac = $eventEnd = $_POST['eventEnd'];


mysql_fetch_array($resultac, if(isset($_POST['hostOrg']))
MYSQL_NUM);
$hostOrg = $_POST['hostOrg'];
$fname = $queryresultac[0];
if(isset($_POST['venue']))
$lname = $queryresultac[1];
$venue = $_POST['venue'];
//intialize variables
// Check Dates
$eventName ="";
if ($eventEnd < $eventStart)
$eventType ="";
{echo '
$Topic ="";
<script>
$eventStart = date('Y-m-d');
alert("Date Error: End Date is greater than
$eventEnd = date('Y-m-d'); Start Date")
$hostOrg =""; </script>';}
$venue = ""; else{
if(isset($_POST['submit'])){ include("./includes/config.php");
//get POST data $insert = "INSERT INTO eventInfo
if(isset($_POST['eventName'])) (eventName, Topic, eventType, eventStart,
eventEnd, hostOrg, venue, creator)
$eventName = $_POST['eventName']; values('$eventName','$Topic','$eventType','$
eventStart','$eventEnd','$hostOrg','$venue','$ <li><a
EmpID')"; href="changepwsd.php">Password</a></li>

if (!mysql_query($insert,$db)) <li style=float:right><a class="logout"


href="logout.php">Log-out</a></li>
{die('Error: ' . mysql_error());}
<li style=float:right><?php echo "".
header("Location:attendee.php"); $fname." ".$lname." (".$EmpID.")";?></li>
}} </ul></b><br></div>
?> <script type="text/javascript">
<!DOCTYPE html> //auto expand textarea
<html> function adjust_textarea(h) {
<head> h.style.height = "20px";
<link rel="stylesheet" type="text/css" h.style.height = (h.scrollHeight)+"px";
href="./includes/style.css">
}function ShowHideDiv() {
<title>LPU Knowledge Management
System</title> var chkYes =
document.getElementById("chkYes");
</head>
var dvtext =
<body> document.getElementById("dvtext");
<div class="header"> dvtext.style.display = chkYes.checked ?
<img src="../images/logo.png"> "block" : "none";

<b><ul><li><a } </script>
href="home.php">Dashboard</a></li> <div class="contains">
<li><a class="active" <?php echo'
href="createevent.php">Create
Event</a></li> <form action="" method="POST">

<li><a href="reports.php">Reports</a></li> <h2 class="headings">New Event</h2>

<li><a <table class="form" bgcolor="white">


href="recommendations.php">Recommenda
tions</a></li> <tr>

<li><a href="empmngt.php">Employee <td height="30" width="600"><textarea


Management</a></li> name="eventName" required
id="Event_Title" placeholder="Event Please specify:
Name" size="255">'.
$eventName.'</textarea></td> <input type="text" placeholder="Event
Type" id="txtBox" name="Type"/>
</tr> </div></td></tr>

<tr> <tr>

<td height="30" width="600"><textarea <td height="30" width="600"><h4


name="Topic" placeholder="Event Topic / class="headings">Host Organization:</h4>
Subject Concerned" required id="Topic"
size="255">'.$Topic.'</textarea></td> <input type="radio" name="hostOrg"
value="internal">Internal
</tr>
<input type="radio" name="hostOrg"
<tr> value="external"> External</td>

<td height="30" width="600"><textarea </tr>


placeholder="Venue" name="venue"
id="venue" size="255" cols="40" <tr><td><h4 class="headings"> Event
rows="1">'.$venue.'</textarea></td> Dates</h4></td></tr>

</tr> <tr>

<tr><td height="10" width="600"><h4 <td height="20" width="120"><font


class="headings">Event Type:</h4> color="black">Event Start Date:</font>

<input type="radio" name="eventType" <input type="date" name="eventStart"


id="chkNo" value="Seminar" value="EventStartDate"></td>
onclick="ShowHideDiv()"> Seminar<br> </tr>
<input type="radio" name="eventType" <tr>
id="chkNo" value="Convention"
onclick="ShowHideDiv()"> <td height="40" width="120"><font
Convention<br><input type="radio" color="black">Event End Date:</font>
name="eventType" id="chkNo"
<input type="date" name="eventEnd"
value="Workshop"
value="EventEndDate"></td></tr>
onclick="ShowHideDiv()"> Workshop<br>
</table><br>
<input type="radio" name="eventType"
id="chkYes" value="Others" <center><input type="submit"
onclick="ShowHideDiv()"> Others class="button" name="submit" value="Add
<div Employees"></center>
id="dvtext" style="display: none">
</form></tr></table></form>
<br><br>'; $resultuser = @mysql_query ($queryuser);

?> $queryresult = array();

</div> $queryresult =
mysql_fetch_array($resultuser,
</body> MYSQL_NUM);
</html> $unit = $queryresult[0];
Attendee.php $fname = $queryresult[1];
<?PHP $lname = $queryresult[2];
session_start(); // Get Value for Employee List Checkbox
if (!(isset($_SESSION['login']) && $get=mysql_query("SELECT empID,
$_SESSION['login'] != '')) { lastName, firstName, position FROM
header ("Location: ../../kms/login.php"); empinfo where unit='$unit' ORDER BY
position, lastName");
}
$option ='<option value=""></option>';
include("./includes/config.php");
while($row = mysql_fetch_assoc($get))
$empID = $_SESSION['empID'];
{ $option .= '<option value = "'.
$queryevent = "SELECT eventID from $row['empID'].'">'.$row['lastName'].','.
eventInfo order by eventID DESC LIMIT $row['firstName'].' - '.
1"; $row['position'].'</option>';}

$resultevent = @mysql_query // Form Method (Action done by the HTML


($queryevent); Code)

$queryresult = array(); if (isset($_POST['submit'])){

$queryresult = $submitDate = $_POST['submitDate'];


mysql_fetch_array($resultevent,
MYSQL_NUM); $condition = "";

$eventID = $queryresult[0]; $none = 0;

// Get Unit (Unit Heads) // -------- For Employee ! -----------------

$queryuser = "SELECT if ($_POST['Employee1'] == $condition)


unit,Firstname,Lastname from empinfo $none = $none + 1;
where empID='$empID'";
else{
$employee =$_POST['Employee1']; $none = $none + 1;

$insert = "INSERT INTO kms (empID, else{


eventID, status, unit, submitDate)
values('$employee','$eventID', 'New', '$unit', $employee =$_POST['Employee2'];
'$submitDate')"; $insert = "INSERT INTO kms (empID,
if (!mysql_query($insert,$db)) eventID, status, unit, submitDate)
values('$employee','$eventID', 'New', '$unit',
{ '$submitDate')";

die('Error: ' . mysql_error()); if (!mysql_query($insert,$db))

} {die('Error: ' . mysql_error());}

//added //added

$query = "SELECT kmsID from kms where $query = "SELECT kmsID from kms where
empID='$employee' ORDER BY kmsID empID='$employee' ORDER BY kmsID
DESC LIMIT 1"; DESC LIMIT 1";

$result = @mysql_query ($query); $result = @mysql_query ($query);

$queryresult = array(); $queryresult = array();

$queryresult = mysql_fetch_array($result, $queryresult = mysql_fetch_array($result,


MYSQL_NUM); MYSQL_NUM);

$kms = $queryresult[0]; $kms = $queryresult[0];

$insert = "INSERT INTO kmsadli (kmsID) $insert = "INSERT INTO kmsadli (kmsID)
values('$kms')"; values('$kms')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{ die('Error: ' . mysql_error()); {die('Error: ' . mysql_error());}

}$insert = "INSERT INTO $insert = "INSERT INTO recommendations


recommendations (kmsID) values('$kms')"; (kmsID) values('$kms')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db)){

{die('Error: ' . mysql_error());}} die('Error: ' . mysql_error()); }}

// -------- For Employee 2 ----------------- // -------- For Employee 3 -----------------

if ($_POST['Employee2'] == $condition) if ($_POST['Employee3'] == $condition)


$none = $none + 1; $none = $none + 1;

else{ else{

$employee =$_POST['Employee3']; $employee =$_POST['Employee4'];

$insert = "INSERT INTO kms (empID, $insert = "INSERT INTO kms (empID,
eventID, status, unit, submitDate) eventID, status, unit, submitDate)
values('$employee','$eventID', 'New', '$unit', values('$employee','$eventID', 'New', '$unit',
'$submitDate')"; '$submitDate')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());} {die('Error: ' . mysql_error());}

//added //added

$query = "SELECT kmsID from kms where $query = "SELECT kmsID from kms where
empID='$employee' ORDER BY kmsID empID='$employee' ORDER BY kmsID
DESC LIMIT 1"; DESC LIMIT 1";

$result = @mysql_query ($query); $result = @mysql_query ($query);

$queryresult = array(); $queryresult = array();

$queryresult = mysql_fetch_array($result, $queryresult = mysql_fetch_array($result,


MYSQL_NUM); MYSQL_NUM);

$kms = $queryresult[0]; $kms = $queryresult[0];

$insert = "INSERT INTO kmsadli (kmsID) $insert = "INSERT INTO kmsadli (kmsID)
values('$kms')"; values('$kms')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());} {die('Error: ' . mysql_error());}

$insert = "INSERT INTO recommendations $insert = "INSERT INTO recommendations


(kmsID) values('$kms')"; (kmsID) values('$kms')";

if (!mysql_query($insert,$db)){ if (!mysql_query($insert,$db))

die('Error: ' . mysql_error());}} {die('Error: ' . mysql_error());}}

// -------- For Employee 4 ----------------- // -------- For Employee 5 -----------------

if ($_POST['Employee4'] == $condition) if ($_POST['Employee5'] == $condition)


$none = $none + 1; $none = $none + 1;

else{ else{

$employee =$_POST['Employee5']; $employee =$_POST['Employee6'];

$insert = "INSERT INTO kms (empID, $insert = "INSERT INTO kms (empID,
eventID, status, unit, submitDate) eventID, status, unit, submitDate)
values('$employee','$eventID', 'New', '$unit', values('$employee','$eventID', 'New', '$unit',
'$submitDate')"; '$submitDate')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());} {die('Error: ' . mysql_error());}

//added //added

$query = "SELECT kmsID from kms where $query = "SELECT kmsID from kms where
empID='$employee' ORDER BY kmsID empID='$employee' ORDER BY kmsID
DESC LIMIT 1"; DESC LIMIT 1";

$result = @mysql_query ($query); $result = @mysql_query ($query);

$queryresult = array(); $queryresult = array();

$queryresult = mysql_fetch_array($result, $queryresult = mysql_fetch_array($result,


MYSQL_NUM); MYSQL_NUM);

$kms = $queryresult[0]; $kms = $queryresult[0];

$insert = "INSERT INTO kmsadli (kmsID) $insert = "INSERT INTO kmsadli (kmsID)
values('$kms')"; values('$kms')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());} {die('Error: ' . mysql_error());}

$insert = "INSERT INTO recommendations $insert = "INSERT INTO recommendations


(kmsID) values('$kms')"; (kmsID) values('$kms')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());}} {die('Error: ' . mysql_error());}}

// -------- For Employee 6 ----------------- // -------- For Employee 7 -----------------

if ($_POST['Employee6'] == $condition) if ($_POST['Employee7'] == $condition)


$none = $none + 1; $none = $none + 1;

else{ else{

$employee =$_POST['Employee7']; $employee =$_POST['Employee8'];

$insert = "INSERT INTO kms (empID, $insert = "INSERT INTO kms (empID,
eventID, status, unit, submitDate) eventID, status, unit, submitDate)
values('$employee','$eventID', 'New', '$unit', values('$employee','$eventID', 'New', '$unit',
'$submitDate')"; '$submitDate')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());} {die('Error: ' . mysql_error());}

//added //added

$query = "SELECT kmsID from kms where $query = "SELECT kmsID from kms where
empID='$employee' ORDER BY kmsID empID='$employee' ORDER BY kmsID
DESC LIMIT 1"; DESC LIMIT 1";

$result = @mysql_query ($query); $result = @mysql_query ($query);

$queryresult = array(); $queryresult = array();

$queryresult = mysql_fetch_array($result, $queryresult = mysql_fetch_array($result,


MYSQL_NUM); MYSQL_NUM);

$kms = $queryresult[0]; $kms = $queryresult[0];

$insert = "INSERT INTO kmsadli (kmsID) $insert = "INSERT INTO kmsadli (kmsID)
values('$kms')"; values('$kms')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());} {die('Error: ' . mysql_error());}

$insert = "INSERT INTO recommendations $insert = "INSERT INTO recommendations


(kmsID) values('$kms')"; (kmsID) values('$kms')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());}} {die('Error: ' . mysql_error());}}

// -------- For Employee 8 ----------------- // -------- For Employee 9 -----------------

if ($_POST['Employee8'] == $condition) if ($_POST['Employee9'] == $condition)


$none = $none + 1; $none = $none + 1;

else{ else{

$employee =$_POST['Employee9']; $employee =$_POST['Employee10'];

$insert = "INSERT INTO kms (empID, $insert = "INSERT INTO kms (empID,
eventID, status, unit, submitDate) eventID, status, unit, submitDate)
values('$employee','$eventID', 'New', '$unit', values('$employee','$eventID', 'New', '$unit',
'$submitDate')"; '$submitDate')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());} {die('Error: ' . mysql_error());}

//added //added

$query = "SELECT kmsID from kms where $query = "SELECT kmsID from kms where
empID='$employee' ORDER BY kmsID empID='$employee' ORDER BY kmsID
DESC LIMIT 1"; DESC LIMIT 1";

$result = @mysql_query ($query); $result = @mysql_query ($query);

$queryresult = array(); $queryresult = array();

$queryresult = mysql_fetch_array($result, $queryresult = mysql_fetch_array($result,


MYSQL_NUM); MYSQL_NUM);

$kms = $queryresult[0]; $kms = $queryresult[0];

$insert = "INSERT INTO kmsadli (kmsID) $insert = "INSERT INTO kmsadli (kmsID)
values('$kms')"; values('$kms')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());} {die('Error: ' . mysql_error());}

$insert = "INSERT INTO recommendations $insert = "INSERT INTO recommendations


(kmsID) values('$kms')"; (kmsID) values('$kms')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());}} {die('Error: ' . mysql_error());}}

// -------- For Employee 10 ----------------- if ($none == 10){

if ($_POST['Employee10'] == $condition) echo '


<script> <li><a href="empmngt.php">Employee
Management</a></li>
alert("Error: No Employee was chosen")
<li><a
</script>';} href="changepwsd.php">Password</a></li>
else{ <li style=float:right><a class="logout"
header("Location:Home.php");}} href="logout.php">Log-out</a></li>

?> <li style=float:right><?php echo "".


$fname." ".$lname." (".$empID.")";?></li>
<!DOCTYPE html>
</ul></b></div>
<html>
<div class="contains">
<head>
<h2><center> Choose Attendees
<link rel="stylesheet" type="text/css" </center></h2>
href="./includes/style.css">
<hr><h3> Unit: <?php echo "$unit" ?
<script ></h3>
src="https://ajax.googleapis.com/ajax/libs/jq
uery/3.1.1/jquery.min.js"></script> <form method="POST">

<title>LPU Knowledge Management <br><br>


System</title> <div class="addContent">
</head> <label>Employee 1: </label><select
<body> name="Employee1" id="Employee2"
value=""><?php echo"$option" ?></select>
<div class="header">
</div>
<img src="../images/logo.png"><b><ul>
<script type="text/javascript">
<li><a
href="home.php">Dashboard</a></li> $(function () {

<li><a class="active" var counter = 2;


href="createevent.php">Create $('.addInput').click (function () {
Event</a></li>
if(counter>10){
<li><a href="reports.php">Reports</a></li>
alert("Only 10 textboxes allow");
<li><a
href="recommendations.php">Recommenda return false;}
tions</a></li>
var newTextBoxDiv = $ $Search = $_SESSION['search'];
(document.createElement('div'))
$Comments = $_POST['comments'];
.attr("id", 'TextBoxDiv' + counter);
$log = mysql_query("UPDATE kms SET
newTextBoxDiv.after().html('<br><br><lab log_transaction = now() where kmsID =
el>Employee '+ counter + ' : </label>' + '$Search'");

'<select name="Employee' + counter + if (isset($_POST['approve'])){

'" id="Employee' + counter + '" value="" > $Approach = $_POST['Approach'];


<?php echo"$option" ?>');
$Deployment =$_POST['Deployment'];
newTextBoxDiv.appendTo(".addContent");
$Learning =$_POST['Learning'];
counter++;});});
$Integration =$_POST['Integration'];
</script>
$Timeline = $_POST['Timeline'];
<div class="addInput"
style="cursor:pointer"><input type="button" $UnitR = $_POST['UnitR'];
class="button" value="+"></div> $ApproachR = $_POST['ApproachR'];
<br> $DeploymentR =$_POST['DeploymentR'];
<h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $LearningR =$_POST['LearningR'];
Submission Date: &nbsp; <input
type="date" name="submitDate" $IntegrationR =$_POST['IntegrationR'];
value="submitDate"> </h5>
$TimelineR = $_POST['TimelineR'];
<input type='submit' class="button"
$query2 = "SELECT Supervisor from
name="submit" value='Confirm'>
empinfo where empID ='$EmpID'";
</form><br><br></div>
$result = @mysql_query($query2);
</body>
$resultarray = array();
</html>
$resultarray = mysql_fetch_assoc($result,
Approval.php MYSQL_NUM);

<?php $SupervisorID = $resultarray[0];

include(".\includes\config.php"); $empty ="";

session_start(); $No = "No";

$EmpID = $_SESSION['empID']; if($EmpID == "03-0001")


{$query = "UPDATE kms SET alert('$message');
Status=\"Approved\", Comments ='$empty', window.location.href='home.php';
Sentback='$No', lasttrans='Approved by',
formertrans='$EmpID' where kmsID = </SCRIPT>";
'$Search'";} include("Home.php");}
else{ else if (isset($_POST['sendback'])){
$query = "UPDATE kms SET $Approach = $_POST['Approach'];
Status='$SupervisorID',
FormerStatus='$EmpID', Sentback='$No', $Deployment =$_POST['Deployment'];
Comments='$Comments',
$Learning =$_POST['Learning'];
lasttrans='Approved by',
formertrans='$EmpID' where kmsID = $Integration =$_POST['Integration'];
'$Search'";}
$Timeline = $_POST['Timeline'];
$result = @mysql_query($query);
$UnitR = $_POST['UnitR'];
$query5 = "UPDATE kmsadli Set
KMS_ID='$Search', Unit='$Unit', $ApproachR = $_POST['ApproachR'];
Approach='$Approach',
$DeploymentR =$_POST['DeploymentR'];
Deployment='$Deployment',
Learning='$Learning', $LearningR =$_POST['LearningR'];
Integration='$Integration',
Timeline='$Timeline' where $IntegrationR =$_POST['IntegrationR'];
KMSID='$Search'"; $TimelineR = $_POST['TimelineR'];
$query6 = "UPDATE recommendations SET $query2 = "SELECT FormerStatus,EmpID
kmsID = '$Search', UnitR='$UnitR', from kms where KMSID ='$Search'";
ApproachR='$ApproachR',
DeploymentR='$DeploymentR', $result = @mysql_query($query2);
LearningR='$LearningR',
$resultarray = array();
IntegrationR='$IntegrationR',
TimelineR='$TimelineR' where $resultarray = mysql_fetch_assoc($result,
KMSID='$Search'"; MYSQL_NUM);
$resultupdate = @mysql_query($query5); $FormerID = $resultarray[0];
$resultupdate1 = @mysql_query($query6); $Sender = $resultarray[1];
$message = "KMS Approved!"; $querylevel = "SELECT AccessLevel from
empaccount where EmpID='$EmpID'";
echo "<SCRIPT>
$resultlevel = @mysql_query($querylevel);
$resultlevelarray = array(); $query = "UPDATE kms SET
Status='$FormerID',
$resultlevelarray = Comments='$Comments',
mysql_fetch_assoc($resultlevel, SentBack=\"Yes\", lasttrans='Sent Back by',
MYSQL_NUM); formertrans='$EmpID' where kmsID =
$AccessLevel = $resultlevelarray[0]; '$Search'";

$queryvisor = "SELECT Supervisor from $result3 = @mysql_query($query);}


empinfo where EmpID='$Sender'"; $query5 = "UPDATE kmsadli Set
$resultvisor = @mysql_query($queryvisor); KMS_ID='$Search', Unit='$Unit',
Approach='$Approach',
$resultarrayvisor = array(); Deployment='$Deployment',
Learning='$Learning',
$resultarrayvisor =
Integration='$Integration',
mysql_fetch_assoc($resultvisor,
Timeline='$Timeline' where
MYSQL_NUM);
KMSID='$Search'";
$visor = $resultarrayvisor[0];
$query6 = "UPDATE recommendations SET
if ($AccessLevel == "1") kmsID = '$Search', UnitR='$UnitR',
ApproachR='$ApproachR',
{$query = "UPDATE kms SET DeploymentR='$DeploymentR',
Status='$FormerID', FormerStatus='$visor', LearningR='$LearningR',
Comments='$Comments', IntegrationR='$IntegrationR',
SentBack=\"Yes\", lasttrans='Sent Back by', TimelineR='$TimelineR' where
formertrans='$EmpID' where KMSID = KMSID='$Search'";
'$Search'";
$resultupdate = @mysql_query($query5);
$result3 = @mysql_query($query);}
$resultupdate1 = @mysql_query($query6);
else if ($AccessLevel == "2") {
$message = "KMS Sent Back!";
$query = "UPDATE kms SET
Status='$FormerID', echo "<SCRIPT>
FormerStatus='$Sender',
alert('$message');
Comments='$Comments',
window.location.href='home.php';
SentBack=\"Yes\", lasttrans='Sent Back by',
formertrans='$EmpID' where KMSID = </SCRIPT>";
'$Search'";
include("Home.php");}
$result3 = @mysql_query($query);}
?>
else if ($AccessLevel == "3"){
SendKMS.php
<?php TimelineR='$TimelineR' where
kmsID='$Search'";
include(".\includes\config.php");
if (!mysql_query($query5,$db))
session_start();
{die('Error: ' . mysql_error());}
$EmpID = $_SESSION['empID'];
if (!mysql_query($query6,$db))
$Search = $_SESSION['search'];
{die('Error: ' . mysql_error());}
$Approach = $_POST['Approach'];
if (isset($_POST['submit'])) {
$Deployment =$_POST['Deployment'];
$querysv = "SELECT Supervisor from
$Learning =$_POST['Learning']; empinfo where EmpID ='$EmpID'";
$Integration =$_POST['Integration']; $results = @mysql_query($querysv);
$Timeline = $_POST['Timeline']; $resultsv = array();
$UnitR = $_POST['UnitR']; $resultsv = mysql_fetch_assoc($results,
$ApproachR = $_POST['ApproachR']; MYSQL_NUM);

$DeploymentR =$_POST['DeploymentR']; $SupervisorID = $resultsv[0];

$LearningR =$_POST['LearningR']; $query = "UPDATE kms SET


status='$SupervisorID',
$IntegrationR =$_POST['IntegrationR']; FormerStatus='$EmpID', lasttrans='Sent by',
formertrans='$EmpID' where kmsID =
$TimelineR = $_POST['TimelineR'];
'$Search'";
$query5 = "UPDATE kmsadli Set
$result = @mysql_query($query);}
kmsID='$Search', Approach='$Approach',
Deployment='$Deployment', $message = "KMS Sent for Approval!";
Learning='$Learning',
Integration='$Integration', echo "<SCRIPT>
Timeline='$Timeline' where alert('$message');
kmsID='$Search'"; window.location.href='home.php';
$query6 = "UPDATE recommendations Set </SCRIPT>";
kmsID='$Search', UnitR='$UnitR',
ApproachR='$ApproachR', include("Home.php");
DeploymentR='$DeploymentR',
LearningR='$LearningR', ?>
IntegrationR='$IntegrationR', Addendee.php
<?php $query2 ="UPDATE kms SET
eventID='$even' where kmsID='$kms'";
include('./includes/config.php');
$result2 = mysql_query($query2);
if (isset($_POST['submit'])){
$insert = "INSERT INTO kmsadli (kmsID)
$submitDate = $_POST['submitDate']; values('$kms')";
$even=$_POST['eventsid']; if (!mysql_query($insert,$db))
$condition = ""; {die('Error: ' . mysql_error());}
$none = 0; $insert = "INSERT INTO recommendations
// -------- For Employee 1 ----------------- (kmsID) values('$kms')";

if ($_POST['Employee1'] == $condition) if (!mysql_query($insert,$db))

$none = $none + 1; {die('Error: ' . mysql_error());}}

else{ // -------- For Employee 2 -----------------

$employee =$_POST['Employee1']; if ($_POST['Employee2'] == $condition)

$insert = "INSERT INTO kms (empID, $none = $none + 1;


eventID, status, unit, submitDate) else{
values('$employee','$even','New', '$unit',
'$submitDate')"; $employee =$_POST['Employee2'];

if (!mysql_query($insert,$db)) $insert = "INSERT INTO kms (empID,


eventID, status, unit, submitDate)
{die('Error: ' . mysql_error());} values('$employee','$even', 'New', '$unit',
//added '$submitDate')";

$query = "SELECT kmsID from kms where if (!mysql_query($insert,$db))


empID='$employee' ORDER BY kmsID {die('Error: ' . mysql_error());}
DESC LIMIT 1";
//added
$result = @mysql_query ($query);
$query = "SELECT kmsID from kms where
$queryresult = array(); empID='$employee' ORDER BY kmsID
$queryresult = mysql_fetch_array($result, DESC LIMIT 1";
MYSQL_NUM); $result = @mysql_query ($query);
$kms = $queryresult[0]; $queryresult = array();
$queryresult = mysql_fetch_array($result, $queryresult = mysql_fetch_array($result,
MYSQL_NUM); MYSQL_NUM);

$kms = $queryresult[0]; $kms = $queryresult[0];

$insert = "INSERT INTO kmsadli (kmsID) $insert = "INSERT INTO kmsadli (kmsID)
values('$kms')"; values('$kms')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());} {die('Error: ' . mysql_error());}

$insert = "INSERT INTO recommendations $insert = "INSERT INTO recommendations


(kmsID) values('$kms')"; (kmsID) values('$kms')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());}} {die('Error: ' . mysql_error());}}

// -------- For Employee 3 ----------------- // -------- For Employee 4 -----------------

if ($_POST['Employee3'] == $condition) if ($_POST['Employee4'] == $condition)

$none = $none + 1; $none = $none + 1;

else{ else{

$employee =$_POST['Employee3']; $employee =$_POST['Employee4'];

$insert = "INSERT INTO kms (empID, $insert = "INSERT INTO kms (empID,
eventID, status, unit, submitDate) eventID, status, unit, submitDate)
values('$employee','$even', 'New', '$unit', values('$employee','$even', 'New', '$unit',
'$submitDate')"; '$submitDate')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());} {die('Error: ' . mysql_error());}

//added //added

$query = "SELECT kmsID from kms where $query = "SELECT kmsID from kms where
empID='$employee' ORDER BY kmsID empID='$employee' ORDER BY kmsID
DESC LIMIT 1"; DESC LIMIT 1";

$result = @mysql_query ($query); $result = @mysql_query ($query);

$queryresult = array(); $queryresult = array();


$queryresult = mysql_fetch_array($result, $queryresult = mysql_fetch_array($result,
MYSQL_NUM); MYSQL_NUM);

$kms = $queryresult[0]; $kms = $queryresult[0];

$insert = "INSERT INTO kmsadli (kmsID) $insert = "INSERT INTO kmsadli (kmsID)
values('$kms')"; values('$kms')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());} {die('Error: ' . mysql_error());}

$insert = "INSERT INTO recommendations $insert = "INSERT INTO recommendations


(kmsID) values('$kms')"; (kmsID) values('$kms')";

if (!mysql_query($insert,$db)) if (!mysql_query($insert,$db))

{die('Error: ' . mysql_error());}} {die('Error: ' . mysql_error());}}

// -------- For Employee 5 ----------------- header("Location:Home.php");}

if ($_POST['Employee5'] == $condition) ?>

$none = $none + 1; Delete.php

else{ <?php

$employee =$_POST['Employee5']; include('./includes/config.php');

$insert = "INSERT INTO kms (empID, if(isset($_POST['delete'])){


eventID, status, unit, submitDate)
values('$employee','$even', 'New', '$unit', $event=$_POST['event'];
'$submitDate')"; $kms = $_POST['kms'];
if (!mysql_query($insert,$db)) $emp = $_POST['employee'];
{die('Error: ' . mysql_error());} $query = "DELETE from kms where
//added kmsid='$kms' LIMIT 1";

$query = "SELECT kmsID from kms where $query2 = "DELETE from kmsadli where
empID='$employee' ORDER BY kmsID kmsid='$kms' LIMIT 1";
DESC LIMIT 1"; $query3 = "DELETE from
$result = @mysql_query ($query); recommendations where kmsid='$kms'
LIMIT 1";
$queryresult = array();
$query4 = "DELETE from eventinfo where $lname = $queryresultac[1];
eventid='$event' AND empID='$emp'
LIMIT 1"; if (isset($_POST['submit'])){

$result = mysql_query($query,$db); $old = $_POST['old'];

$result = mysql_query($query2,$db); $pass1 = $_POST['pass1'];

$result = mysql_query($query3,$db); $pass2 = $_POST['pass2'];

$result = mysql_query($query4,$db); $query = "SELECT password from


empaccount where empID ='$EmpID'";

$result = @mysql_query($query);
header("Location:Home.php");}
$resultarray = array();
?>
$resultarray = mysql_fetch_assoc($result,
Changepswd.php MYSQL_NUM);

<?PHP $oldpass = $resultarray[0];

// Check Log-in state if($oldpass == $old)

session_start(); {if($pass1 == $pass2)

if (!(isset($_SESSION['login']) && { $change = "UPDATE empaccount


$_SESSION['login'] != '')) { SET password='$pass1' where
empID='$EmpID'";
header ("Location: ../../kms/login.php");}
mysql_query($change,$db);
$EmpID = $_SESSION['empID'];
mysql_close($db);
include("./includes/config.php");
$message = "Password changed!";
$queryac = "SELECT Firstname,Lastname
from empinfo where EmpID='$EmpID'"; echo "<SCRIPT>

$resultac = @mysql_query ($queryac); alert('$message');


window.location.href='home.php';
$queryresultac = array();
</SCRIPT>";
$queryresultac =
mysql_fetch_array($resultac, include("Home.php");}
MYSQL_NUM);
else{
$fname = $queryresultac[0];
$message = "Password did not match!";
echo "<SCRIPT> <li><a href="createevent.php">Create
Event</a></li>
alert('$message');
window.location.href='changepwsd.php'; <li><a href="reports.php">Reports</a></li>

</SCRIPT>"; <li><a
href="recommendations.php">Recommenda
include("changepwsd.php"); }} tions</a></li>
else if($oldpass != $old) <li><a href="empmngt.php">Employee
{$message = "Old Password Incorrect!"; Management</a></li>

echo "<SCRIPT> <li><a class="active"


href="changepwsd.php">Password</a></li>
alert('$message');
window.location.href='changepwsd.php'; <li style=float:right><a class="logout"
href="logout.php">Log-out</a></li>
</SCRIPT>";
<li style=float:right><?php echo "".
include("changepwsd.php");}} $fname." ".$lname." (".$EmpID.")";?></li>

?> </ul></b><br></div>

<!DOCTYPE html> <div class="contains">

<html> <center><table class="form">

<head> <form action='' method='POST'>

<link rel="stylesheet" type="text/css" <tr>


href="./includes/style.css">
<th colspan="2"><h2> Change Password
<title>LPU Knowledge Management </h2></th> </tr> <tr>
System</title>
<td><center><h3><font color="black">Old
</head> Password:</font></h3></center></td>

<body> <td><center><h3><input type='password'


placeholder="Old Password"
<div class="header">
name='old'></h3></center></td> </tr>
<img src="../images/logo.png"><b> <tr>

<ul> <td><center><h3><font
color="black">New
<li><a Password:</font></h3></center></td>
href="home.php">Dashboard</a></li>
<td><center><h3><input type='password' $empID = $_SESSION['empID'];
name='pass1' placeholder="Enter New
Password"></h3></center></td> </tr> $queryac = "SELECT Firstname,Lastname
from empinfo where EmpID='$empID'";
<br> <tr>
$resultac = @mysql_query ($queryac);
<td><center><h3><font
color="black">Confirm $queryresultac = array();
Password:</font></h3></center></td> $queryresultac =
<td><center><h3><input type='password' mysql_fetch_array($resultac,
name='pass2' placeholder="Confirm MYSQL_NUM);
Password"></h3></center></td> </tr> $fname = $queryresultac[0];
<br><tr> <td></td> $lname = $queryresultac[1];
<td width="3"><input type='submit' ?>
class="button" name="submit"
value='Confirm'> <!DOCTYPE html>

<input type='reset' class="button" <html>


value='Clear'></td> </tr>
<head>
<tr>
<link rel="stylesheet" type="text/css"
<td height="5" colspan="3"><br></td> href="./includes/style.css">
</tr>
<title>LPU KMS -
</form></table></center></div> Recommendations</title>

</body> </head>

</html> <body>

Recommendations <div class="header">

<?PHP <img src="../images/logo.png">

session_start(); <b><ul>

if (!(isset($_SESSION['login']) && <li><a


$_SESSION['login'] != '')) { href="home.php">Dashboard</a></li>

header ("Location: ../../kms/login.php");} <li><a href="createevent.php">Create


Event</a></li>
include('./includes/config.php');
<li><a href="reports.php">Reports</a></li>
<li><a class="active" if($result)
href="recommendations.php">Recommenda
tions</a></li> {echo '<br>

<li><a href="empmngt.php">Employee <form action="recomadli.php"


Management</a></li> method="POST">

<li><a <script src="sorttable.js"></script>


href="changepwsd.php">Password</a></li> <br><table border="1" class="sortable"
<li style=float:right><a class="logout" id="myTable" align="center"
href="logout.php">Log-out</a></li> cellspacing="5" cellpadding="5" sortable>';

<li style=float:right><?php echo "". // Table headers


$fname." ".$lname." (".$empID.")";?></li> echo'<b><tr class="headings">
</ul></b><br></div> <th align="center" height="28"
<div class="contains"> width="200"><b>Event Title</th>

<h2><center>MY KMS</h2> <hr> <th align="Center" height="28"


width="30"><b>KMS ID </th>
<input type="text" id="myInput"
onkeyup="myFunction()" <th align="center" height="28"
placeholder="Search for Event Title.."> width="50"><b>Unit</th>

<script src="filter.js"></script> <th align="center" height="28"


width="50"><b>Timeline</th></tr></b>';
<?php
//Table content
$querysup = "SELECT unit from empinfo
where empID ='$empID'"; $total = mysql_num_rows($result);

$resultsup = @mysql_query($querysup); for ($num=0; $num < $total; $num++ )

$resultarraysup = array(); { $row = mysql_fetch_array($result,


MYSQL_NUM);
$resultarraysup =
mysql_fetch_assoc($resultsup, $querys = "SELECT eventinfo.eventname,
MYSQL_NUM); empID, unit from kms INNER JOIN
eventinfo on kms.eventID =
$unit = $resultarraysup[0]; eventinfo.eventID where kmsID =
'$row[0]'";
$query = "SELECT kmsID, timelineR from
recommendations where unitR = '$unit'"; $results = @mysql_query($querys);

$result = @mysql_query($query); $resultarrays = array();


$resultarrays = mysql_fetch_assoc($results, mysql_close();?>
MYSQL_NUM);
Recomadli.php
$eventname = $resultarrays[0];
<?PHP
$empl = $resultarrays[1];
session_start();
$unitrd = $resultarrays[2];
if (!(isset($_SESSION['login']) &&
$queryemp = "SELECT lastName from $_SESSION['login'] != '')) {
empinfo where empID = '$empl'";
header ("Location: ../../kms/login.php");}
$resultemp = @mysql_query($queryemp);
include('./includes/config.php');
$resultarrayemp = array();
$empID = $_SESSION['empID'];
$resultarrayemp =
mysql_fetch_assoc($resultemp, $queryac = "SELECT Firstname,Lastname
MYSQL_NUM); from empinfo where EmpID='$empID'";

$name = $resultarrayemp[0]; $resultac = @mysql_query ($queryac);

//$result = @mysql_query($query); $queryresultac = array();

echo'<tr> $queryresultac =
mysql_fetch_array($resultac,
<td align="left" height="30" width="30">'. MYSQL_NUM);
$eventname.'</td>
$fname = $queryresultac[0];
<td align="left" height="30"
width="30"><input type="submit" value="'. $lname = $queryresultac[1];
$row[0].'" class="kmsid" ?>
name="search"></td>
<!DOCTYPE html>
<td align="left" height="30" width="30">'.
$unitrd.' ('.$name.')</td> <html>

<td align="left" height="30" width="30">'. <head>


$row[1].'</td>'; }
<link rel="stylesheet" type="text/css"
echo "</tr>\n"; href="./includes/style.css">

echo'</table> <title>LPU KMS -


Recommendations</title>
</form><br> ';}
</head>
else{echo "No result";}
<body> while ($row4 =
mysql_fetch_assoc($query4))
<div class="header">
$ADLIR[] = $row4;
<img src="../images/logo.png"><b><ul>
foreach($ADLIR as $adlir)
<li><a
href="home.php">Dashboard</a></li> {echo'

<li><a href="createevent.php">Create <center><h3>Recommendations</h3>


Event</a></li>
<h4>for other Units</h4>
<li><a href="reports.php">Reports</a></li>
</center>
<li><a class="active"
href="recommendations.php">Recommenda <table align="center">
tions</a></li> <tr>
<li><a href="empmngt.php">Employee <td height="40" width="50"><font
Management</a></li> color="black">Unit:</font></td>
<li><a <td height="30" width="600"><b>'.
href="changepwsd.php">Password</a></li> $adlir['UnitR'].'</b></td></tr> <tr>
<li style=float:right><a class="logout" <td height="40" width="50"><font
href="logout.php">Log-out</a></li> color="black">Approach:</font></td>
<li style=float:right><?php echo "". <td height="30" width="600"><h5>'.
$fname." ".$lname." (".$empID.")";? $adlir['ApproachR'].'</h5></td></tr><tr>
></li></ul></b><br></div>
<td height="40" width="50"><font
<div class="contains"> color="black">Deployment:</font></td>
<h2><center>MY KMS</h2> <hr> <td height="30" width="600"><h5>'.
<?php $adlir['DeploymentR'].'</h5></td></tr><tr>

$kms = $_POST['search']; <td height="40" width="50"><font


color="black">Learning:</font></td>
$query4 = mysql_query("SELECT UnitR,
ApproachR, DeploymentR, LearningR, <td height="30" width="600"><h5>'.
IntegrationR, TimelineR from $adlir['LearningR'].'</h5></td></tr><tr>
recommendations <td height="40" width="50"><font
where kmsID='$kms'"); color="black">Integration:</font></td>

$ADLIR = array();
<td height="30" width="600"><h5>'. $fname = $queryresultac[0];
$adlir['IntegrationR'].'</h5></td></tr>
<tr> $lname = $queryresultac[1];

<td height="40" width="50"><font $querynam = "SELECT eventName, eventid


color="black">Timeline:</font></td> from eventinfo where eventid ='$event'";

<td height="30" width="600"><h5>'. $resultnam = @mysql_query($querynam);


$adlir['TimelineR'].'</h5></td></tr></table> $resultarraynam = array();
';}
$resultarraynam =
echo'<form mysql_fetch_assoc($resultnam,
action="recommendations.php"> MYSQL_NUM);
<center><input type="submit" $name = $resultarraynam[0];
class="button" value="Back"></center>
$even = $resultarraynam[1];
</form>';?>
// Get Unit (Unit Heads)
Eventmngt.php
$queryuser = "SELECT unit from empinfo
<?PHP where empID='$empID'";
session_start(); $resultuser = @mysql_query ($queryuser);
if (!(isset($_SESSION['login']) && $queryresult = array();
$_SESSION['login'] != '')) {
$queryresult =
header ("Location: ../../kms/login.php");} mysql_fetch_array($resultuser,
include('./includes/config.php'); MYSQL_NUM);

$event = $_POST['event']; $unit = $queryresult[0];

$empID = $_SESSION['empID']; // Get Value for Employee List Checkbox

$queryac = "SELECT Firstname,Lastname $get=mysql_query("SELECT empID,


from empinfo where EmpID='$empID'"; lastName, firstName, position FROM
empinfo where unit='$unit' ORDER BY
$resultac = @mysql_query ($queryac); position, lastName");

$queryresultac = array(); $option ='<option value=""></option>';

$queryresultac = while($row = mysql_fetch_assoc($get))


mysql_fetch_array($resultac,
MYSQL_NUM); { $option .= '<option value = "'.
$row['empID'].'">'.$row['lastName'].','.
$row['firstName'].' - '. <li style=float:right><a class="logout"
$row['position'].'</option>';} href="logout.php">Log-out</a></li>

?> <li style=float:right><?php echo "".


$fname." ".$lname." (".$empID.")";?
<!DOCTYPE html> ></li></ul></b><br></div>
<html> <div class="contains">
<head> <h2><center><?php echo"$name"?
<link rel="stylesheet" type="text/css" ></h2><hr>
href="./includes/style.css"> <script src="filter.js"></script>
<script <?php
src="https://ajax.googleapis.com/ajax/libs/jq
uery/3.1.1/jquery.min.js"></script> $details = mysql_query("SELECT Topic,
eventType, eventStart, EventEnd, hostOrg,
<title>LPU Knowledge Management venue, create_log from eventinfo where
System</title> eventid='$event'");
</head> while ($row = mysql_fetch_assoc($details))
<body> $info[] = $row;
<div class="header"> foreach($info as $x)
<img src="../images/logo.png"><b><ul> {echo"
<li><a <h4>Event Details</h4>
href="home.php">Dashboard</a></li>
<table>
<li><a href="createevent.php">Create
Event</a></li> <tr><td><b>Event ID:</b></td> <td>".
$event."</td></tr>
<li><a href="reports.php">Reports</a></li>
<tr><td><b>Event Name:</b> </td>
<li><a <td>".$name."</td></tr>
href="recommendations.php">Recommenda
tions</a></li> <tr><td><b>Topic:</b> </td> <td> ".
$x['Topic']."</td></tr>
<li><a href="empmngt.php"
class="active">Employee Mngmt.</a></li> <tr><td><b>Event Type:</b> </td> <td>
".$x['eventType']."</td></tr>
<li><a
href="changepwsd.php">Password</a></li> <tr><td><b>Start Date:</b> </td> <td>".
$x['eventStart']."</td></tr>
<tr><td><b>End Date:</b></td> <td>". //Table content
$x['EventEnd']."</td></tr>
$total = mysql_num_rows($result);
<tr><td><b>Host Organization:</b></td>
<td>".$x['hostOrg']."</td></tr> for ($num=0; $num < $total; $num++ )

<tr><td><b>Venue:</b></td> <td>". { $row = mysql_fetch_array($result,


$x['venue']."</td></tr> MYSQL_NUM);

<tr><td><b>KMS Creator:</b></td> $queryname = "SELECT FirstName,


<td>".$empID."</td></tr> LastName from empinfo where empID
='$row[0]'";
<tr><td><b>KMS Date Created:</b></td>
<td>".$x['create_log']."</td></tr> $resultname = @mysql_query($queryname);

</table><hr>";} $resultarrayname = array();

$query = "SELECT empID, kmsid, status $resultarrayname =


from kms where eventid='$event'"; mysql_fetch_assoc($resultname,
MYSQL_NUM);
$result = @mysql_query($query);
$Fname = $resultarrayname[0];
if($result)
$Lname = $resultarrayname[1];
{echo '<br>
if($row[2] == "New" || $row[2] ==
<script src="sorttable.js"></script> "Approved")

<br> { $Lsup = $row[2];

<table border="0" class="sortable" $Fsup = " ";}


id="myTable" align="center"
cellspacing="5" cellpadding="5" sortable>'; else{

echo'<b><tr class="headings"> $querysup = "SELECT FirstName,


LastName from empinfo where empID
<th align="center" height="28" ='$row[2]'";
width="200"><b>Employee</th>
$resultsup = @mysql_query($querysup);
<th align="Center" height="28"
width="30"><b>KMS ID </th> $resultarraysup = array();

<th align="center" height="28" $resultarraysup =


width="50"><b>Status</th> mysql_fetch_assoc($resultsup,
MYSQL_NUM);
<th></th></tr></b>';
$Fsup = $resultarraysup[0];
$Lsup = $resultarraysup[1];} </div>

echo'<tr> <script type="text/javascript">

<td align="left" height="30" width="30">'. $(function () {


$Lname.', '.$Fname.' - '.$row[0].'</td>
var counter = 2;
<td align="left" height="30" width="30">'.
$row[1].'</td> $('.addInput').click (function () {

<td align="left" height="30" width="30">'. if(counter>5){


$Lsup.', '.$Fsup.'</td> alert("Only 5 textboxes allow");
<td align="left" height="30" width="30"> return false;}
<form action="delete.php" var newTextBoxDiv = $
method="POST"> (document.createElement('div'))
<input type="hidden" name="event" .attr("id", 'TextBoxDiv' + counter);
value="'.$even.'"">
newTextBoxDiv.after().html('<br><label>E
<input type="hidden" name="kms" value="'. mployee '+ counter + ' : </label>' +
$row[1].'"">
'<select name="Employee' + counter +
<input type="hidden" name="employee"
value="'.$row[0].'""> '" id="Employee' + counter + '" value="" >
<?php echo"$option" ?>');
<input type="submit" class="button"
name="delete" value="Remove"> newTextBoxDiv.appendTo(".addContent");

</form></td>';} counter++; });});

echo "</tr>\n"; </script>

echo'</table> <br>'; }?> <div class="addInput"


style="cursor:pointer"><input type="button"
<h4>Add Attendees</h4> class="button" value="More"></div><br>
<form action="addendee.php" <h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
method="POST"> Submission Date: &nbsp; <input
<div class="addContent"> type="date" name="submitDate"
value="submitDate"> </h5>
<label>Employee 1: </label><select
name="Employee1" id="Employee2" <input type="hidden" name="eventsid"
value=""><?php echo"$option" ?></select> value="<?php echo"$event"; ?>">
<input type='submit' class="button" $lname = $queryresultac[1];
name="submit" value='Confirm'>
$queryal = "SELECT AccessLevel from
</form> empaccount where empID ='$EmpID'";

<form action="Home.php" $resultal = @mysql_query($queryal);


method="POST">
$resultarrayal = array();
<br><hr><center><input type="submit"
class="button" value="Back"></center> $resultarrayal =
mysql_fetch_assoc($resultal,
</form><br> </div> MYSQL_NUM);

</body> $AccessLevel = $resultarrayal[0];

</html>'; // Get Unit (Unit Heads)

?> $queryuser = "SELECT unit from empinfo


where empID='$EmpID'";
Reports.php
$resultuser = @mysql_query ($queryuser);
<?PHP
$queryresult = array();
// Check Log-in state
$queryresult =
session_start(); mysql_fetch_array($resultuser,
if (!(isset($_SESSION['login']) && MYSQL_NUM);
$_SESSION['login'] != '')) { $unit = $queryresult[0];
header ("Location: ../../kms/login.php");} $getunit = "SELECT DISTINCT unit
$EmpID = $_SESSION['empID']; FROM empinfo";

include("./includes/config.php"); $allunit = mysql_query($getunit);

$queryac = "SELECT Firstname,Lastname if($AccessLevel == "3"){


from empinfo where EmpID='$EmpID'"; // Get Value for Employee List Checkbox
$resultac = @mysql_query ($queryac); $get=mysql_query("SELECT empID,
$queryresultac = array(); lastName, firstName FROM empinfo where
supervisor='$EmpID' or empID='$EmpID'
$queryresultac = ORDER BY position, lastName");
mysql_fetch_array($resultac,
MYSQL_NUM); $option ="";

$fname = $queryresultac[0]; while($row = mysql_fetch_assoc($get))


{ $option .= '<option value = "'. <li><a href="createevent.php">Create
$row['empID'].'">'.$row['lastName'].','. Event</a></li>
$row['firstName'].'</option>';}}
<li><a class="active"
else{ href="reports.php">Reports</a></li>

// Get Value for Employee List Checkbox <li><a


href="recommendations.php">Recommenda
$get=mysql_query("SELECT empID, tions</a></li>
lastName, firstName FROM empinfo where
unit='$unit' ORDER BY position, <li><a href="empmngt.php">Employee
lastName"); Management</a></li>

$option =""; <li><a


href="changepwsd.php">Password</a></li>
while($row = mysql_fetch_assoc($get))
<li style=float:right><a class="logout"
{ $option .= '<option value = "'. href="logout.php">Log-out</a></li>
$row['empID'].'">'.$row['lastName'].','.
$row['firstName'].'</option>';}} <li style=float:right><?php echo "".
$fname." ".$lname." (".$EmpID.")";?></li>
?>
</ul></b><br></div>
<!DOCTYPE html>
<div class="contains">
<html>
<h2
<head> class="headings"><center>Reports</center>
<link rel="stylesheet" type="text/css" </h2>
href="./includes/style.css"> <form action="reportsquery.php"
<title>LPU Knowledge Management method="POST">
System</title> <center><table><tr>
</head> <td><h4> By Employee:
<body> <select name="Employee" id="Employee"
<div class="header"> placeholder="Employee ID">

<img src="../images/logo.png"> <option>Please Select Employee:</option>

<b><ul> <?php echo"$option" ?


></select></h3></td>
<li><a
href="home.php">Dashboard</a></li>
<td align="center"><input type="submit" <tr><td colspan="3" align="center"><h4
class="button" id="byemp" name="byemp" class="headings">Other
value="Generate"></input></h3></td></tr> Reports</h4></td></tr>

</form> <form action="reportsquery.php"


method="POST">
<?php
<tr>
if($EmpID == "03-0001")
<td align="center">Event Suggestions</td>
{echo '
<td align="center"><input type="submit"
<form action="reportsquery.php" class="button" value="Generate"
method="POST"><tr> name="EventSuggest"></td></tr>
<td><h4> By Unit: &nbsp; <tr>
<select name="SearchedUnit" <td align="center">KMS Approval
id="SearchedUnit"><option>Please Select Status</td>
Unit:</option>';
<td align="center"><input type="submit"
while ($rowau = class="button" value="Generate"
mysql_fetch_array($allunit)) { name="UnitKMS"></td></tr>
echo "<option value='".$rowau[0]."'>". </form>';}
$rowau[0]."</option>";}
else{
echo'
echo '
</td><td><input type="submit"
class="button" id="byunitadmin" <form action="reportsquery.php"
name="byunitadmin" method="POST">
value="Generate"></input></h4></td></tr>
<tr><td><h4> On Unit &nbsp;&nbsp;
<tr>
<input type="submit" class="button"
<td align="center"><h4> University id="byunit" name="byunit"
Report</td> value="Generate"></input></h4></td></tr>

<td align="center"><input type="submit" </form>';


class="button" id="byuniv" name="byuniv"
value="Generate"></input> if ($AccessLevel == "2")
</h4></td></tr> {echo'
</form>
<tr><td colspan="3" align="center"><h4 INNER JOIN eventinfo on kms.eventID =
class="headings">Other eventinfo.eventID where
Reports</h4></td></tr> kms.empID='$EmpID' OR status='$EmpID'
Order By kms.Unit";
<form action="reportsquery.php"
method="POST"> $result = @mysql_query($query);

<tr> if($result)

<td align="center">Event Suggestions</td> {echo '<br>

<td align="center"><input type="submit" <script src="sorttable.js"></script>


class="button" value="Generate"
name="EventSuggest"></td></tr> <br><h2><center>University KMS</h2>
<hr>
<tr>
<table border="1" class="sortable"
<td align="center">KMS Approval id="myTable" align="center"
Status</td> cellspacing="1" cellpadding="1" sortable>

<td align="center"><input type="submit" <b><tr class="headings">


class="button" value="Generate"
name="UnitKMS"></td></tr> <td align="Center" height="28"
width="25"><b>KMS ID </td>
</form>';}}
<td align="center" height="28"
echo'</table>'; width="30"><b>Unit</td>

$queryu = "SELECT Unit from empinfo <td align="center" height="28"


where empID ='$EmpID'"; width="30"><b>Employee</td>

$result = @mysql_query($queryu); <td align="center" height="28"


width="30"><b>Event Name</td>
$resultarray = array();
<td align="center" height="28"
$resultarray = mysql_fetch_assoc($result, width="30"><b>Status</td>
MYSQL_NUM);
</tr></b>';
$Unit = $resultarray[0];
$total = mysql_num_rows($result);
echo '<form action="showinfo.php"
method="post">'; for ($num=0; $num < $total; $num++ ){

if($EmpID == "03-0001"){ $row = mysql_fetch_array($result,


MYSQL_NUM);
$query = "SELECT kmsID, Unit, empID,
eventinfo.eventName, status FROM kms
echo"<tr> <td align=\"left\" <b><tr class="headings">
height=\"30\" width=\"25\"><input
type=\"submit\" value=\"$row[0]\" <td align="Center" height="28"
class=\"kmsid\" name=\"search\"></td> width="25"><b>KMS ID </td>

<td align=\"left\" height=\"30\" <td align="center" height="28"


width=\"30\">$row[1] </td> width="30"><b>Employee</td>

<td align=\"left\" height=\"30\" <td align="center" height="28"


width=\"30\">$row[2] </td> width="30"><b>Status</td>

<td align=\"left\" height=\"30\" </tr></b>';


width=\"30\">$row[3] </td> $total = mysql_num_rows($result);
<td align=\"left\" height=\"30\" for ($num=0; $num < $total; $num++ ){
width=\"30\">$row[4] </td> </tr>\n";}
$row = mysql_fetch_array($result,
echo'</table> MYSQL_NUM);
<br></form>'; echo"<tr>
//mysql_free_result($result); //free up the <td align=\"left\" height=\"30\"
resources.}} width=\"25\"><input type=\"submit\"
else{ value=\"$row[0]\" class=\"kmsid\"
name=\"search\"></td>
$query = "SELECT kmsID, empinfo.Lname,
Status from kms Right Join empinfo on <td align=\"left\" height=\"30\"
kms.EmpID = empinfo.EmpID where width=\"30\">$row[1] </td>
empinfo.Unit = '$Unit' and kms.KMSID is <td align=\"left\" height=\"30\"
not null Order By kms.KMSID"; width=\"30\">$row[2] </td>
$result = @mysql_query($query); </tr>\n";}
if($result){ echo'</table>
echo ' <br></form> ';
<script src="sorttable.js"></script> mysql_free_result($result); //free up the
<br><h2><center>Unit KMS</h2> <hr> resources.}}

<table border="1" class="sortable" ?>


id="myTable" align="center" <br><hr><br><br></div>
cellspacing="1" cellpadding="1" sortable>
Reportsquery.php
<?php <head>

// Check Log-in state <link rel="stylesheet" type="text/css"


href="./includes/style.css">
session_start();
<title>LPU Knowledge Management
if (!(isset($_SESSION['login']) && System</title>
$_SESSION['login'] != '')) {
</head>
header ("Location: ../../kms/login.php");}
<body>
$EmpID = $_SESSION['empID'];
<div class="header">
include("./includes/config.php");
<img src="../images/logo.png">
$queryac = "SELECT AccessLevel from
empaccount where EmpID='$EmpID'"; <b><ul>

$resultac = @mysql_query ($queryac); <li><a


href="home.php">Dashboard</a></li>
$queryresultac = array();
<li><a href="createevent.php">Create
$queryresultac = Event</a></li>
mysql_fetch_array($resultac,
MYSQL_NUM); <li><a class="active"
href="reports.php">Reports</a></li>
$AccessLevel = $queryresultac[0];
<li><a
$queryac = "SELECT Firstname,Lastname href="recommendations.php">Recommenda
from empinfo where EmpID='$EmpID'"; tions</a></li>
$resultac = @mysql_query ($queryac); <li><a href="empmngt.php">Employee
$queryresultac = array(); Management</a></li>

$queryresultac = <li><a
mysql_fetch_array($resultac, href="changepwsd.php">Password</a></li>
MYSQL_NUM); <li style=float:right><a class="logout"
$fname = $queryresultac[0]; href="logout.php">Log-out</a></li>

$lname = $queryresultac[1]; <li style=float:right><?php echo "".


$fname." ".$lname." (".$EmpID.")";?></li>
?>
</ul></b><br></div>
<!DOCTYPE html>
<div class="contains">
<html>
<br><br> $Approver = $queryresult[0];

<?php $queryapp = "SELECT Lastname, Firstname


from empinfo where EmpID='$Approver'";
//------------------------- By Employee
------------------------- $resultapp = @mysql_query ($queryapp);

if (isset($_POST['byemp'])){ $queryresapp = array();

$Employee = $_POST['Employee']; $queryresapp =


mysql_fetch_array($resultapp,
$query = "SELECT EmpID, Count(kmsID) MYSQL_NUM);
as numKMS, Count(case Status when
'Approved' then 1 else null end) as $ApproverL = $queryresapp[0];
numApproved, ( (Count(case Status when
'Approved' then 1 else null end)) / $ApproverF = $queryresapp[1];
(Count(KMSID)) *100) as Percentage from $queryinfo = mysql_query("SELECT
kms where EmpID = '$Employee' and Lastname, Firstname, Unit, Position from
KMSID is not null"; empinfo where EmpID = '$Employee'");
$result = @mysql_query($query); $info = array();
$resultarray = array(); while ($row =
$resultarray = mysql_fetch_assoc($result, mysql_fetch_assoc($queryinfo))
MYSQL_NUM); $info[] = $row;
$Emplo = $resultarray[0]; foreach($info as $x) {
$KMSCount = $resultarray[1]; echo "<b>Employee:</b> ".
$ApprovedCount = $resultarray[2]; $Emplo."<br />";

$Percentage = $resultarray[3]; echo "<b>Name:</b> ".$x['Lastname']." ,


".$x['Firstname']." <br />";

echo "<b>Unit:</b> ".$x['Unit']."<br />";


$queryuser = "SELECT Supervisor from
empinfo where EmpID='$Employee'"; echo "<b>Position:</b> ".
$x['Position']."<br />";
$resultuser = @mysql_query ($queryuser);
echo "<b>Supervisor:</b> ".
$queryresult = array(); $ApproverL.", ".$ApproverF."<hr \>";

$queryresult = echo "</center><br>";


mysql_fetch_array($resultuser,
MYSQL_NUM);
echo "<b>Number of KMS:</b> ". <td align="Center" height="28"
$KMSCount."<br>"; width="25"><b>Most Attended Topics</td>

echo "<b>Number of Approved KMS:</b> <td align="center" height="28"


".$ApprovedCount."<br />"; width="30"><b>Number of KMS on Topic
</td> </tr></b>';
$percent = number_format($Percentage, 2,
'.', ','); $totalnum =
mysql_num_rows($resulttrend);
echo "<b>Percentage of KMS
Approval:</b> ".$percent."%<br /> for ($num1=0; $num1 < $totalnum; $num1+
<hr>";} + ){

$querytrend = "SELECT eventinfo.Topic, $rowtrend =


count(Topic) as count from eventinfo Left mysql_fetch_array($resulttrend,
Join kms on kms.eventID = MYSQL_NUM);
eventinfo.eventID where kms.EmpID =
'$Employee' group by Topic order by echo"<tr>
count(Topic) DESC limit 5"; <td align=\"left\" height=\"30\"
$querytype = "SELECT width=\"30\">$rowtrend[0] </td>
eventinfo.EventType, count(EventType) as <td align=\"left\" height=\"30\"
count from eventinfo Left join kms on width=\"30\">$rowtrend[1] </td>
kms.eventID = eventinfo.eventID where
kms.EmpID = '$Employee' group by </tr>\n";}
EventType order by count(EventType)
echo'</table><br>';
DESC limit 5";
echo '
$resulttrend = @mysql_query($querytrend);
<script src="sorttable.js"></script>
$resulttype = @mysql_query($querytype);
<table border="1" class="sortable"
echo '
id="myTable" align="center"
<script src="sorttable.js"></script> cellspacing="5" cellpadding="5" sortable>

<br><h2><center>Employee Trends</h2> <b><tr class="headings">

<table border="1" class="sortable" <td align="center" height="28"


id="myTable" align="center" width="30"><b>Most Attended Event
cellspacing="5" cellpadding="5" sortable> Types</td>

<b><tr class="headings"> <td align="center" height="28"


width="30"><b>Number of KMS on Event
Type</td></tr></b>';
$totalnum1 = <td align="center" height="30"
mysql_num_rows($resulttype); width="25"><b>Event Name</td>

for ($num2=0; $num2 < $totalnum1; <td align="center" height="30"


$num2++ ) { width="25"><b>Status</td></tr></b>';

$rowtype = mysql_fetch_array($resulttype, $total = mysql_num_rows($resultkms);


MYSQL_NUM);
for ($num=0; $num < $total; $num++ ){
echo"<tr>
$row = mysql_fetch_array($resultkms,
<td align=\"left\" height=\"30\" MYSQL_NUM);
width=\"30\">$rowtype[0] </td>
echo"<tr>
<td align=\"left\" height=\"30\"
width=\"30\">$rowtype[1] </td> <td align=\"left\" height=\"30\"
width=\"5\"><input type=\"submit\"
</tr>\n";} value=\"$row[0]\" class=\"kmsid\"
name=\"search\"></td>
echo'</table><br>';
<td align=\"left\" height=\"30\"
$querykms = "SELECT kmsID, width=\"10\">$row[1] </td>
eventinfo.eventName, status FROM kms
INNER JOIN eventinfo on kms.eventID = <td align=\"left\" height=\"30\"
eventinfo.eventID where EmpID = width=\"10\">$row[2] </td>
'$Employee'";
</tr>\n";}
$resultkms = @mysql_query($querykms);
echo'</table><br></form>
echo '
<form action="excel.php"
<form action="showinfo.php" method="POST">
method="post">
<input type="submit" class="button"
<script src="sorttable.js"></script> value="Export to Excel" name="byemp"
id="byemp">
<hr><h2><center>Employee KMS</h2>
<input type="hidden" name="Employee"
<table border="1" class="sortable" id="Employee" value='.$Employee.'>
id="myTable" align="center"
cellspacing="1" cellpadding="1" sortable> </form>';}

<b><tr class="headings"> <td //------------------------- By UNIt ---------------


align="Center" height="30"
width="20%"><b>KMS ID </td> if (isset($_POST['byunit']))
{$queryu = "SELECT Unit from empinfo $ApprovedCount = $resultarray[1];
where EmpID ='$EmpID'";
$Percentage = $resultarray[2];
$result = @mysql_query($queryu);
echo '<br>';
$resultarray = array();
echo "<h3><center>Unit
$resultarray = mysql_fetch_assoc($result, Report</center></h3><br><br>";
MYSQL_NUM);
echo "<b>Unit:</b> ".$Unit."<br />";
$Unit = $resultarray[0];
echo "<b>Number of KMS:</b> ".
if ($AccessLevel == "3") $KMSCount." KMS<br />";

$query = "SELECT Count(KMSID) as echo "<b>Number of Approved KMS:</b>


numKMS, Count(case Status when ".$ApprovedCount." KMS <br />";
'Approved' then 1 else null end) as
numApproved, ( (Count(case Status when $percent = number_format($Percentage, 2,
'Approved' then 1 else null end)) / '.', ',');
(Count(KMSID)) *100) as Percentage from echo "<b>Percentage of KMS
kms right join empinfo on Approval:</b> ".$percent."%";
kms.EmpID=empinfo.EmpID where
Supervisor='$EmpID' or if($AccessLevel == "2")
kms.EmpID='$EmpID' and KMSID is not
$query2 = "SELECT empinfo.EmpID,
null";
empinfo.Lastname, empinfo.Firstname,
else empinfo.Position,
Count(KMSID),Count(case Status when
$query = "SELECT Count(KMSID) as 'Approved' then 1 else null end) as
numKMS, Count(case Status when numApproved, ( (Count(case Status when
'Approved' then 1 else null end) as 'Approved' then 1 else null end)) /
numApproved, ( (Count(case Status when (Count(KMSID)) *100) as Percentage from
'Approved' then 1 else null end)) / kms Right JOIN empinfo on kms.EmpID =
(Count(KMSID)) *100) as Percentage from empinfo.EmpID where
kms where Unit='$Unit' and KMSID is not (empinfo.Unit='$Unit') GROUP BY
null"; EmpID";
$result = @mysql_query($query); Else{
$resultarray = array(); $query2 = "SELECT empinfo.EmpID,
$resultarray = mysql_fetch_assoc($result, empinfo.Lastname, empinfo.Firstname,
MYSQL_NUM); empinfo.Position,
Count(KMSID),Count(case Status when
$KMSCount = $resultarray[0]; 'Approved' then 1 else null end) as
numApproved, ( (Count(case Status when <td align="center" height="28"
'Approved' then 1 else null end)) / width="30"><b>Percentage of KMS
(Count(KMSID)) *100) as Percentage from Approval</td></tr></b>';
kms Right JOIN empinfo on kms.EmpID =
empinfo.EmpID where $total2 = mysql_num_rows($result2);
(empinfo.Supervisor='$EmpID') or for ($num=0; $num < $total2; $num++ ){
kms.empID = '$EmpID' GROUP BY
EmpID"; $row2 = mysql_fetch_array($result2,
MYSQL_NUM);
$result2 = @mysql_query($query2);
echo"<tr>
if($result2)
<td align=\"left\" height=\"30\"
{echo ' width=\"5\"><input type=\"submit\"
<hr><h3><center>Report per value=\"$row2[0]\" class=\"kmsid\"
Employee</center></h3><br> name=\"Employee\"></td>

<form method="POST" <td align=\"left\" height=\"30\"


action="reportemp.php"> width=\"30\">$row2[1], $row2[2] </td>

<script src="sorttable.js"></script> <td align=\"left\" height=\"30\"


width=\"30\">$row2[3] </td>
<table border="1" class="sortable"
id="myTable" align="center" <td align=\"left\" height=\"30\"
cellspacing="1" cellpadding="1" sortable> width=\"30\">$row2[4] </td>

<b><tr class="headings"> <td <td align=\"left\" height=\"30\"


align="Center" height="28" width=\"30\">$row2[5] </td>";
width="25"><b>Employee ID</td> $percent = number_format($row2[6], 2, '.',
<td align="center" height="28" ',');
width="30"><b>Name</td> echo" <td align=\"left\"
<td align="center" height="28" height=\"30\" width=\"30\">$percent %
width="30"><b>Position</td> </td> </tr>\n";}

<td align="center" height="28" echo'</table><br></form>';


width="30"><b>Number of KMS</td> $querytrend = "SELECT eventinfo.Topic,
<td align="center" height="28" count(Topic) as count from eventinfo Left
width="30"><b>Number of Approved KMS Join kms on kms.eventID =
</td> eventinfo.eventID where kms.Unit = '$Unit'
group by Topic order by Count(Topic)
DESC limit 5";
$querytype = "SELECT <td align=\"left\" height=\"30\"
eventinfo.EventType, count(EventType) as width=\"30\">$rowtrend[1] </td>
count from eventinfo Left join kms on
kms.eventID = eventinfo.eventID where </tr>\n";}
kms.Unit = '$Unit' group by EventType echo'</table><br>';
order by Count(EventType) DESC limit 5";
echo '
$resulttrend = @mysql_query($querytrend);
<script src="sorttable.js"></script>
$resulttype = @mysql_query($querytype);
<table border="1" class="sortable"
if($AccessLevel != "3"){ id="myTable" align="center"
echo ' cellspacing="5" cellpadding="5" sortable>

<script src="sorttable.js"></script> <b><tr class="headings">

<br><h2><center>Employee Trends</h2> <td align="center" height="28"


width="30"><b>Most Attended Event
<table border="1" class="sortable" Types</td>
id="myTable" align="center"
cellspacing="5" cellpadding="5" sortable> <td align="center" height="28"
width="30"><b>Number of KMS on Event
<b><tr class="headings"> Type</td></tr></b>';

<td align="Center" height="28" $totalnum1 =


width="25"><b>Most Attended Topics</td> mysql_num_rows($resulttype);

<td align="center" height="28" for ($num2=0; $num2 < $totalnum1;


width="30"><b>Number of KMS on Topic $num2++ ) {
</td></tr></b>';
$rowtype = mysql_fetch_array($resulttype,
$totalnum = MYSQL_NUM);
mysql_num_rows($resulttrend);
echo"<tr>
for ($num1=0; $num1 < $totalnum; $num1+
+ ){ <td align=\"left\" height=\"30\"
width=\"30\">$rowtype[0] </td>
$rowtrend =
mysql_fetch_array($resulttrend, <td align=\"left\" height=\"30\"
MYSQL_NUM); width=\"30\">$rowtype[1] </td>

echo"<tr> </tr>\n";}

<td align=\"left\" height=\"30\" echo'</table><br>';


width=\"30\">$rowtrend[0] </td> echo'
<form action="excel.php" $Percentage = $resultarray[2];
method="POST">
echo '<br>';
<input type="submit" class="button"
value="Export to Excel" name="byunit" echo "<h3><center>Unit
id="byunit"> </form>';}}} Report</center></h3><br>";

if (isset($_POST['byunitadmin'])) echo "<b>Unit:</b> ".$SearchedUnit."<br


/>";
{ $SearchedUnit =
$_POST['SearchedUnit']; echo "<b>Number of KMS:</b> ".
$KMSCount." KMS<br />";
$queryu = "SELECT Unit from empinfo
where EmpID ='$EmpID'"; echo "<b>Number of Approved KMS:</b>
".$ApprovedCount." KMS <br />";
$result = @mysql_query($queryu);
$percent = number_format($Percentage, 2,
$resultarray = array(); '.', ',');

$resultarray = mysql_fetch_assoc($result, echo "<b>Percentage of KMS


MYSQL_NUM); Approval:</b> ".$percent."%";

$Unit = $resultarray[0]; $querytrend = "SELECT eventinfo.Topic,


count(Topic) as count from eventinfo Left
if ($EmpID == "03-0001") Join kms on kms.eventID =
$query = "SELECT Count(KMSID) as eventinfo.eventID where kms.Unit =
numKMS, Count(case Status when '$SearchedUnit' group by Topic order by
'Approved' then 1 else null end) as Count(Topic) DESC limit 5";
numApproved, ( (Count(case Status when $querytype = "SELECT
'Approved' then 1 else null end)) / eventinfo.EventType, count(EventType) as
(Count(KMSID)) *100) as Percentage from count from eventinfo Left join kms on
kms where Unit='$SearchedUnit' and kms.eventID = eventinfo.eventID where
KMSID is not null"; kms.Unit = '$SearchedUnit' group by
$result = @mysql_query($query); EventType order by Count(EventType)
DESC limit 5";
$resultarray = array();
$resulttrend = @mysql_query($querytrend);
$resultarray = mysql_fetch_assoc($result,
MYSQL_NUM); $resulttype = @mysql_query($querytype);

$KMSCount = $resultarray[0]; echo '

$ApprovedCount = $resultarray[1]; <script src="sorttable.js"></script>

<br><h2><center>Employee Trends</h2>
<table border="1" class="sortable" <td align="center" height="28"
id="myTable" align="center" width="30"><b>Most Attended Event
cellspacing="5" cellpadding="5" sortable> Types</td>

<b><tr class="headings"> <td align="center" height="28"


width="30"><b>Number of KMS on Event
<td align="Center" height="28" Type</td>
width="25"><b>Most Attended Topics</td>
</tr></b>';
<td align="center" height="28"
width="30"><b>Number of KMS on Topic $totalnum1 =
</td></tr></b>'; mysql_num_rows($resulttype);

$totalnum = for ($num2=0; $num2 < $totalnum1;


mysql_num_rows($resulttrend); $num2++ ) {

for ($num1=0; $num1 < $totalnum; $num1+ $rowtype = mysql_fetch_array($resulttype,


+) { MYSQL_NUM);

$rowtrend = echo"<tr>
mysql_fetch_array($resulttrend,
MYSQL_NUM); <td align=\"left\" height=\"30\"
width=\"30\">$rowtype[0] </td>
echo"<tr>
<td align=\"left\" height=\"30\"
<td align=\"left\" height=\"30\" width=\"30\">$rowtype[1] </td>
width=\"30\">$rowtrend[0] </td>
</tr>\n";}
<td align=\"left\" height=\"30\"
width=\"30\">$rowtrend[1] </td> echo'</table><br>';

</tr>\n";} $query2 = "SELECT empinfo.EmpID,


empinfo.Lastname, empinfo.Firstname,
echo'</table><br>'; empinfo.Position,
Count(KMSID),Count(case Status when
'Approved' then 1 else null end) as
echo ' numApproved, ( (Count(case Status when
'Approved' then 1 else null end)) /
<script src="sorttable.js"></script> (Count(KMSID)) *100) as Percentage from
kms Right JOIN empinfo on kms.EmpID =
<table border="1" class="sortable"
empinfo.EmpID where
id="myTable" align="center"
(empinfo.Unit='$SearchedUnit') GROUP
cellspacing="5" cellpadding="5" sortable>
BY EmpID";
<b><tr class="headings">
$result2 = @mysql_query($query2);
if($result2){ value=\"$row2[0]\" class=\"kmsid\"
name=\"Employee\"></td>
echo ' <form method="POST"
action="reportemp.php"> <td align=\"left\" height=\"30\"
width=\"30\">$row2[1], $row2[2] </td>
<script src="sorttable.js"></script>
<td align=\"left\" height=\"30\"
<table border="1" class="sortable" width=\"30\">$row2[3] </td>
id="myTable" align="center"
cellspacing="1" cellpadding="1" sortable> <td align=\"left\" height=\"30\"
width=\"30\">$row2[4] </td>
<b><tr class="headings">
<td align=\"left\" height=\"30\"
<td align="Center" height="28" width=\"30\">$row2[5] </td>";
width="25"><b>Employee ID</td>
$percent = number_format($row2[6], 2, '.',
<td align="center" height="28" ',');
width="30"><b>Name</td>
echo" <td align=\"left\"
<td align="center" height="28" height=\"30\" width=\"30\">$percent %
width="30"><b>Position</td> </td></tr>\n"; }
<td align="center" height="28" echo'</table><br></form>
width="30"><b>Number of KMS</td>
<form action="excel.php"
<td align="center" height="28"
width="30"><b>Number of Approved KMS method="POST">
</td>
<input type="submit" class="button"
<td align="center" height="28" value="Export to Excel" name="byunit"
width="30"><b>Percentage of KMS id="byunit">
Approval</td>
<input type="hidden" value='.
</tr></b>'; $SearchedUnit.' name="UnitR"
id="UnitR">
$total2 = mysql_num_rows($result2);
</form>';}}
for ($num=0; $num < $total2; $num++ ){
// ---------------------Whole University---------
$row2 = mysql_fetch_array($result2,
MYSQL_NUM); if (isset($_POST['byuniv'])){

echo" <tr> $query = "SELECT Count(KMSID) as


numKMS, Count(case Status when
<td align=\"left\" height=\"30\" 'Approved' then 1 else null end) as
width=\"5\"><input type=\"submit\" numApproved, ( (Count(case Status when
'Approved' then 1 else null end)) / EventType order by Count(EventType)
(Count(KMSID)) *100) as Percentage from DESC limit 5";
kms where KMSID is not null";
$resulttrend = @mysql_query($querytrend);
$result = @mysql_query($query);
$resulttype = @mysql_query($querytype);
$resultarray = array();
echo '
$resultarray = mysql_fetch_assoc($result,
MYSQL_NUM); <hr><br><h3><center>Report per
Unit</center></h3><br>
$KMSCount = $resultarray[0];
<script src="sorttable.js"></script>';
$ApprovedCount = $resultarray[1];
$query2 = "SELECT Unit, Count(KMSID)
$Percentage = $resultarray[2]; as numKMS, Count(case Status when
'Approved' then 1 else null end) as
echo '<br>'; numApproved, ( (Count(case Status when
echo "<h3><center>Unit 'Approved' then 1 else null end)) /
Report</center></h3><br>"; (Count(KMSID)) *100) as Percentage from
kms where KMSID is not null group by
echo "<b>Unit:</b> All Units <br />"; Unit";

echo "<b>Number of KMS:</b> ". $result2 = @mysql_query($query2);


$KMSCount." KMS<br />";
if($result2){
echo "<b>Number of Approved KMS:</b>
".$ApprovedCount." KMS <br />"; echo '

$percent = number_format($Percentage, 2, <script src="sorttable.js"></script>


'.', ','); <table border="1" class="sortable"
echo "<b>Percentage of KMS id="myTable" align="center"
Approval:</b> ".$percent."%"; cellspacing="1" cellpadding="1" sortable>

$querytrend = "SELECT eventinfo.Topic, <b><tr class="headings">


count(Topic) as count from eventinfo Left <td align="Center" height="28"
Join kms on kms.eventID = width="25"><b>Unit</td>
eventinfo.eventID group by Topic order by
Count(Topic) DESC limit 5"; <td align="center" height="28"
width="30"><b>Number of KMS</td>
$querytype = "SELECT
eventinfo.EventType, count(EventType) as <td align="center" height="28"
count from eventinfo Left join kms on width="30"><b>Number of Approved KMS
kms.eventID = eventinfo.eventID group by </td>
<td align="center" height="28" <td align="center" height="28"
width="30"><b>Percentage of KMS width="30"><b>Number of KMS on Topic
Approval</td> </td> </tr></b>';

</tr></b>'; $totalnum =
mysql_num_rows($resulttrend);
$total2 = mysql_num_rows($result2);
for ($num1=0; $num1 < $totalnum; $num1+
for ($num=0; $num < $total2; $num++ ){ + ){
$row2 = mysql_fetch_array($result2, $rowtrend =
MYSQL_NUM); mysql_fetch_array($resulttrend,
echo"<tr> MYSQL_NUM);

<td align=\"left\" height=\"30\" echo"<tr>


width=\"30\">$row2[0]</td> <td align=\"left\" height=\"30\"
<td align=\"left\" height=\"30\" width=\"30\">$rowtrend[0] </td>
width=\"30\">$row2[1] </td> <td align=\"left\" height=\"30\"
<td align=\"left\" height=\"30\" width=\"30\">$rowtrend[1] </td>
width=\"30\">$row2[2] </td>"; </tr>\n";}
$percent = number_format($row2[3], 2, '.', echo'</table><br>';
',');
echo '
echo" <td align=\"left\"
height=\"30\" width=\"30\">$percent % <script src="sorttable.js"></script>
</td>
<table border="1" class="sortable"
</tr>\n";} id="myTable" align="center"
cellspacing="5" cellpadding="5" sortable>
echo '
<b><tr class="headings">
<script src="sorttable.js"></script>
<td align="center" height="28"
<br><h2><center>Employee Trends</h2> width="30"><b>Most Attended Event
<table border="1" class="sortable" Types</td>
id="myTable" align="center" <td align="center" height="28"
cellspacing="5" cellpadding="5" sortable> width="30"><b>Number of KMS on Event
<b><tr class="headings"> Type</td></tr></b>';

<td align="Center" height="28" $totalnum1 =


width="25"><b>Most Attended Topics</td> mysql_num_rows($resulttype);
for ($num2=0; $num2 < $totalnum1; group by Topic order by count(Topic) desc
$num2++ ) { limit 5";

$rowtype = mysql_fetch_array($resulttype, $querytype = "SELECT


MYSQL_NUM); eventinfo.EventType, count(EventType) as
count from eventinfo Left join kms on
echo"<tr> kms.eventID = eventinfo.eventID where
<td align=\"left\" height=\"30\" kms.Unit = '$Unit' group by EventType
width=\"30\">$rowtype[0] </td> Order by count(EventType) desc limit 5";

<td align=\"left\" height=\"30\" $resulttrend = @mysql_query($querytrend);


width=\"30\">$rowtype[1] </td> $resulttype = @mysql_query($querytype);
</tr>\n";} echo '<h2><center>Trends
echo'</table><br>'; Report</center></h2>

echo'<form action="excel.php" <h3><center>Unit: '.


method="POST"> $Unit.'</center></h3><hr>

<input type="submit" class="button" <h3> Most Attended Event Types </h3>';


value="Export to Excel" name="byuniv" for ($num=0; $num < 3; $num++ ) {
id="byuniv"></form> ';}}
$number = $num + 1;
// ------------- OTHER REPORTS ------------
$rowtype = mysql_fetch_array($resulttype,
if (isset($_POST['EventSuggest'])) MYSQL_NUM);
{$queryu = "SELECT Unit from empinfo echo "Top ".$number." Type: <b>".
where EmpID ='$EmpID'"; $rowtype[0]."</b><br>";}
$result = @mysql_query($queryu); echo'<br><hr><br>';
$resultarray = array(); for ($num=0; $num < 3; $num++ ){
$resultarray = mysql_fetch_assoc($result, $number = $num + 1;
MYSQL_NUM);
$rowtrend =
$Unit = $resultarray[0]; mysql_fetch_array($resulttrend,
$querytrend = "SELECT eventinfo.Topic, MYSQL_NUM);
count(Topic) as count from eventinfo Left $rowtype = mysql_fetch_array($resulttype,
Join kms on kms.eventID = MYSQL_NUM);
eventinfo.eventID where kms.Unit = '$Unit'
echo" <u>Top ".$number." Topic Trend: <script src="sorttable.js"></script>
</u><br>
<center><h3> Employee with No KMS
Topic to Cater: <b>". </h3></center>
$rowtrend[0]."</b><br>";
<table border="1" class="sortable"
$querytocater = "SELECT kms.EmpID, id="myTable" align="center"
Topic, COUNT(TOPIC) from eventinfo cellspacing="1" cellpadding="1" sortable>
right join kms on kms.eventID =
eventinfo.eventID where Topic = <b><tr class="headings">
'$rowtrend[0]' group by EmpID order by <td align="Center" height="28"
COUNT(Topic) desc limit 1"; width="25"><b>Employee ID</td>
$resultcater = <td align="center" height="28"
@mysql_query($querytocater); width="30"><b>Name</td>
$rowcater = mysql_fetch_array($resultcater, <td align="center" height="28"
MYSQL_NUM); width="30"><b>Position </td>
$queryname = "SELECT </tr></b>';
Lastname,Firstname from empinfo where
EmpID ='$rowcater[0]'"; $total2 = mysql_num_rows($result2);

$resultname = @mysql_query($queryname); for ($num=0; $num < $total2; $num++ ){

$rowname = $row2 = mysql_fetch_array($result2,


mysql_fetch_assoc($resultname, MYSQL_NUM);
MYSQL_NUM);
echo"<tr>
echo"Most Suited Employee: <b>".
<td align=\"left\" height=\"30\"
$rowname[0].", ".
width=\"30\">$row2[0] </td>
$rowname[1]."</b><br><br>";}
<td align=\"left\" height=\"30\"
$querynokms = "SELECT empinfo.EmpID,
width=\"30\">$row2[1], $row2[2] </td>
Lastname, Firstname, Position, Unit from
empinfo where empinfo.EmpID NOT IN <td align=\"left\" height=\"30\"
(Select EmpID from kms) and Unit='$Unit' width=\"30\">$row2[3] </td>
and empinfo.EmpID != '03-0001' order by
Position"; </tr>\n";}

$result2 = @mysql_query($querynokms); echo'</table><br></form>

if($result2){ <form action="excel.php"


method="POST">
echo '
<input type="submit" class="button" <td align="Center" height="28"
value="Export to Excel" width="25"><b>KMS ID </td>
name="EventSuggest" id="EventSuggest">
<td align="center" height="28"
</form>';}} width="30"><b>Employee ID</td>

if (isset($_POST['UnitKMS'])){ <td align="center" height="28"


width="30"><b>Event Title</td>
$Start = date("Y-m-d");
<td align="center" height="28"
$End = date("Y-m-d"); width="30"><b>Status</td>
$queryu = "SELECT Unit from empinfo </tr></b>';
where EmpID ='$EmpID'";
$total = mysql_num_rows($resultkms);
$result = @mysql_query($queryu);
for ($num=0; $num < $total; $num++ ){
$resultarray = array();
$row = mysql_fetch_array($resultkms,
$resultarray = mysql_fetch_assoc($result, MYSQL_NUM);
MYSQL_NUM);
$queryname = "SELECT Lastname,
$Unit = $resultarray[0]; Firstname from empinfo where EmpID
$querykms = "SELECT KMSID, EmpID, ='$row[1]'";
eventinfo.EventName, SubmitDate, Status $resultname = @mysql_query($queryname);
from kms right join eventinfo on
kms.eventID = eventinfo.eventID where $resultarrayname = array();
Unit='$Unit' and Status='Approved'";
$resultarrayname =
$resultkms = @mysql_query($querykms); mysql_fetch_assoc($resultname,
MYSQL_NUM);
echo '<h2><center>KMS Approval
Report</h2> <hr> $Lname = $resultarrayname[0];

<form action="showinfo.php" $Fname = $resultarrayname[0];


method="post">
echo"<tr>
<script src="sorttable.js"></script>
<td align=\"left\" height=\"30\"
<br><h3><center>Approved KMS</h3> width=\"25\"><input type=\"submit\"
value=\"$row[0]\" class=\"kmsid\"
<table border="1" class="sortable" name=\"search2\"></td>
id="myTable" align="center"
cellspacing="1" cellpadding="1" sortable> <td align=\"left\" height=\"30\"
width=\"30\">$Lname, $Fname </td>
<b><tr class="headings">
<td align=\"left\" height=\"30\" for ($num=0; $num < $total; $num++ ){
width=\"30\">$row[2] </td>
$row = mysql_fetch_array($resultkms,
<td align=\"left\" height=\"30\" MYSQL_NUM);
width=\"30\">$row[4] </td>
$queryname = "SELECT Lastname,
</tr>\n";} Firstname from empinfo where EmpID
='$row[1]'";
$querykms = "SELECT KMSID, EmpID,
eventinfo.EventName, SubmitDate, Status $resultname = @mysql_query($queryname);
from kms right join eventinfo on
kms.eventID = eventinfo.eventID where $resultarrayname = array();
Unit='$Unit' and Status!='Approved'"; $resultarrayname =
$resultkms = @mysql_query($querykms); mysql_fetch_assoc($resultname,
MYSQL_NUM);
echo '</table></form>
$Lname = $resultarrayname[0];
<form action="showinfo.php"
method="post"> $Fname = $resultarrayname[0];

<script src="sorttable.js"></script> echo"<tr>

<br><h3><center>Pending KMS</h3> <td align=\"left\" height=\"30\"


width=\"25\"><input type=\"submit\"
<table border="1" class="sortable" value=\"$row[0]\" class=\"kmsid\"
id="myTable" align="center" name=\"search2\"></td>
cellspacing="1" cellpadding="1" sortable>
<td align=\"left\" height=\"30\"
<b><tr class="headings"> width=\"30\">$Lname, $Fname </td>

<td align="Center" height="28" <td align=\"left\" height=\"30\"


width="25"><b>KMS ID </td> width=\"30\">$row[2] </td>

<td align="center" height="28" <td align=\"left\" height=\"30\"


width="30"><b>Employee ID</td> width=\"30\">$row[4] </td>

<td align="center" height="28" </tr>\n";}


width="30"><b>Event Title</td>
$querykms = "SELECT KMSID, EmpID,
<td align="center" height="28" eventinfo.EventName, SubmitDate, Status
width="30"><b>Status</td> from kms right join eventinfo on
kms.eventID = eventinfo.eventID where
</tr></b>'; Unit='$Unit' and SubmitDate < curdate()";
$total = mysql_num_rows($resultkms); $resultkms = @mysql_query($querykms);
echo '</table></form> $Lname = $resultarrayname[0];

<form action="showinfo.php" $Fname = $resultarrayname[0];


method="post">
echo"<tr>
<script src="sorttable.js"></script>
<td align=\"left\" height=\"30\"
<br><h3><center>Overdue KMS</h3> width=\"25\"><input type=\"submit\"
value=\"$row[0]\" class=\"kmsid\"
<table border="1" class="sortable" name=\"search2\"></td>
id="myTable" align="center"
cellspacing="1" cellpadding="1" sortable> <td align=\"left\" height=\"30\"
width=\"30\">$Lname, $Fname </td>
<b><tr class="headings">
<td align=\"left\" height=\"30\"
<td align="Center" height="28" width=\"30\">$row[2] </td>
width="25"><b>KMS ID </td>
<td align=\"left\" height=\"30\"
<td align="center" height="28" width=\"30\">$row[3] </td>
width="30"><b>Employee ID</td>
</tr>\n";}
<td align="center" height="28"
width="30"><b>Event Title</td> echo'</table><br></form>

<td align="center" height="28" <form action="excel.php"


width="30"><b>Status</td> method="POST">

</tr></b>'; <input type="submit" class="button"


value="Export to Excel" name="UnitKMS"
$total = mysql_num_rows($resultkms); id="UnitKMS">
for ($num=0; $num < $total; $num++ ){ </form>';}
$row = mysql_fetch_array($resultkms, echo'
MYSQL_NUM);
<form action="reports.php"
$queryname = "SELECT Lastname, method="POST">
Firstname from empinfo where EmpID
='$row[1]'"; <center><input type="submit"
class="button" value="Back"></center>
$resultname = @mysql_query($queryname);
</form><br> </div>
$resultarrayname = array();
</body>
$resultarrayname =
mysql_fetch_assoc($resultname, </html>';
MYSQL_NUM);
?> <!DOCTYPE html>

Reportemp.php <html>

<?php <head>

// Check Log-in state <link rel="stylesheet" type="text/css"


href="./includes/style.css">
session_start();
<title>LPU Knowledge Management
if (!(isset($_SESSION['login']) && System</title>
$_SESSION['login'] != '')) {
</head>
header ("Location: ../../kms/login.php");}
<body>
$EmpID = $_SESSION['empID'];
<div class="header">
include("./includes/config.php");
<img src="../images/logo.png"><b><ul>
$queryal = "SELECT AccessLevel from
empaccount where empID ='$EmpID'"; <li><a
href="home.php">Dashboard</a></li>
$resultal = @mysql_query($queryal);
<li><a href="createevent.php">Create
$resultarrayal = array(); Event</a></li>
$resultarrayal = <li><a class="active"
mysql_fetch_assoc($resultal, href="reports.php">Reports</a></li>
MYSQL_NUM);
<li><a
$AccessLevel = $resultarrayal[0]; href="recommendations.php">Recommenda
$queryac = "SELECT Firstname,Lastname tions</a></li>
from empinfo where EmpID='$EmpID'"; <li><a href="empmngt.php">Employee
$resultac = @mysql_query ($queryac); Management</a></li>

$queryresultac = array(); <li style=float:right><a class="logout"


href="logout.php">Log-out</a></li>
$queryresultac =
mysql_fetch_array($resultac, <li style=float:right><?php echo "".
MYSQL_NUM); $fname." ".$lname." (".$EmpID.")";?
></li></ul></b><br></div>
$fname = $queryresultac[0];
<div class="contains">
$lname = $queryresultac[1];
<br><br>
?>
<?php $resultapp = @mysql_query ($queryapp);

//------------------------- By Employee --------- $queryresapp = array();

if (isset($_POST['Employee'])){ $queryresapp =
mysql_fetch_array($resultapp,
$Employee = $_POST['Employee']; MYSQL_NUM);
$query = "SELECT EmpID, Count(kmsID) $ApproverL = $queryresapp[0];
as numKMS, Count(case Status when
'Approved' then 1 else null end) as $ApproverF = $queryresapp[1];
numApproved, ( (Count(case Status when
'Approved' then 1 else null end)) / $queryinfo = mysql_query("SELECT
(Count(KMSID)) *100) as Percentage from Lastname, Firstname, Unit, Position from
kms where EmpID = '$Employee' and empinfo where EmpID = '$Employee'");
KMSID is not null"; $info = array();
$result = @mysql_query($query); while ($row =
$resultarray = array(); mysql_fetch_assoc($queryinfo))

$resultarray = mysql_fetch_assoc($result, $info[] = $row;


MYSQL_NUM); foreach($info as $x) {
$Emplo = $resultarray[0]; echo "<b>Employee:</b> ".
$KMSCount = $resultarray[1]; $Emplo."<br />";

$ApprovedCount = $resultarray[2]; echo "<b>Name:</b> ".$x['Lastname']." ,


".$x['Firstname']." <br />";
$Percentage = $resultarray[3];
echo "<b>Unit:</b> ".$x['Unit']."<br />";
$queryuser = "SELECT Supervisor from
empinfo where EmpID='$Employee'"; echo "<b>Position:</b> ".
$x['Position']."<br />";
$resultuser = @mysql_query ($queryuser);
echo "<b>Supervisor:</b> ".
$queryresult = array(); $ApproverL.", ".$ApproverF."<hr \>";

$queryresult = echo "</center><br>";


mysql_fetch_array($resultuser,
MYSQL_NUM); echo "<b>Number of KMS:</b> ".
$KMSCount."<br>";
$Approver = $queryresult[0];
echo "<b>Number of Approved KMS:</b>
$queryapp = "SELECT Lastname, Firstname ".$ApprovedCount."<br />";
from empinfo where EmpID='$Approver'";
$percent = number_format($Percentage, 2, </tr></b>';
'.', ',');
$totalnum =
echo "<b>Percentage of KMS mysql_num_rows($resulttrend);
Approval:</b> ".$percent."%<br />
<hr>";} for ($num1=0; $num1 < $totalnum; $num1+
+ ){
$querytrend = "SELECT eventinfo.Topic,
count(Topic) as count from eventinfo Left $rowtrend =
Join kms on kms.eventID = mysql_fetch_array($resulttrend,
eventinfo.eventID where kms.EmpID = MYSQL_NUM);
'$Employee' group by Topic order by echo"<tr>
count(Topic) DESC limit 5";
<td align=\"left\" height=\"30\"
$querytype = "SELECT width=\"30\">$rowtrend[0] </td>
eventinfo.EventType, count(EventType) as
count from eventinfo Left join kms on <td align=\"left\" height=\"30\"
kms.eventID = eventinfo.eventID where width=\"30\">$rowtrend[1] </td>
kms.EmpID = '$Employee' group by
</tr>\n";}
EventType order by count(EventType)
DESC limit 5"; echo'</table><br>';
$resulttrend = @mysql_query($querytrend); echo '
$resulttype = @mysql_query($querytype); <script src="sorttable.js"></script>
echo ' <table border="1" class="sortable"
id="myTable" align="center"
<script src="sorttable.js"></script>
cellspacing="5" cellpadding="5" sortable>
<br><h2><center>Employee Trends</h2>
<b><tr class="headings">
<table border="1" class="sortable"
<td align="center" height="28"
id="myTable" align="center"
width="30"><b>Most Attended Event
cellspacing="5" cellpadding="5" sortable>
Type</td>
<b><tr class="headings">
<td align="center" height="28"
<td align="Center" height="28" width="30"><b>Number of KMS on Event
width="25"><b>Most Attended Topics</td> Type</td>

<td align="center" height="28" </tr></b>';


width="30"><b>Number of KMS on Topic
$totalnum1 =
</td>
mysql_num_rows($resulttype);
for ($num2=0; $num2 < $totalnum1; <td align="center" height="30"
$num2++ ){ width="25"><b>Status</td>

$rowtype = mysql_fetch_array($resulttype, </tr></b>';


MYSQL_NUM);
$total = mysql_num_rows($resultkms);
echo"<tr>
for ($num=0; $num < $total; $num++ ){
<td align=\"left\" height=\"30\"
width=\"30\">$rowtype[0] </td> $row = mysql_fetch_array($resultkms,
MYSQL_NUM);
<td align=\"left\" height=\"30\"
width=\"30\">$rowtype[1] </td> echo"<tr>

</tr>\n";} <td align=\"left\" height=\"30\"


width=\"5\">$row[0]</td>
echo'</table><br>';
<td align=\"left\" height=\"30\"
$querykms = "SELECT kmsID, width=\"10\">$row[1] </td>
eventinfo.eventName, status FROM kms
INNER JOIN eventinfo on kms.eventID = <td align=\"left\" height=\"30\"
eventinfo.eventID where EmpID = width=\"10\">$row[2] </td>
'$Employee'"; </tr>\n";}
$resultkms = @mysql_query($querykms); echo'</table><br></form>
echo ' <form action="excel.php"
<form action="showinfo.php" method="POST">
method="post"> <input type="submit" class="button"
<script src="sorttable.js"></script> value="Export to Excel" name="byemp"
id="byemp">
<hr><h2><center>Employee KMS</h2>
<input type="hidden" name="Employee"
<table border="1" class="sortable" id="Employee" value='.$Employee.'>
id="myTable" align="center"
cellspacing="1" cellpadding="1" sortable> </form>';}

<b><tr class="headings"> <td echo' <form action="redirect.php"


align="Center" height="30" method="POST">
width="20%"><b>KMS ID </td> <center><INPUT TYPE="button"
<td align="center" height="30" class="button" VALUE="Back"
width="25"><b>Event Name</td> onClick="history.go(-1);" title="Please
refresh page after c"></center>
</form>'; $query = "INSERT into empinfo (empid,
lastname, firstname, Unit, position,
Empmngt.php supervisor)
<?PHP values('$employee','$Lname','$Fname','$Uni
t','$Position','$visor')";
session_start();
$query2 = "INSERT into empaccount
if (!(isset($_SESSION['login']) && (empid, lastname, AccessLevel) values
$_SESSION['login'] != '')) { ('$employee','$Lname','$Access')";

header ("Location: ../../kms/login.php");} $result = mysql_query($query,$db);

include('./includes/config.php'); $result = mysql_query($query2,$db);

$empID = $_SESSION['empID']; mysql_close($db);

$queryac = "SELECT Firstname,Lastname $message = 'Employee '.$Lname.'('.


from empinfo where EmpID='$empID'"; $employee.') Added!';

$resultac = @mysql_query ($queryac); echo "<SCRIPT>

$queryresultac = array(); alert('$message');


window.location.href='empmngt.php';
$queryresultac =
mysql_fetch_array($resultac, </SCRIPT>";
MYSQL_NUM);
include("empmngt.php");}
$fname = $queryresultac[0];
?>
$lname = $queryresultac[1];
<!DOCTYPE html>
if (isset($_POST['submit'])){
<html>
$employee = $_POST['Employee'];
<head>
$Lname = $_POST['Lname'];
<link rel="stylesheet" type="text/css"
$Fname = $_POST['Fname']; href="./includes/style.css">

$Unit = $_POST['unit']; <title>KMS Employee Management</title>

$Position = $_POST['Position']; </head>

$visor = $_POST['SupervisorID']; <body>

$Access=0; <div class="header">

$Access = $_POST['AccessLevel']; <img src="../images/logo.png"><b> <ul>


<li><a echo ' <br>
href="home.php">Dashboard</a></li>
<center>
<li><a href="createevent.php">Create
Event</a></li> <h3 class="headings">Employee
Management</h3>
<li><a href="reports.php">Reports</a></li>
</center>
<li><a
href="recommendations.php">Recommenda <center><table>
tions</a></li> <tr>
<li><a href="empmngt.php" <td><h4> UNIT MANAGEMENT
class="active">Employee Mngmt.</a></li>
<form action="unitmgt.php"
<li><a method="POST">
href="changepwsd.php">Password</a></li>
<select name="Unit"
<li style=float:right><a class="logout" required><option>Choose Unit: </option> '.
href="logout.php">Log-out</a></li> $option.' </select></option> &nbsp; <input
<li style=float:right><?php echo "". type="submit" value="Confirm"
$fname." ".$lname." (".$empID.")";?></li> class="button"></h4></td>

</ul></b><br></div> </form></tr>

<div class="contains"> </table></center>

<?php <br>

$query = "select DISTINCT(unit) as Unit <form method="POST">


from empinfo ORDER BY Unit ASC"; <center><h4 class="headings">Add New
$result = @mysql_query ($query); Employee</h4>

$total = mysql_num_rows($result); </center>

$option=''; <table align="center">

for ($num=0; $num < $total; $num++ ) <tr>

{ $row = mysql_fetch_array($result, <td height="40" width="120"><font


MYSQL_NUM); color="black">Employee ID:</font></td>

$option .= '<option value = "'.$row[0].'">'. <td height="30" width="600"><textarea


$row[0].'</option>';} required name="Employee" cols="50"
rows="2" size="10" placeholder="Employee <tr>
ID"></textarea></td> </tr><tr>
<td height="40" width="120"><font
<td height="40" width="120"><font color="black">Supervisor ID:</font></td>
color="black">Last Name:</font></td>
<td height="30"
<td height="30" width="600"><textarea width="600"><br><textarea required
required name="Lname" id="Lname" name="SupervisorID" id="SupervisorID"
cols="50" rows="2" size="50" cols="50" rows="2" size="10"
placeholder="Last placeholder="Employee ID of Immediate
Name"></textarea></td></tr> Superior"></textarea></td></tr>

<tr> <tr>

<td height="40" width="120"><font <td height="40" width="120"><font


color="black">First Name:</font></td> color="black">Access Level:</font></td>

<td height="30" width="600"><textarea <td height="40" width="600"><select


required name="Fname" id="Fname" name="AccessLevel">
cols="50" rows="2" size="50"
placeholder="First Name"></textarea></td> <option value=2>Unit_Head</option>

</tr><tr> <option value=3>Chairperson</option>

<td height="40" width="120"><font <option value=4>Faculty</option>


color="black">Unit:</font></td> </select></td></tr>
<td height="30" <tr>
width="600"><br><textarea required
name="unit" id="unit" cols="50" rows="2" <td></td>
size="255"
<td><br><input class="button"
placeholder="Unit"></textarea></td></tr>
name="submit" type="submit" value ="Add
<tr> Employee">

<td height="40" width="120"><font &nbsp;&nbsp;<input class="button"


color="black">Position:</font></td> type="reset" value="Clear"> </td></tr>

<td height="30" </table></form>


width="600"><br><textarea required
<br><hr>
name="Position" cols="50" rows="2"
size="100" id="Position" <form action="Home.php">
placeholder="Position"></textarea></td></t
r> <center><input type="submit"
class="button" value="Back"></center>
</form> $visor = $_POST['SupervisorID'];

<br><br>'; $Acc = $_POST['AccessLevel'];

?> $query1 = "UPDATE empinfo SET


lastname='$Lname', firstname='$Fname',
Editemp.php Unit='$Unit', Position='$Position',
<?PHP supervisor='$visor' where
empID='$empID'";
session_start();
$result = mysql_query($query1);
if (!(isset($_SESSION['login']) &&
$_SESSION['login'] != '')) { $query2 ="UPDATE empaccount SET
AccessLevel='$Acc', lastname='$Lname'
header ("Location: ../../kms/login.php");} where EmpID='$empID'";

include('./includes/config.php'); $result2 = mysql_query($query2);

$empID = $_SESSION['empID']; $message = "Employee Details Updated!";

$employee = $_POST['employ']; echo "<SCRIPT>

$queryac = "SELECT Firstname,Lastname alert('$message');


from empinfo where EmpID='$empID'"; window.location.href='EmpMngt.php';

$resultac = @mysql_query ($queryac); </SCRIPT>";

$queryresultac = array(); include("EmpMngt.php"); }

$queryresultac = elseif (isset($_POST['delete'])) {


mysql_fetch_array($resultac,
MYSQL_NUM); $empID = $_POST['Employee'];

$fname = $queryresultac[0]; $query1 = "Delete from empinfo where


EmpID='$empID'";
$lname = $queryresultac[1];
$result = mysql_query($query1, $db);
if (isset($_POST['update'])){
$query1 = "Delete from empaccount where
$empID = $_POST['Employee']; EmpID='$empID'";

$Lname = $_POST['Lname']; $result = mysql_query($query1, $db);

$Fname = $_POST['Fname']; $message = 'Employee '.$Lname.' Deleted!';

$Unit = $_POST['unit']; echo "<SCRIPT>

$Position = $_POST['Position'];
alert('$message'); <li style=float:right><?php echo "".
window.location.href='EmpMngt.php'; $fname." ".$lname." (".$empID.")";?></li>

</SCRIPT>"; </ul></b><br></div>

include("EmpMngt.php"); } <div class="contains">

?> <?php

<!DOCTYPE html> $query = "SELECT empid, lastname,


firstname, unit, position, supervisor from
<html> empinfo where empid='$employee'";
<head> $result = @mysql_query($query);
<link rel="stylesheet" type="text/css" $results = array();
href="./includes/style.css">
$results= mysql_fetch_assoc($result,
<title></title> MYSQL_NUM);
</head> $employee = $results[0];
<body> $Lname = $results[1];
<div class="header"> $Fname = $results[2];
<img src="../images/logo.png"><b> <ul> $Unit = $results[3];
<li><a $Position = $results[4];
href="home.php">Dashboard</a></li>
$visor = $results[5];
<li><a href="createevent.php">Create
Event</a></li> $querylev = "SELECT AccessLevel from
empaccount where empID ='$employee'";
<li><a href="reports.php">Reports</a></li>
$resultlev = @mysql_query($querylev);
<li><a
href="recommendations.php">Recommenda $resultarraylev = array();
tions</a></li>
$resultarraylev =
<li><a href="empmngt.php" mysql_fetch_assoc($resultlev,
class="active">Employee Mngmt.</a></li> MYSQL_NUM);

<li><a $level = $resultarraylev[0];


href="changepwsd.php">Password</a></li>
$querysup = "SELECT FirstName,
<li style=float:right><a class="logout" LastName from empinfo where empID
href="logout.php">Log-out</a></li> ='$visor'";
$resultsup = @mysql_query($querysup); <tr>

$resultarraysup = array(); <td height="40" width="120"><font


color="black">First Name:</font></td>
$resultarraysup =
mysql_fetch_assoc($resultsup, <td height="30" width="600"><input
MYSQL_NUM); type="text" required name="Fname"
id="Fname" size="20" placeholder="First
$Fsup = $resultarraysup[0]; Name" value="'.$Fname.'"></td></tr>
$Lsup = $resultarraysup[1]; <tr>
echo ' <br> <td height="40" width="120"><font
<center> color="black">Unit:</font></td>

<h3 class="headings">Employee <td height="30" width="600"><input


Management</h3> type="text" required name="unit" id="unit"
size="20" placeholder="Unit"value="'.
<form action="" method="POST"> $Unit.'"></td></tr>

<center><h4>Edit Details</h4></center> <tr>

<center><table align="center" <td height="40" width="120"><font


class="form"> color="black">Position:</font></td>

<tr> <td height="30" width="600"><input


type="text" name="Position" size="20"
<td height="40" width="120"><font
id="Position"
color="black">Employee ID:</font></td>
placeholder="Position"value='.
<td height="30" width="600"><input $Position.'></td></tr>
type="text" readonly required
<tr>
name="Employee" size="10"
placeholder="Employee ID" value="'. <td height="40" width="120"><font
$employee.'"></td> </tr> color="black">Supervisor ID:</font></td>

<tr> <td height="30" width="600"><input


type="text" required name="SupervisorID"
<td height="40" width="120"><font
id="SupervisorID" size="20"
color="black">Last Name:</font></td>
placeholder="Employee ID of
<td height="30" width="600"><input Superior"value='.$visor.'> <font size="2">
type="text" required name="Lname" ('.$Lsup.', '.$Fsup.')</font></td></tr>
id="Lname" size="20" placeholder="Last
<tr>
Name" value="'.$Lname.'"></td></tr>
<td height="40" width="120"><font $queryac = "SELECT Firstname,Lastname
color="black">Access Level:</font></td> from empinfo where EmpID='$empID'";

<td height="40" width="600"><input $resultac = @mysql_query ($queryac);


type="text" name="AccessLevel" size="20"
id="AccessLevel" placeholder="Unit $queryresultac = array();
Head/Chairperson/Faculty" value='. $queryresultac =
$level.'></td></tr> mysql_fetch_array($resultac,
<tr> MYSQL_NUM);

<td></td> $fname = $queryresultac[0];

<td><input class="button" name="update" $lname = $queryresultac[1];


type="submit" value ="Confirm"> $Unit = $_POST['Unit'];
&nbsp;&nbsp;
?>
<input class="button" name="delete"
type="submit" value ="Delete <!DOCTYPE html>
Employee"></td></tr>
<html>
</table></center></form>
<head>
<br><br>
<link rel="stylesheet" type="text/css"
</body> href="./includes/style.css">

</html>'; <title>Unit Management</title>

?> </head>

Unitmngt.php <body>

<?PHP <div class="header">

session_start(); <img src="../images/logo.png">

if (!(isset($_SESSION['login']) && <b>


$_SESSION['login'] != '')) {
<ul>
header ("Location: ../../kms/login.php");
<li><a
} href="home.php">Dashboard</a></li>

include('./includes/config.php'); <li><a href="createevent.php">Create


Event</a></li>
$empID = $_SESSION['empID'];
<li><a href="reports.php">Reports</a></li> echo'<b><tr class="headings">

<li><a <th align="center" height="28"


href="recommendations.php">Recommenda width="5"><b>Employee ID</th>
tions</a></li>
<th align="Center" height="28"
<li><a href="empmngt.php" width="30"><b>Name </th>
class="active">Employee Mngmt.</a></li>
<th align="center" height="28"
<li><a width="30"><b>Position</th>
href="changepwsd.php">Password</a></li>
<th align="center" height="28"
<li style=float:right><a class="logout" width="30"><b>Supervisor</th>
href="logout.php">Log-out</a></li>
</tr></b>';
<li style=float:right><?php echo "".
$fname." ".$lname." (".$empID.")";?></li> //Table content

</ul></b><br></div> $total = mysql_num_rows($result);

<div class="contains"> for ($num=0; $num < $total; $num++ ){

<?php $row = mysql_fetch_array($result,


MYSQL_NUM);
$getemp = "SELECT empID, lastname,
Firstname, Position, Supervisor from $querysup = "SELECT FirstName,
empinfo where Unit='$Unit'"; LastName from empinfo where empID
='$row[4]'";
$result = @mysql_query($getemp);
$resultsup = @mysql_query($querysup);
if($result){
$resultarraysup = array();
echo '<br>
$resultarraysup =
<form action="editemp.php" mysql_fetch_assoc($resultsup,
method="POST"> MYSQL_NUM);

<script src="sorttable.js"></script> $Fsup = $resultarraysup[0];

<center><h4> '.$Unit.' $Lsup = $resultarraysup[1];


Employees</h4></center>
echo'<tr>
<table border="1" class="sortable"
id="myTable" align="center" <td align="left" height="30"
cellspacing="5" cellpadding="5" sortable>'; width="5"><input type="submit" value="'.
$row[0].'" class="kmsid"
// Table headers name="employ"></td>
<td align="left" height="30" width="30">'. <center><input type="submit"
$row[1].', '.$row[2].'</td> class="button" value="Back"></center>

<td align="left" height="30" width="30">'. </form><br><br>';}


$row[3].'</td>
Logout.php
<td align="left" height="30" width="30">'.
$Lsup.', '.$Fsup.'</td>';} <?php

echo "</tr>\n"; session_start();

echo'</table></form> <br> session_destroy();

<form action="empmngt.php"> header("Location:../../kms/login.php");

?>

Vous aimerez peut-être aussi