Вы находитесь на странице: 1из 41

LEAVE MANAGEMENT SYSTEM

CHAPTER 1: Introduction
1.1 I NTRODUCTION TO PROJECT

There are a lot of traditional tools that help keep track of the different vacation
requests and leave applications in any management. One of the disadvantages with
using old tools are that they are ineffective and just eat away at the productivity and
efficiency of work that is done. They also demand too much of manual intervention
and are hence, not entirely reliable.
A leave management system optimizes and automates the entire process thus
increasing productivity, accuracy and reliability. It is also robust enough to
seamlessly handle all the stages involved in a leave management process
application, approval/rejection, filing leaves, managing leave balance, and analysis.
Leave manager project is a web based system which can be accessed by all the
students, faculties, Hod, and admin. This application is a automated system for
managing leaves related information of the students and the faculties. Both the
students and the faculties are provided with a unique user id and password for log in
to the application and send request for leave. The students request are managed by
the faculty, they may accept or reject or keep it in pending. Similarly, the HOD of
the department look after the faculty’s leave application, the HOD can either accept
or reject the leave application that is received in their module. This helps the
students and faculties to balance their leave, request leaves, view past leave history.
This application is very useful for any department, college or even any organizations
can take this up, where there are large number of students or employees. Also this
application have many features such as notification through email, leave
cancellation, and automated leave approval.

1.2 LITERATURE SURVEY

The goal or assessment is based on a system requirement in terms of Input,


processes, output, fields, programs and procedure. This can be quantified in terms of
volumes of data, trends, frequency of updating, etc. in order to estimate the new
system will perform adequately or not.

1
LEAVE MANAGEMENT SYSTEM

Technological feasibility is carried out to determine the capability, in terms of


software, hardware, personnel, and expertise, to handle the completion of the
project. Economic analysis is the most frequently used method for evaluation the
effectiveness of a new application. Most commonly known as cost/benefit analysis,
the procedure is to determine the benefits and savings that are expected from the
application. Also, operational feasibility is a measure of how well a proposed system
solves the problems, and takes advantage of the opportunities identified during
scope definition and how it satisfies the requirements.

1.2 PROBLEM DEFINITION

Leave manager web Application is very convenient to implement and easy to


understand. The need of designing such application is to provide the administration a
better way for scheduling and balancing work load by maintaining leave details of
the staff and students. It reduces the human efforts of checking the papers for leave
request manually or by mail and then maintaining it in folders and files.

1.3 OBJECTIVE
This project aims to do the following:
• 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 database, thereby reducing the chance of
data loss.
• To provide for an automated leave Management system that intelligently
adapts to manage the leaves and allows the faculty and students to apply for the
leaves with replacement of heavy workload.

1.4 HARDWARE AND SOFTWARE USED

2
LEAVE MANAGEMENT SYSTEM

Hardware Requirements  2GB RAM


 Main Server machine
Software Requirements
 XAMPP Server
 Web browser: Chrome

Platform  Cross platform web application

Programming Language/Tools Used  PHP v7.3.6, Javascript, HTML5,


CSS3, Bootstrap4, jQuery,Ajax,
my.Sql
CHAPTER 2: IMPLEMENTATION
2.1 FLOWCHART

Login:

3
LEAVE MANAGEMENT SYSTEM

Fig 2.1: Login Process

4
LEAVE MANAGEMENT SYSTEM

Student Module:

Fig 2.2: Student Module

5
LEAVE MANAGEMENT SYSTEM

Faculty Module:

Fig 2.3: Faculty Module

6
LEAVE MANAGEMENT SYSTEM

Admin Module:

Fig 2.4: Admin Module

7
LEAVE MANAGEMENT SYSTEM

2.2 Brief description of leave management system


The leave manager basically consists of four modules:
 Students
 Faculty
 HOD
 Admin
Students Module: The students logs into his interface, where he can check:
a. Personal leave details
b. Status of leave application
c. Place new requests for leave

Faculty Module: Faculty logs into his interface and can check for:
a. Check new application request
b. Check his leave details
c. Apply for leave application
d. Accepts/rejects leave application of the students

HOD module: Hod logs into his interface and check for:
a. Check new Faculty request
b. Accepts/request leave application of the faculty

