Top Banner
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 (08501A0588) M.Vamsi (08501A0567) P.Lahari (08501A0589) P.Yamini (08501A0586) T.Prasanna (08501A05B3) Under the esteemed guidance of Mr.B.Srinivasa Rao , M.Tech (Ph.D), Sr.Asst. Professor Department of CSE
98
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mini Project Final

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 (08501A0588)

M.Vamsi (08501A0567)

P.Lahari (08501A0589)

P.Yamini (08501A0586)

T.Prasanna (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.

Page 2: Mini Project Final

PRASAD V. POTLURI

SIDDHARTHA INSTITUTE OF TECHNOLOGY

(Affiliated to JNTU:Kakinada, Approved by AICTE)

(An ISO certified and NBA accredited institution)

Kanuru, Vijayawada – 520007

CERTIFICATE

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 Signature of the HOD

Mr.B.Srinivasa Rao, M.Tech(Ph.D) Dr.K.NAGESWARARAO,M.Tech,Ph.D

Sr.Asst.Professor, Dept. of CSE Head,Dept. of CSE

2

Page 3: Mini Project Final

ACKNOWLEDGEMENT

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.

3

Page 4: Mini Project Final

TABLE OF CONTENTS

1. ABSTRACT 7

2. INTRODUCTION 9

2.1 Project overview

3. SYSTEM STUDY 11

3.1 Problem Definition

3.2 Existing System

3.3 Proposed System

4. SYSTEM REQUIREMENT ANALYSIS 14

4.1 Hardware Requirements

4.2 Software Requirements

4.3 Feasibility Study

5. DESIGN 18

5.1 Use Case Diagrams

5.2 Class Diagram

5.3 Sequence Diagrams

6. DATABASE DESIGN 26

6.1 Data Dictionary

6.2 Tables

7. SYSTEM DESIGN 31

7.1 Software Design

7.2 Module Design

7.2.1 HOD Module

7.2.2 Employee Module

4

Page 5: Mini Project Final

7.3 Input/output Design

7.3.1 Input design

7.3.2 Output design

8. IMPLEMENTATION 35

9. SOFTWARE TESTING 39

9.1 Testing Types

9.2 Test Cases

10. SCREEN SHOTS 44

11. CONCLUSION AND SCOPE FOR FUTURE ENHANCEMENT 56

12. TEXTBOOKS AND WEB REFERENCES 58

5

Page 6: Mini Project Final

LIST OF FIGURES

S.NO FIGURE CONTENT PAGE NO

1 5.1 Use Case Diagram for Administrator 20

2 5.2 Class Diagram for Leave Management System 21

3 5.3.1 Sequence Diagram for Applying a leave 23

4 5.3.2 Sequence Diagram for Accepting a leave 24

5 5.3.3 Sequence Diagram for Rejecting a leave 25

LIST OF TABLES

S.NO TABLE CONTENT PAGE NO

1 6.2.1 Leaves 28

2 6.2.2 Approved Leaves 28

3 6.2.3 Employees 29

4 6.2.4 Employee Leave Balance 30

6

Page 7: Mini Project Final

ABSTRACT

7

Page 8: Mini Project Final

ABSTRACT

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.

8

Page 9: Mini Project Final

INTRODUCTION

9

Page 10: Mini Project Final

2. INTRODUCTION

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

10

Page 11: Mini Project Final

SYSTEM STUDY

11

Page 12: Mini Project Final

3. SYSTEM STUDY

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

Page 13: Mini Project Final

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.

13

Page 14: Mini Project Final

SYSTEM

REQUIREMENT

ANALYSIS

14

Page 15: Mini Project Final

4. SYSTEM REQUIREMENT ANALYSIS

“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 : Pentium-III(or) Higher

Ram : 128MB (or) Higher

Cache : 512MB

Hard disk : 10GB

4.1.1 Hardware Requirements

4.2 Software Requirements

4.2.1 Software Requirements

4.3 Feasibility Study15

Web Server : Tomcat 5.0

Server-side Technologies : Java, PHP

Client-side Technologies : Hyper Text Markup Language, Cascading Style

Sheets, Java Script

Database Server : My SQL

Operating System : Windows (or) Linux (or) Mac any version

Page 16: Mini Project Final

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

afforded by any organization hence it doesn’t incur additional economic overheads, which

renders the system economically feasible.The system being developed is economic with respect

to School or Collage’s point of view. It is cost effective in the sense that has eliminated the paper

work completely.

.

16

Page 17: Mini Project Final

17

Page 18: Mini Project Final

DESIGN

5. DESIGN

UML DIAGRAMS

18

Page 19: Mini Project Final

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 system’s 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, administrator…etc., or another system like central database.

The overview of the whole project through use case diagram is as follows:

19

Page 20: Mini Project Final

20

Page 21: Mini Project Final

5.2 CLASS DIAGRAM

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

Page 22: Mini Project Final

5.3 SEQUENCE DIAGRAMS

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

Page 23: Mini Project Final

Fig 5.3.1 Sequence Diagram for Applying a leave

5.3.2 APPROVE LEAVE

23

Page 24: Mini Project Final

Fig 5.3.2 Sequence Diagram for Approving a leave

24

Page 25: Mini Project Final

5.3.3 REJECT A LEAVE

Fig 5.3.3 Sequence Diagram for Rejecting a leave

25

Page 26: Mini Project Final

DATABASE DESIGN

26

Page 27: Mini Project Final

6. DATABASE DESIGN

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

6.2 TABLES

27

Page 28: Mini Project Final

Table Name: Leave

S.no Field Name Data Type Size Constraints

1. Leave ID Varchar2 10 Primary Key

2. Employee ID Varchar2 10 Not Null

3. From Date Date 10 Not Null

4. To Date Date 10 Not Null

5. No.of Days Number 3 Not Null

6. Leave Type Varchar2 20 Not Null

7. Status Varchar2 10 Not Null

6.2.1 Leaves

Table Name: Approved Leaves

S.no Field name Data Type Size Constraints

1. Leave ID Varchar2 10 Primary Key

2. Emp ID Varchar2 10 Foreign Key

3. From Date Date 10 Not Null

28

Page 29: Mini Project Final

4. To Date Date 10 Not Null

5. No.of days Varchar2 10 Not Null

6. Leave Type Varchar2 20 Not Null

6.2.2 Approved Leaves

Table Name: Employee

S.no Field Name Data Type Size Constraints

1 emp_id Varchar2 10 Primary Key

2 Emp name Varchar2 20 Not Null

3 Password Varchar2 20 Not Null

4 Designation Varchar2 20 Not Null

5 Date of join Date 20 Not Null

6 Gender Varchar2 20 Not Null

7 Department Varchar2 10 Not Null

8 Address Varchar2 100 Not Null

9 Phone Number 15 Not Null

10 Email Varchar2 30 Not Null

6.2.4 Employee

Table Name: Employee Leave Balance

S.no Field Name Data Type Size Constraints

1 Emp ID Varchar2 15 Primary Key

2 CL Number 3 Not Null

29

Page 30: Mini Project Final

3 HPL Number 3 Not Null

4 EL Number 3 Not Null

5 Others Number 3 Not Null

6.2.5 Leave Balance

30

Page 31: Mini Project Final

SYSTEM DESIGN

7. SYSTEM DESIGN

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

31

Page 32: Mini Project Final

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

32

Page 33: Mini Project Final

1. HOD module

2. 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.

7.3.2 Output design

33

Page 34: Mini Project Final

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.

34

Page 35: Mini Project Final

IMPLEMENTATION

8. IMPLEMENTATION

Hyper Text Markup Language (HTML)

35

Page 36: Mini Project Final

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'];$MyDate=$_POST['MyDate'];$address=$_POST['address'];$hash=md5($pwd);

$new=explode("/",$MyDate);

36

Page 37: Mini Project Final

$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");}

?>

CHECK IF LEAVE APPLIED IS A HOLIDAY

<?phpsession_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","");

37

Page 38: Mini Project Final

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]"));

