0% found this document useful (0 votes)
273 views123 pages

HR System

The document describes the coding of a project for an HR system. It includes PHP code for pages like the index, applying for jobs, viewing applied jobs. It connects to a database for retrieving and updating job application data.

Uploaded by

Suraj Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
273 views123 pages

HR System

The document describes the coding of a project for an HR system. It includes PHP code for pages like the index, applying for jobs, viewing applied jobs. It connects to a database for retrieving and updating job application data.

Uploaded by

Suraj Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 123

Coding of project

Index.php
<!doctype html>

<html>
<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="icon"
href="images/homepage/favicon.ico" type="image/x-icon">
<title> HR SYSTEM</title>
<meta name="description" content="a gateway to academic projects|Get your first academic project
now with Free Mini-DBMS and CG Projects |Tech tutorials"
<meta name="keywords" content="css" />
<meta name="author" content="Audenberg Technologies (www.audenberg.com)" />
<link href="css/simpleGridTemplate.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/Animate.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU"
crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="css/Animate.css" rel="stylesheet" type="text/css">
<link href="css/animate.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Kodchasan" rel="stylesheet">
<style>
.tiltContain{margin-top:0%;}
.btnTilt{height: 75px;background:rgba(225,225,225,0.2) ; color:white; font-family: Comfortaa;}

.textDarkShadow{
text-shadow: 0px 0px 3px #000,3px 3px 5px #003333;
}
/* #btn1,#btn2,#btn3,#btn4,#btn5,#btn6{display:none;}*/
</style>

<body onload="logoBeat()" style="font-family: 'Kodchasan', sans-serif;">

<?php
include 'navBar.php';
include 'signinEmployerModals.php';
?>

<!-- Main Container -->


<div class="container-fluid" style=" background-image: url('img/mainBackg.jpg'); background-position:
center; background-size: cover; background-repeat: no-repeat; background-attachment: fixed;">

<div class="hero" style=" color:whitesmoke;" >

<h1 style="padding:50px; font-size: 100px;"><strong>HR SYSTEM</strong></h1>


<div style="width: 100%" class="row" >

<div class="col-md-9" >


<div style=" margin-top: 30px;">
<h1>Find jobs</h1>
<form class="example" action="index.php">
<input style="color:#000" type="text" placeholder="Search.." name="q">
<button type="submit"><i class="fa fa-search"></i></button>
</form></div>

<div class="container row">


<?php
$name=$category=$minexp=$salary=$industry=$desc=$role=$eType=$status=$msg="";

include 'connect.php';

$sql = "select *,(select name from employer where id=post.eid)as ename from post order by date";

if(isset($_GET['q'])){
$sql = "select *,(select name from employer where id=post.eid)as ename from post where name
LIKE '%".$_GET['q']."%' order by date";
}
if(isset($_GET['industry'])){
$sql = "select *,(select name from employer where id=post.eid)as ename from post where
industry='".$_GET['industry']."' order by date";
}
if(isset($_GET['category'])){
$sql = "select *,(select name from employer where id=post.eid)as ename from post where
category='".$_GET['category']."' order by date";
}

$result = $conn->query($sql);
if($result->num_rows>0){
while( $row=$result->fetch_assoc()){
$pid= $row['id'];
$jobtitle= $row['name'];
$category=$row['category'];
$minexp=$row['minexp'];
$salary=$row['salary'];
$industry=$row['industry'];
$desc=$row['desc'];
$role=$row['role'];
$ename =$row['ename'];
$status=$row['status'];
?>
<div class="col-md-4" style="margin: 20px; background: rgba(0,0,0,0.5);padding:
5px;box-shadow: 0px 0px 5px #003333">
<h3 style="color: #2196F3"><?php echo $jobtitle;?></h3>
<h5>By <?php echo $ename;?></h5><br>
<h4>Job Description:<br><h5><?php echo $desc;?></h5></h4>
<h5>Experiance required:<?php echo $minexp;?> years </h5>
<h5>Salary:<?php echo $salary;?> </h5>
<br>
<a href="applyJob.php?id=<?php echo $pid;?>" class="pull-right"
><h3>Apply</h3></a>
</div>

<?php }}else{
echo "Search returned no results";
} ?>
</div>

</div>

<div style=" height: 100vh; " class="col-md-3">

<br><br>
<div style='padding:10px'>
<h3>Jobs by Category</h3>
<form>
<div>
<select class="form-control" name='category'>
<?php include "categoryOptions.php";?>
</select><br>
<input class="btn btn-success pull-right" type="submit" value="Search"/>
</div>
</form>
</div><br><br>
<br><br>
<div style='padding:10px'>
<h3>Jobs by Industry</h3>
<form>
<select class="form-control" name='industry'>
<?php include "industryOptions.php";?>
</select><br>
<input class="btn btn-success pull-right" type="submit" value="Search"/>
</form>
</div>

</div>
</div>

</div>

</div>

<!--first row -->

<script src="js/tilt.jquery.min.js"></script>
<script src="js/signinModal.js"></script>

<?php include 'footer.php';?>

<button style="display:none;" type="button" class="btn btn-info btn-lg" data-toggle="modal" data-


target="#msgModal" id="msgModalBtn">Open Modal</button>

<!-- Modal -->


<div id="msgModal" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->


<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<?php if(isset($_GET['msg'])){
$msg= $_GET['msg'];
if($msg=='success'){

echo "<h4 class='modal-title'>Job Applied Successfully!</h4>";


}else if($msg=='error'){
echo "<h4 class='modal-title'>Some Error occured Pls try again later!</h4>";
}else if($msg=='dup'){
echo "<h4 class='modal-title'>You have already applied for this job.\n "
. "Check your application status in 'Jobs Applied' section</h4>";
}

}?>
</div>

</div>

</div>
</div>
<?php
if(isset($_GET['msg'])){
if($_GET['msg']=='login'){
?>
<script>
$('#loginAnchor').trigger( "click" );
</script>
<?php }else{
?>
<script>
$('#msgModalBtn').trigger( "click" );
</script>

<?php
}

}?>
</body>
</html>

acceptApplication.php
<?php

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

include 'authorizeEmployer.php';
if(isset($_GET['id'])){
$aip = $_GET['id']; //application id

include 'connect.php';

$sql = "update jobsapplied set status='Accepted' where id='$aip';";


$result=$conn->query($sql);
header('location: ViewApplicants.php');
}else{
header('location: index.php?msg=dup');
}
die();

?>
Appliedjobs.php
<?php include 'authorizeSeeker.php';?>
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="icon"
href="images/homepage/favicon.ico" type="image/x-icon">
<title>HR SYSTEM</title>
<meta name="description" content="a gateway to academic projects|Get your first academic project
now with Free Mini-DBMS and CG Projects |Tech tutorials"
<meta name="keywords" content="IEEE project,B.E project 2018, 2018 projects,M.tech project,
M.Tech project 2018 - 2019,Low cost projects, DBMS, database management system, engineering
projects, mini projects, Gulbarga, Kalaburagi, free projects" />
<meta name="author" content="Audenberg Technologies (www.audenberg.com)" />
<link href="css/simpleGridTemplate.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/Animate.css" rel="stylesheet" type="text/css">
<link type="text/css" rel="css/bootstrap.min.css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/jquery-3.3.1.js"></script>
<script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="js/dataTables.bootstrap.min.js"></script>
<link href="css/Animate.css" rel="stylesheet" type="text/css">
<link href="css/animate.min.css" rel="stylesheet" type="text/css">
<link href="https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap.min.css" rel="stylesheet"
type="text/css">
<link href="css/kodchasan.css" rel="stylesheet">
<style>
.tiltContain{margin-top:0%;}
.btnTilt{height: 75px;background:rgba(225,225,225,0.2) ; color:white; font-family: Comfortaa;}

.textDarkShadow{
text-shadow: 0px 0px 3px #000,3px 3px 5px #003333;
}
/* #btn1,#btn2,#btn3,#btn4,#btn5,#btn6{display:none;}*/
</style>

<body onload="logoBeat()" style="font-family: 'Kodchasan', sans-serif;">

<?php
include 'navBar.php';

?>
<!-- Main Container -->
<div class="container-fluid" style="background:url('img/Wonderful-Blur-Wallpaper.jpg');">
<?php
include 'connect.php';

$sql = "select * from seeker where id = '$sid' ;";

$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
if($row = $result->fetch_assoc()) {
$name= $row["name"];
$email = $row["email"];

}}

?>
<div class="hero" >

<div style="width: 100%; " class="row" >

<div class="col-md-4" >

<h4>User Name</h4>
<h2><?php echo $name; ?></h2>
<h4>Email</h4>
<h2><?php echo $email; ?></h2>
</div>

<div style=" height: 100vh; margin-top:5% " class="col-md-8">


<div><h3>Jobs Applied by you:</h3></div>
<table class="table table-hover table-responsive table-striped" id='jobappliedTable'>
<thead>
<th>Post Id</th>
<th>Company Name</th>
<th>Job Title</th>
<th>Date Applied</th>
<th>Min Experiance</th>
<th>Salary</th>
<th>Job Description</th>
<th>Status</th>

</thead>
<tbody>

<?php
$sql="select id,(select name from employer where id=post.eid)as
ename,name,minexp,salary,`desc`,(select date from jobsapplied where pid=post.id and sid=$sid)as
date,(select status from jobsapplied where pid=post.id and sid=$sid)as appstatus from post where id in
(select pid from jobsapplied where sid=$sid);";
$appresult = $conn->query($sql);
if ($appresult->num_rows > 0) {
// output data of each row
while($row = $appresult->fetch_assoc())
{
$ename = $row['ename'];
$id=$row['id'];
$title=$row['name'];
$date=$row['date'];
$minexp=$row['minexp'];
$salary=$row['salary'];
$desc=$row['desc'];
$status=$row['appstatus'];
?>
<tr>
<td><?php echo $id;?></td>
<td><?php echo $ename;?></td>
<td><?php echo $title;?></td>
<td><?php echo $date;?></td>
<td><?php echo $minexp;?></td>
<td><?php echo $salary;?></td>
<td><?php echo $desc;?></td>
<td><?php echo $status;?></td>

</tr>
<?php
}}
?>

</tbody>
</table>

</div>
</div>

</div>

</div>

<!--first row -->

<script src="js/tilt.jquery.min.js"></script>
<script src="js/signinModal.js"></script>

<?php include 'footer.php';?>


<script>
$(document).ready(function() {
$('#jobappliedTable').DataTable();
} );
</script>
</body>
</html>

Applyjobs.php
<?php

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/

if(isset($_GET['id'])){
$pid = $_GET['id'];
session_start();
if(isset($_SESSION['sid'])){
include 'connect.php';
$sid = $_SESSION['sid'];

$sql = "select * from jobsapplied where pid='$pid' and sid='$sid';";


$result=$conn->query($sql);
$count=$result->num_rows;
if($count>0){
header('location: index.php?msg=dup');
die();
}

$sql = "INSERT INTO `jobsapplied` "


. "(`id`, `date`, `pid`, `sid`, `status`) "
. "VALUES (NULL, CURRENT_DATE(), '$pid', '$sid', 'sent');";
if ($conn->query($sql) === TRUE) {

header('location: index.php?msg=success');

}else{
header('location: index.php?msg=failed');
}
}else{
header('location:index.php?msg=login');
}
}

?>
authorizeEmployer.php
<?php
$eid="";
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
if(isset($_SESSION["eid"])){
$eid=$_SESSION["eid"];

}else{
header('Location:index.php');
}
Authorieseeker.php
<?php

$sid="";
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
if(isset($_SESSION["sid"])){
$sid=$_SESSION["sid"];

}else{
header('Location:index.php');
}
categoryOption.php
<?php

?>
<option>Accounting Jobs</option>
<option>Interior Design Jobs</option>
<option>Bank Jobs</option>
<option>Content Writing Jobs</option>
<option>Consultant Jobs</option>
<option>Engineering Jobs</option>
<option>Export Import Jobs</option>
<option>Merchandiser Jobs</option>
<option>Security Jobs</option>
<option>HR Jobs</option>
<option>Hotel Jobs</option>
<option>Application Programming Jobs</option>
<option>Client Server Jobs</option>
<option>DBA Jobs</option>
<option>Ecommerce Jobs</option>
<option>ERP Jobs</option>
<option>VLSI Jobs</option>
<option>Mainframe Jobs</option>
<option>Middleware Jobs</option>
<option>Mobile Jobs</option>
<option>Network administrator Jobs</option>
<option>IT Jobs</option>
<option>Testing Jobs</option>
<option>System Programming Jobs</option>
<option>EDP Jobs</option>
<option>Telecom Software Jobs</option>
<option>Telecom Jobs</option>
<option>BPO Jobs</option>
<option>Legal Jobs</option>
<option>Marketing Jobs</option>
<option>Packaging Jobs</option>
<option>Pharma Jobs</option>
<option>Maintenance Jobs</option>
<option>Logistics Jobs</option>
<option>Sales Jobs</option>
<option>Secretary Jobs</option>
<option>Corporate Planning Jobs</option>
<option>Site Engineering Jobs</option>
<option>Film Jobs</option>
<option>Teacher Jobs</option>
<option>Airline Jobs</option>
<option>Graphic Designer Jobs</option>
<option>Shipping Jobs</option>
<option>Analytics Jobs</option>
<option>Business Intelligence Jobs</option>

Connect.php
<?php

error_reporting(1);
$conn = new mysqli("localhost","root","","hrsystem");

?>
Delete.php
<?php

include 'authorizeEmployer.php';

if(isset($_GET['id'])){
include 'connect.php';
$id = $_GET['id'];
$sql = "delete from post where id=$id";
if ($conn->query($sql) === TRUE) {

header('location: employerAccount.php');

}else{
echo "error deleting post";
}
}

