You are on page 1of 78

Leave Management System

A project report submitted in partial fulfillment of the requirements for the award of the degree of BACHELOR OF TECHNOLOGY IN COMPUTER SCIENCE & ENGINEERING
Presented by: P.Srilakshmi M.Vamsi P.Lahari P.Yamini T.Prasanna (08501A0588) (08501A0567) (08501A0589) (08501A0586) (08501A05B3)

Under the esteemed guidance of Mr.B.Srinivasa Rao , M.Tech (Ph.D), Sr.Asst. Professor
Department of CSE

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING PRASAD V. POTLURI SIDDHARTHA INSTITUTE OF TECHNOLOGY (Affiliated to JNTU:Kakinada, Approved by AICTE) (An ISO certified and NBA accredited institution) Kanuru, Vijayawada 520007.


(Affiliated to JNTU:Kakinada, Approved by AICTE) (An ISO certified and NBA accredited institution) Kanuru, Vijayawada 520007

This is to certify that this project entitled Leave Management System is a bonafide work carried out by P.SRILAKSHMI(08501A0588) , M.VAMSI(08501A0567)

P.LAHARI(08501A0589) , P.YAMINI(08501A0586) , T.PRASANNA(08501A05B3) in the partial

fulfilment for the award of degree of Bachelor of Technology in Computer Science and Engineering of JNTU, Kakinada during the year 2011-2012.

Signature of the Guide Mr.B.Srinivasa Rao, M.Tech(Ph.D) Sr.Asst.Professor, Dept. of CSE





Dr.K.NAGESWARARAO,M.Tech,Ph.D Head,Dept. of CSE


The satisfaction that accompanies the successful completion of any task would be incomplete without a mention of the people, who made it possible and whose guidance and encouragement crown all the efforts with success. We wish to place on record our profound gratitude to Dr.P.Venkateswarlu, Principal, PVP Siddhartha Institute of Technology, Kanuru, Vijayawada for having given us the opportunity to complete this project successfully. We reckon to a distant pleasure to endorse out indebtedness and deep sense of gratitude to Dr. K. Nageswara Rao, Head, Department of Computer Science and Engineering, for his encouragement in all endeavours. We sincerely thank our guide Mr.B.Srinivasa Rao for the guidance and support. We thank for timely suggestions and constant encouragement that boosted up our moral and to the accomplishment of this project. We are very much grateful to all the staff and faculty of Department of CSE for their cooperation during the course of this project work. Finally we would like to express our sincere thanks to each and every one of our college, who have contributed their help and guidance for the successful completion of this project.



2.1 Project overview

9 11

3.1 Problem Definition 3.2 Existing System 3.3 Proposed System


4.1 Hardware Requirements 4.2 Software Requirements 4.3 Feasibility Study


5.1 Use Case Diagrams 5.2 Class Diagram 5.3 Sequence Diagrams


6.1 Data Dictionary 6.2 Tables


7.1 Software Design 7.2 Module Design 7.2.1 HOD Module 7.2.2 Employee Module


7.3 Input/output Design 7.3.1 Input design 7.3.2 Output design



9.1 Testing Types 9.2 Test Cases









1 2 3 4 5 5.1 5.2 5.3.1 5.3.2 5.3.3

Use Case Diagram for Administrator Class Diagram for Leave Management System Sequence Diagram for Applying a leave Sequence Diagram for Accepting a leave Sequence Diagram for Rejecting a leave

20 21 23 24 25


1 2 3 4

6.2.1 6.2.2 6.2.3 6.2.4

Leaves Approved Leaves Employees Employee Leave Balance

28 28 29 30



Leave Management System is intended to manage the details of faculty of a college. It also serves the need of managing leaves of the faculty. This project is aimed at developing an online leave management system that is of importance to either an organisation or a college. The Leave Management System (LMS) is an Intranet based application that can be accessed throughout the organisation or a specified group/Dept. This system can be used to automate the workflow of leave applications and their approvals. The periodic crediting of leave is also automated. There are features like email notifications, cancellation of leave, automatic approval of leave, report generators etc in this system.There will be two types of users of this system: HOD and staff. The administrator will be able to do the functions such as

creating/editing/deleting the employee details. The employee can edit his own details and apply leaves which are to be approved by his supervisors. Once an employee applies for a leave, the HOD of the respective department has to decide whether to approve the leave or not based on priority. The user can use the module for applying leave or as approving authority or as Leave Management System administrator for sanctioning the leave. Through Leave Management System it will be also possible to cancel a leave already applied for or to extend the leaves of an employee. All the application, approval, rejection of the leaves will be done by the email reducing the paperwork.


2.1 Project overview

Leave Management System is intended to manage the details of employees of an organization. It also serves the need of managing leaves of the employees. It is designed to maintain the leave records of employee of and allows the user to apply different kind of leave permissible. There will be two types of users of this system: an Administrator and employee. The administrator will be able to do the functions such as creating/editing/deleting the employee details. The employee can edit his own details and apply leaves which are to be approved by his supervisors. Once an employee applies for a leave, system has to decide whether to approve the leave or not based on priority.

