You are on page 1of 106

1.

PROJECT PROFILE

1.1 Project Goal and Objectives

Goal:-
To automate the existing leave management in educational institutes.
To decrease the paperwork and enable the process with efficient,reliable record maintenance
by using centralized databse,thereby reducing chances of data loss.
To provide for an automated leave management system that intelligently adapts to HR policy
of the organizational and allows employees and their line manager to manage leaves and
replacement for better schedulingof work load & processes.

Objectives:-

 Admin can Login.


 Admin can manage department.
 Admin can manage leave type.
 Admin can view reports.
 Admin can logout.
 Manager can register.
 Manager can login.
 Manager can view leave application.
 Manager can approved/reject employee leave.
 Manger can view the report.
 Manager can logout.
 Employee can register.
 Employee can Login.
 Employee can view leave type.
 Employee can apply for leave.
 Employee can view confirmation on application.
 Employee can logout.

1
1.2 Scope of the Project

Scope:-

The leave management system is designed in such a way that makes it possible to access it
through any web browser program.
The scope of this project is limited to several processes:

 handling of employees.
 leave applications.
 managing leave balances.
 records management.
 administration and.
 leave management.

2
2. SYSTEM ENVIRONMENT

 Hardware Requirement

 Processor : Intel corei3


 RAM : 2 GB
 Hard Disk : 32 GB

 Software Requirement

 PHP : 5.4.16
 MySql : 5.6.12
 Wamp Server : 2.4
 Apache version : 2.4.4

3
3.PLATFORM ENVIRONMENT

3.1 FRONT END

PHP:-

 Php stand for personal home page

 Php is a general purpose scripting language that is especially suited to server side web
development, in which case php generally runs on a web server

PHP(HYPERTEXT PREPROCESSOR)

3.2 BACKEND

My SQL:-

 MYSQL is a database system used by many website on the internet


 MYSQL is a world’s most popular open source database.
 MYSQL can be easily installed in all major operation system like Microsoft ,windows,linux,unix.

My SQL(STRUCTURE QUERY LANGUAGE)

4
4.SYSTEM REQUIREMENT ANALYSIS

 MODULES:-
 Admin
 pathologist
 patient

 ADMIN MODULE:-
Login:-
Admin can login.

Manages leave:-
Admin can manager leave.

Send Emails:-
Admin can send email to manger for leave approval.
Reports :-
Admin generate multiple reports.

 MANAGER MODULE:-
Registration:-
Manager can register.

Login:-
Manager can login.

View leave application:-


Manager can view employee leave application.

Update leave status:-


Manager can update leave status.

Apply leave:-
Manager can apply for leave.

5
 EMPLOYEE MODULE:

Registration:-
User can register in our website.

Login:-
User can login.

Apply leave:-
Employee can apply for leave.

Leave approval information:-


Employee can view the leave status.

6
5. SYSTEM DESIGN

7
5.1) SYSTEM FLOW DIAGRAM

Patient entry

Online
laborarty
system

BILL

Admin Patient Pathologist

SAMPLE TEST
INSERT
SIGN INN
UPDATE CREATES
AWD
AWD REPORT
AWD

5.2) DATA FLOW DIAGRAM

Zero level DFD

8
Login details regis details

valid/invalid ID
Online laboratory Regis details
system
Admin Request details Login details patient
Report details Valid/Invalid ID

Valid/Invalid ID
Regis details
Login details

Pathologist

1st level DFD

9
patient details

patient details

1.0
regis details
Admin Registration registration master
regis details

Description
Admin details 2.0 Description

Admin details
Login

admin detail

admin details 3.0 admin details


Admin
Pathologist Admin master
process
admin details

4.0
patient details
Patient
process Patient
patient details

testing details
laboratory details
5.0
report details
pathologist details
pathologist details Pathologist
Pathologist master
pathologist details pathologist details

2nd level DFD for admin process(3.0)

10
3.1
Admin
pathologist details manage
pathologist

Test master

3.2 pathologist details

manage test
manage test

test report

test report
3.3 Laboratory
request report manage
report
report details report details

report details
3.4
Assign appointment Report master
manage
appointment
Recieve request

3.5
send bill request
send bill
manage bill pays bill
Patient
Recieve bill

2nd level DFD for patient process(4.0)

11
3.4.1
Laboratory
Admin Lab details Lab details
view request system

Assign appointment 3.4.2


Assign date
recieve request Lab details
& time

Assign task
3.4.2
sends report Assign lab details
pathologist

2nd level DFD for manager process(5.0)

12
13
3rd level DFD for manager department(3.1)

14
3nd level DFD for manager leave type(3.2)

15
5.3) ER DIGRAM

16
Data Dictionary

(1) Admin
Field Name Data Type Null/not null Key
Name Varchar(50) Not null
ID Int(10) Not null Primary key
Address Varchar(200) Not null
Contact no. Number(10) Not null
Gender Varchar Not null
E-mail ID Varchar(50) Not null
Password Varchar(20) Not null

(2) Patient
Field Name Data Type Null/not null Key
Name Varchar(50) Not null
ID Int(10) Not null Primary key
Password Varchar(20) Not null
Gender Varchar(10) Not null
Address Varchar(200) Not null
Contact no. Number(10) Not null
E-mail Varchar(20) Not null
Age Number(10) Not null
Blood Grp Varchar(10) Not null

(3) Pathologist

Field Name Data Type Null/not null Key


Name Varchar(50) Not null
ID Int(10) Not null Primary key
Password Varchar(20) Not null
Contact no. Number(10) Not null
Degree Varchar(20) Not null
Gender Varchar(10) Not null

(4) Test Master

Field Name Data Type Null/not null Key


Test ID Int(10) Not null Primary key
Patient ID Int(10) Not null Foreign key
Pathologist ID Int(10) Not null Foreign key
Test blood Varchar(20) Not null
Test urine Varchar(20) Not null
Test stool Varchar(20) Not null
Total cost Number(10) Not null

(5) Sub Test Master-Blood

Field name Data Type Null/not null Key


Blood id Int(10) Not null Primary key
17
Test ID Int(10) Not null Foreign key
Patient ID Int(10) Not null Foreign key
Hemeoglobin Number(20) Not null
RBC Count Number(20) Not null
WBC Count Number(20) Not null
Platelet Count Number(20) Not null
Range Number(20) Not null
Cost Number(20) Not null

(6) Sub Test Master-Urine

Field name Data Type Null/not null Key


Urine Id Int(10) Not null Primary key
Test ID Int(10) Not null Foreign key
Patient ID Int(10) Not null Foreign key
Color Varchar(20) Not null
Acidity Varchar(20) Not null
Cost Number(20) Not null

(7) Sub-test Stool

Field name Data Type Null/not null Key


Urine id Int(10) Not null Primary key
Test ID Int(10) Not null Foreign key
Patient ID Int(10) Not null Foreign key
Color Number(20) Not null
Number(20) Not null
Bacteria count Number(20) Not null
Type Number(20) Not null
Cost Number(20) Not null

7) Form Designing and coding

18
INDEX PAGE

CODING OF INDEX PAGE


<?php
include("header.php");
19
?>
<!-- banner -->
<div class="benner">
<!-- slider -->
<!--- img-slider --->
<div class="img-slider">
<!----start-slider-script---->
<script src="js/responsiveslides.min.js"></script>
<script>
// You can also use "$(window).load(function() {"
$(function () {
// Slideshow 4
$("#slider4").responsiveSlides({
auto: true,
pager: true,
nav: true,
speed: 500,
namespace: "callbacks",
before: function () {
$('.events').append("<li>before event fired.</li>");
},
after: function () {
$('.events').append("<li>after event fired.</li>");
}
});

});
</script>
<!----//End-slider-script---->
<!-- Slideshow 4 -->
<div id="top" class="callbacks_container">
<ul class="rslides" id="slider4">
<li>
<img class="img-responsive" src="images/banner1.jpg" alt="">

</li>
<li>
<img src="images/banner2.jpg" alt="">

</li>
<li>
<img src="images/banner3.jpg" alt="">

</li>
</ul>
</div>
<div class="clearfix"> </div>
</div>
<!-- slider -->
</div>
<!-- /banner -->
<!-- top-grids -->
<div class="top-grids text-center">

20
<div class="container">
<div class="col-md-4">
<div class="top-grid">
<img src='images/icon1.png' >
<h3>Apply Leave</h3>
<p>Now Employee and Manager can Apply Leave Online with paperless application.</p>
</div>
</div>
<div class="col-md-4">
<div class="top-grid">
<img src='images/icon2.png' >
<h3>View Application</h3>
<p>Manager Can View Applied Leave Application By Employee and follow up that application.</p>
</div>
</div>
<div class="col-md-4">
<div class="top-grid">
<img src='images/icon3.png' >
<h3>Approval</h3>
<p>After Viewing the Leave Application Manage can approved/rejected the leave application.</p>
</div>
</div>

<div class="clearfix"> </div>


</div>

</div>
<!-- top-grids -->
<!-- mid-grids -->
<div class="mid-grids">
<div class="col-md-6 mid-grid-left">