?>
Employeraccount.php
<?php include 'authorizeEmployer.php';?>
<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="icon"
href="images/homepage/favicon.ico" type="image/x-icon">
<title> HR SYSTEM</title>
<meta name="description" content="a gateway to academic projects|Get your first academic project
now with Free Mini-DBMS and CG Projects |Tech tutorials"
<meta name="keywords" content="IEEE project,B.E project 2018, 2018 projects,M.tech project,
M.Tech project 2018 - 2019,Low cost projects, DBMS, database management system, engineering
projects, mini projects, Gulbarga, Kalaburagi, free projects" />
<meta name="author" content="Audenberg Technologies (www.audenberg.com)" />
<link href="css/simpleGridTemplate.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/Animate.css" rel="stylesheet" type="text/css">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap.min.js"></script>
<link href="css/Animate.css" rel="stylesheet" type="text/css">
<link href="css/animate.min.css" rel="stylesheet" type="text/css">
<link href="https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap.min.css" rel="stylesheet"
type="text/css">
<link href="https://fonts.googleapis.com/css?family=Kodchasan" rel="stylesheet">
<style>
.tiltContain{margin-top:0%;}
.btnTilt{height: 75px;background:rgba(225,225,225,0.2) ; color:white; font-family: Comfortaa;}

.textDarkShadow{
text-shadow: 0px 0px 3px #000,3px 3px 5px #003333;
}
/* #btn1,#btn2,#btn3,#btn4,#btn5,#btn6{display:none;}*/
</style>

<body onload="logoBeat()" style="font-family: 'Kodchasan', sans-serif;">

<?php
include 'navBar.php';

?>
<!-- Main Container -->
<div class="container-fluid" style="background:url('img/Wonderful-Blur-Wallpaper.jpg');">
<?php
include 'connect.php';

$sqlE = "select * from employer where id = '$eid' ;";

$resultE = $conn->query($sqlE);
if ($resultE->num_rows > 0) {
// output data of each row
if($rowE = $resultE->fetch_assoc()) {
$name= $rowE["name"];
$email = $rowE["email"];
$fileName = $rowE["logo"];
}}

?>

<div class="hero" >

<div style="width: 100%; " class="row" >

<div class="col-md-4" >


<img src="uploads/<?php echo $fileName;?>" class="img-circle img-responsive"
width="200" style="margin: 20%; box-shadow: 0px 0px 20px #1e1e1e;">
<h4>User Name</h4>
<h2><?php echo $name; ?></h2>
<h4>Email</h4>
<h2><?php echo $email; ?></h2>
</div>

<div style=" height: 100vh; margin-top:5% " class="col-md-8">


<div><h3>Jobs Posted:</h3></div>
<table class="table table-hover table-responsive table-striped" id='postTable'>
<thead>
<th>Post Id</th>
<th>Title</th>
<th>Desc</th>
<th>Min Experiance</th>
<th>Salary</th>
<th>Status</th>
<th>Update</th>
<th>Delete</th>
</thead>
<tbody>

<?php
$sql="select * from post where eid=$eid";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc())
{
$id=$row['id'];
$title=$row['name'];
$category=$row['category'];
$minexp=$row['minexp'];
$salary=$row['salary'];
$industry=$row['industry'];
$desc=$row['desc'];
$role=$row['role'];

$status=$row['status'];

?>
<tr>
<td><?php echo $id;?></td>
<td><?php echo $title;?></td>
<td><?php echo $desc;?></td>
<td><?php echo $minexp;?></td>
<td><?php echo $salary;?></td>
<td><?php echo $status;?></td>
<td>
<a href="postjob.php?update=true&id=<?php echo $id;?>"> <span
class="glyphicon glyphicon-pencil"></span></a>
</td>
<td>
<a href="deletePost.php?id=<?php echo $id;?>"> <span class="glyphicon
glyphicon-trash"></span></a>
</td>
</tr>
<?php
}}
?>

</tbody>
</table>

</div>
</div>

</div>

</div>

<!--first row -->

<script src="js/tilt.jquery.min.js"></script>
<script src="js/signinModal.js"></script>

<?php include 'footer.php';?>


<script>
$(document).ready(function() {
$('#postTable').DataTable();
} );
</script>
</body>
</html>
Postjobs.php
<?php

// Create connection
include 'authorizeEmployer.php';
$id=0;
$name=$category=$minexp=$salary=$industry=$desc=$role=$eType=$status=$msg="";

if ($_SERVER['REQUEST_METHOD'] == 'POST' || $_SERVER['REQUEST_METHOD'] == 'GET') {


include 'connect.php';
if(isset($_GET['update'])&& isset($_GET['id'])){
$id = $_GET['id'];
$sql="select * from post where eid=$eid and id=$id";
$result = $conn->query($sql);
if( $row=$result->fetch_assoc()){
$name= $row['name'];
$category=$row['category'];
$minexp=$row['minexp'];
$salary=$row['salary'];
$industry=$row['industry'];
$desc=$row['desc'];
$role=$row['role'];
$eType=$row['eType'];
$status=$row['status'];
}
}

if(isset($_POST['submitPost'])){

$id= $_POST['id'];
$name= $_POST['name'];
$category=$_POST['category'];
$minexp=$_POST['minexp'];
$salary=$_POST['salary'];
$industry=$_POST['industry'];
$desc=$_POST['desc'];
$role=$_POST['role'];
$eType=$_POST['eType'];
$status=$_POST['status'];

if($id>0){
$sql = "Update `post` set `date`=CURRENT_DATE(),"
. "`name`='$name', "
. "`category`='$category', "
. "`minexp`='$minexp', "
. "`desc`='$desc', "
. "`salary`='$salary', "
. "`industry`='$industry', "
. "`role`='$role', "
. "`employmentType`='$eType', "
. "`status`= '$status' "
. "where id=$id and eid=$eid;";
}else{
$sql = "INSERT INTO `post` (`id`, `date`, `eid`, `name`, `category`, `minexp`, `desc`, `salary`, `industry`,
`role`, `employmentType`, `status`) "
. "VALUES (NULL, CURRENT_DATE(), '$eid', '$name', '$category', '$minexp', '$desc', '$salary',
'$industry', '$role', '$eType', '$status');";
}

if ($conn->query($sql) === TRUE) {


if($_GET['update']){
header('location: employerAccount.php');
}else{
$msg="New Post has been created successfully";
}
} else {
$msg="Error: " . $sql . "<br>" . $conn->error;
}
}

}
?>

<html>
<head>
<!-- Global site tag (gtag.js) - Google Analytics -->

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="icon"
href="images/homepage/favicon.ico" type="image/x-icon">
<title> HR SYSTEM</title>
<meta name="description" content="a gateway to academic projects|Get your first academic project
now with Free Mini-DBMS and CG Projects |Tech tutorials"
<meta name="keywords" content="IEEE project,B.E project 2018, 2018 projects,M.tech project,
M.Tech project 2018 - 2019,Low cost projects, DBMS, database management system, engineering
projects, mini projects, Gulbarga, Kalaburagi, free projects" />
<meta name="author" content="Audenberg Technologies (www.audenberg.com)" />
<link href="css/simpleGridTemplate.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/Animate.css" rel="stylesheet" type="text/css">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="css/Animate.css" rel="stylesheet" type="text/css">
<link href="css/animate.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Kodchasan" rel="stylesheet">
<body onload="logoBeat()" style="font-family: 'Kodchasan', sans-serif;">

<?php
include 'navBar.php';

?>
<!-- Main Container -->
<div class="container-fluid" style="background-color:#3bb3e0;">
<?php
include 'connect.php';
$eid = $_SESSION["eid"];
$sqlE = "select * from employer where id = '$eid' ;";

$resultE = $conn->query($sqlE);
if ($resultE->num_rows > 0) {
// output data of each row
if($rowE = $resultE->fetch_assoc()) {
$ename= $rowE["name"];
$email = $rowE["email"];

}}

?>

<div class="hero" >

<div class="container contact-form" style=" background-image: url('img/bgbg.png'); box-shadow:


0px 0px 25px #1e1e1e;">
<div class="contact-image" >
<img src="img/rocket_contact.png"style=" background-image: url('img/bgbg.png'); box-
shadow: 0px 0px 25px #1e1e1e;" alt="rocket_contact"/>
</div>
<form method="post" >
<h3>Post a JOB</h3>
<div class="row">
<div><?php echo $msg;?></div>
<input type='hidden' value="<?php echo $id;?>" name='id'/>
<div class="col-md-6">
<div class="form-group">
<label for="name">Job Title:</label>
<input type="text" name="name" class="form-control" placeholder="Job Title"
value="<?php echo $name;?>" />
</div>
<div class="form-group">
<label for="category">Job Category</label>
<select type="text" name="category" class="form-control" placeholder="Category">
<?php include 'categoryOptions.php';?>
</select>
</div>
<div class="form-group">
<label for="minexp">Minimum Experiance</label>
<input type="text" name="minexp" class="form-control" placeholder="Minimum
Expireince" value="<?php echo $minexp;?>" />
</div>
<div class="form-group">
<label for="salary">Salary Budget</label>
<input type="text" name="salary" class="form-control" placeholder="Salary"
value="<?php echo $salary;?>" />
</div>
<div class="form-group">
<label for="industry">Job industry</label>
<select type="text" name="industry" class="form-control" placeholder="Industry" >
<?php include 'industryOptions.php';?>
</select>
</div>

</div>
<div class="col-md-6">
<div class="form-group">
<label for="desc">Job requirements</label>
<textarea name="desc" class="form-control" placeholder="Description" style="width:
100%; height: 120px;"><?php echo $desc;?></textarea>
</div>
<div class="form-group">
<label for="role">Role</label>
<input type="text" name="role" class="form-control" placeholder="Role" value="<?php
echo $role;?>" />
</div>
<div class="form-group">
<label for="eType">Employment Type</label>
<select type="text" name="eType" class="form-control" >
<option>Permanent</option>
<option>Part-Time</option>
</select>
</div>
<label>Status</label><br>
<label class="radio-inline">
<input type="radio" name="status" value="open"
<?php if($status=='open'){echo "checked='true'";}?>>Open
</label>
<label class="radio-inline">
<input type="radio" name="status" value='closed' <?php if($status=='closed'){echo
"checked='true'";}?>>Closed
</label> <div class="form-group">
<button type="submit" name="submitPost" class="btnContact pull-right" > Post
Job</button>
</div>
</div>
</div>
</form>
</div>

</div>

</div>

<!--first row -->

<script src="js/tilt.jquery.min.js"></script>
<script src="js/signinModal.js"></script>

<?php include 'footer.php';?>

</body>
</html>
RegisterEmployer.php
<?php

include 'connect.php';

$name =$email= $password="";


if($_SERVER['REQUEST_METHOD']=='POST'){
$name = $_POST["name"];
$email = $_POST["email"];
$password = $_POST["password"];

$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["logo"]["name"]);
$fileName= basename($_FILES["logo"]["name"]);
$uploadOk = 1;
$imageFileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
// Check if image file is a actual image or fake image

$check = getimagesize($_FILES["logo"]["tmp_name"]);
if($check !== false) {
echo "File is an image - " . $check["mime"] . ".";
$uploadOk = 1;
} else {
echo "File is not an image.";
$uploadOk = 0;
}

// Check if file already exists


if (file_exists($target_file)) {
echo "Sorry, file already exists.";
$uploadOk = 0;
}
// Check file size
if ($_FILES["logo"]["size"] > 500000) {
echo "Sorry, your file is too large.";
$uploadOk = 0;
}
// Allow certain file formats
if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
&& $imageFileType != "gif" ) {
echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed.";
$uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
echo "Sorry, your file was not uploaded.";
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES["logo"]["tmp_name"], $target_file)) {
// echo "The file ". basename( $_FILES["logo"]["name"]). " has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
}
}
$sql = "INSERT INTO employer (name,email,password,logo)
VALUES ('$name', '$email', '$password','$fileName')";

if ($conn->query($sql) === TRUE) {

?>
<html>
<head>
<link href="css/simpleGridTemplate.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/Animate.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU"
crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body style="background: url(img/bgbg.png);height: 100vh;">
<div style="">

</div>

<!-- Trigger the modal with a button -->


<button id="modalBtn" type="button" style="display:none" class="btn btn-info btn-lg" data-
toggle="modal" data-target="#myModal">Open Modal</button>

<!-- Modal -->


<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->


<div class="modal-content">
<div class="modal-header">

<h3 >Employer has been registered.. Login to continue using our services</h3>
<br>
<a href="index.php?msg=login">Login</a>
</div>
</div>
</div>

<script>
$('#modalBtn').trigger("click");
</script>
</body>
</html>

<?php
$conn->close();
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}

//$conn->close();
}else{
header("location : index.php");
}

Registerjobseeker.php
<?php
include 'connect.php';

if($_SERVER['REQUEST_METHOD']=='POST'){

$name = $_POST["name"];
$email = $_POST["email"];
$password = $_POST["password"];
$qlf = $_POST["qlf"];
$dob = $_POST["dob"];
$skills = $_POST["skills"];

$target_dir = "uploadedResume/";
$target_file = $target_dir . basename($_FILES["resume"]["name"]);
$fileName= basename($_FILES["resume"]["name"]);
$uploadOk = 1;
$fileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
// Check if image file is a actual image or fake image

$uploadOk = 1;

// Check if file already exists


if (file_exists($target_file)) {
echo "Sorry, file already exists.";
$uploadOk = 0;
}
// Check file size
if ($_FILES["resume"]["size"] > 5000000) {
echo "Sorry, your file is too large.";
$uploadOk = 0;
}
// Allow certain file formats
if($fileType != "txt" && $fileType != "doc" && $fileType != "docx"
&& $fileType != "pdf" ) {
echo "Sorry, only txt, doc, docx & pdf files are allowed.";
$uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
echo "Sorry, your file was not uploaded.";
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES["resume"]["tmp_name"], $target_file)) {
// echo "The file ". basename( $_FILES["resume"]["name"]). " has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
}
}

$sql = "INSERT INTO seeker (name,email,password,qualification,dob,skills,resume)


VALUES ('$name', '$email', '$password','$qlf', '$dob', '$skills','$fileName')";