This project is mainly divided into 2 modules for proper functioning. They are 1. HOD module 2. Employee module





3.1 Problem Definition This project is developed for providing the services like online services to the employees and recruiting paper work. Automating many of the tasks, thereby reducing tedious jobs like managing the leaves.

3.2 Existing System

In the present system all work is done on paper. The whole leave management session leave is stored in register and at the end of the session the leaves are approved.

Disadvantages Not User Friendly:- The existing system is not user friendly because the retrieval of data is very slow and data is not maintained efficiently. Manual control:- As the leaves are approved manually, there is greater chance of errors. Lots of paperwork:- Existing system requires lot of paper work. Loss of even a single register/record led to difficult situation because all the papers are needed. Time consuming:- Every work is done manually so we cannot generate report in the middle of the session or as per the requirement because it is very time consuming.

3.3 Proposed System

In this proposed system, all the data is stored into the computer on applying leaves by the staff. So leaves can be approved easily by the HOD of the respective department using the faculty data. At the same time the employee can view the status of his request. 12

Advantages User Friendly: The proposed system is user friendly because the retrieval and storing of data is fast and data is maintained efficiently. Moreover the graphical user interface is provided in the proposed system, which provides user to deal with the system very easily. Very less paper work: The proposed system requires very less paper work. All the data is feted into the computer immediately and leaves can be applied and approved through computers. Moreover work becomes very easy because there is no need to keep data on papers. Computer operator control: Computer operator control will be there so no chance of errors. Moreover storing and retrieving of information is easy. So work can be done speedily and in time.





Leave Resource Information System service is a network based application. When we talk about hardware and software, we have to mention requirements on both sides client and server part.

4.1 Hardware Requirements

Processor Ram Cache Hard disk

: : : :

Pentium-III(or) Higher 128MB (or) Higher 512MB 10GB

4.1.1 Hardware Requirements

4.2 Software Requirements : : : Tomcat 5.0 Java, PHP Hyper Text Markup Language, Cascading Style Sheets, Java Script Database Server Operating System : : My SQL Windows (or) Linux (or) Mac any version

Web Server Server-side Technologies Client-side Technologies

4.2.1 Software Requirements


4.3 Feasibility Study The next step in analysis is to verify the feasibility of the proposed system. All projects are feasible given unlimited resources and infinite time. But in reality both resources and time are scarce. Project should confirm to time bounce and should be optimal in their consumption of resources. This places a constant approval of any project. Feasibility has applied to Leave Management System pertains to the following areas: Technical feasibility Behavioural feasibility Economical feasibility

Technical Feasibility To determine whether the proposed system is technically feasible, we should take into consideration the technical issues involved behind the system. Leave Management System uses the web technologies, which is rampantly employed these days worldwide. The world without the web is incomprehensible today. The technical requirement for the system is economic and it does not use any other additional Hardware. That goes to proposed system is technically feasible Behavioural Feasibility The system working is quite easy to use and learn due to its simple but attractive interface. User requires no special training for operating the system. The system is also time effective because the leave management is automated as per the user requirement. The result obtained contains minimum errors and are highly accurate as the data is required. Economic Feasibility To decide whether a project is economically feasible, we have to consider various factors as: Cost benefit analysis Long-term returns Maintenance costs

The proposed Enterprise Resource Information System is computer based. It requires average computing capabilities and access to internet, which are very basic requirements and can be 16

afforded by any organization hence it doesnt incur additional economic overheads, which renders the system economically feasible.The system being developed is economic with respect to School or Collages point of view. It is cost effective in the sense that has eliminated the paper work completely. .





The Unified Modelling Language (UML) is a graphical language for visualizing, specifying, constructing, and documenting the artifacts of a software intensive system. The UML gives us a standard way to write a systems blueprints, covering conceptual things, such as business processes and system functions, as well as classes written in a specific programming language, database schemas, and reusable software components.

5.1 USECASE DIAGRAMS Use Case diagrams are one of the five diagrams in UML for modelling the dynamic aspects of systems. Use case diagrams are central to modelling the behaviour of a system, a subsystem, or a class. Actors are external entities that interact with the system. Examples of actors include users like client, administratoretc., or another system like central database. The overview of the whole project through use case diagram is as follows:




A class diagram shows a set of classes, interfaces, and collaborations and their relationships. Class diagrams are used to illustrate the static design view of a system.

Fig 5.2 Class Diagram for Enterprise Resource Information System 21


A sequence diagram is an interaction diagram that emphasizes the time ordering of messages. Graphically, a sequence diagram is a table that shows objects arranged along X axis and messages, ordered in increasing time along the Y axis. It contains the object life line that represents the existence of an object over a period of time. There is a focus of control that shows the period of time during which an object is performing an action, either directly or through a subordinate procedure.

5.3.1 APPLY LEAVE 22

Fig 5.3.1 Sequence Diagram for Applying a leave


Fig 5.3.2 Sequence Diagram for Approving a leave