</div>
<div class="col-md-6 mid-grid-right">
<h2>Welcome To Leave Organizer</h2>
<p>Online Leave Organizer is the System where Employee and manager can apply for leave, if employee
can apply a leave than the leave application will approved or rejected by manager.</p>
<p>Manage Can View a Leave Application and provide approval or rejection for leave application while
manager can apply a leave than admin of the leave organizer can provide a leave approval or rejection.</p>

</div>
<div class="clearfix"> </div>
</div>
<!-- mid-grids -->

<!-- bottom-grids -->


<!-- team -->

<!-- team-grids-caption -->


<div class="team-grids-caption">
<div class="container">

21
<div style='color:#FFFFFF'>
<center><h4>PaperLess, Fast And Efficient</h4></center>

</div>

<div class="clearfix"> </div>


</div>
</div>
<!-- team-grids-caption -->

<?php
include("footer.php");
?>

Registration page

22
Coding for registration

<?php
include("header.php");
include("conn.php");
?>

<script type='text/javascript'>
function validate()
{
var v=/^[a-zA-Z ]+$/
if(form2.txtname.value=="")
{
alert('Please Enter Name');
form2.txtname.focus();
return false;
}else{
if(!v.test(form2.txtname.value))

23
{
alert('Please Enter Only Characters in Name');
form2.txtname.focus();
return false;
}

if(form2.txtadd.value=="")
{
alert('Please Enter Address');
form2.txtadd.focus();
return false;
}

if(form2.txtcity.value=="")
{
alert('Please Enter City');
form2.txtcity.focus();
return false;
}else{
if(!v.test(form2.txtcity.value))
{
alert('Please Enter Only Characters in City');
form2.txtcity.focus();
return false;
}
}

var v=/^[0-9]+$/
if(form2.txtmno.value=="")
{
alert('Please Enter Mobile No');
form2.txtmno.focus();
return false;
}else if(form2.txtmno.value.length!=10)
{
alert('Please Enter Only 10 Digits in Mobile No');
form2.txtmno.focus();
return false;
}
else{
if(!v.test(form2.txtmno.value))
{
alert('Please Enter Only Digits in Mobile No');
form2.txtmno.focus();
return false;
}

var v=/^[a-zA-Z0-9.-_]+@[a-zA-Z0-9.-_]+\.([a-zA-Z]{2,4})$/
if(form2.txtemail.value=="")

24
{
alert('Please Enter Email ID');
form2.txtemail.focus();
return false;
}else{
if(!v.test(form2.txtemail.value))
{
alert('Please Enter Valid Email ID');
form2.txtemail.focus();
return false;
}

if(form2.txtpwd.value=="")
{
alert('Please Enter Password');
form2.txtpwd.focus();
return false;
}else if(form2.txtpwd.value.length<6){
alert('Please Enter Password length greater than 6 characters');
form2.txtpwd.focus();
return false;

}else if(form2.txtpwd.value.length>10){
alert('Please Enter Password length Less than 10 characters');
form2.txtpwd.focus();
return false;

if(form2.selutype.value=="0")
{
alert('Please Select User Type');
form2.selutype.focus();
return false;
}

if(form2.seldept.value=="0")
{
alert('Please Select Department');
form2.seldept.focus();
return false;
}

var v=/^[a-zA-Z ]+$/


if(form2.txtdesig.value=="")
{
alert('Please Enter Designation');
form2.txtdesig.focus();
return false;

25
}else{
if(!v.test(form2.txtdesig.value))
{
alert('Please Enter Only Characters in Designation');
form2.txtdesig.focus();
return false;
}

if(form2.gender[0].checked==false)
{
if(form2.gender[1].checked==false)
{
alert('Please Select Gender');
return false;
}
}
}
</script>
<?php
if(isset($_POST['btnregis']))
{
$name=$_POST['txtname'];
$add=$_POST['txtadd'];
$city=$_POST['txtcity'];
$mno=$_POST['txtmno'];
$email=$_POST['txtemail'];
$pwd=$_POST['txtpwd'];
$utype=$_POST['selutype'];
$deptid=$_POST['seldept'];
$desig=$_POST['txtdesig'];
$gender=$_POST['gender'];

$qur1=mysql_query("select * from emp_master where email_id='$email'");


if(mysql_num_rows($qur1)>0)
{
echo "<script type='text/javascript'>";
echo "alert('Email Id Already Exists');";
echo "</script>";
}else{
//auto number code start..
$qur1=mysql_query("select max(emp_id) from emp_master");
$empid=0;
while($q1=mysql_fetch_array($qur1))
{
$empid=$q1[0];
}
$empid++;
//auto number code end....

$query="insert into imp_master


values('$empid','$name','$add','$city','$mno','$email','$pwd','$utype','$deptid','$gender','$desig')";

26
if(mysql_query($query))
{
echo "<script type='text/javascript'>";
echo "alert('Employee Registered Successfully');";
echo "window.location.href='login.php';";
echo "</script>";
}
}
}
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">REGISTRATION FORM</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">
<form method="post" name="form2">
<div class="contact-form-row">
<div>
<span>Enter Name</span>
<input type="text" class="text" name="txtname" placeholder="Your Name">
</div>
<div class="clearfix"> </div>
</div>
<div class="contact-form-row2">
<span>Address :</span>
<textarea name="txtadd" row="3" placeholder="Enter Address"></textarea>
</div>
<div class="contact-form-row">
<div>
<span>Enter City</span>
<input type="text" class="text" placeholder="Enter City" name="txtcity">
</div>
<div class="clearfix"> </div>
</div>

<div class="contact-form-row">
<div>

27
<span>Enter Mobile No</span>
<input type="text" class="text" placeholder="Enter Mobile No" name="txtmno">
</div>
<div class="clearfix"> </div>
</div>

<div class="contact-form-row">
<div>
<span>Enter Email Id</span>
<input type="text" class="text" placeholder="Enter Email ID" name="txtemail">
</div>
<div class="clearfix"> </div>
</div>
<div class="clearfix"> </div>

<div class="contact-form-row">
<div>
<span>Enter Password</span>
<input type="password" class="text" placeholder="******" name="txtpwd">
</div>
<div class="clearfix"> </div>
</div>
<div class="contact-form-row">
<div>
<span>Select User Type</span>
<select class="text" name="selutype">
<option value="0">--Select User Type--</option>
<option value="1">MANAGER</option>
<option value="2">EMPLOYEE</option>
</select>
</div>
<div class="clearfix"> </div>
</div>
<div class="contact-form-row">
<div>
<span>Select Department</span>
<select class="text" name="seldept">
<option value="0">--Select Department--</option>
<?php
$res1=mysql_query("select * from department_master");
while($r1=mysql_fetch_array($res1))
{
?>
<option value="<?php echo $r1[0]; ?>"><?php echo $r1[1]; ?></option>
<?php
}
?>
</select>
</div>
<div class="clearfix"> </div>
</div>
<div class="contact-form-row">
<div>

28
<span>Enter Designation</span>
<input type="text" class="text" placeholder="Enter Designation" name="txtdesig">
</div>
<div class="clearfix"> </div>
</div>
<div class="contact-form-row">
<div>
<span>SELECT GENDER</span>
<input type="radio" class="text" name="gender" value="MALE"> MALE
<input type="radio" class="text" name="gender" value="FEMALE"> FEMALE
</div>
<div class="clearfix"> </div>
</div>
<input type="submit" value="REGISTER" name="btnregis" onclick="return validate();">
</form>
</div>
<!----- contact-form ------>
</div>
<div class="col-md-6 about-left">
<div class="news-grid">
<img src="images/regis1.jpg" style="width:450px; height:450px;" title="name">
</div>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Login page

29
Coding of login page

<?php
session_start();
include("header.php");
include("conn.php");
if(isset($_POST['btnlogin']))
{
$email=$_POST['txtemail'];
$pwd=$_POST['txtpwd'];
$res1=mysql_query("select * from admin_detail where email_id='$email' and pwd='$pwd'");
if(mysql_num_rows($res1)>0)
{
echo "<script type='text/javascript'>";
echo "alert('Admin Login Successfull');";
echo "window.location.href='admin_manage_dept.php';";
echo "</script>";
}else{
$res2=mysql_query("select * from emp_master where email_id='$email' and pwd='$pwd'");
if(mysql_num_rows($res2)>0)
{
$r2=mysql_fetch_array($res2);
if($r2[7]=="1")
{
$_SESSION['mgrid']=$r2[0];
echo "<script type='text/javascript'>";
echo "alert('Manager Login Successfull');";
30
echo "window.location.href='mgr_apply_leave.php';";
echo "</script>";
}else if($r2[7]=="2"){
$_SESSION['empid']=$r2[0];
echo "<script type='text/javascript'>";
echo "alert('Employee Login Successfull');";
echo "window.location.href='emp_apply_leave.php';";
echo "</script>";
}
}else{
echo "<script type='text/javascript'>";
echo "alert('Check Email ID or Password');";
echo "</script>";
}
}
}

?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">LOGIN</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">
<br/><br/><br/>
<form method="post">

<div class="contact-form-row">
<div>
<span>Enter Email Id</span>
<input type="text" class="text" placeholder="Enter Email ID" name="txtemail">
</div>
<div class="clearfix"> </div>
</div>
<div class="clearfix"> </div>

<div class="contact-form-row">
<div>

31
<span>Enter Password</span>
<input type="password" class="text" placeholder="******" name="txtpwd">
</div>
<div class="clearfix"> </div>
</div>

<input type="submit" value="LOGIN" name="btnlogin">


</form>
</div>
<!----- contact-form ------>
</div>
<div class="col-md-6 about-left">
<div class="news-grid">
<img src="images/log1.png" style="width:500px; height:350px;" title="name">
</div>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Manage department

32
Coding for manage department

<?php
include("admin_header.php");
include("conn.php");

//auto number code start..


$qur1=mysql_query("select max(dept_id) from department_master");
$did=0;
while($q1=mysql_fetch_array($qur1))
{
$did=$q1[0];

}
$did++;

//auto number code end....

?>

<script type='text/javascript'>
function validate()
{
var v=/^[a-zA-Z ]+$/
if(form2.txtdept.value=="")
{
alert('Please Enter Department');
form2.txtdept.focus();
return false;
}else{
33
if(!v.test(form2.txtdept.value))
{
alert('Please Enter Only Characters in Department');
form2.txtdept.focus();
return false;
}

}
}
</script>
<?php
if(isset($_POST['btninsert']))
{
$did=$_POST['txtdid'];
$dept=$_POST['txtdept'];
$query="insert into department_master values('$did','$dept')";
if(mysql_query($query))
{
echo "<script type='text/javascript'>";
echo "alert('Department Inserted Successfully');";
echo "window.location.href='admin_manage_dept.php';";
echo "</script>";
}
}

if(isset($_REQUEST['ddid']))
{
$did=$_REQUEST['ddid'];
$query="delete from department_master where dept_id='$did'";
if(mysql_query($query))
{
echo "<script type='text/javascript'>";
echo "alert('Department Deleted Successfully');";
echo "window.location.href='admin_manage_dept.php';";
echo "</script>";
}
}

if(isset($_REQUEST['edid']))
{
$did=$_REQUEST['edid'];
$qur2=mysql_query("select * from department_master where dept_id='$did'");
$q2=mysql_fetch_array($qur2);
$dept=$q2[1];
}

if(isset($_POST['btnedit']))
{
$did=$_POST['txtdid'];
$dept=$_POST['txtdept'];
$query="update department_master set dept_name='$dept' where dept_id='$did'";
if(mysql_query($query))
{

34
echo "<script type='text/javascript'>";
echo "alert('Department Updated Successfully');";
echo "window.location.href='admin_manage_dept.php';";
echo "</script>";
}
}
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">MANAGE DEPARTMENT</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">
<br/><br/><br/>
<form method="post" name="form2">

<div class="contact-form-row">
<div>
<span>Enter Department Id</span>
<input type="text" class="text" placeholder="Enter Department ID" name="txtdid" value="<?php echo
$did; ?>" readonly="readonly">
</div>
<div class="clearfix"> </div>
</div>
<div class="clearfix"> </div>

<div class="contact-form-row">
<div>
<span>Enter Department</span>
<input type="text" class="text" placeholder="Enter Department" name="txtdept" value="<?php echo
$dept; ?>">
</div>
<div class="clearfix"> </div>
</div>
<?php
if(isset($_REQUEST['edid']))
{
?>
<input type="submit" value="EDIT" name="btnedit" onclick="return validate();">

35
<?php
}else{
?>
<input type="submit" value="INSERT" name="btninsert" onclick="return validate();">
<?php
}
?>
</form>
</div>
<!----- contact-form ------>
</div>
<div class="col-md-6 about-left">
<br/><br/><br/><br/><br/>
<?php
$res1=mysql_query("select * from department_master");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>DEPARTMENT ID</th>
<th>DEPARTMENT</th>
<th></th>
<th></th>
</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";
echo "<td>$r1[0]</td>";
echo "<td>$r1[1]</td>";
echo "<td><a href='admin_manage_dept.php?edid=$r1[0]'>EDIT</a></td>";
echo "<td><a href='admin_manage_dept.php?ddid=$r1[0]'>DELETE</a></td>";
echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Department Found</h2>";
}
?>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Manage leave type

36
Code for manage leave type
<?php
include("admin_header.php");
include("conn.php");

//auto number code start..


$qur1=mysql_query("select max(l_type_id) from leave_master");
$ltid=0;
while($q1=mysql_fetch_array($qur1))
{
$ltid=$q1[0];

}
$ltid++;

//auto number code end....

?>

<script type='text/javascript'>
function validate()
{
var v=/^[a-zA-Z ]+$/
if(form2.txtltype.value=="")
{
alert('Please Enter Leave Type');
form2.txtltype.focus();
return false;
}else{
37
if(!v.test(form2.txtltype.value))
{
alert('Please Enter Only Characters in Leave Type');
form2.txtltype.focus();
return false;
}

}
}
</script>
<?php
if(isset($_POST['btninsert']))
{
$ltid=$_POST['txtltid'];
$ltype=$_POST['txtltype'];
$query="insert into leave_master values('$ltid','$ltype')";
if(mysql_query($query))
{
echo "<script type='text/javascript'>";
echo "alert('Leave Type Inserted Successfully');";
echo "window.location.href='admin_manage_leave_type.php';";
echo "</script>";
}
}

if(isset($_REQUEST['dltid']))
{
$ltid=$_REQUEST['dltid'];
$query="delete from leave_master where l_type_id='$ltid'";
if(mysql_query($query))
{
echo "<script type='text/javascript'>";
echo "alert('Leave Type Deleted Successfully');";
echo "window.location.href='admin_manage_leave_type.php';";
echo "</script>";
}
}

if(isset($_REQUEST['eltid']))
{
$ltid=$_REQUEST['eltid'];
$qur2=mysql_query("select * from leave_master where l_type_id='$ltid'");
$q2=mysql_fetch_array($qur2);
$ltype=$q2[1];
}

if(isset($_POST['btnedit']))
{
$ltid=$_POST['txtltid'];
$ltype=$_POST['txtltype'];
$query="update leave_master set leave_type='$ltype' where l_type_id='$ltid'";
if(mysql_query($query))
{

38
echo "<script type='text/javascript'>";
echo "alert('Leave Type Updated Successfully');";
echo "window.location.href='admin_manage_leave_type.php';";
echo "</script>";
}
}
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">MANAGE LEAVE TYPE</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">
<br/><br/><br/>
<form method="post" name="form2">

<div class="contact-form-row">
<div>
<span>Enter Leave Type Id</span>
<input type="text" class="text" placeholder="Enter Leave Type ID" name="txtltid" value="<?php echo
$ltid; ?>" readonly="readonly">
</div>
<div class="clearfix"> </div>
</div>
<div class="clearfix"> </div>

<div class="contact-form-row">
<div>
<span>Enter Leave Type</span>
<input type="text" class="text" placeholder="Enter Leave Type" name="txtltype" value="<?php echo
$ltype; ?>">
</div>
<div class="clearfix"> </div>
</div>
<?php
if(isset($_REQUEST['eltid']))
{
?>
<input type="submit" value="EDIT" name="btnedit" onclick="return validate();">

39
<?php
}else{
?>
<input type="submit" value="INSERT" name="btninsert" onclick="return validate();">
<?php
}
?>
</form>
</div>
<!----- contact-form ------>
</div>
<div class="col-md-6 about-left">
<br/><br/><br/><br/><br/>
<?php
$res1=mysql_query("select * from leave_master");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>LEAVE TYPE ID</th>
<th>LEAVE TYPE</th>
<th></th>
<th></th>
</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";
echo "<td>$r1[0]</td>";
echo "<td>$r1[1]</td>";
echo "<td><a href='admin_manage_leave_type.php?eltid=$r1[0]'>EDIT</a></td>";
echo "<td><a href='admin_manage_leave_type.php?dltid=$r1[0]'>DELETE</a></td>";
echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Leave Type Found</h2>";
}
?>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Manager leave detail

40
Code for manager leave detail

<?php
session_start();
include("admin_header.php");
include("conn.php");
include("PHPMailer-master/class.phpmailer.php");
$laid=$_REQUEST['laid'];
?>

<script type='text/javascript'>
function validate()
{

if(form2.selstatus.value=="0")
{
alert('Please Select Status');
form2.selstatus.focus();
return false;
}

if(form2.txtremark.value=="")
{
alert('Please Enter Leave Remark');
form2.txtremark.focus();
return false;
}
}
</script>
<?php
if(isset($_POST['btnupdate']))
{

41
$laid=$_REQUEST['laid'];

$status=$_POST['selstatus'];
$remark=$_POST['txtremark'];

$res1=mysql_query("select * from emp_master where emp_id=(select emp_id from leave_apply_master


where apply_id='$laid')");
$r1=mysql_fetch_array($res1);
$email=$r1[5];

$query="update leave_apply_master set leave_apply_status='$status',remark='$remark' where


apply_id='$laid'";
if(mysql_query($query))
{
try {
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->Username = "prajapatin953@gmail.com";
$mail->Password = "8200412641";
$mail->FromName = "Leave Organizer";
$mail->AddAddress($email);

$mail->Subject = "Leave Approval Detail";


if($status=="1")
{
$mail->MsgHTML("Your Leave Is Approved");
}else{
$mail->MsgHTML("Sorry!!!! Your Leave Is Rejected");
}
if(!$mail->Send())
{
echo $mail->ErrorInfo;
}
} catch (phpmailerException $e) {
echo $e->errorMessage();
} catch (Exception $e) {
echo $e->getMessage();
}
/*echo "<script type='text/javascript'>";
echo "alert('Leave Status Updated Successfully');";
echo "window.location.href='admin_view_new_apply_mgr_leave.php';";
echo "</script>";*/
}

}
?>
<div class="team-grids-caption">
<div class="container">

42
<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">LEAVE APPLY FORM</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">
<form method="post" name="form2">
<div class="contact-form-row">
<div>
<span>Select Status</span>
<select class="text" name="selstatus">
<option value="0">--Select Status--</option>
<option value="1">ACCEPTED</option>
<option value="2">REJECTED</option>
</select>
</div>
<div class="clearfix"> </div>
</div>

<div class="contact-form-row2">
<span>Enter Remark</span>
<textarea name="txtremark" row="3" placeholder="Enter Remark"></textarea>
</div>
<input type="submit" value="UPDATE STATUS" name="btnupdate" onclick="return validate();">
</form>
</div>
<!----- contact-form ------>
</div>
<div class="col-md-6 about-left">
<div class="news-grid">
<img src="images/regis1.jpg" style="width:450px; height:450px;" title="name">
</div>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php

43
include("footer.php");
?>

Manager module:

44
Manager leave apply form

Code for manager leave apply form

<?php
session_start();
include("mgr_header.php");
include("conn.php");
?>

<script type='text/javascript'>
function validate()
{

if(form2.selltype.value=="0")
{
alert('Please Select Leave Type');
form2.selltype.focus();
return false;
}

if(form2.txtedate.value<form2.txtsdate.value)
{
alert('Please Select End Date greater than start date');
form2.txtedate.focus();
return false;
}

45
if(form2.txtlreason.value=="")
{
alert('Please Enter Leave Reason');
form2.txtlreason.focus();
return false;
}
}
</script>
<?php
if(isset($_POST['btnapply']))
{
$ltid=$_POST['selltype'];
$sdate=date("Y-m-d",strtotime($_POST['txtsdate']));
$edate=date("Y-m-d",strtotime($_POST['txtedate']));
$lreason=$_POST['txtlreason'];
$mgrid=$_SESSION['mgrid'];

//auto number code start..


$qur1=mysql_query("select max(apply_id) from leave_apply_master");
$aid=0;
while($q1=mysql_fetch_array($qur1))
{
$aid=$q1[0];
}
$aid++;
//auto number code end....
$adate=date("Y-m-d");
$query="insert into leave_apply_master
values('$aid','$adate','$ltid','$mgrid','$sdate','$edate','$lreason','0','0','')";
if(mysql_query($query))
{
echo "<script type='text/javascript'>";
echo "alert('Leave Applied Successfully');";
echo "window.location.href='mgr_view_leave_status.php';";
echo "</script>";
}

}
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">LEAVE APPLY FORM</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

46
</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">
<form method="post" name="form2">
<div class="contact-form-row">
<div>
<span>Select Leave Type</span>
<select class="text" name="selltype">
<option value="0">--Select Leave Type--</option>
<?php
$res1=mysql_query("select * from leave_master");
while($r1=mysql_fetch_array($res1))
{
?>
<option value="<?php echo $r1[0]; ?>"><?php echo $r1[1]; ?></option>
<?php
}
?>
</select>
</div>
<div class="clearfix"> </div>
</div>
<div class="contact-form-row">
<div>
<span>Enter Leave Start Date</span>
<input type="date" class="text" name="txtsdate" value="<?php echo date("Y-m-d"); ?>" min="<?php echo
date("Y-m-d"); ?>">
</div>
<div class="clearfix"> </div>
</div>
<div class="contact-form-row">
<div>
<span>Enter Leave End Date</span>
<input type="date" class="text" name="txtedate" value="<?php echo date("Y-m-d"); ?>" min="<?php echo
date("Y-m-d"); ?>">
</div>
<div class="clearfix"> </div>
</div>

<div class="contact-form-row2">
<span>Enter Leave Reason</span>
<textarea name="txtlreason" row="3" placeholder="Enter Leave Reason"></textarea>
</div>
<input type="submit" value="APPLY" name="btnapply" onclick="return validate();">
</form>
</div>
<!----- contact-form ------>
</div>
<div class="col-md-6 about-left">

47
<div class="news-grid">
<img src="images/regis1.jpg" style="width:450px; height:450px;" title="name">
</div>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Leave approval status

48
Code for leave approval status
<?php
session_start();
include("mgr_header.php");
include("conn.php");

?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">EMPLOYEE LEAVE DETAIL</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->

49
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">

</div>
<!----- contact-form ------>
</div>
<div class="col-md-12 about-left">
<br/><br/><br/><br/><br/>
<?php
$mgrid=$_SESSION['mgrid'];
$res1=mysql_query("select * from leave_apply_master where emp_id in (select emp_id from emp_master
where dept_id in (select dept_id from emp_master where emp_id='$mgrid')) and emp_id!='$mgrid' and
leave_apply_status='1'");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>APPLY DATE</th>
<th>LEAVE TYPE</th>
<th>EMPLOYEE NAME</th>
<th>MOBILE NO</th>
<th>LEAVE START DATE</th>
<th>LEAVE END DATE</th>
<th>LEAVE REASON</th>
<th>LEAVE STATUS</th>
<th>MANAGER NAME</th>
<th>REMARK</th>

</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";

echo "<td>$r1[1]</td>";
//echo "<td>$r1[2]</td>";
$qur2=mysql_query("select * from leave_master where l_type_id='$r1[2]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
$qur4=mysql_query("select * from emp_master where emp_id='$r1[3]'");
$q4=mysql_fetch_array($qur4);
echo "<td>$q4[1]</td>";
echo "<td>$q4[4]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
echo "<td>$r1[6]</td>";
if($r1[7]=="0")
{
echo "<td>LEAVE APPLIED</td>";
}else if($r1[7]=="1")
{
echo "<td>LEAVE APPROVED</td>";

50
}else if($r1[7]=="2")
{
echo "<td>LEAVE REJECTED</td>";
}
if($r1[8]=="0")
{
echo "<td>--------</td>";
}else{
$qur3=mysql_query("select * from emp_master where emp_id='$r1[8]'");
$q3=mysql_fetch_array($qur3);
echo "<td>$q3[1]</td>";
}
if($r1[9]=="")
{
echo "<td>--------</td>";
}else{

echo "<td>$r1[9]</td>";
}

echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Leave Applied</h2>";
}
?>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Manager view employee leave detail:

51
Code for Manager view employee leave detail

<?php
session_start();
include("mgr_header.php");
include("conn.php");

?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">EMPLOYEE LEAVE DETAIL</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">

52
</div>
<!----- contact-form ------>
</div>
<div class="col-md-12 about-left">
<br/><br/><br/><br/><br/>
<?php
$mgrid=$_SESSION['mgrid'];
$res1=mysql_query("select * from leave_apply_master where emp_id in (select emp_id from emp_master
where dept_id in (select dept_id from emp_master where emp_id='$mgrid')) and emp_id!='$mgrid' and
leave_apply_status='0'");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>APPLY DATE</th>
<th>LEAVE TYPE</th>
<th>EMPLOYEE NAME</th>
<th>MOBILE NO</th>
<th>LEAVE START DATE</th>
<th>LEAVE END DATE</th>
<th>LEAVE REASON</th>
<th>LEAVE STATUS</th>
<th>MANAGER NAME</th>
<th>REMARK</th>
<th>UPDATE STATUS</th>
</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";

echo "<td>$r1[1]</td>";
//echo "<td>$r1[2]</td>";
$qur2=mysql_query("select * from leave_master where l_type_id='$r1[2]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
$qur4=mysql_query("select * from emp_master where emp_id='$r1[3]'");
$q4=mysql_fetch_array($qur4);
echo "<td>$q4[1]</td>";
echo "<td>$q4[4]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
echo "<td>$r1[6]</td>";
if($r1[7]=="0")
{
echo "<td>LEAVE APPLIED</td>";
}else if($r1[7]=="1")
{
echo "<td>LEAVE APPROVED</td>";
}else if($r1[7]=="2")
{
echo "<td>LEAVE REJECTED</td>";
}
if($r1[8]=="0")

53
{
echo "<td>--------</td>";
}else{
$qur3=mysql_query("select * from emp_master where emp_id='$r1[8]'");
$q3=mysql_fetch_array($qur3);
echo "<td>$q3[1]</td>";
}
if($r1[9]=="")
{
echo "<td>--------</td>";
}else{

echo "<td>$r1[9]</td>";
}
echo "<td><a href='mgr_update_leave_status.php?laid=$r1[0]'>UPDATE STATUS</a></td>";
echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Leave Applied</h2>";
}
?>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Manager view approved employee leave status:

54
Code for manager view approved employee leave status
<?php
session_start();
include("mgr_header.php");
include("conn.php");

?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">EMPLOYEE LEAVE DETAIL</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">

</div>
<!----- contact-form ------>

55
</div>
<div class="col-md-12 about-left">
<br/><br/><br/><br/><br/>
<?php
$mgrid=$_SESSION['mgrid'];
$res1=mysql_query("select * from leave_apply_master where emp_id in (select emp_id from emp_master
where dept_id in (select dept_id from emp_master where emp_id='$mgrid')) and emp_id!='$mgrid' and
leave_apply_status='1'");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>APPLY DATE</th>
<th>LEAVE TYPE</th>
<th>EMPLOYEE NAME</th>
<th>MOBILE NO</th>
<th>LEAVE START DATE</th>
<th>LEAVE END DATE</th>
<th>LEAVE REASON</th>
<th>LEAVE STATUS</th>
<th>MANAGER NAME</th>
<th>REMARK</th>

</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";

echo "<td>$r1[1]</td>";
//echo "<td>$r1[2]</td>";
$qur2=mysql_query("select * from leave_master where l_type_id='$r1[2]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
$qur4=mysql_query("select * from emp_master where emp_id='$r1[3]'");
$q4=mysql_fetch_array($qur4);
echo "<td>$q4[1]</td>";
echo "<td>$q4[4]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
echo "<td>$r1[6]</td>";
if($r1[7]=="0")
{
echo "<td>LEAVE APPLIED</td>";
}else if($r1[7]=="1")
{
echo "<td>LEAVE APPROVED</td>";
}else if($r1[7]=="2")
{
echo "<td>LEAVE REJECTED</td>";
}
if($r1[8]=="0")
{
echo "<td>--------</td>";

56
}else{
$qur3=mysql_query("select * from emp_master where emp_id='$r1[8]'");
$q3=mysql_fetch_array($qur3);
echo "<td>$q3[1]</td>";
}
if($r1[9]=="")
{
echo "<td>--------</td>";
}else{

echo "<td>$r1[9]</td>";
}

echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Leave Applied</h2>";
}
?>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Employee leave apply form:

57
Code for employee leave apply form
<?php
session_start();
include("emp_header.php");
include("conn.php");
?>

<script type='text/javascript'>
function validate()
{

if(form2.selltype.value=="0")
{
alert('Please Select Leave Type');
form2.selltype.focus();
return false;
}

if(form2.txtedate.value<form2.txtsdate.value)
{
alert('Please Select End Date greater than start date');
form2.txtedate.focus();
return false;
}

if(form2.txtlreason.value=="")
{
alert('Please Enter Leave Reason');
form2.txtlreason.focus();
return false;
}

58
}
</script>
<?php
if(isset($_POST['btnapply']))
{
$ltid=$_POST['selltype'];
$sdate=date("Y-m-d",strtotime($_POST['txtsdate']));
$edate=date("Y-m-d",strtotime($_POST['txtedate']));
$lreason=$_POST['txtlreason'];
$empid=$_SESSION['empid'];

//auto number code start..


$qur1=mysql_query("select max(apply_id) from leave_apply_master");
$aid=0;
while($q1=mysql_fetch_array($qur1))
{
$aid=$q1[0];
}
$aid++;
//auto number code end....
$adate=date("Y-m-d");
$query="insert into leave_apply_master
values('$aid','$adate','$ltid','$empid','$sdate','$edate','$lreason','0','0','')";
if(mysql_query($query))
{
echo "<script type='text/javascript'>";
echo "alert('Leave Applied Successfully');";
echo "window.location.href='emp_view_leave_status.php';";
echo "</script>";
}

}
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">LEAVE APPLY FORM</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>

59
<div class="contact-form">
<form method="post" name="form2">
<div class="contact-form-row">
<div>
<span>Select Leave Type</span>
<select class="text" name="selltype">
<option value="0">--Select Leave Type--</option>
<?php
$res1=mysql_query("select * from leave_master");
while($r1=mysql_fetch_array($res1))
{
?>
<option value="<?php echo $r1[0]; ?>"><?php echo $r1[1]; ?></option>
<?php
}
?>
</select>
</div>
<div class="clearfix"> </div>
</div>
<div class="contact-form-row">
<div>
<span>Enter Leave Start Date</span>
<input type="date" class="text" name="txtsdate" value="<?php echo date("Y-m-d"); ?>" min="<?php echo
date("Y-m-d"); ?>">
</div>
<div class="clearfix"> </div>
</div>
<div class="contact-form-row">
<div>
<span>Enter Leave End Date</span>
<input type="date" class="text" name="txtedate" value="<?php echo date("Y-m-d"); ?>" min="<?php echo
date("Y-m-d"); ?>">
</div>
<div class="clearfix"> </div>
</div>

<div class="contact-form-row2">
<span>Enter Leave Reason</span>
<textarea name="txtlreason" row="3" placeholder="Enter Leave Reason"></textarea>
</div>
<input type="submit" value="APPLY" name="btnapply" onclick="return validate();">
</form>
</div>
<!----- contact-form ------>
</div>
<div class="col-md-6 about-left">
<div class="news-grid">
<img src="images/regis1.jpg" style="width:450px; height:450px;" title="name">
</div>
</div>
</div>
<!----- contact-grids ----->

60
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Employee leave approval detail:

61
Code for employee leave approval detail

<?php
session_start();
include("emp_header.php");
include("conn.php");

?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">LEAVE APPLIED STATUS</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">

62
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">

</div>
<!----- contact-form ------>
</div>
<div class="col-md-12 about-left">
<br/><br/><br/><br/><br/>
<?php
$empid=$_SESSION['empid'];
$res1=mysql_query("select * from leave_apply_master where emp_id='$empid'");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>APPLY DATE</th>
<th>LEAVE TYPE</th>
<th>LEAVE START DATE</th>
<th>LEAVE END DATE</th>
<th>LEAVE REASON</th>
<th>LEAVE STATUS</th>
<th>MANAGER NAME</th>
<th>REMARK</th>
</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";

echo "<td>$r1[1]</td>";
//echo "<td>$r1[2]</td>";
$qur2=mysql_query("select * from leave_master where l_type_id='$r1[2]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
echo "<td>$r1[6]</td>";
if($r1[7]=="0")
{
echo "<td>LEAVE APPLIED</td>";
}else if($r1[7]=="1")
{
echo "<td>LEAVE APPROVED</td>";
}else if($r1[7]=="2")
{
echo "<td>LEAVE REJECTED</td>";
}
if($r1[8]=="0")
{
echo "<td>--------</td>";
}else{
$qur3=mysql_query("select * from emp_master where emp_id='$r1[8]'");
$q3=mysql_fetch_array($qur3);

63
echo "<td>$q3[1]</td>";
}
if($r1[9]=="")
{
echo "<td>--------</td>";
}else{

echo "<td>$r1[9]</td>";
}

echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Leave Applied</h2>";
}
?>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Admin update manager leave status:

64
Code for admin update manager leave status

<?php
session_start();
include("admin_header.php");
include("conn.php");
include("PHPMailer-master/class.phpmailer.php");
$laid=$_REQUEST['laid'];
?>

<script type='text/javascript'>
function validate()
{

if(form2.selstatus.value=="0")
{
alert('Please Select Status');
form2.selstatus.focus();
return false;
}

if(form2.txtremark.value=="")
{
alert('Please Enter Leave Remark');
form2.txtremark.focus();
return false;
}
}
</script>

65
<?php
if(isset($_POST['btnupdate']))
{
$laid=$_REQUEST['laid'];

$status=$_POST['selstatus'];
$remark=$_POST['txtremark'];

$res1=mysql_query("select * from emp_master where emp_id=(select emp_id from leave_apply_master


where apply_id='$laid')");
$r1=mysql_fetch_array($res1);
$email=$r1[5];

$query="update leave_apply_master set leave_apply_status='$status',remark='$remark' where


apply_id='$laid'";
if(mysql_query($query))
{
try {
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->Username = "prajapatin953@gmail.com";
$mail->Password = "8200412641";
$mail->FromName = "Leave Organizer";
$mail->AddAddress($email);

$mail->Subject = "Leave Approval Detail";


if($status=="1")
{
$mail->MsgHTML("Your Leave Is Approved");
}else{
$mail->MsgHTML("Sorry!!!! Your Leave Is Rejected");
}
if(!$mail->Send())
{
echo $mail->ErrorInfo;
}
} catch (phpmailerException $e) {
echo $e->errorMessage();
} catch (Exception $e) {
echo $e->getMessage();
}
/*echo "<script type='text/javascript'>";
echo "alert('Leave Status Updated Successfully');";
echo "window.location.href='admin_view_new_apply_mgr_leave.php';";
echo "</script>";*/
}

66
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">LEAVE APPLY FORM</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">
<form method="post" name="form2">
<div class="contact-form-row">
<div>
<span>Select Status</span>
<select class="text" name="selstatus">
<option value="0">--Select Status--</option>
<option value="1">ACCEPTED</option>
<option value="2">REJECTED</option>
</select>
</div>
<div class="clearfix"> </div>
</div>

<div class="contact-form-row2">
<span>Enter Remark</span>
<textarea name="txtremark" row="3" placeholder="Enter Remark"></textarea>
</div>
<input type="submit" value="UPDATE STATUS" name="btnupdate" onclick="return validate();">
</form>
</div>
<!----- contact-form ------>
</div>
<div class="col-md-6 about-left">
<div class="news-grid">
<img src="images/regis1.jpg" style="width:450px; height:450px;" title="name">
</div>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>

67
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Manager update leave status:

68
Code for manager update leave status

<?php
session_start();
include("mgr_header.php");
include("conn.php");

$laid=$_REQUEST['laid'];
?>

<script type='text/javascript'>
function validate()
{

if(form2.selstatus.value=="0")
{
alert('Please Select Status');
form2.selstatus.focus();
return false;
}

if(form2.txtremark.value=="")
{
alert('Please Enter Leave Remark');
form2.txtremark.focus();
return false;
}
}
</script>
69
<?php
if(isset($_POST['btnupdate']))
{
$laid=$_REQUEST['laid'];

$status=$_POST['selstatus'];
$remark=$_POST['txtremark'];
$mgrid=$_SESSION['mgrid'];

$query="update leave_apply_master set leave_apply_status='$status',mgr_id='$mgrid',remark='$remark'


where apply_id='$laid'";
if(mysql_query($query))
{
echo "<script type='text/javascript'>";
echo "alert('Leave Status Updated Successfully');";
echo "window.location.href='mgr_update_emp_leave_status.php';";
echo "</script>";
}

}
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">LEAVE APPLY FORM</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">
<form method="post" name="form2">
<div class="contact-form-row">
<div>
<span>Select Status</span>
<select class="text" name="selstatus">
<option value="0">--Select Status--</option>
<option value="1">ACCEPTED</option>
<option value="2">REJECTED</option>
</select>
</div>

70
<div class="clearfix"> </div>
</div>

<div class="contact-form-row2">
<span>Enter Remark</span>
<textarea name="txtremark" row="3" placeholder="Enter Remark"></textarea>
</div>
<input type="submit" value="UPDATE STATUS" name="btnupdate" onclick="return validate();">
</form>
</div>
<!----- contact-form ------>
</div>
<div class="col-md-6 about-left">
<div class="news-grid">
<img src="images/regis1.jpg" style="width:450px; height:450px;" title="name">
</div>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

About us

71
Code for about us
<?php
include("header.php");
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">ABOUT US</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="about">
<div class="container">
<div class="about-grids">
<div class="col-md-6 about-left">
<br/><br/>
<h1>About Leave Organizer</h1>
<p align="justify">Online Leave Organizer is the System where Employee and manager can apply for leave,
if employee can apply a leave than the leave application will approved or rejected by manager.</p>
<p align="justify">Manage Can View a Leave Application and provide approval or rejection for leave
application while manager can apply a leave than admin of the leave organizer can provide a leave approval
or rejection.</p>

</div>
<div class="col-md-6 about-left">

<!-- news-grid -->


<div class="news-grid">
<img src="images/home3.png" style="width:450px; height:350px;" title="name">
</div>
72
<!-- news-grid -->
<!-- recent-news -->
<br/><br/><br/>
<!-- recent-news -->
</div>
</div>
</div>

<!-- about-us -->

<!-- team-grids-caption -->

<?php
include("footer.php");
?>

Contact us

73
Coding for contact us
<?php
include("header.php");
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">CONTACT US</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="about">
<div class="container">
<div class="about-grids">
<div class="col-md-6 about-left">
<br/><br/>
<h1>Contact Leave Organizer</h1>
<p align="justify">
<font size="+1">

Address: 2nd Floor, Infinity Mall<br/>


Dharampur Cross Road, <br/>
Valsad: 396001,<br/>
Gujarat-(India)
<br/><br/>

74
Mobile No: 7016180953, 8200412641
<br/><br/>
Email ID: admin@leaveorganizer.com

</font>
</p>

</div>
<div class="col-md-6 about-left">

<!-- news-grid -->


<div class="news-grid">
<img src="images/home4.jpg" style="width:450px; height:350px;" title="name">
</div>
<!-- news-grid -->
<!-- recent-news -->
<br/><br/><br/>
<!-- recent-news -->
</div>
</div>
</div>

<!-- about-us -->

<!-- team-grids-caption -->

<?php
include("footer.php");
?>

Reports

75
Manager detail report

Coding for manger detail report


<?php
include("admin_header.php");
include("conn.php");
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">MANAGER DETAIL REPORT</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-12 about-left">
<?php

76
$res1=mysql_query("select * from emp_master where user_type='1'");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>MANAGER ID</th>
<th>MANAGER NAME</th>
<th>ADDRESS</th>
<th>CITY</th>
<th>MOBILE NO</th>
<th>EMAIL ID</th>
<th>DEPARTMENT</th>
<th>GENDER</th>
<th>DESIGNATION</th>
<th>APPLIED LEAVE DETAIL</th>
</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";
echo "<td>$r1[0]</td>";
echo "<td>$r1[1]</td>";
echo "<td>$r1[2]</td>";
echo "<td>$r1[3]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
$qur2=mysql_query("select * from department_master where dept_id='$r1[8]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
echo "<td>$r1[9]</td>";
echo "<td>$r1[10]</td>";
echo "<td><a href='admin_view_manager_wise_applied_leave_report.php?empid=$r1[0]'>APPLIED
LEAVE DETAIL</a></td>";
echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Manager Found</h2>";
}
?>
</div>
<div class="col-md-6 about-left">
<br/><br/><br/><br/><br/>

</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

77
Employee detail report

78
Coding for employee detail report

<?php
include("admin_header.php");
include("conn.php");
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">EMPLOYEE DETAIL REPORT</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">
</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-12 about-left">
<?php
$res1=mysql_query("select * from emp_master where user_type='2'");
if(mysql_num_rows($res1)>0)
79
{
echo "<table class='table table-bordered'>
<tr>
<th>MANAGER ID</th>
<th>MANAGER NAME</th>
<th>ADDRESS</th>
<th>CITY</th>
<th>MOBILE NO</th>
<th>EMAIL ID</th>
<th>DEPARTMENT</th>
<th>GENDER</th>
<th>DESIGNATION</th>
<th>APPLIED LEAVE DETAIL</th>
</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";
echo "<td>$r1[0]</td>";
echo "<td>$r1[1]</td>";
echo "<td>$r1[2]</td>";
echo "<td>$r1[3]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
$qur2=mysql_query("select * from department_master where dept_id='$r1[8]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
echo "<td>$r1[9]</td>";
echo "<td>$r1[10]</td>";
echo "<td><a href='admin_view_emp_wise_applied_leave_report.php?empid=$r1[0]'>APPLIED LEAVE
DETAIL</a></td>";
echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Employee Found</h2>";
}
?>
</div>
<div class="col-md-6 about-left">
<br/><br/><br/><br/><br/>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Department wise employee report


80
Coding for Department wise employee report

<?php
include("admin_header.php");
include("conn.php");

?>

<script type='text/javascript'>
function validate()
{

if(form2.seldept.value=="")
{
alert('Please Select Department');
form2.seldept.focus();
return false;
}
}
</script>
<?php
if(isset($_POST['btnreport']))
{
$deptid=$_POST['seldept'];
}
?>
<div class="team-grids-caption">
<div class="container">

81
<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">DEPARTMENT WISE EMPLOYEE DETAIL
REPORT</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">
<br/><br/><br/>
<form method="post" name="form2">

<div class="contact-form-row">
<div>
<span>Select Department</span>
<select class="text" name="seldept">
<option value="0">--Select Department--</option>
<?php
$res1=mysql_query("select * from department_master");
while($r1=mysql_fetch_array($res1))
{
?>
<option value="<?php echo $r1[0]; ?>" <?php if($r1[0]==$deptid){ echo "selected='selected'"; }?>><?php
echo $r1[1]; ?></option>
<?php
}
?>
</select>
</div>
<div class="clearfix"> </div>
</div>

<input type="submit" value="DISPLAY REPORT" name="btnreport" onclick="return validate();">

</form>
</div>
<!----- contact-form ------>
</div>
<div class="col-md-12 about-left">
<br/><br/><br/><br/><br/>
<?php
if(isset($_POST['btnreport']))
{

82
$res1=mysql_query("select * from emp_master where dept_id='$deptid'");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>MANAGER ID</th>
<th>MANAGER NAME</th>
<th>ADDRESS</th>
<th>CITY</th>
<th>MOBILE NO</th>
<th>EMAIL ID</th>
<th>DEPARTMENT</th>
<th>GENDER</th>
<th>DESIGNATION</th>
<th>APPLIED LEAVE DETAIL</th>
</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";
echo "<td>$r1[0]</td>";
echo "<td>$r1[1]</td>";
echo "<td>$r1[2]</td>";
echo "<td>$r1[3]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
$qur2=mysql_query("select * from department_master where dept_id='$r1[8]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
echo "<td>$r1[9]</td>";
echo "<td>$r1[10]</td>";
echo "<td><a href='admin_view_emp_wise_applied_leave_report.php?empid=$r1[0]'>APPLIED LEAVE
DETAIL</a></td>";
echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Employee Found</h2>";
}
}
?>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>
Manager approved leave detail report

83
Code for Manager approved leave detail report

<?php
session_start();
include("admin_header.php");
include("conn.php");

?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">MANAGER APPROVED LEAVE DETAIL
REPORT</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
84
<div class="contact-form">

</div>
<!----- contact-form ------>
</div>
<div class="col-md-12 about-left">
<br/><br/><br/><br/><br/>
<?php

$res1=mysql_query("select * from leave_apply_master where leave_apply_status='1' and emp_id in (select


emp_id from emp_master where user_type='1')");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>APPLY DATE</th>
<th>LEAVE TYPE</th>
<th>EMPLOYEE NAME</th>
<th>MOBILE NO</th>
<th>LEAVE START DATE</th>
<th>LEAVE END DATE</th>
<th>LEAVE REASON</th>
<th>LEAVE STATUS</th>
<th>MANAGER NAME</th>
<th>REMARK</th>

</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";

echo "<td>$r1[1]</td>";
//echo "<td>$r1[2]</td>";
$qur2=mysql_query("select * from leave_master where l_type_id='$r1[2]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
$qur4=mysql_query("select * from emp_master where emp_id='$r1[3]'");
$q4=mysql_fetch_array($qur4);
echo "<td>$q4[1]</td>";
echo "<td>$q4[4]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
echo "<td>$r1[6]</td>";
if($r1[7]=="0")
{
echo "<td>LEAVE APPLIED</td>";
}else if($r1[7]=="1")
{
echo "<td>LEAVE APPROVED</td>";
}else if($r1[7]=="2")
{
echo "<td>LEAVE REJECTED</td>";
}

85
if($r1[8]=="0")
{
echo "<td>--------</td>";
}else{
$qur3=mysql_query("select * from emp_master where emp_id='$r1[8]'");
$q3=mysql_fetch_array($qur3);
echo "<td>$q3[1]</td>";
}
if($r1[9]=="")
{
echo "<td>--------</td>";
}else{

echo "<td>$r1[9]</td>";
}

echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Leave Applied</h2>";
}
?>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Manger rejected leave detail report

86
Code for Manger rejected leave detail report

<?php
session_start();
include("admin_header.php");
include("conn.php");

?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">MANAGER REJECTED LEAVE DETAIL REPORT</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">

</div>
<!----- contact-form ------>
</div>
87
<div class="col-md-12 about-left">
<br/><br/><br/><br/><br/>
<?php

$res1=mysql_query("select * from leave_apply_master where leave_apply_status='2' and emp_id in (select


emp_id from emp_master where user_type='1')");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>APPLY DATE</th>
<th>LEAVE TYPE</th>
<th>EMPLOYEE NAME</th>
<th>MOBILE NO</th>
<th>LEAVE START DATE</th>
<th>LEAVE END DATE</th>
<th>LEAVE REASON</th>
<th>LEAVE STATUS</th>
<th>MANAGER NAME</th>
<th>REMARK</th>

</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";

echo "<td>$r1[1]</td>";
//echo "<td>$r1[2]</td>";
$qur2=mysql_query("select * from leave_master where l_type_id='$r1[2]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
$qur4=mysql_query("select * from emp_master where emp_id='$r1[3]'");
$q4=mysql_fetch_array($qur4);
echo "<td>$q4[1]</td>";
echo "<td>$q4[4]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
echo "<td>$r1[6]</td>";
if($r1[7]=="0")
{
echo "<td>LEAVE APPLIED</td>";
}else if($r1[7]=="1")
{
echo "<td>LEAVE APPROVED</td>";
}else if($r1[7]=="2")
{
echo "<td>LEAVE REJECTED</td>";
}
if($r1[8]=="0")
{
echo "<td>--------</td>";
}else{
$qur3=mysql_query("select * from emp_master where emp_id='$r1[8]'");

88
$q3=mysql_fetch_array($qur3);
echo "<td>$q3[1]</td>";
}
if($r1[9]=="")
{
echo "<td>--------</td>";
}else{

echo "<td>$r1[9]</td>";
}

echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Leave Rejected</h2>";
}
?>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Department wise employee report


89
Code for department wise employee detail reports

<?php
include("admin_header.php");
include("conn.php");

if(isset($_POST['btnreport']))
{
$sdate=date("Y-m-d",strtotime($_POST['txtsdate']));
$edate=date("Y-m-d",strtotime($_POST['txtedate']));
}
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">DEPARTMENT WISE EMPLOYEE DETAIL
REPORT</a></center>
</div>
90
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">
<br/><br/><br/>
<form method="post" name="form2">

<div class="contact-form-row">
<div>
<span>Select Start Date</span>
<input type="date" class="text" name="txtsdate" value="<?php if(isset($sdate)){ echo $sdate; }else{ echo
date("Y-m-d"); } ?>" >
</div>
<div class="clearfix"> </div>
</div>
<div class="contact-form-row">
<div>
<span>Select End Date</span>
<input type="date" class="text" name="txtedate" value="<?php if(isset($edate)){ echo $edate; }else{ echo
date("Y-m-d"); } ?>" >
</div>
<div class="clearfix"> </div>
</div>
<input type="submit" value="DISPLAY REPORT" name="btnreport" onclick="return validate();">

</form>
</div>
<!----- contact-form ------>
</div>
<div class="col-md-12 about-left">
<br/><br/><br/><br/><br/>
<?php
if(isset($_POST['btnreport']))
{
$res1=mysql_query("select * from emp_master where user_type='1' and emp_id in(select emp_id from
leave_apply_master where leave_start_date>='$sdate' and leave_end_date<='$edate')");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>MANAGER ID</th>

91
<th>MANAGER NAME</th>
<th>ADDRESS</th>
<th>CITY</th>
<th>MOBILE NO</th>
<th>EMAIL ID</th>
<th>DEPARTMENT</th>
<th>GENDER</th>
<th>DESIGNATION</th>
<th>TOTAL LEAVE</th>
<th>APPLIED LEAVE DETAIL</th>
</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";
echo "<td>$r1[0]</td>";
echo "<td>$r1[1]</td>";
echo "<td>$r1[2]</td>";
echo "<td>$r1[3]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
$qur2=mysql_query("select * from department_master where dept_id='$r1[8]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
echo "<td>$r1[9]</td>";
echo "<td>$r1[10]</td>";
$qur3=mysql_query("select sum((DATEDIFF(leave_end_date,leave_start_date))+1) from
leave_apply_master where emp_id='$r1[0]' and leave_apply_status='1'");
$q3=mysql_fetch_array($qur3);
echo "<td>$q3[0]</td>";
echo "<td><a href='admin_view_emp_wise_applied_leave_report.php?empid=$r1[0]'>APPLIED LEAVE
DETAIL</a></td>";
echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Employee Found</h2>";
}
}
?>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Employee detail report:

92
Code for Employee detail report

<?php
session_start();
include("mgr_header.php");
include("conn.php");
?>
<div class="team-grids-caption">
.<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">EMPLOYEE DETAIL REPORT</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-12 about-left">
<?php
$mgrid=$_SESSION['mgrid'];
$res1=mysql_query("select * from emp_master where user_type='2' and dept_id=(select dept_id from
emp_master where emp_id='$mgrid')");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>MANAGER ID</th>
93
<th>MANAGER NAME</th>
<th>ADDRESS</th>
<th>CITY</th>
<th>MOBILE NO</th>
<th>EMAIL ID</th>
<th>DEPARTMENT</th>
<th>GENDER</th>
<th>DESIGNATION</th>
<th>APPLIED LEAVE DETAIL</th>
</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";
echo "<td>$r1[0]</td>";
echo "<td>$r1[1]</td>";
echo "<td>$r1[2]</td>";
echo "<td>$r1[3]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
$qur2=mysql_query("select * from department_master where dept_id='$r1[8]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
echo "<td>$r1[9]</td>";
echo "<td>$r1[10]</td>";
echo "<td><a href='mgr_view_emp_wise_applied_leave_report.php?empid=$r1[0]'>APPLIED LEAVE
DETAIL</a></td>";
echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Employee Found</h2>";
}
?>
</div>
<div class="col-md-6 about-left">
<br/><br/><br/><br/><br/>

</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Employee approved leave detail report:

94
Code for Employee approved leave detail report

<?php
session_start();
include("mgr_header.php");
include("conn.php");

?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">EMPLOYEE APPROVED LEAVE DETAIL
REPORT</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">

</div>
<!----- contact-form ------>
95
</div>
<div class="col-md-12 about-left">
<br/><br/><br/><br/><br/>
<?php
$mgrid=$_SESSION['mgrid'];
$res1=mysql_query("select * from leave_apply_master where leave_apply_status='1' and
mgr_id='$mgrid'");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>APPLY DATE</th>
<th>LEAVE TYPE</th>
<th>EMPLOYEE NAME</th>
<th>MOBILE NO</th>
<th>LEAVE START DATE</th>
<th>LEAVE END DATE</th>
<th>LEAVE REASON</th>
<th>LEAVE STATUS</th>
<th>MANAGER NAME</th>
<th>REMARK</th>

</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";

echo "<td>$r1[1]</td>";
//echo "<td>$r1[2]</td>";
$qur2=mysql_query("select * from leave_master where l_type_id='$r1[2]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
$qur4=mysql_query("select * from emp_master where emp_id='$r1[3]'");
$q4=mysql_fetch_array($qur4);
echo "<td>$q4[1]</td>";
echo "<td>$q4[4]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
echo "<td>$r1[6]</td>";
if($r1[7]=="0")
{
echo "<td>LEAVE APPLIED</td>";
}else if($r1[7]=="1")
{
echo "<td>LEAVE APPROVED</td>";
}else if($r1[7]=="2")
{
echo "<td>LEAVE REJECTED</td>";
}
if($r1[8]=="0")
{
echo "<td>--------</td>";
}else{

96
$qur3=mysql_query("select * from emp_master where emp_id='$r1[8]'");
$q3=mysql_fetch_array($qur3);
echo "<td>$q3[1]</td>";
}
if($r1[9]=="")
{
echo "<td>--------</td>";
}else{

echo "<td>$r1[9]</td>";
}

echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Leave Applied</h2>";
}
?>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Employee rejected leave detail report:

97
Code for Employee rejected leave detail report

<?php
session_start();
include("mgr_header.php");
include("conn.php");
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">MANAGER REJECTED LEAVE DETAIL REPORT</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">

</div>
<!----- contact-form ------>
</div>
<div class="col-md-12 about-left">
98
<br/><br/><br/><br/><br/>
<?php
$mgrid=$_SESSION['mgrid'];
$res1=mysql_query("select * from leave_apply_master where leave_apply_status='2' and
mgr_id='$mgrid'");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>APPLY DATE</th>
<th>LEAVE TYPE</th>
<th>EMPLOYEE NAME</th>
<th>MOBILE NO</th>
<th>LEAVE START DATE</th>
<th>LEAVE END DATE</th>
<th>LEAVE REASON</th>
<th>LEAVE STATUS</th>
<th>MANAGER NAME</th>
<th>REMARK</th>

</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";

echo "<td>$r1[1]</td>";
//echo "<td>$r1[2]</td>";
$qur2=mysql_query("select * from leave_master where l_type_id='$r1[2]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
$qur4=mysql_query("select * from emp_master where emp_id='$r1[3]'");
$q4=mysql_fetch_array($qur4);
echo "<td>$q4[1]</td>";
echo "<td>$q4[4]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
echo "<td>$r1[6]</td>";
if($r1[7]=="0")
{
echo "<td>LEAVE APPLIED</td>";
}else if($r1[7]=="1")
{
echo "<td>LEAVE APPROVED</td>";
}else if($r1[7]=="2")
{
echo "<td>LEAVE REJECTED</td>";
}
if($r1[8]=="0")
{
echo "<td>--------</td>";
}else{
$qur3=mysql_query("select * from emp_master where emp_id='$r1[8]'");
$q3=mysql_fetch_array($qur3);

99
echo "<td>$q3[1]</td>";
}
if($r1[9]=="")
{
echo "<td>--------</td>";
}else{

echo "<td>$r1[9]</td>";
}

echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Leave Rejected</h2><br/><br/><br/><br/>";
}
?>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

Employee total leave report:

100
Code for employee total leave report

<?php
session_start();
include("mgr_header.php");
include("conn.php");

if(isset($_POST['btnreport']))
{
$sdate=date("Y-m-d",strtotime($_POST['txtsdate']));
$edate=date("Y-m-d",strtotime($_POST['txtedate']));
}
?>
<div class="team-grids-caption">
<div class="container">

<div class="team-grids-caption-center">
<center><a class="team-btn" href="#">EMPLOYEE TOTAL LEAVE REPORT</a></center>
</div>
<div class="clearfix"> </div>
</div>
</div>

101
<div class="contact">
<div class="container">
<div class="contact-head text-center">

</div>
<!----- contact-grids ----->
<div class="contact-grids">
<div class="col-md-6 about-left">
<!----- contact-form ------>
<div class="contact-form">
<br/><br/><br/>
<form method="post" name="form2">

<div class="contact-form-row">
<div>
<span>Select Start Date</span>
<input type="date" class="text" name="txtsdate" value="<?php if(isset($sdate)){ echo $sdate; }else{ echo
date("Y-m-d"); } ?>" >
</div>
<div class="clearfix"> </div>
</div>
<div class="contact-form-row">
<div>
<span>Select End Date</span>
<input type="date" class="text" name="txtedate" value="<?php if(isset($edate)){ echo $edate; }else{ echo
date("Y-m-d"); } ?>" >
</div>
<div class="clearfix"> </div>
</div>
<input type="submit" value="DISPLAY REPORT" name="btnreport" onclick="return validate();">

</form>
</div>
<!----- contact-form ------>
</div>
<div class="col-md-12 about-left">
<br/><br/><br/><br/><br/>
<?php
if(isset($_POST['btnreport']))
{
$mgrid=$_SESSION['mgrid'];
$res1=mysql_query("select * from emp_master where user_type='2' and emp_id in(select emp_id from
leave_apply_master where leave_start_date>='$sdate' and leave_end_date<='$edate' and
mgr_id='$mgrid')");
if(mysql_num_rows($res1)>0)
{
echo "<table class='table table-bordered'>
<tr>
<th>EMPLOYEE ID</th>
<th>EMPLOYEE NAME</th>
<th>ADDRESS</th>
<th>CITY</th>

102
<th>MOBILE NO</th>
<th>EMAIL ID</th>
<th>DEPARTMENT</th>
<th>GENDER</th>
<th>DESIGNATION</th>
<th>TOTAL LEAVE</th>
<th>APPLIED LEAVE DETAIL</th>
</tr>";
while($r1=mysql_fetch_array($res1))
{
echo "<tr>";
echo "<td>$r1[0]</td>";
echo "<td>$r1[1]</td>";
echo "<td>$r1[2]</td>";
echo "<td>$r1[3]</td>";
echo "<td>$r1[4]</td>";
echo "<td>$r1[5]</td>";
$qur2=mysql_query("select * from department_master where dept_id='$r1[8]'");
$q2=mysql_fetch_array($qur2);
echo "<td>$q2[1]</td>";
echo "<td>$r1[9]</td>";
echo "<td>$r1[10]</td>";
$qur3=mysql_query("select sum((DATEDIFF(leave_end_date,leave_start_date))+1) from
leave_apply_master where emp_id='$r1[0]' and leave_apply_status='1'");
$q3=mysql_fetch_array($qur3);
echo "<td>$q3[0]</td>";
echo "<td><a href='admin_view_emp_wise_applied_leave_report.php?empid=$r1[0]'>APPLIED LEAVE
DETAIL</a></td>";
echo "</tr>";
}
echo "</table>";
}else{
echo "<h2>No Employee Found</h2>";
}
}
?>
</div>
</div>
<!----- contact-grids ----->
</div>
</div>
<!-- /Contact -->
</div>
<?php
include("footer.php");
?>

9)TESTING

103
REGISTRASTION:-

Fieldname Value message RESULT


Enter name Avish63 Invalid name avish
Address - Enter address Tithal valsad
Enter city - Enter city valsad
Mobile 95741228923 Enter only 10 digit 7041616445
Enter email Avish.com Enter valid email avish@gmail.com
Enter password 222 Enter password more tham 6 123456
character or digit
Enter user type - Select user type manager
Select department - Select dept sales
Enter designation - Enter desiganation employee
Select gender - Select gender Male

LOGIN:-

Fieldname Value message RESULT


Email_id chhowalaavish.com Invalid emailid Chhowalaavish9@gmai
l.com
Password - Enter password 1111111

LEAVE APPLY FORM :-

Fieldname Value message RESULT


Select leave type - Select leave type Sick leave
Enter leave start date - Select start date 10/04/2019
Enter leave end date - Select end date 12/04/2019
Enter leave reason - Enter reason Your leave is
approved..

CONCLUSION AND FUTURE ENHANCEMENT

As a future work, some additional stuff could be implemented and integrated into the application code
making it much more reliable and flexible; especially what concems apay-roll module, for instance

104
Apparently, the role of such systems is basic and essential within each company That wants to keep a
really good control and record concerning its personnal
data,functionality and performance on all levels in its structure. Every organization
nowadays, has the necessity of managing its staff on a really good level as the staff
has definitely the greatest merit of building up a company as such as it is.
The well managed employee means giving the appropriate financial award-ness and all
kind of benefits as such as they have been deserved. That's why the development of
such systems is not just a programming business a lot of people are ordinarily
involved in such projects and one of the basic requirements is the reliability of the
system,especially what concerns the storage of data and all of the operations that will
be performed upon it.

105
11)REFERENCE

 www.javapoint.com

 www.w3school.com

 www.stackoverflow.com

 www.tutorialspoint.com

 Book :- Essence of PHP

106

You might also like