if ($conn->query($sql) === TRUE) {


?>

<html>
<head>
<link href="css/simpleGridTemplate.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/Animate.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU"
crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body style="background: url(img/bgbg.png);height: 100vh;">
<div style="">

</div>
<!-- Trigger the modal with a button -->
<button id="modalBtn" type="button" style="display:none" class="btn btn-info btn-lg" data-
toggle="modal" data-target="#myModal">Open Modal</button>

<!-- Modal -->


<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->


<div class="modal-content">
<div class="modal-header">

<h3 >Thanks for Registering with us.. Login to continue using our services</h3>
<br>
<a href="index.php?msg=login">Login</a>
</div>
</div>
</div>

<script>
$('#modalBtn').trigger("click");
</script>
</body>
</html>

<?php
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();
}else{
header("location : index.php");
}

Registerjobseeker.php
<?php
include 'connect.php';

if($_SERVER['REQUEST_METHOD']=='POST'){

$name = $_POST["name"];
$email = $_POST["email"];
$password = $_POST["password"];
$qlf = $_POST["qlf"];
$dob = $_POST["dob"];
$skills = $_POST["skills"];

$target_dir = "uploadedResume/";
$target_file = $target_dir . basename($_FILES["resume"]["name"]);
$fileName= basename($_FILES["resume"]["name"]);
$uploadOk = 1;
$fileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
// Check if image file is a actual image or fake image

$uploadOk = 1;

// Check if file already exists


if (file_exists($target_file)) {
echo "Sorry, file already exists.";
$uploadOk = 0;
}
// Check file size
if ($_FILES["resume"]["size"] > 5000000) {
echo "Sorry, your file is too large.";
$uploadOk = 0;
}
// Allow certain file formats
if($fileType != "txt" && $fileType != "doc" && $fileType != "docx"
&& $fileType != "pdf" ) {
echo "Sorry, only txt, doc, docx & pdf files are allowed.";
$uploadOk = 0;
}
// Check if $uploadOk is set to 0 by an error
if ($uploadOk == 0) {
echo "Sorry, your file was not uploaded.";
// if everything is ok, try to upload file
} else {
if (move_uploaded_file($_FILES["resume"]["tmp_name"], $target_file)) {
// echo "The file ". basename( $_FILES["resume"]["name"]). " has been uploaded.";
} else {
echo "Sorry, there was an error uploading your file.";
}
}

$sql = "INSERT INTO seeker (name,email,password,qualification,dob,skills,resume)


VALUES ('$name', '$email', '$password','$qlf', '$dob', '$skills','$fileName')";

if ($conn->query($sql) === TRUE) {


?>

<html>
<head>
<link href="css/simpleGridTemplate.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/Animate.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU"
crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body style="background: url(img/bgbg.png);height: 100vh;">
<div style="">

</div>

<!-- Trigger the modal with a button -->


<button id="modalBtn" type="button" style="display:none" class="btn btn-info btn-lg" data-
toggle="modal" data-target="#myModal">Open Modal</button>

<!-- Modal -->


<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->


<div class="modal-content">
<div class="modal-header">

<h3 >Thanks for Registering with us.. Login to continue using our services</h3>
<br>
<a href="index.php?msg=login">Login</a>
</div>
</div>
</div>

<script>
$('#modalBtn').trigger("click");
</script>
</body>
</html>

<?php
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
}else{
header("location : index.php");
}
Application.php
<?php include 'authorizeEmployer.php';?>
<html>
<head>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="icon"
href="images/homepage/favicon.ico" type="image/x-icon">
<title>HR SYSTEM</title>
<meta name="description" content="a gateway to academic projects|Get your first academic project
now with Free Mini-DBMS and CG Projects |Tech tutorials"
<meta name="keywords" content="css" />
<meta name="author" content="Audenberg Technologies (www.audenberg.com)" />
<link href="css/simpleGridTemplate.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/Animate.css" rel="stylesheet" type="text/css">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/dataTables.bootstrap.min.js"></script>
<link href="css/Animate.css" rel="stylesheet" type="text/css">
<link href="css/animate.min.css" rel="stylesheet" type="text/css">
<link href="https://cdn.datatables.net/1.10.19/css/dataTables.bootstrap.min.css" rel="stylesheet"
type="text/css">
<link href="https://fonts.googleapis.com/css?family=Kodchasan" rel="stylesheet">
<style>
.tiltContain{margin-top:0%;}
.btnTilt{height: 75px;background:rgba(225,225,225,0.2) ; color:white; font-family: Comfortaa;}

.textDarkShadow{
text-shadow: 0px 0px 3px #000,3px 3px 5px #003333;
}
/* #btn1,#btn2,#btn3,#btn4,#btn5,#btn6{display:none;}*/
</style>
<body onload="logoBeat()" style="font-family: 'Kodchasan', sans-serif;">

<?php
include 'navBar.php';

?>
<!-- Main Container -->
<div class="container-fluid" style="background:url('img/Wonderful-Blur-Wallpaper.jpg');">
<?php
include 'connect.php';

$sql = "select * from employer where id = '$eid' ;";

$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
if($row = $result->fetch_assoc()) {
$name= $row["name"];
$email = $row["email"];

}}

?>

<div class="hero" >

<div style="width: 100%; " class="row" >

<div class="col-md-4" >

<h4>User Name</h4>
<h2><?php echo $name; ?></h2>
<h4>Email</h4>
<h2><?php echo $email; ?></h2>
</div>

<div style=" height: 100vh; margin-top:5% " class="col-md-8">


<div><h3>Applications received:</h3></div>
<table class="table table-hover table-responsive table-striped" id='jobappliedTable'>
<thead>
<th>Post Id</th>
<th>Applicant Name</th>
<th>Date Applied</th>
<th>Job Title</th>
<th>Applicants Skills</th>
<th>Application Status</th>
<th>Download Resume</th>
<th>Accept</th>
<th>Reject</th>
</thead>
<tbody>

<?php
$sql="select id,sid,pid,(select name from seeker where id=j.sid)as sname,date,"
. "(select name from post where id=j.pid)as title,"
. "(select skills from seeker where id=j.sid)as skills,"
. "status,(select resume from seeker where id=j.sid)as resume"
. " from jobsapplied j where pid in (select id from post where eid=$eid);";

$appresult = $conn->query($sql);
if ($appresult->num_rows > 0) {
// output data of each row
while($row = $appresult->fetch_assoc())
{
$id=$row['id']; //application id
$pid=$row['pid'];
$sname = $row['sname'];
$title=$row['title'];
$date=$row['date'];
$skills=$row['skills'];
$status=$row['status'];
$resume=$row['resume'];

?>
<tr>
<td><?php echo $pid;?></td>
<td><?php echo $sname;?></td>
<td><?php echo $date;?></td>
<td><?php echo $title;?></td>
<td><?php echo $skills;?></td>
<td><?php echo $status;?></td>
<td><a href="uploadedResume/<?php echo $resume;?>" download><span
class="glyphicon glyphicon-download"></span></a></td>
<td><a href="acceptApplication.php?id=<?php echo $id;?>"><span class="glyphicon
glyphicon-ok"></span></a></td>
<td><a href="rejectApplication.php?id=<?php echo $id;?>"><span class="glyphicon
glyphicon-ban-circle"></span></a></td>

</tr>
<?php
}}
?>

</tbody>
</table>

</div>
</div>

</div>

</div>

<!--first row -->

<script src="js/tilt.jquery.min.js"></script>
<script src="js/signinModal.js"></script>

<?php include 'footer.php';?>


<script>
$(document).ready(function() {
$('#jobappliedTable').DataTable();
} );
</script>
</body>
</html>

Admin Section Coding


Index.php

<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(isset($_POST['signin']))
{
$uname=$_POST['username'];
$password=md5($_POST['password']);
$sql ="SELECT EmailId,Password,Status,id FROM tblemployees WHERE EmailId=:uname and
Password=:password";
$query= $dbh -> prepare($sql);
$query-> bindParam(':uname', $uname, PDO::PARAM_STR);
$query-> bindParam(':password', $password, PDO::PARAM_STR);
$query-> execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
if($query->rowCount() > 0)
{
foreach ($results as $result) {
$status=$result->Status;
$_SESSION['eid']=$result->id;
}
if($status==0)
{
$msg="Your account is Inactive. Please contact admin";
} else{
$_SESSION['emplogin']=$_POST['username'];
echo "<script type='text/javascript'> document.location = 'emp-changepassword.php'; </script>";
}}

else{

echo "<script>alert('Invalid Details');</script>";

?><!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>HR SYSTEM(LEAVE SYSTEM) | Home Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-
scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="assets/plugins/materialize/css/materialize.min.css"/>
<link href="assets/css/materialdesign.css" rel="stylesheet">
<link href="assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">

<!-- Theme Styles -->


<link href="assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/custom.css" rel="stylesheet" type="text/css"/>

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="http://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

</head>
<body>
<div class="loader-bg"></div>
<div class="loader">
<div class="preloader-wrapper big active">
<div class="spinner-layer spinner-blue">
<div class="circle-clipper left">
<div class="circle"></div>
</div><div class="gap-patch">
<div class="circle"></div>
</div><div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
<div class="spinner-layer spinner-spinner-teal lighten-1">
<div class="circle-clipper left">
<div class="circle"></div>
</div><div class="gap-patch">
<div class="circle"></div>
</div><div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
<div class="spinner-layer spinner-yellow">
<div class="circle-clipper left">
<div class="circle"></div>
</div><div class="gap-patch">
<div class="circle"></div>
</div><div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
<div class="spinner-layer spinner-green">
<div class="circle-clipper left">
<div class="circle"></div>
</div><div class="gap-patch">
<div class="circle"></div>
</div><div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
</div>
<div class="mn-content fixed-sidebar">
<header class="mn-header navbar-fixed">
<nav class="cyan darken-1">
<div class="nav-wrapper row">
<section class="material-design-hamburger navigation-toggle">
<a href="#" data-activates="slide-out" class="button-collapse show-on-large material-
design-hamburger__icon">
<span class="material-design-hamburger__layer"></span>
</a>
</section>
<div class="header-title col s3">
<span class="chapter-title">HR SYSTEM |Leave System</span>
</div>

</form>

</div>
</nav>
</header>

<aside id="slide-out" class="side-nav white fixed">


<div class="side-nav-wrapper">
<ul class="sidebar-menu collapsible collapsible-accordion" data-collapsible="accordion"
style="">
<li>&nbsp;</li>
<li class="no-padding"><a class="waves-effect waves-grey" href="index.php"><i
class="material-icons">account_box</i>Employe Login</a></li>
<li class="no-padding"><a class="waves-effect waves-grey" href="forgot-password.php"><i
class="material-icons">account_box</i>Emp Password Recovery</a></li>

<li class="no-padding"><a class="waves-effect waves-grey" href="admin/"><i


class="material-icons">account_box</i>Admin Login</a></li>

</ul>
<div class="footer">
<p class="copyright"><a href="http://phpgurukul.com/">ELMS </a>©</p>

</div>
</div>
</aside>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title"><h4>Welcome to HR System</h4></div>

<div class="col s12 m6 l8 offset-l2 offset-m3">


<div class="card white darken-1">

<div class="card-content ">


<span class="card-title" style="font-size:20px;">Employee Login</span>
<?php if($msg){?><div class="errorWrap"><strong>Error</strong> : <?php echo
htmlentities($msg); ?> </div><?php }?>
<div class="row">
<form class="col s12" name="signin" method="post">
<div class="input-field col s12">
<input id="username" type="text" name="username" class="validate"
autocomplete="off" required >
<label for="email">Email Id</label>
</div>
<div class="input-field col s12">
<input id="password" type="password" class="validate" name="password"
autocomplete="off" required>
<label for="password">Password</label>
</div>
<div class="col s12 right-align m-t-sm">

<input type="submit" name="signin" value="Sign in" class="waves-effect


waves-light btn teal">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="assets/plugins/materialize/js/materialize.min.js"></script>
<script src="assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="assets/js/alpha.min.js"></script>

</body>
</html>

Chatwith-admin.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['emplogin'])==0)
{
header('location:index.php');
}
else{

?>
<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Employee | Leave History</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-


scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />
<!-- Styles -->
<link type="text/css" rel="stylesheet" href="assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
<link href="assets/plugins/datatables/css/jquery.dataTables.min.css" rel="stylesheet">

<!-- Theme Styles -->


<link href="assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Chat with admin</div>
</div>

<div class="col s12 m12 l12">


<div class="card">
<div class="card-content">

<?php if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php echo


htmlentities($msg); ?> </div><?php }?>
<aside>
<p class="sidebar-chat-name">Tom Simpson<a href="#" data-activates="chat-messages"
class="chat-message-link"><i class="material-icons">keyboard_arrow_right</i></a></p>
<div class="messages-container">

<?php
$eid=$_SESSION['emplogin'];
$sql = "SELECT * from tblchating where empid=:eid";
$query = $dbh -> prepare($sql);
$query -> bindParam(':eid',$eid, PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
<div class="message-wrapper them">
<div >Me fgfdgdfgfd</div>
<div class="text-wrapper"><?php echo htmlentities($result->chat);?></div>
</div>
<div class="message-wrapper me">
<div class="circle-wrapper"><img src="assets/images/profile-image-3.jpg" class="circle"
alt=""></div>
<div class="text-wrapper"><?php $st=$result->admin;
// if($st==1){

// echo htmlentities($result->chat);

// };?></div>
</div>

</div>
<div class="message-compose-box">
<div class="input-field">
<input placeholder="Write message" id="message_compose" type="text">
</div>
</div>
<?php }} ?>
</aside>
</div>
</div>
</div>
</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="assets/plugins/materialize/js/materialize.min.js"></script>
<script src="assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="assets/plugins/datatables/js/jquery.dataTables.min.js"></script>
<script src="assets/js/alpha.min.js"></script>
<script src="assets/js/pages/table-data.js"></script>