Fig 5.3.3 Sequence Diagram for Rejecting a leave




A database is a collection of interrelated data stored with the minimum redundancy to serve many users quickly and efficiently. The general objective is to make information access quick, in expensive and flexible for the user. The tables are organized

To reduce data duplication and hence inconsistency. To enable the efficient storage and retrieval.

6.1 DATA DICTIONARY Introduction to the Data Dictionary One of the most important parts of an Oracle database is its data dictionary, which is a read-only set of tables that provides information about the database. A data dictionary contains: The definitions of all schema objects in the database (tables, procedures, functions, packages and so on) How much space has been allocated for, and is currently used by, the schema objects Default values for columns Integrity constraint information The names of Oracle users It provides domain information. Other general database information


Table Name: Leave 1. 2. 3. 4. 5. 6. 7.

Field Name Leave ID Employee ID From Date To Date No.of Days Leave Type Status

Data Type Varchar2 Varchar2 Date Date Number Varchar2 Varchar2

Size 10 10 10 10 3 20 10

Constraints Primary Key Not Null Not Null Not Null Not Null Not Null Not Null

6.2.1 Leaves

Table Name: Approved Leaves 1.

Field name Leave ID

Data Type Varchar2

Size 10

Constraints Primary Key 28

2. 3. 4. 5. 6.

Emp ID From Date To Date No.of days Leave Type

Varchar2 Date Date Varchar2 Varchar2

10 10 10 10 20

Foreign Key Not Null Not Null Not Null Not Null

6.2.2 Approved Leaves

Table Name: Employee 1 2 3 4 5 6 7 8 9 10

Field Name emp_id Emp name Password Designation Date of join Gender Department Address Phone Email

Data Type Varchar2 Varchar2 Varchar2 Varchar2 Date Varchar2 Varchar2 Varchar2 Number Varchar2
6.2.4 Employee

Size 10 20 20 20 20 20 10 100 15 30

Constraints Primary Key Not Null Not Null Not Null Not Null Not Null Not Null Not Null Not Null Not Null

Table Name: Employee Leave Balance

Field Name

Data Type


Constraints 29

1 2 3 4 5

Emp ID CL HPL EL Others

Varchar2 Number Number Number Number

6.2.5 Leave Balance

15 3 3 3 3

Primary Key Not Null Not Null Not Null Not Null




System design is transition from a user oriented document to programmers or data base personnel. The design is a solution, how to approach to the creation of a new system. This is composed of several steps. It provides the understanding and procedural details necessary for implementing the system recommended in the feasibility study. Designing goes through logical and physical stages of development, logical design reviews the present physical system, prepare input and output specification, details of implementation plan and prepare a logical design walkthrough.

The database tables are designed by analyzing functions involved in the system and format of the fields is also designed. The fields in the database tables should define their role in the system. The unnecessary fields should be avoided because it affects the storage areas of the system. Then in the input and output screen design, the design should be made user friendly. The menu should be precise and compact.

7.1 Software Design

In designing the software following principles are followed: 1. Modularity and partitioning: software is designed such that, each system should consists of hierarchy of modules and serve to partition into separate function. 2. Coupling: modules should have little dependence on other modules of a system. 3. Cohesion: modules should carry out in a single processing function. 4. Shared use: avoid duplication by allowing a single module be called by other that need the function it provides.


7.2 Module Design

The major modules of the project are 1. 2. HOD module Employee module

7.2.1 HOD Module

HOD plays a vital role in this project. He has rights to update the faculty profile. Faculty send their requests to the HOD. Based up on the priorities he will approve the leaves.

7.2.2 Employee Module

The employee must register to enter into the website. He can apply for leaves.And view the status of the leave request.

7.3 Input/output Design

7.3.1 Input design Considering the requirements, procedures to collect the necessary input data in most efficiently designed. The input design has been done keeping in view that, the interaction of the user with the system being the most effective and simplified way.

Also the measures are taken for the following

Controlling the amount of input Avoid unauthorized access to the classroom. Eliminating extra steps Keeping the process simple At this stage the input forms and screens are designed. 33

7.3.2 Output design

All the screens of the system are designed with a view to provide the user with easy operations in simpler and efficient way, minimum key strokes possible. Instructions and important information is emphasized on the screen. Almost every screen is provided with no error and important messages and option selection facilitates. Emphasis is given for speedy processing and speedy transaction between the screens. Each screen assigned to make it as much user friendly as possible by using interactive procedures. So to say user can operate the system without much help from the operating manual.





Hyper Text Markup Language (HTML) HTML is a static language used to create hypertext documents that have hyperlinks embedded in them. You can build web pages. It is only formatting language and not a programming language. Hyperlinks are underlined or emphasized words or locations in a screen that lead to other documents. WWW is a global, interactive, graphical, hypertext information system. .