Admin Module: Admin is responsible for updating and maintaining the student’s and
faculty’s records and uploading excel sheets.

8
LEAVE MANAGEMENT SYSTEM

3.3 Program/Pseudocode

indexStud.php:
<?php
session_start();
if (isset($_SESSION['uname'])) {
$uid = $_SESSION['uid'];
include("connect.php");

?>
<?php

if($_SESSION['desig']=='student'){

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

<head>

<!--[if lt IE 11]>
<script
src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script
>
<script
src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></scri
pt>
<![endif]-->
<!-- Meta -->
9
LEAVE MANAGEMENT SYSTEM

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-
scale=1.0, user-scalable=0, minimal-ui">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="Free Datta Able Admin
Template come up with latest Bootstrap 4 framework with basic
components, form elements and lots of pre-made layout options" />
<meta name="keywords" content="admin templates, bootstrap
admin templates, bootstrap 4, dashboard, dashboard templets, sass admin
templets, html admin templates, responsive, bootstrap admin templates
free download,premium bootstrap admin templates, datta able, datta able
bootstrap admin template, free admin theme, free dashboard template" />
<meta name="author" content="CodedThemes" />

<!-- Favicon icon -->


<link rel="icon" href="assets/images/favicon.ico" type="image/x-
icon">
<!-- fontawesome icon -->
<link rel="stylesheet"
href="assets/fonts/fontawesome/css/fontawesome-all.min.css">
<!-- animation css -->
<link rel="stylesheet"
href="assets/plugins/animation/css/animate.min.css">
<!-- vendor css -->
<link rel="stylesheet" href="assets/css/style.css">
<!-- user css-->
<link rel="stylesheet" href="assets/css/user-style.css">

10
LEAVE MANAGEMENT SYSTEM

</head>

<body>

<!-- [ Header ] start -->


<header class="navbar pcoded-header navbar-expand-lg navbar-
light header-lightblue mgb-10 " style="margin-left:0px;width: calc(100%
- 0px)">

<div class="collapse navbar-collapse">


<ul class="navbar-nav mr-auto">
<li class="pdr-10"><a href="javascript:" class="full-screen"
onclick="javascript:toggleFullScreen()"><i class="feather icon-
maximize"></i></a></li>
<li class="nav-item dropdown">
<a class="mb-1" href="logout.php">Logout</a>
</li>

</ul>
<ul class="navbar-nav ml-auto">
<li class="pdr-10">
<div class="dropdown">
<span class="label label-pill label-danger count"
style="border-radius:20px;"> </span>
<a class="dropdown-toggle dropdown-toggle-noti"
href="javascript:" data-toggle="dropdown"><i class="icon feather icon-
bell"></i></a>
<div class="dropdown-menu dropdown-menu-right
notification drop-noti">
11
LEAVE MANAGEMENT SYSTEM

</div>
</div>
</li>
<li>
<div class="dropdown drp-user">

<a href="javascript:" class="dropdown-toggle" data-


toggle="dropdown">
<i class="icon feather icon-settings"></i>
</a>
<div class="dropdown-menu dropdown-menu-right
profile-notification">
<div class="pro-head">
<img src="assets/images/user/avatar-1.jpg"
class="img-radius" alt="User-Profile-Image">
<span><?php echo ($_SESSION['uname']) ?
></span>
<a href="logout.php" class="dud-logout"
title="Logout">
<i class="feather icon-log-out"></i>
</a>
</div>

</div>
</div>
</li>
</ul>
12
LEAVE MANAGEMENT SYSTEM

</div>
</header>
<!-- [ Header ] end -->

<!-- [ Main Content ] start -->


<div class="main-container mgt-10 mgl-10 mgr-10">
<div class="wrapper mgl-10">
<div class="content">
<div class="inner-content">
<!-- [ breadcrumb ] start -->

<!-- [ breadcrumb ] end -->


<div class="main-body">
<div class="page-wrapper">
<!-- [ Main Content ] start -->
<div class="row mgl-10">

<div class="col-xl-8 col-md-6">


<div class="card Recent-Users">
<div class="card-header">
<h5>Recent Leave Requests</h5>
</div>
<div class="card-block px-0 py-3"
style="overflow:auto;max-height:1000px;">
<div class="table-responsive">
<table class="table table-hover"
id="res1">
<!--[Ajax call for Recent Users ] -->
13
LEAVE MANAGEMENT SYSTEM

</table>
</div>
</div>
</div>
</div>
<!--[ Recent Users ] end-->

<!-- [ statistics year chart ] start -->


<div class="col-xl-4 col-md-6">
<div class="card card-event">
<div class="card-block">
<div class="row align-items-center
justify-content-center">
<div class="col">
<h5 class="m-0">Upcoming
Holiday</h5>
</div>

</div>
<h2 class="mt-3 f-w-300">10th OCT<sub
class="text-muted f-14">Diwali</sub>
</h2>
<h6 class="text-muted mt-4 mb-0">9.00
p.m - Diwali Party </h6>
<i class="fab fa-angellist text-c-purple f-
50"></i>
</div>
</div>
14
LEAVE MANAGEMENT SYSTEM

<div class="card">
<div class="card-block border-bottom">
<div class="row d-flex align-items-
center">
<div class="col-auto">
<i class="feather icon-zap f-30 text-
c-green"></i>
</div>
<div class="col">
<h3 class="f-w-300">
<?php
$getLeaveTaken_query =
"SELECT LeaveTaken FROM user WHERE user_id='$uid'";
$getLeaveTaken_result =
mysqli_query($connect, $getLeaveTaken_query);
if
(mysqli_num_rows($getLeaveTaken_result) > 0) {
while ($LeaveTaken_row =
mysqli_fetch_array($getLeaveTaken_result)) {
echo
$LeaveTaken_row['LeaveTaken'];
}
}
?>
</h3>
<span class="d-block text-
uppercase">LEAVES TAKEN</span>
</div>
</div>
15
LEAVE MANAGEMENT SYSTEM

</div>
<div class="card-block">
<div class="row d-flex align-items-
center">
<div class="col-auto">
<i class="feather icon-zap f-30 text-
c-green"></i>
</div>
<div class="col">
<h3 class="f-w-300">
<?php
$getLeaveTaken_query =
"SELECT balanceLeave FROM user WHERE user_id='$uid'";
$getLeaveTaken_result =
mysqli_query($connect, $getLeaveTaken_query);
if
(mysqli_num_rows($getLeaveTaken_result) > 0) {
while ($LeaveTaken_row =
mysqli_fetch_array($getLeaveTaken_result)) {
echo
$LeaveTaken_row['balanceLeave'];
}
}
?>

</h3>
<span class="d-block text-
uppercase">LEAVES LEFT</span>
</div>
16
LEAVE MANAGEMENT SYSTEM

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

<div class="col-lg-8">
<div class="card">
<div class="card-header">
<h5> LEAVE FORM</h5>
</div>
<div class="card-body">

<div class="row">
<div class="col-lg-6">
<form method="post"
id="leave_form" action="./insertStud.php">
<div class="form-group">
<label>Mentor</label>
<input type="text" class="form-
control" placeholder="Mentor">
</div>
<div class="form-group">
<label
for="exampleFormControlSelect1">Faculty
substitute</label>
<select class="form-control"
name="name" id="name" required>
<option disabled selected
value="NULL">Select Teacher</option>
17
LEAVE MANAGEMENT SYSTEM

<?php

$teachers_sql =
"SELECT name FROM user WHERE designation='faculty'";
$teachers_result =
mysqli_query($connect, $teachers_sql);
$trail =
$teachers_result;
if
(mysqli_num_rows($teachers_result) > 0) {
while ($teacher
= mysqli_fetch_array($teachers_result)) {
?>
<option
value="<?php echo $teacher['name']; ?>"><?php echo
$teacher['name']; ?></option>
<?php
}
}
?>
</select>
</div>

<div class="form-group">
<label for="fromDate">From-
Date</label>
<input type="date"
class="form-control" name="fromDate" id="fromDate" required>
</div>
18
LEAVE MANAGEMENT SYSTEM

<div class="form-group">
<label for="toDate">To-
Date</label>
<input type="date"
class="form-control" name="toDate" id="toDate" required>
</div>

</div>
<div class="col-lg-6">

<div class="form-group">
<label>Subject</label>
<input type="text" class="form-
control" name="subject" id="subject" placeholder="Subject" required>
</div>

<div class="form-group">
<label for="reason">Reason for
absence</label>
<textarea class="form-control"
name="reason" id="reason" rows="5" required></textarea>
</div>

</div>

<div class="col-lg-6">
19
LEAVE MANAGEMENT SYSTEM

<input type="submit" class="btn


btn-primary" value="Submit" name="post" id="post">

</div>
</div>

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

<!-- Required Js -->


<script src="assets/js/vendor-all.min.js"></script>
<script
src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<script src="assets/js/pcoded.min.js"></script>
<script>
$(document).ready(function() {

function load_unseen_notification(view = '') {


$.ajax({
url: "fetchStud.php",
20
LEAVE MANAGEMENT SYSTEM

method: "POST",
data: {
view: view
},
dataType: "json",
success: function(data) {
$('.drop-noti').html(data.notification);
load_unseen_requests();
if (data.unseen_notification > -1) {
$('.count').html(data.unseen_notification);
}
}
});
}
function load_unseen_requests(view = '') {
$.ajax({
url: "req_dis_stud.php",
method: "POST",
data: {
view: view
},
dataType: "json",
success: function(data) {
$('#res1').html(data.output);
}
});
}
load_unseen_notification();
load_unseen_requests();
21
LEAVE MANAGEMENT SYSTEM

$(document).on('click', '.dropdown-toggle-noti', function() {


$('.count').html('');
load_unseen_notification('yes');
});
setInterval(function() {
load_unseen_notification();

}, 2000);
});
</script>
</body>
</html>
<?php
} else {
echo '<script>window.location.href = "404.html";</script>';
}
?>
<?php
} else {
echo '<script>window.location.href = "./login.html";</script>';
}
?>