38

Page 39: Mini Project Final

$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]"));

39

Page 40: Mini Project Final

$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

40

Page 41: Mini Project Final

{$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++;

41

Page 42: Mini Project Final

}}

}

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);

42

Page 43: Mini Project Final

$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/>";

43

Page 44: Mini Project Final

}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)){

44

Page 45: Mini Project Final

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");

}

?>

LOGIN

<?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;

45

Page 46: Mini Project Final

$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>;'; }

?>

LEAVE APPLICATION

<?phpsession_start();

46

Page 47: Mini Project Final

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

<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;

elsereturn daysInMonth[month];

}

function getToday(){

// Generate todays date.this.now = new Date();this.year = this.now.getFullYear() ; // Returned year XXXXthis.month = this.now.getMonth();this.day = this.now.getDate();

}

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;

47

Page 48: Mini Project Final

var startDay = newCal.getDay();var daily = 0;

today = new getToday(); // 1st callif ((today.year == newCal.getFullYear() ) && (today.month ==

newCal.getMonth())) day = today.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. cell.style.color = (day == daily) ? "red" : ""; if(day == daily) {

document.all.todayday.innerText= "Today: " + day + "/" +

(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.day + "/" + (today.month+1) +

"/" + today.year; //document.all.calendar.style.visibility="hidden";

document.all.calendar.style.display="none";document.all.year.selectedIndex =100;

document.all.month.selectedIndex = today.month; }

function getDate()

48

Page 49: Mini Project Final

{ // 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;

//document.all.calendar.style.visibility="hidden"; document.all.calendar.style.display="none";

} }

function GetBodyOffsetX(el_name, shift){

var x;var y;x = 0;y = 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.style.pixelLeft = shift[0]; // -

document.all.calendar.offsetLeft;document.all.calendar.style.pixelTop = shift[1] + 25 ;

}

function ShowCalendar(elem_name)

49

Page 50: Mini Project Final

{if (elem_name=="")elem_name = element_id;

element_id = elem_name; // element_id is global variablenewCalendar();SetCalendarOnElement(element_id);//document.all.calendar.style.visibility = "visible";document.all.calendar.style.display="inline";

}