</body>
</html>
<?php } ?>
emp-changepassword.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['emplogin'])==0)
{
header('location:index.php');
}
else{
// Code for change password
if(isset($_POST['change']))
{
$password=md5($_POST['password']);
$newpassword=md5($_POST['newpassword']);
$username=$_SESSION['emplogin'];
$sql ="SELECT Password FROM tblemployees WHERE EmailId=:username and Password=:password";
$query= $dbh -> prepare($sql);
$query-> bindParam(':username', $username, PDO::PARAM_STR);
$query-> bindParam(':password', $password, PDO::PARAM_STR);
$query-> execute();
$results = $query -> fetchAll(PDO::FETCH_OBJ);
if($query -> rowCount() > 0)
{
$con="update tblemployees set Password=:newpassword where EmailId=:username";
$chngpwd1 = $dbh->prepare($con);
$chngpwd1-> bindParam(':username', $username, PDO::PARAM_STR);
$chngpwd1-> bindParam(':newpassword', $newpassword, PDO::PARAM_STR);
$chngpwd1->execute();
$msg="Your Password succesfully changed";
}
else {
$error="Your current password is wrong";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Employee | Change Password</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-


scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
<link href="assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Change Pasword</div>
</div>
<div class="col s12 m12 l6">
<div class="card">
<div class="card-content">

<div class="row">
<form class="col s12" name="chngpwd" method="post">
<?php if($error){?><div class="errorWrap"><strong>ERROR</strong>:<?php
echo htmlentities($error); ?> </div><?php }
else if($msg){?><div class="succWrap"><strong>SUCCESS</strong>:<?php echo
htmlentities($msg); ?> </div><?php }?>
<div class="row">
<div class="input-field col s12">
<input id="password" type="password" class="validate" autocomplete="off" name="password"
required>
<label for="password">Current Password</label>
</div>

<div class="input-field col s12">


<input id="password" type="password" name="newpassword" class="validate" autocomplete="off"
required>
<label for="password">New Password</label>
</div>

<div class="input-field col s12">


<input id="password" type="password" name="confirmpassword" class="validate" autocomplete="off"
required>
<label for="password">Confirm Password</label>
</div>

<div class="input-field col s12">


<button type="submit" name="change" class="waves-effect waves-light btn indigo m-b-xs"
onclick="return valid();">Change</button>

</div>

</div>

</form>
</div>
</div>
</div>
</div>

</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="assets/plugins/materialize/js/materialize.min.js"></script>
<script src="assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="assets/js/alpha.min.js"></script>
<script src="assets/js/pages/form_elements.js"></script>

</body>
</html>
<?php } ?>
Fogot-password.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
// Code for change password
if(isset($_POST['change']))
{
$newpassword=md5($_POST['newpassword']);
$empid=$_SESSION['empid'];

$con="update tblemployees set Password=:newpassword where id=:empid";


$chngpwd1 = $dbh->prepare($con);
$chngpwd1-> bindParam(':empid', $empid, PDO::PARAM_STR);
$chngpwd1-> bindParam(':newpassword', $newpassword, PDO::PARAM_STR);
$chngpwd1->execute();
$msg="Your Password succesfully changed";
}

?><!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>HR SYSTEM | Password Recovery</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-
scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">

<!-- Theme Styles -->


<link href="assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>

</head>
<body>
<div class="loader-bg"></div>
<div class="loader">
<div class="preloader-wrapper big active">
<div class="spinner-layer spinner-blue">
<div class="circle-clipper left">
<div class="circle"></div>
</div><div class="gap-patch">
<div class="circle"></div>
</div><div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
<div class="spinner-layer spinner-spinner-teal lighten-1">
<div class="circle-clipper left">
<div class="circle"></div>
</div><div class="gap-patch">
<div class="circle"></div>
</div><div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
<div class="spinner-layer spinner-yellow">
<div class="circle-clipper left">
<div class="circle"></div>
</div><div class="gap-patch">
<div class="circle"></div>
</div><div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
<div class="spinner-layer spinner-green">
<div class="circle-clipper left">
<div class="circle"></div>
</div><div class="gap-patch">
<div class="circle"></div>
</div><div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
</div>
<div class="mn-content fixed-sidebar">
<header class="mn-header navbar-fixed">
<nav class="cyan darken-1">
<div class="nav-wrapper row">
<section class="material-design-hamburger navigation-toggle">
<a href="#" data-activates="slide-out" class="button-collapse show-on-large material-
design-hamburger__icon">
<span class="material-design-hamburger__layer"></span>
</a>
</section>
<div class="header-title col s3">
<span class="chapter-title">HR SYSTEM | Leave System</span>
</div>

</form>
</div>
</nav>
</header>

<aside id="slide-out" class="side-nav white fixed">


<div class="side-nav-wrapper">

<ul class="sidebar-menu collapsible collapsible-accordion" data-collapsible="accordion"


style="">
<li>&nbsp;</li>
<li class="no-padding"><a class="waves-effect waves-grey" href="index.php"><i
class="material-icons">account_box</i>Employe Login</a></li>
<li class="no-padding"><a class="waves-effect waves-grey" href="forgot-password.php"><i
class="material-icons">account_box</i>Emp Password Recovery</a></li>

<li class="no-padding"><a class="waves-effect waves-grey" href="admin/"><i


class="material-icons">account_box</i>Admin Login</a></li>

</ul>
<div class="footer">
<p class="copyright"><a href="http://phpgurukul.com/">ELMS </a>©</p>

</div>
</div>
</aside>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title"><h4>Employee Password Recovery</h4></div>

<div class="col s12 m6 l8 offset-l2 offset-m3">


<div class="card white darken-1">

<div class="card-content ">


<span class="card-title" style="font-size:20px;">Employee details</span>
<?php if($msg){?><div class="succWrap"><strong>Success </strong> : <?php
echo htmlentities($msg); ?> </div><?php }?>
<div class="row">
<form class="col s12" name="signin" method="post">
<div class="input-field col s12">
<input id="empid" type="text" name="empid" class="validate"
autocomplete="off" required >
<label for="email">Employee Id</label>
</div>
<div class="input-field col s12">
<input id="password" type="text" class="validate" name="emailid"
autocomplete="off" required>
<label for="password">Email id</label>
</div>
<div class="col s12 right-align m-t-sm">

<input type="submit" name="submit" value="Reset" class="waves-effect


waves-light btn teal">
</div>
</form>
</div>
</div>
<?php if(isset($_POST['submit']))
{
$empid=$_POST['empid'];
$email=$_POST['emailid'];
$sql ="SELECT id FROM tblemployees WHERE EmailId=:email and EmpId=:empid";
$query= $dbh -> prepare($sql);
$query-> bindParam(':email', $email, PDO::PARAM_STR);
$query-> bindParam(':empid', $empid, PDO::PARAM_STR);
$query-> execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
if($query->rowCount() > 0)
{
foreach ($results as $result) {
$_SESSION['empid']=$result->id;
}
?>

<div class="row">
<span class="card-title" style="font-size:20px;">change your password </span>
<form class="col s12" name="udatepwd" method="post">
<div class="input-field col s12">
<input id="password" type="password" name="newpassword" class="validate" autocomplete="off"
required>
<label for="password">New Password</label>
</div>

<div class="input-field col s12">


<input id="password" type="password" name="confirmpassword" class="validate" autocomplete="off"
required>
<label for="password">Confirm Password</label>
</div>

<div class="input-field col s12">


<button type="submit" name="change" class="waves-effect waves-light btn indigo m-b-xs"
onclick="return valid();">Change</button>
</div>
</div>
</form>
<?php } else{ ?>
<div class="errorWrap" style="margin-left: 2%; font-size:22px;">
<strong>ERROR</strong> : <?php echo htmlentities("Invalid details");
}?></div>
<?php } ?>

</div>
</div>
</div>
</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="assets/plugins/materialize/js/materialize.min.js"></script>
<script src="assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="assets/js/alpha.min.js"></script>

</body>
</html>

Leavehistory.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['emplogin'])==0)
{
header('location:index.php');
}
else{

?>
<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Employee | Leave History</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-


scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
<link href="assets/plugins/datatables/css/jquery.dataTables.min.css" rel="stylesheet">

<!-- Theme Styles -->


<link href="assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Leave History</div>
</div>

<div class="col s12 m12 l12">


<div class="card">
<div class="card-content">
<span class="card-title">Leave History</span>
<?php if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php echo
htmlentities($msg); ?> </div><?php }?>
<table id="example" class="display responsive-table ">
<thead>
<tr>
<th>#</th>
<th width="120">Leave Type</th>
<th>From</th>
<th>To</th>
<th>Description</th>
<th width="120">Posting Date</th>
<th width="200">Admin Remak</th>
<th>Status</th>
</tr>
</thead>

<tbody>
<?php
$eid=$_SESSION['eid'];
$sql = "SELECT
LeaveType,ToDate,FromDate,Description,PostingDate,AdminRemarkDate,AdminRemark,Status from
tblleaves where empid=:eid";
$query = $dbh -> prepare($sql);
$query->bindParam(':eid',$eid,PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
<tr>
<td> <?php echo htmlentities($cnt);?></td>
<td><?php echo htmlentities($result->LeaveType);?></td>
<td><?php echo htmlentities($result->FromDate);?></td>
<td><?php echo htmlentities($result->ToDate);?></td>
<td><?php echo htmlentities($result->Description);?></td>
<td><?php echo htmlentities($result->PostingDate);?></td>
<td><?php if($result->AdminRemark=="")
{
echo htmlentities('waiting for approval');
} else
{

echo htmlentities(($result->AdminRemark)." "."at"." ".$result->AdminRemarkDate);


}

?></td>
<td><?php $stats=$result->Status;
if($stats==1){
?>
<span style="color: green">Approved</span>
<?php } if($stats==2) { ?>
<span style="color: red">Not Approved</span>
<?php } if($stats==0) { ?>
<span style="color: blue">waiting for approval</span>
<?php } ?>

</td>

</tr>
<?php $cnt++;} }?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="assets/plugins/materialize/js/materialize.min.js"></script>
<script src="assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="assets/plugins/datatables/js/jquery.dataTables.min.js"></script>
<script src="assets/js/alpha.min.js"></script>
<script src="assets/js/pages/table-data.js"></script>

</body>
</html>
<?php } ?>
Logout.php
<?php
session_start();
$_SESSION = array();
if (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
setcookie(session_name(), '', time() - 60*60,
$params["path"], $params["domain"],
$params["secure"], $params["httponly"]
);
}
unset($_SESSION['alogin']);
session_destroy(); // destroy session
header("location:index.php");
?>

Myprofile.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['emplogin'])==0)
{
header('location:index.php');
}
else{
$eid=$_SESSION['emplogin'];
if(isset($_POST['update']))
{

$fname=$_POST['firstName'];
$lname=$_POST['lastName'];
$gender=$_POST['gender'];
$dob=$_POST['dob'];
$department=$_POST['department'];
$address=$_POST['address'];
$city=$_POST['city'];
$country=$_POST['country'];
$mobileno=$_POST['mobileno'];
$sql="update tblemployees set
FirstName=:fname,LastName=:lname,Gender=:gender,Dob=:dob,Department=:department,Address=:ad
dress,City=:city,Country=:country,Phonenumber=:mobileno where EmailId=:eid";
$query = $dbh->prepare($sql);
$query->bindParam(':fname',$fname,PDO::PARAM_STR);
$query->bindParam(':lname',$lname,PDO::PARAM_STR);
$query->bindParam(':gender',$gender,PDO::PARAM_STR);
$query->bindParam(':dob',$dob,PDO::PARAM_STR);
$query->bindParam(':department',$department,PDO::PARAM_STR);
$query->bindParam(':address',$address,PDO::PARAM_STR);
$query->bindParam(':city',$city,PDO::PARAM_STR);
$query->bindParam(':country',$country,PDO::PARAM_STR);
$query->bindParam(':mobileno',$mobileno,PDO::PARAM_STR);
$query->bindParam(':eid',$eid,PDO::PARAM_STR);
$query->execute();
$msg="Employee record updated Successfully";
}

?>

<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Update Employee</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-


scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
<link href="assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Update employee</div>
</div>
<div class="col s12 m12 l12">
<div class="card">
<div class="card-content">
<form id="example-form" method="post" name="updatemp">
<div>
<h3>Update Employee Info</h3>
<?php if($error){?><div class="errorWrap"><strong>ERROR</strong>:<?php
echo htmlentities($error); ?> </div><?php }
else if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php echo
htmlentities($msg); ?> </div><?php }?>
<section>
<div class="wizard-content">
<div class="row">
<div class="col m6">
<div class="row">
<?php
$eid=$_SESSION['emplogin'];
$sql = "SELECT * from tblemployees where EmailId=:eid";
$query = $dbh -> prepare($sql);
$query -> bindParam(':eid',$eid, PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
<div class="input-field col s12">
<label for="empcode">Employee Code</label>
<input name="empcode" id="empcode" value="<?php echo htmlentities($result->EmpId);?>"
type="text" autocomplete="off" readonly required>
<span id="empid-availability" style="font-size:12px;"></span>
</div>
<div class="input-field col m6 s12">
<label for="firstName">First name</label>
<input id="firstName" name="firstName" value="<?php echo htmlentities($result->FirstName);?>"
type="text" required>
</div>

<div class="input-field col m6 s12">


<label for="lastName">Last name </label>
<input id="lastName" name="lastName" value="<?php echo htmlentities($result->LastName);?>"
type="text" autocomplete="off" required>
</div>

<div class="input-field col s12">


<label for="email">Email</label>
<input name="email" type="email" id="email" value="<?php echo htmlentities($result->EmailId);?>"
readonly autocomplete="off" required>
<span id="emailid-availability" style="font-size:12px;"></span>
</div>

<div class="input-field col s12">


<label for="phone">Mobile number</label>
<input id="phone" name="mobileno" type="tel" value="<?php echo htmlentities($result-
>Phonenumber);?>" maxlength="10" autocomplete="off" required>
</div>

</div>
</div>

<div class="col m6">


<div class="row">
<div class="input-field col m6 s12">
<select name="gender" autocomplete="off">
<option value="<?php echo htmlentities($result->Gender);?>"><?php echo htmlentities($result-
>Gender);?></option>
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Other">Other</option>
</select>
</div>
<label for="birthdate">Date of Birth</label>
<div class="input-field col m6 s12">