Hypertext Pre-processor(PHP) PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. PHP supports many databases (MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.). PHP is an open source software. PHP is free to download and use.PHP files can contain text, HTML tags and scripts. PHP files are returned to the browser as plain HTML . PHP files have a file extension of ".php", ".php3", or ".phtml". Basically, PHP allows a static webpage to become dynamic. "PHP" is an acronym that stands for "PHP: Hypertext Preprocessor". The word "Preprocessor" means that PHP makes changes before the HTML page is created. This enables developers to create powerful applications which can publish a blog, remotely control hardware, or run a powerful website such as Wikipedia or Wikibooks. Of course, to accomplish something such as this, you need a database application such as MySQL.

8.1 INSERT INTO DATABASE <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("pvp", $con); $y=6; $name=$_POST['name']; $empid=$_POST['empid']; $pwd=$_POST['pwd']; $email=$_POST['email']; $phone=$_POST['phone']; $rgroup=$_POST['rgroup']; $desg=$_POST['desg']; $dept=$_POST['dept']; 36

$MyDate=$_POST['MyDate']; $address=$_POST['address']; $hash=md5($pwd); $new=explode("/",$MyDate); $a=array($new[2],$new[1],$new[0]); $n=implode("-",$a); $c=explode("-",$n); $cl=12; $hpl=5; $el=5; $others=3; $res=mysql_query("select * from employee"); while($j=mysql_fetch_array($res)) { if($j["EMPID"]==$empid) { $y=1; include("login.html"); echo '<script language="javascript">alert("You have already Registered")</script>;'; } } if($y!=1) { mysql_query("insert into employee values('$empid','$name','$hash','$desg','$n','$rgroup','$dept','$address','$phone','$email')"); mysql_query("insert into leavebalance values('$empid',$cl,$hpl,$el,$others)"); if($desg=="Head Of Department") { mysql_query("insert into departmenthod values('$dept','$empid')"); } echo '<script language="javascript">alert("Registration successful.Login to proceed with further activities")</script>;'; include("login.html"); } ?>


<?php session_start(); $r=$_SESSION['un']; echo "<table border=0>"; echo "<tr>"; echo "Emp Id: "; echo "<td>" .$r. "</td>";


echo "</tr>"; echo "</table>"; $status="Applied"; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("pvp", $con); function markasholiday($mydate) { $flag=5; $starts=date($mydate); $ar=array('2011-1-1','2011-1-14','2011-1-15','2011-1-26','2011-3-2'); foreach($ar as $ny) { if($ny==$starts) { $flag=1;break; } else $flag=0; } if($flag==1) return 1; if($flag==0) return 0; } function diff($x,$y) { $start = strtotime($x); $end = strtotime($y); $days_between = floor(abs($end - $start) / 86400); $f=$days_between; echo "no.of days on between are".$f; return $f+1; } function getday($my) { $start=date($my); $x=explode("-",$start); $y=array($x[1],$x[2],$x[0]);


$z=implode("/",$y); $f=explode("/",$z); $calc=mktime(0,0,0,date("$f[0]"),date("$f[1]"),date("$f[2]")); $pr=date("m/w/Y",$calc);

$n=explode("/",$pr); $c=$n[1]; return $c; } $date=$_POST['MyDate']; $dates=$_POST['MyDate1']; $type=$_POST['type']; $rsn=$_POST['reason']; if($type=="CL") { $type=1; } elseif($type=="EL") { $type=2; } elseif($type=="HPL") { $type=3; } else { $type=4; } $new=explode("/",$date); $news=explode("/",$dates);

$a=array($new[2],$new[1],$new[0]); $as=array($news[2],$news[1],$news[0]); $n=implode("-",$a); $ns=implode("-",$as); $c=explode("-",$n); $d=explode("-",$ns);