function HideCalendar(){

//document.all.calendar.style.visibility="hidden";document.all.calendar.style.display="none";

}

function toggleCalendar(elem_name){

//if (document.all.calendar.style.visibility == "hidden")if(document.all.calendar.style.display=="none")

ShowCalendar(elem_name);else

HideCalendar();}--></script>

<style>.today {COLOR: black; FONT-FAMILY: sans-serif; FONT-SIZE: 10pt; FONT-WEIGHT: bold}.days {COLOR: navy; FONT-FAMILY: sans-serif; FONT-SIZE: 10pt; FONT-WEIGHT: 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>

50

Page 51: Mini Project Final

<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>

<TR class=days><!-- Generate column for each day. -->

51

Page 52: Mini Project Final

<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; FONT-SIZE: 10px"><B>Hide</B></SPAN></A></TD> </TR> </TBODY>

</TABLE>

</body></html>

GETDATEANDTIME

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

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

52

Page 53: Mini Project Final

// add a zero in front of numbers<10m=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<?phpsession_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");

53

Page 54: Mini Project Final

echo "<table border=1 align=center>";echo "<tr>";echo "<th>";echo "LEAVE ID";echo "</th>";echo "<th>";echo "EMP ID";echo "</th>";echo "<th>";echo "EMP NAME";echo "</th>";echo "<th>";echo "FROM DATE";echo "</th>";echo "<th>";echo "TO DATE";echo "</th>";

echo "<th>";echo "TOTAL DAYS";echo "</th>";echo "<th>";echo "LEAVE TYPE";echo "</th>";echo "<th>";echo "STATUS";echo "</th>";echo "<th>";echo "REASON";echo "</th>";echo "<th>";echo "MANAGE";echo "</th>";echo "</tr>";

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 "<tr>";echo "<td>";echo $row['LEAVEID'];echo "</td>";echo "<td>";echo $row['EMPID'];echo "</td>";echo "<td>";echo $y;echo "</td>";

54

Page 55: Mini Project Final

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()">

55

Page 56: Mini Project Final

<table align="right"><tr><td> </td><td><div id="txt"></div></td></tr></table>

LOGOUT

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

56

Page 57: Mini Project Final

SOFTWARE

TESTING

57

Page 58: Mini Project Final

9. SOFTWARE TESTING

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 customer’s

requirements.

Unit Testing:

58

Page 59: Mini Project Final

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:

59

Page 60: Mini Project Final

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.

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.

60

Page 61: Mini Project Final

3. Errors in data structures or external data access

9.2 Test Cases

S.No. Test Case Expected Output Achieved Output Description

1.

Test Case

for Login

Page

To Display “Not

A Valid User

Name”

Displays “Not a

Valid User

Name”

When a user tries to login by

submitting an incorrect ID or an

incorrect Password, then it

displays an error message “Not

A Valid User Name”.

2.

Test Case

for Change

Password

To Display the

error message as

“Old Password

Does Not Match

with New

Password”

Displays the error message as “Old Password Does Not Match with New Password”

When the old password does not

match with the new password,

then this results in displaying an

error message as “Old Password

Does Not Match with the New

Password”.

9.2.1 Test Cases

61

Page 62: Mini Project Final

SCREEN SHOTS

62

Page 63: Mini Project Final

10. SCREEN SHOTS

10.1 ADMINISTRATOR

10.1.1 Home page

63

Page 64: Mini Project Final

10.1.2 Login page

64

Page 65: Mini Project Final

10.2 FACULTY:

10.2.1 Faculty Login

65

Page 66: Mini Project Final

10.2.2 Faculty Account

66

Page 67: Mini Project Final

10.2.3 Apply a leave:

67

Page 68: Mini Project Final

10.2.4 View Holidays

68

Page 69: Mini Project Final

10.2.5 Leave balance

69

Page 70: Mini Project Final

10.2.6 View Status

70

Page 71: Mini Project Final

10.3 HOD

10.3.1 HOD login

71

Page 72: Mini Project Final

10.3.2 HOD account

72

Page 73: Mini Project Final

10.3.2 View Leave Requests

73

Page 74: Mini Project Final

74

Page 75: Mini Project Final

CONCLUSION

AND

SCOPE FOR

FUTURE

ENHANCEMENT

75

Page 76: Mini Project Final

11. CONCLUSION AND SCOPE FOR FUTURE ENHANCEMENT

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 doesn’t 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.

76

Page 77: Mini Project Final

TEXTBOOKS

AND

WEB REFERENCES

77

Page 78: Mini Project Final

12. TEXTBOOKS AND WEB REFERENCES

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:

www.google.com

www.w3schools.com

http://www.php.net/

http://www.tizag.com/mysqlTutorial/mysqlquery.php

http://www.tutorialspoint.com/mysql/mysql-insert-query.htm

http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/insert-data-into-a-mysql-database.aspx

http://www.comptechdoc.org/independent/web/php/intro/phpmsinsert.html

78