req_dis.php

<?php

session_start();
if (isset($_SESSION['uname']))
22
LEAVE MANAGEMENT SYSTEM

{
$uid = $_SESSION['uid'];
$uname = $_SESSION['uname'];

include('connect.php');

$output = '';
$output .= '<tbody>';
$output1 = '';
$output1 .= '<tbody>';
if ($_SESSION['desig'] != 'hod') {
$query = "SELECT * FROM leaveapplication where
facultyApproval = '" . $uname . "' ORDER BY application_id
DESC";//student leave req
$result = mysqli_query($connect, $query);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_array($result)) {
$query1 = "SELECT name from `user`,`leaveapplication`
WHERE user.user_id = '".$row['user_id']."'";

$result1 = mysqli_query($connect, $query1);


$s = mysqli_fetch_array($result1);
$name = $s['name'];

$rejid = 'rej' . $row["application_id"];


$acpid = "acp" . $row["application_id"];

$orifrom=$row['fromDate'];
$orito=$row['toDate'];
23
LEAVE MANAGEMENT SYSTEM

$t_from = strtotime($orifrom);
$t_to = strtotime($orito);
$new_from = date("d-m-Y", $t_from);
$new_to = date("d-m-Y", $t_to);

$output .= '<tr class="unread">


<td><img class="rounded-circle" style="width:40px;"
src="assets/images/user/avatar-1.jpg"
alt="activity-user"><br>'.$name.'</td>
<td>

<h6 class="mb-1">' . $row["subjectOfLeave"] . '</h6>


<p class="m-0" style="max-width:500px;margin: auto;">' .
$row["reason"] . '</p>
</td>
<td>
<h6 class="text-muted"><i
class="fas fa-circle text-c-green f-10 m-r-15"></i>' .
$new_from . '</h6><h6 class="text-muted"><i
class="fas fa-circle text-c-red f-10 m-r-15"></i>' .
$new_to . '</h6>
</td>
<td><form id=' . $row["application_id"] . '>';
if ($row['leaveStatus'] == 1) {
$output .= '<button class="label theme-bg text-white f-15 "
id=' . $acpid . ' value=' . $acpid . ' name="accpt" disabled disabled
>Accepted</button></a>
</li></form>';
24
LEAVE MANAGEMENT SYSTEM

}
if ($row['leaveStatus'] == -1) {
$output .= '<button class="label theme-bg2 text-white f-15 "
id=' . $rejid . ' value=' . $rejid . ' name="reject" disabled
>Rejected</button></a>
</li></form>';
}
if ($row['leaveStatus'] == 0) {
$output .= '<button class="label theme-bg text-white f-15
leave-button" id=' . $acpid . ' value=' . $acpid . ' name="accpt"
>Accept</button></a>';

$output .= '<button class="label theme-bg2 text-white f-15


leave-button" id=' . $rejid . ' value=' . $rejid . ' name="reject"
>Reject</button></a>
</li></form>

</a>
';
}
$output .= '</td>
</tr></tbody>';
}
} else {
$output .= '<tr class="unread">

<td>

<h6 class="mb-1">No Requests</h6>


25
LEAVE MANAGEMENT SYSTEM

</td>

</tr></tbody>';
}
$query = "SELECT * FROM leaveapplication where user_id='".
$uid."' ORDER BY application_id DESC";
$result = mysqli_query($connect, $query);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_array($result)) {
$orifrom=$row['fromDate'];
$orito=$row['toDate'];
$t_from = strtotime($orifrom);
$t_to = strtotime($orito);
$new_from = date("d-m-Y", $t_from);
$new_to = date("d-m-Y", $t_to);
$output1 .= '<tr class="unread">
<td><img class="rounded-circle" style="width:40px;"
src="assets/images/user/avatar-1.jpg"
alt="activity-user"></td>
<td>

<h6 class="mb-1">' . $row["subjectOfLeave"] . '</h6>


<p class="m-0" style="max-width:400px;margin: auto; word-
wrap: break-word;white-space: initial" >' . $row["reason"] . '</p>
</td>
<td>
<h6 class="text-muted"><i

26
LEAVE MANAGEMENT SYSTEM

class="fas fa-circle text-c-green f-10 m-r-15"></i>' .


$new_from . '</h6><h6 class="text-muted"><i
class="fas fa-circle text-c-red f-10 m-r-15"></i>' . $new_to .
'</h6>
</td>
<td> <button type="button" class="label label-info text-white f-15"
data-toggle="modal" data-target="#myModal" id='.
$row['application_id'].'
onClick="detail_show(this.id)">INFO</button></td>

<td>';
if ($row['leaveStatus'] == 1) {
$output1 .= '<button class="label theme-bg text-white f-15"
disabled >Accepted</button></a>
</li></form>';
}
if ($row['leaveStatus'] == -1) {
$output1 .= '<button class="label theme-bg2 text-white f-
15" disabled >Rejected</button></a>
</li></form>';
}
if ($row['leaveStatus'] == 0) {
$output1 .= '<button class="label label-warning theme-bg3
text-white f-15" disabled >Pending..</button>

</form><br></a>
</li>';
}
$output1 .= '</td>
27
LEAVE MANAGEMENT SYSTEM

</tr></tbody>';
}
} else {
$output1 .= '<tr class="unread">

<td>

<h6 class="mb-1">No Requests</h6>

</td>

</tr></tbody>';
}
}
if ($_SESSION['desig'] == 'hod') {
$query = "SELECT * FROM leaveapplication where hodStatus=1
ORDER BY application_id DESC";
$result = mysqli_query($connect, $query);
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_array($result)) {
$query1 = "SELECT name from `user`,`leaveapplication`
WHERE user.user_id = '".$row['user_id']."'";

$result1 = mysqli_query($connect, $query1);


$s = mysqli_fetch_array($result1);
$name = $s['name'];
$orifrom=$row['fromDate'];
$orito=$row['toDate'];
$t_from = strtotime($orifrom);
28
LEAVE MANAGEMENT SYSTEM

$t_to = strtotime($orito);
$new_from = date("d-m-Y", $t_from);
$new_to = date("d-m-Y", $t_to);

$rejid = 'rej' . $row["application_id"];


$acpid = "acp" . $row["application_id"];
$output .= '<tr class="unread">
<td><img class="rounded-circle" style="width:40px;"
src="assets/images/user/avatar-1.jpg"
alt="activity-user"><br>'.$name.'</td>
<td>

<h6 class="mb-1">' . $row["subjectOfLeave"] . '</h6>


<p class="m-0" style="max-width:500px;margin: auto;">' .
$row["reason"] . '</p>
</td>
<td>
<h6 class="text-muted"><i
class="fas fa-circle text-c-green f-10 m-r-15"></i>' .
$new_from . '</h6><h6 class="text-muted"><i
class="fas fa-circle text-c-red f-10 m-r-15"></i>' .
$new_to . '</h6>
</td>
<td> <button type="button" class="label label-info text-white f-
15" data-toggle="modal" data-target="#myModal" id='.
$row['application_id'].'
onClick="detail_show(this.id)">INFO</button></td>
<td><form id=' . $row["application_id"] . '>';

29
LEAVE MANAGEMENT SYSTEM

if ($row['leaveStatus'] == 1) {
$output .= '<button class="label theme-bg text-white f-15 "
id=' . $acpid . ' value=' . $acpid . ' name="accpt" disabled disabled
>Accepted</button></a>
</li></form>';
}
if ($row['leaveStatus'] == -1) {
$output .= '<button class="label theme-bg2 text-white f-15 "
id=' . $rejid . ' value=' . $rejid . ' name="reject" disabled
>Rejected</button></a>
</li></form>';
}
if ($row['leaveStatus'] == 0) {
$output .= '<button class="label theme-bg text-white f-15
leave-button" id=' . $acpid . ' value=' . $acpid . ' name="accpt"
>Accept</button></a>';

$output .= '<button class="label theme-bg2 text-white f-15


leave-button" id=' . $rejid . ' value=' . $rejid . ' name="reject"
>Reject</button></a>
</li></form>

</a>
';
}
$output .= '</td>
</tr></tbody>';
}
}
30
LEAVE MANAGEMENT SYSTEM