$year=$c[0];$years=$d[0]; $month=$c[1];$months=$d[1]; $day=$c[2];$days=$d[2]; $val=mktime(0,0,0,date("$c[1]"),date("$c[2]"),date("$c[0]")); $leap=date("L",$val); echo "<br/>"; $temp=$day;$i=$day; $w=diff($n,$ns);$q=$w; for($s=1;$s<=$w;$s++) { $check=$year%4; if($check==0) {

if($month==12) { if(($temp+1)>31) { $m=array($year,$month,$temp); $disp=implode("-",$m); $month=1; $temp=1;$year++;$h=1; echo "<br/>"; } else { $m=array($year,$month,$temp); $disp=implode("-",$m); $temp++; } } elseif(($month==1)||($month==3)||($month==5)||($month==7)||($month==8) ||($month==10)) { if(($temp+1)>31) { $m=array($year,$month,$temp); $disp=implode("-",$m); $month++; $temp=1;$h=1;


echo "<br/>"; } else { $m=array($year,$month,$temp); $disp=implode("-",$m); $temp++; } } elseif(($month==4)||($month==6)||($month==9)||($month==11)) { if(($temp+1)>30) { $m=array($year,$month,$temp); $disp=implode("-",$m); $month++; $temp=1;$h=1; echo "<br/>"; } else { $m=array($year,$month,$temp); $disp=implode("-",$m); $temp++; } } elseif($month==2) { if(($temp+1)>29) { $m=array($year,$month,$temp); $disp=implode("-",$m); $month++; $temp=1;$h=1; echo "<br/>"; } else {


$m=array($year,$month,$temp); $disp=implode("-",$m); $temp++; } }

else {

if($month==12) { if(($temp+1)>31) { $m=array($year,$month,$temp); $disp=implode("-",$m); $month=1; $temp=1;$year++;$h=1; echo "<br/>"; } else { $m=array($year,$month,$temp); $disp=implode("-",$m); $temp++; } } elseif(($month==1)||($month==3)||($month==5)||($month==7)||($month==8) ||($month==10)) { if(($temp+1)>31) {


$m=array($year,$month,$temp); $disp=implode("-",$m); $month++; $temp=1;$h=1; echo "<br/>"; } else { $m=array($year,$month,$temp); $disp=implode("-",$m); $temp++; } } elseif(($month==4)||($month==6)||($month==9)||($month==11)) { if(($temp+1)>30) { $m=array($year,$month,$temp); $disp=implode("-",$m);

$month++; $temp=1;$h=1; echo "<br/>"; } else { $m=array($year,$month,$temp); $disp=implode("-",$m); $temp++; } } elseif($month==2) { if(($temp+1)>28) { $m=array($year,$month,$temp); $disp=implode("-",$m);


$month++; $temp=1;$h=1; echo "<br/>";

} else { $m=array($year,$month,$temp); $disp=implode("-",$m); $temp++;

} } }

$g=markasholiday($disp); $day=getday($disp); if(($day!=0)&&($g==1)) { $q--; } if($day==0) { $q--; } if(($day==6)&&($g!=1)) { $q=$q-0.5; }

} echo $n;echo "<br/>"; echo $ns;


$kk=mysql_query("select * from leavetable where EMPID='$r' and FROMDATE='$n' and TODATE='$ns'"); while($k=mysql_fetch_array($kk)) { echo $k['EMPID']; echo '<script language="javascript">alert("You have already applied leave on the same dates!")</script>;'; } if($q != 0) { mysql_query("insert into leavetable(EMPID,FROMDATE,TODATE,NUMOFDAYS,LEAVETYPE,STATUS,REASON) values('$r','$n','$ns',$q,$type,'$status','$rsn')"); $levid = mysql_query("select LEAVEID from leavetable where EMPID='$r' and FROMDATE='$n' and TODATE='$ns'"); while($l = mysql_fetch_array($levid)) { $finalid = $l['LEAVEID']; } echo '<script language="javascript">alert("Leave has been applied successfully!")</script>;'; Header('Location:account.php'); } else { echo '<script language="javascript">alert("Leave need not be applied on Holiday or Sunday!")</script>;'; session_destroy(); include("plans.php"); } ?>

<?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("pvp", $con); $u1=$_POST['u1'];


$p1=$_POST['p1']; $p=md5($p1); session_start(); $_SESSION['k']=$u1; $flag=2; $res=mysql_query("select * from employee"); while($g=mysql_fetch_array($res)) { if(($u1==$g['EMPID'])) { $flag=1;break; } } if($flag==1) { $result = mysql_query("SELECT * FROM employee where empid='$u1'"); while($row = mysql_fetch_array($result)) { $dbpwd=$row['PASSWORD']; } if($dbpwd == $p) { header('location:accounts.php'); } else { include("facultylogin.html"); echo '<script language="javascript">alert("Invalid username or password!")</script>;'; } } else { include("facultylogin.html"); echo '<script language="javascript">alert("Invalid username!")</script>;'; }



<?php session_start();

$r=$_SESSION['k']; echo "<table border=0>"; echo "<tr>";echo " echo "<td>";echo "Emp Id: "; echo "<td>" .$r. "</td>"; echo "</tr>"; echo "</table>"; ?>

";echo "</td>";

<html> <head> <script language="JavaScript"> <!-var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); var days = new Array("S", "M", "T", "W", "T", "F", "S"); today = new getToday(); var element_id; function getDays(month, year) { // Test for leap year when February is selected. if (1 == month) return ((0 == year % 4) && (0 != (year % 100))) || (0 == year % 400) ? 29 : 28; else return daysInMonth[month]; } function getToday() { // Generate todays date. = new Date(); this.year = ; // Returned year XXXX this.month =; =; } function newCalendar() {


var parseYear = parseInt(document.all.year [document.all.year.selectedIndex].text); var newCal = new Date(parseYear , document.all.month.selectedIndex, 1); var day = -1; var startDay = newCal.getDay(); var daily = 0; today = new getToday(); // 1st call if ((today.year == newCal.getFullYear() ) && (today.month == newCal.getMonth())) day =; // Cache the calendar tables tBody section, dayList. var tableCal = document.all.calendar.tBodies.dayList; var intDaysInMonth = getDays(newCal.getMonth(), newCal.getFullYear() ); for (var intWeek = 0; intWeek < tableCal.rows.length; intWeek++) for (var intDay = 0; intDay < tableCal.rows[intWeek].cells.length; intDay++) { var cell = tableCal.rows[intWeek].cells[intDay]; // Start counting days. if ((intDay == startDay) && (0 == daily)) daily = 1; // Highlight the current day. = (day == daily) ? "red" : ""; if(day == daily) { document.all.todayday.innerText= "Today: " + + "/" + (newCal.getMonth()+1) + "/" + newCal.getFullYear() ; } // Output the day number into the cell. if ((daily > 0) && (daily <= intDaysInMonth)) cell.innerText = daily++; else cell.innerText = ""; } } function getTodayDay() { document.all[element_id].value = + "/" + (today.month+1) + "/" + today.year; //"hidden";


48"none"; document.all.year.selectedIndex =100; document.all.month.selectedIndex = today.month; } function getDate() { // This code executes when the user clicks on a day // in the calendar. if ("TD" == event.srcElement.tagName) // Test whether day is valid. if ("" != event.srcElement.innerText) { var mn = document.all.month.selectedIndex+1; var Year = document.all.year [document.all.year.selectedIndex].text; document.all[element_id].value=event.srcElement.innerText+"/"+mn +"/" +Year; //"hidden";"none"; } } function { var var x = y = GetBodyOffsetX(el_name, shift) x; y; 0; 0;

var elem = document.all[el_name]; do { x += elem.offsetLeft; y += elem.offsetTop; if (elem.tagName == "BODY") break; elem = elem.offsetParent; } while (1 > 0); shift[0] = x; shift[1] = y; return x; } function SetCalendarOnElement(el_name) { if (el_name=="") el_name = element_id; var shift = new Array(2); GetBodyOffsetX(el_name, shift); document.all.calendar.offsetLeft;

= shift[0]; //

49 = shift[1] + 25 ; }