<input id="birthdate" name="dob" class="datepicker" value="<?php echo htmlentities($result-


>Dob);?>" >
</div>
<div class="input-field col m6 s12">
<select name="department" autocomplete="off">
<option value="<?php echo htmlentities($result->Department);?>"><?php echo htmlentities($result-
>Department);?></option>
<?php $sql = "SELECT DepartmentName from tbldepartments";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $resultt)
{ ?>
<option value="<?php echo htmlentities($resultt->DepartmentName);?>"><?php echo
htmlentities($resultt->DepartmentName);?></option>
<?php }} ?>
</select>
</div>

<div class="input-field col m6 s12">


<label for="address">Address</label>
<input id="address" name="address" type="text" value="<?php echo htmlentities($result-
>Address);?>" autocomplete="off" required>
</div>

<div class="input-field col m6 s12">


<label for="city">City/Town</label>
<input id="city" name="city" type="text" value="<?php echo htmlentities($result->City);?>"
autocomplete="off" required>
</div>

<div class="input-field col m6 s12">


<label for="country">Country</label>
<input id="country" name="country" type="text" value="<?php echo htmlentities($result->Country);?>"
autocomplete="off" required>
</div>

<?php }}?>

<div class="input-field col s12">


<button type="submit" name="update" id="update" class="waves-effect waves-light btn indigo m-b-
xs">UPDATE</button>

</div>

</div>
</div>
</div>
</div>
</section>

</section>
</div>
</form>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="assets/plugins/materialize/js/materialize.min.js"></script>
<script src="assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="assets/js/alpha.min.js"></script>
<script src="assets/js/pages/form_elements.js"></script>

</body>
</html>
<?php } ?>
Admin/index.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
if(isset($_POST['add']))
{
$deptname=$_POST['departmentname'];
$deptshortname=$_POST['departmentshortname'];
$deptcode=$_POST['deptcode'];
$sql="INSERT INTO tbldepartments(DepartmentName,DepartmentCode,DepartmentShortName)
VALUES(:deptname,:deptcode,:deptshortname)";
$query = $dbh->prepare($sql);
$query->bindParam(':deptname',$deptname,PDO::PARAM_STR);
$query->bindParam(':deptcode',$deptcode,PDO::PARAM_STR);
$query->bindParam(':deptshortname',$deptshortname,PDO::PARAM_STR);
$query->execute();
$lastInsertId = $dbh->lastInsertId();
if($lastInsertId)
{
$msg="Department Created Successfully";
}
else
{
$error="Something went wrong. Please try again";
}

?>

<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Add Department</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-


scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Add Department</div>
</div>
<div class="col s12 m12 l6">
<div class="card">
<div class="card-content">

<div class="row">
<form class="col s12" name="chngpwd" method="post">
<?php if($error){?><div class="errorWrap"><strong>ERROR</strong>:<?php
echo htmlentities($error); ?> </div><?php }
else if($msg){?><div class="succWrap"><strong>SUCCESS</strong>:<?php echo
htmlentities($msg); ?> </div><?php }?>
<div class="row">
<div class="input-field col s12">
<input id="departmentname" type="text" class="validate" autocomplete="off"
name="departmentname" required>
<label for="deptname">Department Name</label>
</div>

<div class="input-field col s12">


<input id="departmentshortname" type="text" class="validate" autocomplete="off"
name="departmentshortname" required>
<label for="deptshortname">Department Short Name</label>
</div>
<div class="input-field col s12">
<input id="deptcode" type="text" name="deptcode" class="validate" autocomplete="off" required>
<label for="password">Department Code</label>
</div>
<div class="input-field col s12">
<button type="submit" name="add" class="waves-effect waves-light btn indigo m-b-xs">ADD</button>

</div>

</div>

</form>
</div>
</div>
</div>

</div>

</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/form_elements.js"></script>

</body>
</html>
<?php } ?>
Admin/adddepartment.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
if(isset($_POST['add']))
{
$deptname=$_POST['departmentname'];
$deptshortname=$_POST['departmentshortname'];
$deptcode=$_POST['deptcode'];
$sql="INSERT INTO tbldepartments(DepartmentName,DepartmentCode,DepartmentShortName)
VALUES(:deptname,:deptcode,:deptshortname)";
$query = $dbh->prepare($sql);
$query->bindParam(':deptname',$deptname,PDO::PARAM_STR);
$query->bindParam(':deptcode',$deptcode,PDO::PARAM_STR);
$query->bindParam(':deptshortname',$deptshortname,PDO::PARAM_STR);
$query->execute();
$lastInsertId = $dbh->lastInsertId();
if($lastInsertId)
{
$msg="Department Created Successfully";
}
else
{
$error="Something went wrong. Please try again";
}

?>

<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Add Department</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-


scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Add Department</div>
</div>
<div class="col s12 m12 l6">
<div class="card">
<div class="card-content">

<div class="row">
<form class="col s12" name="chngpwd" method="post">
<?php if($error){?><div class="errorWrap"><strong>ERROR</strong>:<?php
echo htmlentities($error); ?> </div><?php }
else if($msg){?><div class="succWrap"><strong>SUCCESS</strong>:<?php echo
htmlentities($msg); ?> </div><?php }?>
<div class="row">
<div class="input-field col s12">
<input id="departmentname" type="text" class="validate" autocomplete="off"
name="departmentname" required>
<label for="deptname">Department Name</label>
</div>

<div class="input-field col s12">


<input id="departmentshortname" type="text" class="validate" autocomplete="off"
name="departmentshortname" required>
<label for="deptshortname">Department Short Name</label>
</div>
<div class="input-field col s12">
<input id="deptcode" type="text" name="deptcode" class="validate" autocomplete="off" required>
<label for="password">Department Code</label>
</div>

<div class="input-field col s12">


<button type="submit" name="add" class="waves-effect waves-light btn indigo m-b-xs">ADD</button>

</div>

</div>

</form>
</div>
</div>
</div>

</div>

</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/form_elements.js"></script>

</body>
</html>
<?php } ?>
Addemployee.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
if(isset($_POST['add']))
{
$empid=$_POST['empcode'];
$fname=$_POST['firstName'];
$lname=$_POST['lastName'];
$email=$_POST['email'];
$password=md5($_POST['password']);
$gender=$_POST['gender'];
$dob=$_POST['dob'];
$department=$_POST['department'];
$address=$_POST['address'];
$city=$_POST['city'];
$country=$_POST['country'];
$mobileno=$_POST['mobileno'];
$status=1;

$sql="INSERT INTO
tblemployees(EmpId,FirstName,LastName,EmailId,Password,Gender,Dob,Department,Address,City,Cou
ntry,Phonenumber,Status)
VALUES(:empid,:fname,:lname,:email,:password,:gender,:dob,:department,:address,:city,:country,:mobi
leno,:status)";
$query = $dbh->prepare($sql);
$query->bindParam(':empid',$empid,PDO::PARAM_STR);
$query->bindParam(':fname',$fname,PDO::PARAM_STR);
$query->bindParam(':lname',$lname,PDO::PARAM_STR);
$query->bindParam(':email',$email,PDO::PARAM_STR);
$query->bindParam(':password',$password,PDO::PARAM_STR);
$query->bindParam(':gender',$gender,PDO::PARAM_STR);
$query->bindParam(':dob',$dob,PDO::PARAM_STR);
$query->bindParam(':department',$department,PDO::PARAM_STR);
$query->bindParam(':address',$address,PDO::PARAM_STR);
$query->bindParam(':city',$city,PDO::PARAM_STR);
$query->bindParam(':country',$country,PDO::PARAM_STR);
$query->bindParam(':mobileno',$mobileno,PDO::PARAM_STR);
$query->bindParam(':status',$status,PDO::PARAM_STR);
$query->execute();
$lastInsertId = $dbh->lastInsertId();
if($lastInsertId)
{
$msg="Employee record added Successfully";
}
else
{
$error="Something went wrong. Please try again";
}

?>

<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Add Employee</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-


scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
<script type="text/javascript">
function valid()
{
if(document.addemp.password.value!= document.addemp.confirmpassword.value)
{
alert("New Password and Confirm Password Field do not match !!");
document.addemp.confirmpassword.focus();
return false;
}
return true;
}
</script>

<script>
function checkAvailabilityEmpid() {
$("#loaderIcon").show();
jQuery.ajax({
url: "check_availability.php",
data:'empcode='+$("#empcode").val(),
type: "POST",
success:function(data){
$("#empid-availability").html(data);
$("#loaderIcon").hide();
},
error:function (){}
});
}
</script>

<script>
function checkAvailabilityEmailid() {
$("#loaderIcon").show();
jQuery.ajax({
url: "check_availability.php",
data:'emailid='+$("#email").val(),
type: "POST",
success:function(data){
$("#emailid-availability").html(data);
$("#loaderIcon").hide();
},
error:function (){}
});
}
</script>

</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Add employee</div>
</div>
<div class="col s12 m12 l12">
<div class="card">
<div class="card-content">
<form id="example-form" method="post" name="addemp">
<div>
<h3>Employee Info</h3>
<section>
<div class="wizard-content">
<div class="row">
<div class="col m6">
<div class="row">
<?php if($error){?><div class="errorWrap"><strong>ERROR</strong>:<?php echo
htmlentities($error); ?> </div><?php }
else if($msg){?><div class="succWrap"><strong>SUCCESS</strong>:<?php echo
htmlentities($msg); ?> </div><?php }?>

<div class="input-field col s12">


<label for="empcode">Employee Code(Must be unique)</label>
<input name="empcode" id="empcode" onBlur="checkAvailabilityEmpid()" type="text"
autocomplete="off" required>
<span id="empid-availability" style="font-size:12px;"></span>
</div>

<div class="input-field col m6 s12">


<label for="firstName">First name</label>
<input id="firstName" name="firstName" type="text" required>
</div>

<div class="input-field col m6 s12">


<label for="lastName">Last name</label>
<input id="lastName" name="lastName" type="text" autocomplete="off" required>
</div>

<div class="input-field col s12">


<label for="email">Email</label>
<input name="email" type="email" id="email" onBlur="checkAvailabilityEmailid()" autocomplete="off"
required>
<span id="emailid-availability" style="font-size:12px;"></span>
</div>

<div class="input-field col s12">


<label for="password">Password</label>
<input id="password" name="password" type="password" autocomplete="off" required>
</div>

<div class="input-field col s12">


<label for="confirm">Confirm password</label>
<input id="confirm" name="confirmpassword" type="password" autocomplete="off" required>
</div>
</div>
</div>

<div class="col m6">


<div class="row">
<div class="input-field col m6 s12">
<select name="gender" autocomplete="off">
<option value="">Gender...</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Other">Other</option>
</select>
</div>

<div class="input-field col m6 s12">


<label for="birthdate">Birthdate</label>
<input id="birthdate" name="dob" type="date" class="datepicker" autocomplete="off" >
</div>

<div class="input-field col m6 s12">


<select name="department" autocomplete="off">
<option value="">Department...</option>
<?php $sql = "SELECT DepartmentName from tbldepartments";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
<option value="<?php echo htmlentities($result->DepartmentName);?>"><?php echo
htmlentities($result->DepartmentName);?></option>
<?php }} ?>
</select>
</div>

<div class="input-field col m6 s12">


<label for="address">Address</label>
<input id="address" name="address" type="text" autocomplete="off" required>
</div>

<div class="input-field col m6 s12">


<label for="city">City/Town</label>
<input id="city" name="city" type="text" autocomplete="off" required>
</div>

<div class="input-field col m6 s12">


<label for="country">Country</label>
<input id="country" name="country" type="text" autocomplete="off" required>
</div>

<div class="input-field col s12">


<label for="phone">Mobile number</label>
<input id="phone" name="mobileno" type="tel" maxlength="10" autocomplete="off" required>
</div>

<div class="input-field col s12">


<button type="submit" name="add" onclick="return valid();" id="add" class="waves-effect waves-light
btn indigo m-b-xs">ADD</button>

</div>

</div>
</div>
</div>
</div>
</section>

</section>
</div>
</form>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="left-sidebar-hover"></div>
<!-- Javascripts -->
<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/form_elements.js"></script>

</body>
</html>
<?php } ?>
Addleavetype.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
if(isset($_POST['add']))
{
$leavetype=$_POST['leavetype'];
$description=$_POST['description'];
$sql="INSERT INTO tblleavetype(LeaveType,Description) VALUES(:leavetype,:description)";
$query = $dbh->prepare($sql);
$query->bindParam(':leavetype',$leavetype,PDO::PARAM_STR);
$query->bindParam(':description',$description,PDO::PARAM_STR);
$query->execute();
$lastInsertId = $dbh->lastInsertId();
if($lastInsertId)
{
$msg="Leave type added Successfully";
}
else
{
$error="Something went wrong. Please try again";
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
<!-- Title -->
<title>Admin | Add Leave Type</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-


scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Add Leave Type</div>
</div>
<div class="col s12 m12 l6">
<div class="card">
<div class="card-content">
<div class="row">
<form class="col s12" name="chngpwd" method="post">
<?php if($error){?><div class="errorWrap"><strong>ERROR</strong> : <?php
echo htmlentities($error); ?> </div><?php }
else if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php echo
htmlentities($msg); ?> </div><?php }?>
<div class="row">
<div class="input-field col s12">
<input id="leavetype" type="text" class="validate" autocomplete="off" name="leavetype" required>
<label for="leavetype">Leave Type</label>
</div>

<div class="input-field col s12">


<textarea id="textarea1" name="description" class="materialize-textarea" name="description"
length="500"></textarea>
<label for="deptshortname">Description</label>
</div>

<div class="input-field col s12">


<button type="submit" name="add" class="waves-effect waves-light btn indigo m-b-xs">ADD</button>

</div>

</div>

</form>
</div>
</div>
</div>

</div>

</div>
</main>

</div>
<div class="left-sidebar-hover"></div>
<!-- Javascripts -->
<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/form_elements.js"></script>

</body>
</html>
<?php } ?>
approvedleave-history.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{

?>
<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Approved Leaves </title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-


scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
<link href="../assets/plugins/datatables/css/jquery.dataTables.min.css" rel="stylesheet">

<link href="../assets/plugins/google-code-prettify/prettify.css" rel="stylesheet"


type="text/css"/>
<!-- Theme Styles -->
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Approved Leave History</div>
</div>

<div class="col s12 m12 l12">


<div class="card">
<div class="card-content">
<span class="card-title">Approved Leave History</span>
<?php if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php echo
htmlentities($msg); ?> </div><?php }?>
<table id="example" class="display responsive-table ">
<thead>
<tr>
<th>#</th>
<th width="200">Employe Name</th>
<th width="120">Leave Type</th>

<th width="180">Posting Date</th>


<th>Status</th>
<th align="center">Action</th>
</tr>
</thead>

<tbody>
<?php
$status=1;
$sql = "SELECT tblleaves.id as
lid,tblemployees.FirstName,tblemployees.LastName,tblemployees.EmpId,tblemployees.id,tblleaves.Lea
veType,tblleaves.PostingDate,tblleaves.Status from tblleaves join tblemployees on
tblleaves.empid=tblemployees.id where tblleaves.Status=:status order by lid desc";
$query = $dbh -> prepare($sql);
$query->bindParam(':status',$status,PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{
?>

<tr>
<td> <b><?php echo htmlentities($cnt);?></b></td>
<td><a href="editemployee.php?empid=<?php echo htmlentities($result-
>id);?>" target="_blank"><?php echo htmlentities($result->FirstName." ".$result->LastName);?>(<?php
echo htmlentities($result->EmpId);?>)</a></td>
<td><?php echo htmlentities($result->LeaveType);?></td>
<td><?php echo htmlentities($result->PostingDate);?></td>
<td><?php $stats=$result->Status;
if($stats==1){
?>
<span style="color: green">Approved</span>
<?php } if($stats==2) { ?>
<span style="color: red">Not Approved</span>
<?php } if($stats==0) { ?>
<span style="color: blue">waiting for approval</span>
<?php } ?>

</td>

<td>
<td><a href="leave-details.php?leaveid=<?php echo htmlentities($result->lid);?>" class="waves-
effect waves-light btn blue m-b-xs" > View Details</a></td>
</tr>
<?php $cnt++;} }?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/plugins/datatables/js/jquery.dataTables.min.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/table-data.js"></script>
<script src="assets/js/pages/ui-modals.js"></script>
<script src="assets/plugins/google-code-prettify/prettify.js"></script>

</body>
</html>
<?php } ?>

Changepassword.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
// Code for change password
if(isset($_POST['change']))
{
$password=md5($_POST['password']);
$newpassword=md5($_POST['newpassword']);
$username=$_SESSION['alogin'];
$sql ="SELECT Password FROM admin WHERE UserName=:username and Password=:password";
$query= $dbh -> prepare($sql);
$query-> bindParam(':username', $username, PDO::PARAM_STR);
$query-> bindParam(':password', $password, PDO::PARAM_STR);
$query-> execute();
$results = $query -> fetchAll(PDO::FETCH_OBJ);
if($query -> rowCount() > 0)
{
$con="update admin set Password=:newpassword where UserName=:username";
$chngpwd1 = $dbh->prepare($con);
$chngpwd1-> bindParam(':username', $username, PDO::PARAM_STR);
$chngpwd1-> bindParam(':newpassword', $newpassword, PDO::PARAM_STR);
$chngpwd1->execute();
$msg="Your Password succesfully changed";
}
else {
$error="Your current password is wrong";
}
}
?>

<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Change Password</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-


scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Change Pasword</div>
</div>
<div class="col s12 m12 l6">
<div class="card">
<div class="card-content">

<div class="row">
<form class="col s12" name="chngpwd" method="post">
<?php if($error){?><div class="errorWrap"><strong>ERROR</strong>:<?php
echo htmlentities($error); ?> </div><?php }
else if($msg){?><div class="succWrap"><strong>SUCCESS</strong>:<?php echo
htmlentities($msg); ?> </div><?php }?>
<div class="row">
<div class="input-field col s12">
<input id="password" type="password" class="validate" autocomplete="off" name="password"
required>
<label for="password">Current Password</label>
</div>

<div class="input-field col s12">


<input id="password" type="password" name="newpassword" class="validate" autocomplete="off"
required>
<label for="password">New Password</label>
</div>

<div class="input-field col s12">


<input id="password" type="password" name="confirmpassword" class="validate" autocomplete="off"
required>
<label for="password">Confirm Password</label>
</div>

<div class="input-field col s12">


<button type="submit" name="change" class="waves-effect waves-light btn indigo m-b-xs"
onclick="return valid();">Change</button>

</div>

</div>

</form>
</div>
</div>
</div>

</div>

</div>
</main>
</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/form_elements.js"></script>

</body>
</html>
<?php } ?>
Dashboard.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
?>

<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Dashboard</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-


scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/metrojs/MetroJs.min.css" rel="stylesheet">
<link href="../assets/plugins/weather-icons-master/css/weather-icons.min.css" rel="stylesheet">
<!-- Theme Styles -->
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>

</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>

<main class="mn-inner">
<div class="middle-content">
<div class="row no-m-t no-m-b">
<div class="col s12 m12 l4">
<div class="card stats-card">
<div class="card-content">

<span class="card-title">Totle Regd Employee</span>


<span class="stats-counter">
<?php
$sql = "SELECT id from tblemployees";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$empcount=$query->rowCount();
?>

<span class="counter"><?php echo htmlentities($empcount);?></span></span>


</div>
<div id="sparkline-bar"></div>
</div>
</div>
<div class="col s12 m12 l4">
<div class="card stats-card">
<div class="card-content">

<span class="card-title">Listed Departments </span>


<?php
$sql = "SELECT id from tbldepartments";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$dptcount=$query->rowCount();
?>
<span class="stats-counter"><span class="counter"><?php echo
htmlentities($dptcount);?></span></span>
</div>
<div id="sparkline-line"></div>
</div>
</div>
<div class="col s12 m12 l4">
<div class="card stats-card">
<div class="card-content">
<span class="card-title">Listed leave Type</span>
<?php
$sql = "SELECT id from tblleavetype";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$leavtypcount=$query->rowCount();
?>
<span class="stats-counter"><span class="counter"><?php echo
htmlentities($leavtypcount);?></span></span>

</div>
<div class="progress stats-card-progress">
<div class="determinate" style="width: 70%"></div>
</div>
</div>
</div>
</div>

<div class="row no-m-t no-m-b">


<div class="col s12 m12 l12">
<div class="card invoices-card">
<div class="card-content">

<span class="card-title">Latest Leave Applications</span>


<table id="example" class="display responsive-table ">
<thead>
<tr>
<th>#</th>
<th width="200">Employe Name</th>
<th width="120">Leave Type</th>

<th width="180">Posting Date</th>


<th>Status</th>
<th align="center">Action</th>
</tr>
</thead>

<tbody>
<?php $sql = "SELECT tblleaves.id as
lid,tblemployees.FirstName,tblemployees.LastName,tblemployees.EmpId,tblemployees.id,tblleaves.Lea
veType,tblleaves.PostingDate,tblleaves.Status from tblleaves join tblemployees on
tblleaves.empid=tblemployees.id order by lid desc limit 6";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{
?>

<tr>
<td> <b><?php echo htmlentities($cnt);?></b></td>
<td><a href="editemployee.php?empid=<?php echo htmlentities($result-
>id);?>" target="_blank"><?php echo htmlentities($result->FirstName." ".$result->LastName);?>(<?php
echo htmlentities($result->EmpId);?>)</a></td>
<td><?php echo htmlentities($result->LeaveType);?></td>
<td><?php echo htmlentities($result->PostingDate);?></td>
<td><?php $stats=$result->Status;
if($stats==1){
?>
<span style="color: green">Approved</span>
<?php } if($stats==2) { ?>
<span style="color: red">Not Approved</span>
<?php } if($stats==0) { ?>
<span style="color: blue">waiting for approval</span>
<?php } ?>

</td>

<td>
<td><a href="leave-details.php?leaveid=<?php echo htmlentities($result->lid);?>" class="waves-
effect waves-light btn blue m-b-xs" > View Details</a></td>
</tr>
<?php $cnt++;} }?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

</main>

</div>
<!-- Javascripts -->
<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/plugins/waypoints/jquery.waypoints.min.js"></script>
<script src="../assets/plugins/counter-up-master/jquery.counterup.min.js"></script>
<script src="../assets/plugins/jquery-sparkline/jquery.sparkline.min.js"></script>
<script src="../assets/plugins/chart.js/chart.min.js"></script>
<script src="../assets/plugins/flot/jquery.flot.min.js"></script>
<script src="../assets/plugins/flot/jquery.flot.time.min.js"></script>
<script src="../assets/plugins/flot/jquery.flot.symbol.min.js"></script>
<script src="../assets/plugins/flot/jquery.flot.resize.min.js"></script>
<script src="../assets/plugins/flot/jquery.flot.tooltip.min.js"></script>
<script src="../assets/plugins/curvedlines/curvedLines.js"></script>
<script src="../assets/plugins/peity/jquery.peity.min.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/dashboard.js"></script>

</body>
</html>
<?php } ?>

Editdepartment.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
if(isset($_POST['update']))
{
$did=intval($_GET['deptid']);
$deptname=$_POST['departmentname'];
$deptshortname=$_POST['departmentshortname'];
$deptcode=$_POST['deptcode'];
$sql="update tbldepartments set
DepartmentName=:deptname,DepartmentCode=:deptcode,DepartmentShortName=:deptshortname
where id=:did";
$query = $dbh->prepare($sql);
$query->bindParam(':deptname',$deptname,PDO::PARAM_STR);
$query->bindParam(':deptcode',$deptcode,PDO::PARAM_STR);
$query->bindParam(':deptshortname',$deptshortname,PDO::PARAM_STR);
$query->bindParam(':did',$did,PDO::PARAM_STR);
$query->execute();
$msg="Department updated Successfully";
}

?>

<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Update Department</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-


scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>
<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Update Department</div>
</div>
<div class="col s12 m12 l6">
<div class="card">
<div class="card-content">

<div class="row">
<form class="col s12" name="chngpwd" method="post">
<?php if($error){?><div class="errorWrap"><strong>ERROR</strong>:<?php
echo htmlentities($error); ?> </div><?php }
else if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php echo
htmlentities($msg); ?> </div><?php }?>
<?php
$did=intval($_GET['deptid']);
$sql = "SELECT * from tbldepartments WHERE id=:did";
$query = $dbh -> prepare($sql);
$query->bindParam(':did',$did,PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>

<div class="row">
<div class="input-field col s12">
<input id="departmentname" type="text" class="validate" autocomplete="off"
name="departmentname" value="<?php echo htmlentities($result->DepartmentName);?>" required>
<label for="deptname">Department Name</label>
</div>

<div class="input-field col s12">


<input id="departmentshortname" type="text" class="validate" autocomplete="off" value="<?php echo
htmlentities($result->DepartmentShortName);?>" name="departmentshortname" required>
<label for="deptshortname">Department Short Name</label>
</div>
<div class="input-field col s12">
<input id="deptcode" type="text" name="deptcode" class="validate" autocomplete="off" value="<?php
echo htmlentities($result->DepartmentCode);?>" required>
<label for="password">Department Code</label>
</div>
<?php }} ?>

<div class="input-field col s12">


<button type="submit" name="update" class="waves-effect waves-light btn indigo m-b-
xs">UPDATE</button>

</div>

</div>

</form>
</div>
</div>
</div>

</div>

</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/form_elements.js"></script>

</body>
</html>
<?php } ?>
Editemployee.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
$eid=intval($_GET['empid']);
if(isset($_POST['update']))
{

$fname=$_POST['firstName'];
$lname=$_POST['lastName'];
$gender=$_POST['gender'];
$dob=$_POST['dob'];
$department=$_POST['department'];
$address=$_POST['address'];
$city=$_POST['city'];
$country=$_POST['country'];
$mobileno=$_POST['mobileno'];
$sql="update tblemployees set
FirstName=:fname,LastName=:lname,Gender=:gender,Dob=:dob,Department=:department,Address=:ad
dress,City=:city,Country=:country,Phonenumber=:mobileno where id=:eid";
$query = $dbh->prepare($sql);
$query->bindParam(':fname',$fname,PDO::PARAM_STR);
$query->bindParam(':lname',$lname,PDO::PARAM_STR);
$query->bindParam(':gender',$gender,PDO::PARAM_STR);
$query->bindParam(':dob',$dob,PDO::PARAM_STR);
$query->bindParam(':department',$department,PDO::PARAM_STR);
$query->bindParam(':address',$address,PDO::PARAM_STR);
$query->bindParam(':city',$city,PDO::PARAM_STR);
$query->bindParam(':country',$country,PDO::PARAM_STR);
$query->bindParam(':mobileno',$mobileno,PDO::PARAM_STR);
$query->bindParam(':eid',$eid,PDO::PARAM_STR);
$query->execute();
$msg="Employee record updated Successfully";
}

?>

<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Update Employee</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-


scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet" href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css" rel="stylesheet">
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>

</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Update employee</div>
</div>
<div class="col s12 m12 l12">
<div class="card">
<div class="card-content">
<form id="example-form" method="post" name="updatemp">
<div>
<h3>Update Employee Info</h3>
<?php if($error){?><div class="errorWrap"><strong>ERROR</strong>:<?php
echo htmlentities($error); ?> </div><?php }
else if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php echo
htmlentities($msg); ?> </div><?php }?>
<section>
<div class="wizard-content">
<div class="row">
<div class="col m6">
<div class="row">
<?php
$eid=intval($_GET['empid']);
$sql = "SELECT * from tblemployees where id=:eid";
$query = $dbh -> prepare($sql);
$query -> bindParam(':eid',$eid, PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
<div class="input-field col s12">
<label for="empcode">Employee Code(Must be unique)</label>
<input name="empcode" id="empcode" value="<?php echo htmlentities($result->EmpId);?>"
type="text" autocomplete="off" readonly required>
<span id="empid-availability" style="font-size:12px;"></span>
</div>

<div class="input-field col m6 s12">


<label for="firstName">First name</label>
<input id="firstName" name="firstName" value="<?php echo htmlentities($result->FirstName);?>"
type="text" required>
</div>

<div class="input-field col m6 s12">


<label for="lastName">Last name </label>
<input id="lastName" name="lastName" value="<?php echo htmlentities($result->LastName);?>"
type="text" autocomplete="off" required>
</div>

<div class="input-field col s12">


<label for="email">Email</label>
<input name="email" type="email" id="email" value="<?php echo htmlentities($result->EmailId);?>"
readonly autocomplete="off" required>
<span id="emailid-availability" style="font-size:12px;"></span>
</div>
<div class="input-field col s12">
<label for="phone">Mobile number</label>
<input id="phone" name="mobileno" type="tel" value="<?php echo htmlentities($result-
>Phonenumber);?>" maxlength="10" autocomplete="off" required>
</div>

</div>
</div>

<div class="col m6">


<div class="row">
<div class="input-field col m6 s12">
<select name="gender" autocomplete="off">
<option value="<?php echo htmlentities($result->Gender);?>"><?php echo htmlentities($result-
>Gender);?></option>
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Other">Other</option>
</select>
</div>

<div class="input-field col m6 s12">


<label for="birthdate">Date of Birth</label>
<input id="birthdate" name="dob" class="datepicker" value="<?php echo htmlentities($result-
>Dob);?>" >
</div>

<div class="input-field col m6 s12">


<select name="department" autocomplete="off">
<option value="<?php echo htmlentities($result->Department);?>"><?php echo htmlentities($result-
>Department);?></option>
<?php $sql = "SELECT DepartmentName from tbldepartments";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $resultt)
{ ?>
<option value="<?php echo htmlentities($resultt->DepartmentName);?>"><?php echo
htmlentities($resultt->DepartmentName);?></option>
<?php }} ?>
</select>
</div>
<div class="input-field col m6 s12">
<label for="address">Address</label>
<input id="address" name="address" type="text" value="<?php echo htmlentities($result-
>Address);?>" autocomplete="off" required>
</div>

<div class="input-field col m6 s12">


<label for="city">City/Town</label>
<input id="city" name="city" type="text" value="<?php echo htmlentities($result->City);?>"
autocomplete="off" required>
</div>

<div class="input-field col m6 s12">


<label for="country">Country</label>
<input id="country" name="country" type="text" value="<?php echo htmlentities($result->Country);?>"
autocomplete="off" required>
</div>

<?php }}?>

<div class="input-field col s12">


<button type="submit" name="update" id="update" class="waves-effect waves-light btn indigo m-b-
xs">UPDATE</button>

</div>

</div>
</div>
</div>
</div>
</section>

</section>
</div>
</form>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/form_elements.js"></script>

</body>
</html>
<?php } ?>
Editleavetype.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
if(isset($_POST['update']))
{
$lid=intval($_GET['lid']);
$leavetype=$_POST['leavetype'];
$description=$_POST['description'];
$sql="update tblleavetype set LeaveType=:leavetype,Description=:description where id=:lid";
$query = $dbh->prepare($sql);
$query->bindParam(':leavetype',$leavetype,PDO::PARAM_STR);
$query->bindParam(':description',$description,PDO::PARAM_STR);
$query->bindParam(':lid',$lid,PDO::PARAM_STR);
$query->execute();

$msg="Leave type updated Successfully";

?>

<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Edit Leave Type</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-
scale=1.0, user-scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet"
href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css"
rel="stylesheet">
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Edit Leave Type</div>
</div>
<div class="col s12 m12 l6">
<div class="card">
<div class="card-content">

<div class="row">
<form class="col s12" name="chngpwd" method="post">
<?php if($error){?><div class="errorWrap"><strong>ERROR</strong> :
<?php echo htmlentities($error); ?> </div><?php }
else if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php echo
htmlentities($msg); ?> </div><?php }?>
<?php
$lid=intval($_GET['lid']);
$sql = "SELECT * from tblleavetype where id=:lid";
$query = $dbh -> prepare($sql);
$query->bindParam(':lid',$lid,PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>

<div class="row">
<div class="input-field col s12">
<input id="leavetype" type="text" class="validate" autocomplete="off" name="leavetype"
value="<?php echo htmlentities($result->LeaveType);?>" required>
<label for="leavetype">Leave Type</label>
</div>

<div class="input-field col s12">


<textarea id="textarea1" name="description" class="materialize-textarea" name="description"
length="500"><?php echo htmlentities($result->Description);?></textarea>
<label for="deptshortname">Description</label>
</div>

<?php }} ?>

<div class="input-field col s12">


<button type="submit" name="update" class="waves-effect waves-light btn indigo m-b-
xs">Update</button>
</div>

</div>

</form>
</div>
</div>
</div>

</div>

</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/form_elements.js"></script>

</body>
</html>
<?php } ?>

Leavedetails.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{

// code for update the read notification status


$isread=1;
$did=intval($_GET['leaveid']);
date_default_timezone_set('Asia/Kolkata');
$admremarkdate=date('Y-m-d G:i:s ', strtotime("now"));
$sql="update tblleaves set IsRead=:isread where id=:did";
$query = $dbh->prepare($sql);
$query->bindParam(':isread',$isread,PDO::PARAM_STR);
$query->bindParam(':did',$did,PDO::PARAM_STR);
$query->execute();

// code for action taken on leave


if(isset($_POST['update']))
{
$did=intval($_GET['leaveid']);
$description=$_POST['description'];
$status=$_POST['status'];
date_default_timezone_set('Asia/Kolkata');
$admremarkdate=date('Y-m-d G:i:s ', strtotime("now"));
$sql="update tblleaves set
AdminRemark=:description,Status=:status,AdminRemarkDate=:admremarkdate where id=:did";
$query = $dbh->prepare($sql);
$query->bindParam(':description',$description,PDO::PARAM_STR);
$query->bindParam(':status',$status,PDO::PARAM_STR);
$query->bindParam(':admremarkdate',$admremarkdate,PDO::PARAM_STR);
$query->bindParam(':did',$did,PDO::PARAM_STR);
$query->execute();
$msg="Leave updated Successfully";
}

?>
<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Leave Details </title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-


scale=1.0, user-scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet"
href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css"
rel="stylesheet">
<link href="../assets/plugins/datatables/css/jquery.dataTables.min.css" rel="stylesheet">

<link href="../assets/plugins/google-code-prettify/prettify.css" rel="stylesheet"


type="text/css"/>
<!-- Theme Styles -->
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title" style="font-size:24px;">Leave Details</div>
</div>

<div class="col s12 m12 l12">


<div class="card">
<div class="card-content">
<span class="card-title">Leave Details</span>
<?php if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php
echo htmlentities($msg); ?> </div><?php }?>
<table id="example" class="display responsive-table ">

<tbody>
<?php
$lid=intval($_GET['leaveid']);
$sql = "SELECT tblleaves.id as
lid,tblemployees.FirstName,tblemployees.LastName,tblemployees.EmpId,tblemployees.id,tble
mployees.Gender,tblemployees.Phonenumber,tblemployees.EmailId,tblleaves.LeaveType,tblle
aves.ToDate,tblleaves.FromDate,tblleaves.Description,tblleaves.PostingDate,tblleaves.Status,tb
lleaves.AdminRemark,tblleaves.AdminRemarkDate from tblleaves join tblemployees on
tblleaves.empid=tblemployees.id where tblleaves.id=:lid";
$query = $dbh -> prepare($sql);
$query->bindParam(':lid',$lid,PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{
?>

<tr>
<td style="font-size:16px;"> <b>Employe Name :</b></td>
<td><a href="editemployee.php?empid=<?php echo
htmlentities($result->id);?>" target="_blank">
<?php echo htmlentities($result->FirstName." ".$result-
>LastName);?></a></td>
<td style="font-size:16px;"><b>Emp Id :</b></td>
<td><?php echo htmlentities($result->EmpId);?></td>
<td style="font-size:16px;"><b>Gender :</b></td>
<td><?php echo htmlentities($result->Gender);?></td>
</tr>
<tr>
<td style="font-size:16px;"><b>Emp Email id :</b></td>
<td><?php echo htmlentities($result->EmailId);?></td>
<td style="font-size:16px;"><b>Emp Contact No. :</b></td>
<td><?php echo htmlentities($result->Phonenumber);?></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>

<tr>
<td style="font-size:16px;"><b>Leave Type :</b></td>
<td><?php echo htmlentities($result->LeaveType);?></td>
<td style="font-size:16px;"><b>Leave Date . :</b></td>
<td>From <?php echo htmlentities($result->FromDate);?> to <?php
echo htmlentities($result->ToDate);?></td>
<td style="font-size:16px;"><b>Posting Date</b></td>
<td><?php echo htmlentities($result->PostingDate);?></td>
</tr>

<tr>
<td style="font-size:16px;"><b>Employe Leave Description : </b></td>
<td colspan="5"><?php echo htmlentities($result-
>Description);?></td>

</tr>

<tr>
<td style="font-size:16px;"><b>leave Status :</b></td>
<td colspan="5"><?php $stats=$result->Status;
if($stats==1){
?>
<span style="color: green">Approved</span>
<?php } if($stats==2) { ?>
<span style="color: red">Not Approved</span>
<?php } if($stats==0) { ?>
<span style="color: blue">waiting for approval</span>
<?php } ?>
</td>
</tr>

<tr>
<td style="font-size:16px;"><b>Admin Remark: </b></td>
<td colspan="5"><?php
if($result->AdminRemark==""){
echo "waiting for Approval";
}
else{
echo htmlentities($result->AdminRemark);
}
?></td>
</tr>

<tr>
<td style="font-size:16px;"><b>Admin Action taken date : </b></td>
<td colspan="5"><?php
if($result->AdminRemarkDate==""){
echo "NA";
}
else{
echo htmlentities($result->AdminRemarkDate);
}
?></td>
</tr>
<?php
if($stats==0)
{

?>
<tr>
<td colspan="5">
<a class="modal-trigger waves-effect waves-light btn" href="#modal1">Take&nbsp;Action</a>
<form name="adminaction" method="post">
<div id="modal1" class="modal modal-fixed-footer" style="height: 60%">
<div class="modal-content" style="width:90%">
<h4>Leave take action</h4>
<select class="browser-default" name="status" required="">
<option value="">Choose your option</option>
<option value="1">Approved</option>
<option value="2">Not Approved</option>
</select></p>
<p><textarea id="textarea1" name="description" class="materialize-
textarea" name="description" placeholder="Description" length="500" maxlength="500"
required></textarea></p>
</div>
<div class="modal-footer" style="width:90%">
<input type="submit" class="waves-effect waves-light btn blue m-b-xs" name="update"
value="Submit">
</div>
</div>

</td>
</tr>
<?php } ?>
</form> </tr>
<?php $cnt++;} }?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/plugins/datatables/js/jquery.dataTables.min.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/table-data.js"></script>
<script src="assets/js/pages/ui-modals.js"></script>
<script src="assets/plugins/google-code-prettify/prettify.js"></script>

</body>
</html>
<?php } ?>
Leaves.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
?>
<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Total Leave </title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-


scale=1.0, user-scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet"
href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css"
rel="stylesheet">
<link href="../assets/plugins/datatables/css/jquery.dataTables.min.css" rel="stylesheet">

<link href="../assets/plugins/google-code-prettify/prettify.css" rel="stylesheet"


type="text/css"/>
<!-- Theme Styles -->
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Leave History</div>
</div>

<div class="col s12 m12 l12">


<div class="card">
<div class="card-content">
<span class="card-title">Leave History</span>
<?php if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php
echo htmlentities($msg); ?> </div><?php }?>
<table id="example" class="display responsive-table ">
<thead>
<tr>
<th>#</th>
<th width="200">Employe Name</th>
<th width="120">Leave Type</th>

<th width="180">Posting Date</th>


<th>Status</th>
<th align="center">Action</th>
</tr>
</thead>

<tbody>
<?php $sql = "SELECT tblleaves.id as
lid,tblemployees.FirstName,tblemployees.LastName,tblemployees.EmpId,tblemployees.id,tblle
aves.LeaveType,tblleaves.PostingDate,tblleaves.Status from tblleaves join tblemployees on
tblleaves.empid=tblemployees.id order by lid desc";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{
?>

<tr>
<td> <b><?php echo htmlentities($cnt);?></b></td>
<td><a href="editemployee.php?empid=<?php echo
htmlentities($result->id);?>" target="_blank"><?php echo htmlentities($result->FirstName."
".$result->LastName);?>(<?php echo htmlentities($result->EmpId);?>)</a></td>
<td><?php echo htmlentities($result->LeaveType);?></td>
<td><?php echo htmlentities($result->PostingDate);?></td>
<td><?php $stats=$result->Status;
if($stats==1){
?>
<span style="color: green">Approved</span>
<?php } if($stats==2) { ?>
<span style="color: red">Not Approved</span>
<?php } if($stats==0) { ?>
<span style="color: blue">waiting for approval</span>
<?php } ?>

</td>

<td>
<td><a href="leave-details.php?leaveid=<?php echo htmlentities($result->lid);?>"
class="waves-effect waves-light btn blue m-b-xs" > View Details</a></td>
</tr>
<?php $cnt++;} }?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/plugins/datatables/js/jquery.dataTables.min.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/table-data.js"></script>
<script src="assets/js/pages/ui-modals.js"></script>
<script src="assets/plugins/google-code-prettify/prettify.js"></script>

</body>
</html>
<?php } ?>
Logout.php
<?php
session_start();
$_SESSION = array();
if (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
setcookie(session_name(), '', time() - 60*60,
$params["path"], $params["domain"],
$params["secure"], $params["httponly"]
);
}
unset($_SESSION['alogin']);
session_destroy(); // destroy session
header("location:../index.php");
?>