else {
$output .= '<tr class="unread">

<td>

<h6 class="mb-1">No Requests </h6>


</td>
</tr></tbody>';
}
}
$data = array(
'output' => $output,
'output1' => $output1,
);
echo json_encode($data);
}
?>
verifyAccount.php
<?php

include("connect.php");

session_start();

$uid=$_POST['uid'];
$password=$_POST['pass'];

$query = "SELECT * FROM login WHERE user_id = '".$uid."'";


31
LEAVE MANAGEMENT SYSTEM

$result = mysqli_query($connect, $query);

$data = array();

if(mysqli_num_rows($result) > 0)
{
//
$2y$10$VPdsbHC1XYkgp0.629QWq.Cu4.gzvcn6kuRLuxctTItkSXBa56
eLq
$row = mysqli_fetch_assoc($result);
if(password_verify($password,
$row['password'])/*$password==$row['password']*/)
{
//password valid
$uquery = "SELECT * FROM user where user_id = '".$uid."'" ;
$uresult = mysqli_query($connect, $uquery);
$urow = mysqli_fetch_assoc($uresult);

$_SESSION['uname'] =$urow['name'];
$_SESSION['uid']=$urow['user_id'];
$_SESSION['desig']=$urow['designation'];
if($urow['designation']=="faculty")
{
echo '<script>window.location.href = "./index.php";</script>';
}
if( $urow['designation']=="hod")
{
32
LEAVE MANAGEMENT SYSTEM

echo '<script>window.location.href = "./indexH.php";</script>';


}
if( $urow['designation']=="admin")
{
echo '<script>window.location.href = "./indexAdmin.php";</script>';
}
else
{
echo '<script>window.location.href = "./indexStud.php";</script>';
}

}
else
{
echo '<script language="javascript">';
echo 'alert("Wrong Password")';
echo '</script>';
echo '<script>window.location.href = "./login.html";</script>';
}

Connect.php
<?php
//connect.php;
$connect = mysqli_connect("localhost", "root", "", "dummydb");
?>
SQL FILE:

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";


33
LEAVE MANAGEMENT SYSTEM

SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";

--
-- Database: `dummydb`
--

CREATE TABLE `leaveapplication` (


`application_id` int(11) NOT NULL,
`user_id` varchar(14) NOT NULL,
`fromDate` date NOT NULL,
`toDate` date NOT NULL,
`subjectOfLeave` varchar(25) NOT NULL,
`reason` varchar(100) NOT NULL,
`typeLeave` varchar(15) NOT NULL,
`inchargeFaculty` varchar(20) DEFAULT NULL,
`facultyApproval` varchar(15) NOT NULL,
`leaveStatus` int(1) NOT NULL DEFAULT 0,
`hodStatus` int(1) NOT NULL DEFAULT 0,
`notification_status` int(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `login` (


`user_id` varchar(14) NOT NULL,
`password` varchar(70) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `managefaculty` (

34
LEAVE MANAGEMENT SYSTEM

`application_id` int(11) NOT NULL,


`date` date NOT NULL,
`period1` varchar(15) NOT NULL,
`period2` varchar(15) NOT NULL,
`period3` varchar(15) NOT NULL,
`period4` varchar(15) NOT NULL,
`period5` varchar(15) NOT NULL,
`period6` varchar(15) NOT NULL,
`period7` varchar(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `resetpassword` (


`id` int(50) NOT NULL,
`email` varchar(25) NOT NULL,
`token` varchar(15) NOT NULL,
`token_expiry` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `user` (


`user_id` varchar(14) NOT NULL,
`name` varchar(25) NOT NULL,
`designation` varchar(12) NOT NULL,
`email` varchar(40) NOT NULL,
`LeaveTaken` int(10) NOT NULL DEFAULT 0,
`balanceLeave` int(10) NOT NULL DEFAULT 12,
`department` varchar(10) NOT NULL,
`mobile` bigint(10) NOT NULL,
`joinDate` int(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `leaveapplication`

35
LEAVE MANAGEMENT SYSTEM

ADD PRIMARY KEY (`application_id`),


ADD KEY `userFKApplication` (`user_id`);

ALTER TABLE `login`


ADD UNIQUE KEY `password` (`password`),
ADD KEY `userFK` (`user_id`);

ALTER TABLE `managefaculty`


ADD PRIMARY KEY (`application_id`,`date`);

ALTER TABLE `resetpassword`


ADD PRIMARY KEY (`id`),
ADD KEY `reset_mail_FK` (`email`);

ALTER TABLE `user`


ADD UNIQUE KEY `user_id` (`user_id`),
ADD UNIQUE KEY `email` (`email`);

ALTER TABLE `leaveapplication`


MODIFY `application_id` int(11) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT=46;

ALTER TABLE `resetpassword`


MODIFY `id` int(50) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT=31;

ALTER TABLE `leaveapplication`


ADD CONSTRAINT `userFKApplication` FOREIGN KEY (`user_id`)
REFERENCES `user` (`user_id`) ON DELETE CASCADE ON UPDATE
CASCADE;

ALTER TABLE `login`

36
LEAVE MANAGEMENT SYSTEM

ADD CONSTRAINT `userFK` FOREIGN KEY (`user_id`) REFERENCES `user`


(`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;

ALTER TABLE `managefaculty`


ADD CONSTRAINT `appli_id` FOREIGN KEY (`application_id`) REFERENCES
`leaveapplication` (`application_id`) ON DELETE CASCADE ON UPDATE
CASCADE,
ADD CONSTRAINT `application_id_leave` FOREIGN KEY (`application_id`)
REFERENCES `leaveapplication` (`application_id`) ON DELETE CASCADE ON
UPDATE CASCADE;

ALTER TABLE `resetpassword`


ADD CONSTRAINT `reset_mail_FK` FOREIGN KEY (`email`) REFERENCES
`user` (`email`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

CHAPTER 4: RESULT AND CONCLUSION

37
LEAVE MANAGEMENT SYSTEM

Fig 4.1 Login

Fig 4.2 Student module

38
LEAVE MANAGEMENT SYSTEM

Fig 4.3 Faculty module

Fig 4.4 HOD module

39
LEAVE MANAGEMENT SYSTEM

Fig 4.5 Admin module

Fig 4.6 ER Diagram

4.1 Conclusion and Future Scope

40
LEAVE MANAGEMENT SYSTEM

This Leaver manager application would help various types of organisations with multiple
hierarchies in reducing paperwork, help achieve error free tabulation and calculation of
leaves.

FUTURE SCOPE:

 Every employees individual leave record can be tabulated in a pie chart format to
ascertain his/her performance during the working session.
 The summarised data generated by this system can be further provided to different
departments, for example, to calculate the fine for shortage of attendance, to
deduct from the salaries of the faculties.

41

Вам также может понравиться