HR System
HR System
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>
<?php
include 'navBar.php';
include 'signinEmployerModals.php';
?>
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>
<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>
<script src="js/tilt.jquery.min.js"></script>
<script src="js/signinModal.js"></script>
}?>
</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';
?>
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>
<?php
include 'navBar.php';
?>
<!-- Main Container -->
<div class="container-fluid" style="background:url('img/Wonderful-Blur-Wallpaper.jpg');">
<?php
include 'connect.php';
$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" >
<h4>User Name</h4>
<h2><?php echo $name; ?></h2>
<h4>Email</h4>
<h2><?php echo $email; ?></h2>
</div>
</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>
<script src="js/tilt.jquery.min.js"></script>
<script src="js/signinModal.js"></script>
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'];
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">
.textDarkShadow{
text-shadow: 0px 0px 3px #000,3px 3px 5px #003333;
}
/* #btn1,#btn2,#btn3,#btn4,#btn5,#btn6{display:none;}*/
</style>
<?php
include 'navBar.php';
?>
<!-- Main Container -->
<div class="container-fluid" style="background:url('img/Wonderful-Blur-Wallpaper.jpg');">
<?php
include 'connect.php';
$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"];
}}
?>
<?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>
<script src="js/tilt.jquery.min.js"></script>
<script src="js/signinModal.js"></script>
// Create connection
include 'authorizeEmployer.php';
$id=0;
$name=$category=$minexp=$salary=$industry=$desc=$role=$eType=$status=$msg="";
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');";
}
}
?>
<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">
<?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>
<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>
<script src="js/tilt.jquery.min.js"></script>
<script src="js/signinModal.js"></script>
</body>
</html>
RegisterEmployer.php
<?php
include 'connect.php';
$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;
}
?>
<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>
<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;
<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>
<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;
<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>
<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">
.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';
$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"];
}}
?>
<h4>User Name</h4>
<h2><?php echo $name; ?></h2>
<h4>Email</h4>
<h2><?php echo $email; ?></h2>
</div>
<?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>
<script src="js/tilt.jquery.min.js"></script>
<script src="js/signinModal.js"></script>
<?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{
?><!DOCTYPE html>
<html lang="en">
<head>
<!-- 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>
</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>
<div class="left-sidebar-hover"></div>
</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>
<?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>
<?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>
</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>
<?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>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="left-sidebar-hover"></div>
</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'];
?><!DOCTYPE html>
<html lang="en">
<head>
</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>
</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="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>
</div>
</div>
</div>
</main>
</div>
<div class="left-sidebar-hover"></div>
</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>
<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Leave History</div>
</div>
<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
{
?></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>
</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>
<?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>
</div>
<?php }}?>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</form>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="left-sidebar-hover"></div>
</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>
<?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>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="left-sidebar-hover"></div>
</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>
<?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>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="left-sidebar-hover"></div>
</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>
<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>
</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>
<?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>
</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>
<?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>
<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>
</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>
<?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>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="left-sidebar-hover"></div>
</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>
</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">
</div>
<div class="progress stats-card-progress">
<div class="determinate" style="width: 70%"></div>
</div>
</div>
</div>
</div>
<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>
<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>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="left-sidebar-hover"></div>
</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>
</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>
</div>
<?php }}?>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</form>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="left-sidebar-hover"></div>
</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();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?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>
<?php }} ?>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<div class="left-sidebar-hover"></div>
</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{
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?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>
<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> </td>
<td> </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 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>
</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>
<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Leave History</div>
</div>
<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>
</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>
<?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>
</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');
}
<?php include('includes/sidebar.php');?>
<main class="mn-inner">
<div class="row">
<div class="col s12">
<div class="page-title">Manage EmployesWWW</div>
</div>
<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);?> <?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 {?>
</div>
<div class="left-sidebar-hover"></div>
</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>
<?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>
<div class="left-sidebar-hover"></div>
</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>
<?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>
<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>
</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>
<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>
</body>
</html>
<?php } ?>