Managedepartments.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
if(isset($_GET['del']))
{
$id=$_GET['del'];
$sql = "delete from tbldepartments WHERE id=:id";
$query = $dbh->prepare($sql);
$query -> bindParam(':id',$id, PDO::PARAM_STR);
$query -> execute();
$msg="Department record deleted";

?>
<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Manage Departments</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-


scale=1.0, user-scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet"
href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css"
rel="stylesheet">
<link href="../assets/plugins/datatables/css/jquery.dataTables.min.css" rel="stylesheet">

<!-- Theme Styles -->


<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Manage Departments</div>
</div>
<div class="col s12 m12 l12">
<div class="card">
<div class="card-content">
<span class="card-title">Departments Info</span>
<?php if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php
echo htmlentities($msg); ?> </div><?php }?>
<table id="example" class="display responsive-table ">
<thead>
<tr>
<th>Sr no</th>
<th>Dept Name</th>
<th>Dept Short Name</th>
<th>Dept Code</th>
<th>Creation Date</th>
<th>Action</th>
</tr>
</thead>

<tbody>
<?php $sql = "SELECT * from tbldepartments";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
<tr>
<td> <?php echo htmlentities($cnt);?></td>
<td><?php echo htmlentities($result->DepartmentName);?></td>
<td><?php echo htmlentities($result->DepartmentShortName);?></td>
<td><?php echo htmlentities($result->DepartmentCode);?></td>
<td><?php echo htmlentities($result->CreationDate);?></td>
<td><a href="editdepartment.php?deptid=<?php echo
htmlentities($result->id);?>"><i class="material-icons">mode_edit</i></a><a
href="managedepartments.php?del=<?php echo htmlentities($result->id);?>" onclick="return
confirm('Do you want to delete');"> <i class="material-icons">delete_forever</i></a></td>
</tr>
<?php $cnt++;} }?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/plugins/datatables/js/jquery.dataTables.min.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/table-data.js"></script>

</body>
</html>
<?php } ?>
Manageemployee.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
// code for Inactive employee
if(isset($_GET['inid']))
{
$id=$_GET['inid'];
$status=0;
$sql = "update tblemployees set Status=:status WHERE id=:id";
$query = $dbh->prepare($sql);
$query -> bindParam(':id',$id, PDO::PARAM_STR);
$query -> bindParam(':status',$status, PDO::PARAM_STR);
$query -> execute();
header('location:manageemployee.php');
}

//code for active employee


if(isset($_GET['id']))
{
$id=$_GET['id'];
$status=1;
$sql = "update tblemployees set Status=:status WHERE id=:id";
$query = $dbh->prepare($sql);
$query -> bindParam(':id',$id, PDO::PARAM_STR);
$query -> bindParam(':status',$status, PDO::PARAM_STR);
$query -> execute();
header('location:manageemployee.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Manage Employees</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-


scale=1.0, user-scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />
<!-- Styles -->
<link type="text/css" rel="stylesheet"
href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css"
rel="stylesheet">
<link href="../assets/plugins/datatables/css/jquery.dataTables.min.css" rel="stylesheet">

<!-- Theme Styles -->


<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Manage EmployesWWW</div>
</div>

<div class="col s12 m12 l12">


<div class="card">
<div class="card-content">
<span class="card-title">Employees Info</span>
<?php if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php
echo htmlentities($msg); ?> </div><?php }?>
<table id="example" class="display responsive-table ">
<thead>
<tr>
<th>Sr no</th>
<th>Emp Id</th>
<th>Full Name</th>
<th>Department</th>
<th>Status</th>
<th>Reg Date</th>
<th>Action</th>
</tr>
</thead>

<tbody>
<?php $sql = "SELECT EmpId,FirstName,LastName,Department,Status,RegDate,id from
tblemployees";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
<tr>
<td> <?php echo htmlentities($cnt);?></td>
<td><?php echo htmlentities($result->EmpId);?></td>
<td><?php echo htmlentities($result->FirstName);?>&nbsp;<?php
echo htmlentities($result->LastName);?></td>
<td><?php echo htmlentities($result->Department);?></td>
<td><?php $stats=$result->Status;
if($stats){
?>
<a class="waves-effect waves-green btn-flat m-b-xs">Active</a>
<?php } else { ?>
<a class="waves-effect waves-red btn-flat m-b-xs">Inactive</a>
<?php } ?>

</td>
<td><?php echo htmlentities($result->RegDate);?></td>
<td><a href="editemployee.php?empid=<?php echo
htmlentities($result->id);?>"><i class="material-icons">mode_edit</i></a>
<?php if($result->Status==1)
{?>
<a href="manageemployee.php?inid=<?php echo htmlentities($result->id);?>" onclick="return
confirm('Are you sure you want to inactive this Employe?');"" > <i class="material-icons"
title="Inactive">clear</i>
<?php } else {?>

<a href="manageemployee.php?id=<?php echo htmlentities($result-


>id);?>" onclick="return confirm('Are you sure you want to active this employee?');""><i
class="material-icons" title="Active">done</i>
<?php } ?> </td>
</tr>
<?php $cnt++;} }?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/plugins/datatables/js/jquery.dataTables.min.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/table-data.js"></script>

</body>
</html>
<?php } ?>
Manageleavetype.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{
if(isset($_GET['del']))
{
$id=$_GET['del'];
$sql = "delete from tblleavetype WHERE id=:id";
$query = $dbh->prepare($sql);
$query -> bindParam(':id',$id, PDO::PARAM_STR);
$query -> execute();
$msg="Leave type record deleted";

}
?>
<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Manage Leave Type</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-


scale=1.0, user-scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet"
href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css"
rel="stylesheet">
<link href="../assets/plugins/datatables/css/jquery.dataTables.min.css" rel="stylesheet">

<!-- Theme Styles -->


<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Manage Leave Type</div>
</div>

<div class="col s12 m12 l12">


<div class="card">
<div class="card-content">
<span class="card-title">Leave Type Info</span>
<?php if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php
echo htmlentities($msg); ?> </div><?php }?>
<table id="example" class="display responsive-table ">
<thead>
<tr>
<th>Sr no</th>
<th>Leave Type</th>
<th>Description</th>
<th>Creation Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php $sql = "SELECT * from tblleavetype";
$query = $dbh -> prepare($sql);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{ ?>
<tr>
<td> <?php echo htmlentities($cnt);?></td>
<td><?php echo htmlentities($result->LeaveType);?></td>
<td><?php echo htmlentities($result->Description);?></td>
<td><?php echo htmlentities($result->CreationDate);?></td>
<td><a href="editleavetype.php?lid=<?php echo htmlentities($result-
>id);?>"><i class="material-icons">mode_edit</i></a>
<a href="manageleavetype.php?del=<?php echo htmlentities($result-
>id);?>" onclick="return confirm('Do you want to delete');"> <i class="material-
icons">delete_forever</i></a> </td>
</tr>
<?php $cnt++;} }?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/plugins/datatables/js/jquery.dataTables.min.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/table-data.js"></script>

</body>
</html>
<?php } ?>
Notapproved.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{

?>
<!DOCTYPE html>
<html lang="en">
<head>

<!-- Title -->


<title>Admin | Not Approved Leaves </title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-


scale=1.0, user-scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet"
href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css"
rel="stylesheet">
<link href="../assets/plugins/datatables/css/jquery.dataTables.min.css" rel="stylesheet">

<link href="../assets/plugins/google-code-prettify/prettify.css" rel="stylesheet"


type="text/css"/>
<!-- Theme Styles -->
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>

<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title"> Not Approved Leave History</div>
</div>

<div class="col s12 m12 l12">


<div class="card">
<div class="card-content">
<span class="card-title">Not Approved Leave History</span>
<?php if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php
echo htmlentities($msg); ?> </div><?php }?>
<table id="example" class="display responsive-table ">
<thead>
<tr>
<th>#</th>
<th width="200">Employe Name</th>
<th width="120">Leave Type</th>

<th width="180">Posting Date</th>


<th>Status</th>
<th align="center">Action</th>
</tr>
</thead>

<tbody>
<?php
$status=2;
$sql = "SELECT tblleaves.id as
lid,tblemployees.FirstName,tblemployees.LastName,tblemployees.EmpId,tblemployees.id,tblle
aves.LeaveType,tblleaves.PostingDate,tblleaves.Status from tblleaves join tblemployees on
tblleaves.empid=tblemployees.id where tblleaves.Status=:status order by lid desc";
$query = $dbh -> prepare($sql);
$query->bindParam(':status',$status,PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{
?>

<tr>
<td> <b><?php echo htmlentities($cnt);?></b></td>
<td><a href="editemployee.php?empid=<?php echo
htmlentities($result->id);?>" target="_blank"><?php echo htmlentities($result->FirstName."
".$result->LastName);?>(<?php echo htmlentities($result->EmpId);?>)</a></td>
<td><?php echo htmlentities($result->LeaveType);?></td>
<td><?php echo htmlentities($result->PostingDate);?></td>
<td><?php $stats=$result->Status;
if($stats==1){
?>
<span style="color: green">Approved</span>
<?php } if($stats==2) { ?>
<span style="color: red">Not Approved</span>
<?php } if($stats==0) { ?>
<span style="color: blue">waiting for approval</span>
<?php } ?>

</td>

<td>
<td><a href="leave-details.php?leaveid=<?php echo htmlentities($result->lid);?>"
class="waves-effect waves-light btn blue m-b-xs" > View Details</a></td>
</tr>
<?php $cnt++;} }?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/plugins/datatables/js/jquery.dataTables.min.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/table-data.js"></script>
<script src="assets/js/pages/ui-modals.js"></script>
<script src="assets/plugins/google-code-prettify/prettify.js"></script>

</body>
</html>
<?php } ?>
Pendingleave.php
<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['alogin'])==0)
{
header('location:index.php');
}
else{

?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Title -->
<title>Admin | Approved Leave leaves </title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-


scale=1.0, user-scalable=no"/>
<meta charset="UTF-8">
<meta name="description" content="Responsive Admin Dashboard Template" />
<meta name="keywords" content="admin,dashboard" />
<meta name="author" content="Steelcoders" />

<!-- Styles -->


<link type="text/css" rel="stylesheet"
href="../assets/plugins/materialize/css/materialize.min.css"/>
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../assets/plugins/material-preloader/css/materialPreloader.min.css"
rel="stylesheet">
<link href="../assets/plugins/datatables/css/jquery.dataTables.min.css" rel="stylesheet">

<link href="../assets/plugins/google-code-prettify/prettify.css" rel="stylesheet"


type="text/css"/>
<!-- Theme Styles -->
<link href="../assets/css/alpha.min.css" rel="stylesheet" type="text/css"/>
<link href="../assets/css/custom.css" rel="stylesheet" type="text/css"/>
<style>
.errorWrap {
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #dd3d36;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
.succWrap{
padding: 10px;
margin: 0 0 20px 0;
background: #fff;
border-left: 4px solid #5cb85c;
-webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
}
</style>
</head>
<body>
<?php include('includes/header.php');?>
<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Pending Leave History</div>
</div>

<div class="col s12 m12 l12">


<div class="card">
<div class="card-content">
<span class="card-title">Leave History</span>
<?php if($msg){?><div class="succWrap"><strong>SUCCESS</strong> : <?php
echo htmlentities($msg); ?> </div><?php }?>
<table id="example" class="display responsive-table ">
<thead>
<tr>
<th>#</th>
<th width="200">Employe Name</th>
<th width="120">Leave Type</th>

<th width="180">Posting Date</th>


<th>Status</th>
<th align="center">Action</th>
</tr>
</thead>

<tbody>
<?php
$status=0;
$sql = "SELECT tblleaves.id as
lid,tblemployees.FirstName,tblemployees.LastName,tblemployees.EmpId,tblemployees.id,tblle
aves.LeaveType,tblleaves.PostingDate,tblleaves.Status from tblleaves join tblemployees on
tblleaves.empid=tblemployees.id where tblleaves.Status=:status order by lid desc";
$query = $dbh -> prepare($sql);
$query->bindParam(':status',$status,PDO::PARAM_STR);
$query->execute();
$results=$query->fetchAll(PDO::FETCH_OBJ);
$cnt=1;
if($query->rowCount() > 0)
{
foreach($results as $result)
{
?>
<tr>
<td> <b><?php echo htmlentities($cnt);?></b></td>
<td><a href="editemployee.php?empid=<?php echo
htmlentities($result->id);?>" target="_blank"><?php echo htmlentities($result->FirstName."
".$result->LastName);?>(<?php echo htmlentities($result->EmpId);?>)</a></td>
<td><?php echo htmlentities($result->LeaveType);?></td>
<td><?php echo htmlentities($result->PostingDate);?></td>
<td><?php $stats=$result->Status;
if($stats==1){
?>
<span style="color: green">Approved</span>
<?php } if($stats==2) { ?>
<span style="color: red">Not Approved</span>
<?php } if($stats==0) { ?>
<span style="color: blue">waiting for approval</span>
<?php } ?>

</td>

<td>
<td><a href="leave-details.php?leaveid=<?php echo htmlentities($result->lid);?>"
class="waves-effect waves-light btn blue m-b-xs" > View Details</a></td>
</tr>
<?php $cnt++;} }?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>

</div>
<div class="left-sidebar-hover"></div>

<!-- Javascripts -->


<script src="../assets/plugins/jquery/jquery-2.2.0.min.js"></script>
<script src="../assets/plugins/materialize/js/materialize.min.js"></script>
<script src="../assets/plugins/material-preloader/js/materialPreloader.min.js"></script>
<script src="../assets/plugins/jquery-blockui/jquery.blockui.js"></script>
<script src="../assets/plugins/datatables/js/jquery.dataTables.min.js"></script>
<script src="../assets/js/alpha.min.js"></script>
<script src="../assets/js/pages/table-data.js"></script>
<script src="assets/js/pages/ui-modals.js"></script>
<script src="assets/plugins/google-code-prettify/prettify.js"></script>

</body>
</html>
<?php } ?>

You might also like