function ShowCalendar(elem_name) { if (elem_name=="") elem_name = element_id; element_id = elem_name; // element_id is global variable newCalendar(); SetCalendarOnElement(element_id); // = "visible";"inline"; } function HideCalendar() { //"hidden";"none"; } function toggleCalendar(elem_name) { //if ( == "hidden") if("none") ShowCalendar(elem_name); else HideCalendar(); } --> </script> <style> .today {COLOR: black; FONT-FAMILY: sans-serif; FONT-SIZE: 10pt; FONTWEIGHT: bold} .days {COLOR: navy; FONT-FAMILY: sans-serif; FONT-SIZE: 10pt; FONTWEIGHT: bold; TEXT-ALIGN: center} .dates {COLOR: black; FONT-FAMILY: sans-serif; FONT-SIZE: 10pt} </style> </head> <body bgcolor="lightpink"> <a href="accounts.php">myaccount</a> <a href="viewmyleaves.php">viewmyleaves</a> <FORM name=myForm action="insert.php" method="post"> <table align="center"> <tr> <td>From</td><td><INPUT id=MyDate name=MyDate size=15> <a href="JavaScript:;" onClick="toggleCalendar('MyDate')"><img src="calendar.jpg" width=20 height=15></img></a></td> <td> </td> <td> </td><td> </td> <td> </td> <td>To</td><td><INPUT id=MyDate1 name=MyDate1 size=15>


<a href="JavaScript:;" onClick="toggleCalendar('MyDate1')"><img src="calendar.jpg" width=20 height=15></img></a></td></tr> <tr><td>Type</td><td><select name="type"> <option value="CL">CL</option> <option value="EL">EL</option> <option value="HPL">HPL</option></tr> <option value="Others">Others</option> </select></td></tr> <tr><td>Reason</td><td><textarea name=reason rows=4 cols=15></textarea></td></tr> <tr> <td> </td> <td><input type="submit" value="submit"/> <input type="reset" value="reset"/></td></tr></table> </form>

<TABLE bgColor=#ffffff border=1 cellPadding=0 cellSpacing=3 id=calendar style="DISPLAY: none; POSITION: absolute; Z-INDEX: 4"> <TBODY> <TR> <TD colSpan=7 vAlign=center> <!-- Month combo box --> <SELECT id=month onchange=newCalendar()> <SCRIPT language=JavaScript> // Output months into the document. // Select current month. for (var intLoop = 0; intLoop < months.length; intLoop++) document.write("<OPTION " + (today.month == intLoop ? "Selected" : "") + ">" + months[intLoop]); </SCRIPT> </SELECT> <!-- Year combo box --> <SELECT id=year onchange=newCalendar()> <SCRIPT language=JavaScript> // Output years into the document. // Select current year. for (var intLoop = 1900; intLoop < 2028; intLoop++) document.write("<OPTION " + (today.year == intLoop ? "Selected" : "") + ">" + intLoop); </SCRIPT> </SELECT> </TD>



<TR class=days> <!-- Generate column for each day. --> <SCRIPT language=JavaScript> // Output days. for (var intLoop = 0; intLoop < days.length; intLoop++) document.write("<TD>" + days[intLoop] + "</TD>"); </SCRIPT> </TR> <TBODY style="cursor:hand" class=dates id=dayList onclick="getDate('')" vAlign=center> <!-- Generate grid for individual days. --> <SCRIPT language=JavaScript> for (var intWeeks = 0; intWeeks < 6; intWeeks++) { document.write("<TR>"); for (var intDays = 0; intDays < days.length; intDays++) document.write("<TD></TD>"); document.write("</TR>"); } </SCRIPT> <!-- Generate today day. --></TBODY> <TBODY> <TR> <TD class=today colSpan=5 id=todayday onclick=getTodayDay()></TD> <TD align=right colSpan=2><A href="javascript:HideCalendar();"><SPAN style="COLOR: black; FONTSIZE: 10px"><B>Hide</B></SPAN></A></TD> </TR> </TBODY> </TABLE> </body> </html>


function startTime() { var today=new Date(); var h=today.getHours(); var m=today.getMinutes();


var s=today.getSeconds(); var var var var month = today.getMonth() + 1; day = today.getDate(); year = today.getFullYear(); slash='/';

// add a zero in front of numbers<10 m=checkTime(m); s=checkTime(s); document.getElementById('txt').innerHTML=day+slash+month+slash+year+" "+h+":"+m+":"+s;

t=setTimeout('startTime()',500); } function checkTime(i) { if (i<10) { i="0" + i; } return i; } APPLY LEAVE <?php session_start(); $t=$_SESSION['h']; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("pvp", $con); echo "<a href='approvedleaves.php'>View Approved Leaves</a>"; $dept=mysql_query("select DEPARTMENT from employee where EMPID='$t'"); while($dep=mysql_fetch_array($dept)) { $w=$dep['DEPARTMENT'];echo $w; }


$ref=mysql_query("select * from LEAVETABLE l1,EMPLOYEE e1 where e1.EMPID=l1.EMPID and e1.DEPARTMENT='$w' ORDER BY l1.FROMDATE,l1.TODATE,l1.LEAVETYPE");

echo echo echo echo echo echo echo echo echo echo echo echo echo

"<table border=1 align=center>"; "<tr>"; "<th>";echo "LEAVE ID";echo "</th>"; "<th>";echo "EMP ID";echo "</th>"; "<th>";echo "EMP NAME";echo "</th>"; "<th>";echo "FROM DATE";echo "</th>"; "<th>";echo "TO DATE";echo "</th>"; "<th>";echo "<th>";echo "<th>";echo "<th>";echo "<th>";echo "</tr>"; "TOTAL DAYS";echo "</th>"; "LEAVE TYPE";echo "</th>"; "STATUS";echo "</th>"; "REASON";echo "</th>"; "MANAGE";echo "</th>";

while($row = mysql_fetch_array($ref)) { $levid=$row['LEAVEID']; if($row['LEAVETYPE']==1) { $leavetype="Casual"; } elseif($row['LEAVETYPE']==2) { $leavetype="Earned"; } elseif($row['LEAVETYPE']==3) { $leavetype="Half Paid Leave"; } else { $leavetype="Others"; } $emp = $row['EMPID']; $name=mysql_query("select NAME from EMPLOYEE where EMPID='$emp'"); while($nam=mysql_fetch_array($name)) { $y=$nam['NAME']; }


$user1 = $row['LEAVEID']; echo echo echo echo "<tr>"; "<td>";echo $row['LEAVEID'];echo "</td>"; "<td>";echo $row['EMPID'];echo "</td>"; "<td>";echo $y;echo "</td>";

echo "<td>";echo $row['FROMDATE'];echo "</td>"; echo "<td>";echo $row['TODATE'];echo "</td>"; echo "<td>";echo $row['NUMOFDAYS'];echo "</td>"; echo "<td>";echo $leavetype;echo "</td>"; if($row['STATUS']=="APPROVED") { echo "<td bgcolor='grey'>";echo $row['STATUS'];echo "</td>"; echo "<td bgcolor='grey'>";echo $row['REASON'];echo "</td>"; } elseif($row['STATUS']=="REJECTED") { echo "<td bgcolor='red'>";echo $row['STATUS'];echo "</td>"; echo "<td bgcolor='red'>";echo $row['REASON'];echo "</td>"; } else { echo "<td>";echo $row['STATUS'];echo "</td>"; echo "<td>";echo $row['REASON'];echo "</td>"; } if($row['STATUS']=="Applied") { echo "<td>"; echo "<form action ='approval.php' method = 'post'><input type = 'submit' name = '$user1' value = 'Approve'><input type = 'hidden' name = 'username' value = '$user1'></form>"; echo "<form action ='reject.php' method = 'post'><input type = 'submit' name = '$user1' value = 'Reject'><input type = 'hidden' name = 'username' value = '$user1'></form>"; echo "</td>"; }

echo "</tr>"; } echo "</table>";


?> <html> <head> <script type="text/javascript" src="getdateandtime.js"></script> </head> <body onload="startTime()"> <table align="right"> <tr><td> </td> <td><div id="txt"></div></td> </tr></table>

<?php session_start(); unset($_SESSION['h']); session_destroy(); echo "This is session of:".$_SESSION['h']; ?>



Software testing is critical element of Software Quality Assurance and represents the ultimate review of specification, design and coding. Software testing is one of broader topic and often referred to as verification refer to all the activities that endure that software built is traceable to use requirements. System testing consists of the following steps:

1. Modular Testing 2. Integrated Testing 3. User Acceptance Testing

9.1 Testing Types


A Strategy for software testing integrates software test cases into a series of well planned steps that result in the successful construction of software. Software testing is a broader topic for what is referred to as Verification and Validation. Verification refers to the set of activities that ensure that the software correctly implements a specific function. Validation refers he set of activities that ensure that the software that has been built is traceable to customers requirements. Unit Testing: Unit testing focuses verification effort on the smallest unit of software design that is the module. Using procedural design description as a guide, important control paths are tested to uncover errors within the boundaries of the module. The unit test is normally white box testing oriented and the step can be conducted in parallel for multiple modules. Integration Testing: Integration testing is a systematic technique for constructing the program structure, while conducting test to uncover errors associated with the interface. The objective is to take unit tested methods and build a program structure that has been dictated by design.

Top-down Integration: Top down integrations is an incremental approach for construction of program structure. Modules are integrated by moving downward through the control hierarchy, beginning with the main control program. Modules subordinate to the main program are incorporated in the structure either in the breath-first or depth-first manner.

Bottom-up Integration: This method as the name suggests, begins construction and testing with atomic modules i.e., modules at the lowest level. Because the modules are integrated in the bottom up manner the processing required for the modules subordinate to a given level is always available and the need for stubs is eliminated.


Validation Testing: At the end of integration testing software is completely assembled as a package. Validation testing is the next stage, which can be defined as successful when the software functions in the manner reasonably expected by the customer. Reasonable expectations are those defined in the software requirements specifications.

System Testing: System testing is actually a series of different tests whose primary purpose is to fully exercise the computer-based system. Although each test has a different purpose, all work to verify that all system elements have been properly integrated to perform allocated functions.

Security Testing: Attempts to verify the protection mechanisms built into the system.

Performance Testing: This method is designed to test runtime performance of software within the context of an integrated system.

White-Box Testing: White-Box testing sometimes called a glass-box testing, is a test case design method that uses the control structure of the procedural design to derive test cases. Using white box testing methods the software engineer can derive test cases that are

1. Guarantee that all independent parts within a module have been exercised atleast once. 2. Exercise all logical decisions on their true and false sides. 3. Execute all loops at their boundaries and within their operational bounds. 4. Exercise internal data structures to ensure their validity. 60

Black-Box Testing: Black-Box testing, also called behavioural testing, focuses on the functional requirements of the software. Black-Box testing enables the software engineer to drive sets of input conditions that will fully exercise all functional requirements for a program. Black-Box testing attends to find errors in the following categories: 1. Incorrect or missing functions. 2. Interface errors.
3. Errors in data structures or external data access

9.2 Test Cases


Test Case Test for

Expected Output Achieved Output Description

Case To Display Not Displays Not a When a user tries to login by Login A Valid User Valid Name User submitting an incorrect ID or an incorrect Password, then it displays an error message Not A Valid User Name. Name




Case To Display the Displays the error When the old password does not message as Old for Change error message as Password Does match with the new password, Password Old Password Not Match with then this results in displaying an New Password 61 Test

Does Not Match with Password New

error message as Old Password Does Not Match with the New Password.

9.2.1 Test Cases





10.1.1 Home page


10.1.2 Login page



10.2.1 Faculty Login


10.2.2 Faculty Account


10.2.3 Apply a leave:


10.2.4 View Holidays


10.2.5 Leave balance


10.2.6 View Status


10.3 HOD

10.3.1 HOD login 71

10.3.2 HOD account


10.3.2 View Leave Requests






Conclusion The Leave Management System project has been successfully completed. The goal of the system is achieved and the problems are solved. This project is developed in this manner that is user friendly and required help is provided at different levels. 1. Providing online services to the staff in a school or college. 2. Automating many of the tasks, thereby reducing tedious jobs.

Scope for Future Enhancement

The primary objective is to provide the interactive service to all the general users in this contemporary world. Different types of services can be provided to all users. It is used to facilitate companies in scheduling dates for tests and interviews for jobseekers both fresher as well as experienced, recruiting the selected candidates, maintaining the clients details, receiving requests for employees from the clients, sending the employees whose skills and experience matches the requirements of the clients, etc., thereby reducing tedious job. This system certainly doesnt reduce the manpower but helps the development of the available manpower and optimizes the man power. It can be further enhanced by grading the jobseekers by conducting online tests there by facilitating the clients in recruiting the employees.





Beginning PHP and MYSQL by Gilmore

James A.Senn,Analysis and Design of Information Systems,Mc-GrawHills,New Delhi.

John Zukowski,Mastering Java 2,4th Edition,sybex,1998

Roger S Pressman,Software Engineering,5th Edition,wiley,2001

Web References: