Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
A PROJECT REPORT
Submitted as a part of INFOSYS CAMPUS CONNECT Training
By,
OF
1
Leave Management System – Version 1.0
BONAFIDE CERTIFICATE
Endorsed by
Place: Coimbatore
Date: 29.12.2011
Ms.Rajeshwari,
Faculty Guide.
2
Leave Management System – Version 1.0
CONTENTS
3
Leave Management System – Version 1.0
ABSTRACT
The project Leave Management System includes student login, staff login. Student
login enables students to view their attendance details and also their leave status. They can
also apply for the leave. Staff login enables staff to confirm the leave applied by the students
of their class. They can either accept or reject the leave. Staff can also generate various reports
on the leave details. Attendance percent of the student calculated automatically and updated.
Students cannot apply for more leave when their attendance percent is below minimum.
The Leave Management System can be entered using a user id and password. It is
accessible either by a student or staff. Only they can add data into the database. The data can
be retrieved easily. The interface is very user-friendly. The data are well protected for personal
use and makes the data processing very fast. This project has been developed using C
language as a front end and back end as oracle.
4
Leave Management System – Version 1.0
BACKGROUND:
5
Leave Management System – Version 1.0
This document contains details of the project “Leave Management System” which is
to be implemented in C using Oracle database. Leave Management system is a system which
handles leave details of students.
BUSINESS REQUIREMENTS:
1. LOGIN
6
Leave Management System – Version 1.0
2. STUDENT DETAILS:
Current attendance percentage of student is displayed.
Attendance percentage is calculated based on number of working days and
number of days the student present.
Mark for current attendance percentage is displayed.
Allowed number of leaves is displayed
It is calculated from the current attendance percentage and the minimum
attendence percentage required
If the minimum level occurred student is not allowed to apply for leave.
Number of leaves took by the student is displayed.
Type of the leave is specified.
i. Medical leave
ii. On duty
iii. Casual leave
3. LEAVE APPLICATION :
Form for applying leave is displayed
Start and end date of leave is got from student
Type of leave is got from user.
On duty
Medical
Casual
In case of casual leave reason for leave is specified
Number of leave days is calculated from start and end date.
If the number of leave days exceed the maximum leave days student is not allowed to
apply for leave.
Else leave application is posted to the respective class advisor.
4. LEAVE STATUS:
7
Leave Management System – Version 1.0
5.LEAVE CONFIRMATION:
Leave applied by the students will be displayed in advisors page.
Advisor can view each application separately.
Based on the type and reason of leave ,application can be accepted or rejected.
Once accepted or rejected it is confirmed by the advisor.
6.REPORT:
Overall Report:
Displays register no, name, department and attendance percentage for all students
in the class.
Individual Report:
Displays leave details, attendance percentage and internal mark for attendance for
individual students.
Leave Report:
List of students who took leave in particular month are displayed.
7.ATTENDANCE:
Attendance percentage is calculated from the number of working days and number
of leave taken by the student.
Based on the attendance percentage internal marks for attendance is calculated.
8
Leave Management System – Version 1.0
9
Leave Management System – Version 1.0
Design Documentation
This project is a Leave Management System. This system maintains the Leave details and attendance
details of students.
1.High-Level Design
This section describes the high level design of the Leave Management system. The system has the
following modules:
1. Login: Accepts the user id and password. Validates the user id and password. If valid then
appropriate main menu is displayed. Otherwise a suitable error message is displayed.
2. Student: Displays students details, leave status and application for leave
3. Staff: Displays various reports such as overall, individual and leave reports.
4. Attendance: Calculates and updates attendance percentage of student.
2. Detailed Design
This section describes the detailed design of the various modules in the Leave Management system.
10
Leave Management System – Version 1.0
Function: main
Parameters int argc, char** argv
Return Values Integer – Return code to OS
Calls fnLogin to check the username and password
Description If the fnLogin returns VALID then fnStudentMainMenu or fnStaffMainMenu is
called. If the fnLogin returns INVALID, it displays the error message
Calling Function ---
Functions called by
fnLogin,fnStudentMainMenu,fnStaffMainMenu
this function
Function: fnLogin
Parameters None
Return Values None
Accepts the user id and the password from the user. If the user id and password
Description are valid, then returns VALID to the calling function. Otherwise returns
INVALID.
Calling Function Main
Functions called by
fnStudentMainMenu,fnStaffMainMenu
this function
Function: fnStudentMainMenu
Parameters None
Return Values None
Displays the student main menu. Then waits for user’s input using scanf
Description function. Until the user types in a selection, control will not be returned to the
calling function.
Calling Function main
Functions called by
fnStudentDetails, fnLeaveApplication and fnLeaveStatus,fnLogin
this function
11
Leave Management System – Version 1.0
Function: fnStudentDetails
Parameters None
Return Values None
Displays student details like name,Register number.
Description
Displays the current attendance percentage of student.
Calling Function fnSudentMainMenu
Functions called by
fnStudentMainMenu
this function
Function: fnLeaveApplication
Parameters None
Return Values None
Displays the application form to the student for applying leave.
Description
User fills the form and post the application.
Calling Function fnStudentMainMenu
Functions called by
fnAttendance, fnStudentMainMenu
this function
Function: fnLeaveStatus
Parameters None
Return Values None
Description Displays the status of leave applied by the student.
Calling Function fnStudentMainMenu
Functions called by
fnStudentMainMenu
this function
Function: fnStaffMainMenu
Parameters None
Return Values None
Displays the staff main menu. Then waits for user’s input using scanf function.
Description Until the user types in a selection, control will not be returned to the calling
function.
Calling Function Main
Functions called by
fnConfirmLeave,fnReport, fnLogin
this function
12
Leave Management System – Version 1.0
Function: fnConfirmLeave
Parameters None
Return Values None
Displays all the leave applied by the students.
Displays the options for Confirming or rejecting the leave applied by the student
Description
for every leave.
Function: fnReport
Parameters None
Return Values None
Displays options for displaying report.
Description
Based on the type of the report selected by the user the report will be displayed.
Calling Function fnStaffMainMenu
Functions called by
fnOverallReport,fnIndividualReport,fnLeaveReport, fnStaffMainMenu
this function
Function: fnOverallReport
Parameters None
Return Values None
Displays the overall leave report of the particular class.
Description
Displays details of all students and their leave details.
Calling Function fnReport
Functions called by
fnReport
this function
Function: fnIndividualReport
Parameters None
13
Leave Management System – Version 1.0
Function: fnLeaveReport
Parameters None
Return Values None
Displays leave details in the class.
Description
Displays details of students who took leave on a particular day.
Calling Function fnReport
Functions called by
fnReport
this function
Function: fnAttendance
Parameters None
Return Values fAttetndancePercent-Current attendance percentage of the student.
Description Calculates the attendance percentage of the student based on the leave taken.
Calling Function fnStudentDetails
Functions called by
None
this function
14
Leave Management System – Version 1.0
Database Design
DATABASE DESIGN
Online Leave Management System is developed using C and oracle consists of the following tables.
15
Leave Management System – Version 1.0
16
Leave Management System – Version 1.0
Table Structure
Table: Student
17
Leave Management System – Version 1.0
Table: Staff
Table: Leave
18
Leave Management System – Version 1.0
STUDENTID VARCHAR2(10)
LEAVEDATE VARCHAR2(20)
LEAVEREASON CHAR(50)
STATUS CHAR(20)
NOTE:
1. The Student_details table must contain at least one record using INSERT query and the
studentid should not have null values as it is set to primary key.
INSERT INTO STUDENT_DETAILS VALUES(‘09cse01’,’123’,’alice’,100,’cse-b’,0);
2. The staff_details must contain at least one record and that can be done by using INSERT
query. staffId should not have null values as it is set to primary key.
INSERT INTO STAFF_DETAILS VALUES (‘cs100’,’staff1’,’bob’,’cse-b’);
3. The given query is used to retrieve the studentid and password from student_details table
SELECT STUDENTID INTO :ACLOGIN FROM STUDENT_DETAILS WHERE
STUDENTID=:ACSTULOGINID AND PASSWORD=:ACSTUPASSWORD;
4. The given query is used to retrieve the staffid and password from staff_details table
SELECT STAFFID INTO :ACLOGIN FROM STAFF_DETAILS WHERE
STAFFID=:ACSTLOGINID AND PASSWORD =:ACSTPASSWORD;
19
Leave Management System – Version 1.0
20
Leave Management System – Version 1.0
UNIT TESTING
Each individual code is tested to ensure that it performs its intended functionality. Unit
tests are created using some techniques which ensure that all logical paths of the code unit are
tested.
21
Leave Management System – Version 1.0
Login Module
22
Leave Management System – Version 1.0
form for
applying
leave
Student_fnStudentMainMe Enter the choice 3 in None Displays the fnStudentMain
nu_choice_3 StudentMainMenu status of Menu
which is valid choice leave applied
by the
student
23
Leave Management System – Version 1.0
24
Leave Management System – Version 1.0
Sample Coding
SAMPLE CODING
The sample coding consists of the code for login module,student module,staff module
and attendance modue.
/*********************************************************************************
* Filename: Main.pc
* Description: calls the login function for enabling user to login
* Author: S.Divya swathi
* Date: 29.12.2011
*********************************************************************************/
#include <stdio.h>
25
Leave Management System – Version 1.0
#include <conio.h>
#include<string.h>
exec sql begin declare section;
char *userName="cse_08cse90";
char *password="sql";
char *srvr="siet";
int ich;
exec sql end declare section;
exec sql include sqlca;
void main()
{
exec sql connect :userName identified by :password using :srvr;
printf("\n****LEAVE MANAGEMENT SYSTEM****");
printf("\n--------------------------------");
printf("\nPRESS 1 TO GOTO LOGIN MENU");
scanf("%d",ich);
if(ich==1)
fnlogin();
else
exit(1);
}
LOGIN MODULE
/*********************************************************************************
* Filename: Login.pc
* Description: Accept the user name and password from user and allow access if authorized
* user.
* Author: Dahlia Jesvine
* Date: 29.12.2011
*********************************************************************************/
#include <stdio.h>
#include <conio.h>
#include<string.h>
#include "dos.h"
26
Leave Management System – Version 1.0
#include "login.h"
exec sql begin declare section;
char acstuloginid[10];
char acstupassword[15];
char acstloginid[10];
char acstpassword[15];
int i,ich,if,ilen,ino_days,icnt;
char c;
char aclogin[10];
char acpass[15];
char acstudentname[20],acstudentid[10],acclass[20],acdate[20],acstatus[20],acreason[50];
float fatt_per;
int idays;
exec sql end declare section;
exec sql include sqlca;
/*********************************************************************************
* Function: fnlogin()
* Description: Accepts the user id from the user. If the user id
* is valid, then calls the appropriate home page
* Input Parameters: None
* Returns: An integer
*********************************************************************************/
int fnlogin()
{
printf("\nLEAVE MANAGEMENT SYSTEM");
printf("\nMAIN MENU");
printf("\n\n1.Student login\n2.Staff login\n3.Exit");
printf("\nEnter the choice");
scanf("%d",&ich);
switch(ich)
{
case 1:
printf("\nEnter the userid: ");
scanf("%s",acstuloginid);
27
Leave Management System – Version 1.0
28
Leave Management System – Version 1.0
else
{
printf("\nINVALID USERNAME AND PASSWORD");
}
break;
case 3:
return(1);
}
getch();
}
STUDENT MODULE
/*********************************************************************************
* Filename: student.pc
* Description: Provides options for student to view their details, leave status and apply
* for leave
* Author: Dahlia Jeavine
* Date: 29.12.2011
*********************************************************************************/
#include <stdio.h>
#include <conio.h>
#include<string.h>
#include<student.h>
exec sql begin declare section;
char acstuloginid[10];
char acstupassword[15];
char acstloginid[10];
char acstpassword[15];
int i,ich,if,ilen,ino_days,icnt;
char c;
char aclogin[10];
char acpass[15];
char acstudentname[20],acstudentid[10],acclass[20],acdate[20],acstatus[20],acreason[50];
float fatt_per;
29
Leave Management System – Version 1.0
int idays;
exec sql end declare section;
exec sql include sqlca;
/*********************************************************************************
* Function: fnStudentDetails()
* Description: Displays the details of the student
* Input Parameters: None
* Returns: None
*********************************************************************************/
void fnStudentDetails()
{
printf("\nDETAILS");
printf("\n\n-------------------");
EXEC SQL
select STUDENTNAME ,CLASS,ATT_PERCENT into
:acstudentname,:acclass,:fatt_per from STUDENT_DETAILS where
STUDENTID=:acstuloginid ;
EXEC SQL COMMIT;
printf("\nNAME:%s",acstudentname);
printf("\nROLLNO:%s",acstuloginid);
printf("\nCLASS:%s",acclass);
printf("\nATTEDENCE%:%f",fatt_per);
printf("\n\n\t\t\tpress 1 to go to student main menu");
scanf("%d",&ich);
if(ich==1)
fnStudentMainMenu();
else
printf("\nInvalid choice");
}
/*********************************************************************************
* Function: fnLeaveApplication()
* Description: Get data from student for applying for new leave
30
Leave Management System – Version 1.0
31
Leave Management System – Version 1.0
else
printf("\nInvalid choice");
}
/*********************************************************************************
* Function: fnLeaveStatus()
* Description: Displays the status of the leave applied by students
* Input Parameters: None
* Returns: None
*********************************************************************************/
void fnLeaveStatus()
{
printf("\nLEAVE STATUS");
printf("\n----------------------");
printf("\nEnter the leave date (dd-mmm-yyyy):");
scanf("%s",acdate);
EXEC SQL
select STATUS into :acstatus from LEAVE where STUDENTID=:acstuloginid AND
LEAVEDATE=:acdate;
EXEC SQL COMMIT;
printf("\nStatus of leave:%s",acstatus);
printf("\n\n\t\t\tpress 1 to go to student main menu");
scanf("%d",&ich);
if(ich==1)
fnStudentMainMenu();
else
printf("\nInvalid choice");
}
/*********************************************************************************
* Function: fnStudentMainMenu()
* Description: Displays the menu for student
* Input Parameters: None
* Returns: An integer
32
Leave Management System – Version 1.0
*********************************************************************************/
int fnStudentMainMenu()
{
int iflag;
int ich;
fflush(stdout);
printf("\n--------------------------------------------------------");
printf("\n--------------------------------------------------------");
printf("\nLEAVE MANAGEMENT SYSTEM");
printf("\n--------------------------------------------------------");
printf("\n--------------------------------------------------------");
printf("\n\t\tSTUDENT PAGE");
printf("\n1.VIEW DETAILS\n2.APLLY FOR LEAVE\n3.VIEW LEAVE STATUS\n4.EXIT");
printf("\nEnter the choice:");
scanf("%d",&ich);
switch(ich)
{
case 1:
fnStudentDetails();
break;
case 2:
fnLeaveApplication();
break;
case 3:
fnLeaveStatus();
break;
case 4:
return(1);
}
}
STAFF MODULE
/*********************************************************************************
* Filename: Staff.pc
* Description: Displays reoprts on leave and confirms student leaves
33
Leave Management System – Version 1.0
34
Leave Management System – Version 1.0
FROM LEAVE
WHERE status = 'posted';
EXEC SQL OPEN confirm_cursor;
EXEC SQL WHENEVER NOT FOUND DO break;
for(;;)
{
EXEC SQL
FETCH confirm_cursor into :acstudentid,:acdate,:acreason;
printf("\n%s\t%s\t%s",acstudentid,acdate,acreason);
printf("\nAccept(y/n)?");
scanf("%c",&c);
if(c=='y')
{
EXEC SQL
update LEAVE set status='ACCEPTED' where
STUDENTID=:acstudentid AND LEAVEDATE=:acdate;
EXEC SQL COMMIT;
}
else if(c=='n')
{
EXEC SQL
update LEAVE set status='REJECTED' where
STUDENTID=:acstudentid AND LEAVEDATE=:acdate;
EXEC SQL COMMIT;
}
else
printf("\nEnter y/n:");
}
EXEC SQL CLOSE confirm_cursor;
EXEC SQL COMMIT WORK RELEASE;
printf("\n\n\t\t\tpress 1 to go to staff main menu:");
scanf("%d",&ich);
if(ch==1)
35
Leave Management System – Version 1.0
fnStaffMainMenu();
else
printf("\nInvalid choice");
}
/*********************************************************************************
* Function: fnOverallReport()
* Description: Generates overall leave report for a class
* Input Parameters: None
* Returns: None
*********************************************************************************/
void fnOverallReport()
{
EXEC SQL
select class into :acclass from STAFF_DETAILS where STAFFID=:acstloginid;
EXEC SQL COMMIT;
EXEC SQL
DECLARE overall_cursor CURSOR FOR
select st.studentid,st.studentname,st.class,l.leavedate,l.leavereason from
student_details st, leave l where st.class=:class AND
st.studentid=l.studentid;
EXEC SQL OPEN overall_cursor;
EXEC SQL WHENEVER NOT FOUND DO break;
printf("\nOVERALL LEAVE REPORT FOR CLASS %s",class);
printf("\n--------------------------------------------");
for (;;)
{
EXEC SQL FETCH overall_cursor INTO
:acstudentid,:acstudentname,:acclass,:acdate,:acreason;
printf("\n%s\t%s\t%s\t%s\t%s",acstudentid,acstudentname,acclass,acdate,acreason);
}
EXEC SQL CLOSE overall_cursor;
EXEC SQL COMMIT WORK RELEASE;
36
Leave Management System – Version 1.0
}
/*********************************************************************************
* Function: fnIndividualReport()
* Description: Generates individual leave report
* Input Parameters: None
* Returns: None
*********************************************************************************/
void fnIndividualReport()
{
printf("\nINDIVIDUAL REPORT");
printf("\n----------------------------");
printf("\nEnter the student id:");
scanf("%s",acstudentid);
EXEC SQL
DECLARE indiv_cursor CURSOR FOR
SELECT LEAVEDATE,LEAVEREASON,STATUS FROM LEAVE WHERE
STUDENTID=:studentid AND STATUS='Accepted';
EXEC SQL OPEN indiv_cursor;
EXEC SQL WHENEVER NOT FOUND DO break;
printf("\nREPORT FOR %s",studentid);
printf("\n----------------------------------");
for (;;)
{
EXEC SQL FETCH indiv_cursor INTO :acdate,:acreason,:acstatus;
printf("\n%s\t%s\t%s",acdate,acreason,acstatus);
}
EXEC SQL CLOSE indiv_cursor;
EXEC SQL COMMIT WORK RELEASE;
}
/*********************************************************************************
* Function: fnLeaveReport()
* Description: Generates leave report for a particular day
37
Leave Management System – Version 1.0
}
EXEC SQL CLOSE leave_cursor;
EXEC SQL COMMIT WORK RELEASE;
}
/*********************************************************************************
* Function: fnReport()
* Description: Displays menu for report
* Input Parameters: None
* Returns: An integer
*********************************************************************************/
int fnReport()
{
38
Leave Management System – Version 1.0
printf("\nREPORT");
printf("\n----------------");
printf("\n1.overall report\n2.Individual Report\n3.Leave Report of day\n4.Exit");
printf("\nSElect the type:");
scanf("%d",&ich);
switch(ich)
{
case 1:
fnOverallReport();
break;
case 2:
fnIndividualReport();
break;
case 3:
fnLeaveReport();
break;
case 4:
return(1);
}
printf("\n\n\t\t\tpress 1 to go to staff main menu:");
scanf("%d",&ich);
if(ich==1)
fnStaffMainMenu();
else
printf("\nInvalid choice");
}
/*********************************************************************************
* Function: fnStaffMainMenu()
* Description: Displays staff main menu
* Input Parameters: None
* Returns: An integer
*********************************************************************************/
int fnStaffMainMenu()
{
39
Leave Management System – Version 1.0
int iflag;
int ich;
fflush(stdout);
printf("\n--------------------------------------------------------");
printf("\n--------------------------------------------------------");
printf("\nLEAVE MANAGEMENT SYSTEM");
printf("\n--------------------------------------------------------");
printf("\n--------------------------------------------------------");
printf("\n\t\tSTAFF PAGE");
printf("\n1.CONFIRM LEAVE\n2.VIEW REPORT\n3.EXIT");
printf("\nEnter the choice:");
scanf("%d",&ich);
switch(ich)
{
case 1:
fnConfirmLeave();
break;
case 2:
fnReport();
break;
case 3:
return(1);
}
}
ATTENDANCE MODULE
/*********************************************************************************
* Filename: Attendance.pc
* Description: Calculates the attendance percent
* Author: Divya Swathi
* Date: 29.12.2011
*********************************************************************************/
#include <stdio.h>
#include <conio.h>
#include<string.h>
40
Leave Management System – Version 1.0
#include<attendance.h>
exec sql begin declare section;
int ino_days;
float fatt_per;
exec sql end declare section;
exec sql include sqlca;
/*********************************************************************************
* Function: fnAttendance(int ino_days)
* Description: Accepts the total no.of days and caculates the attendance percent
* Input Parameters: Number of days
* Returns: None
*********************************************************************************/
void fnAttendance(int ino_days)
{
fatt_per=((150.00-no_days)/150)*100;
EXEC SQL
update STUDENT_DETAILS set
ATT_PERCENT=:fatt_per,TOTALLEAVE=:ino_days where
STUDENTID=:acstuloginid;
EXEC SQL COMMIT;
}
41
Leave Management System – Version 1.0
Defect Log
1. LOGIN MODULE
42
Leave Management System – Version 1.0
Flow not Unit testing Logical Medium Medium Medium Coding Fixed
redirected to error
staff home page
Flow not Unit testing Logical Medium Medium Medium Coding Fixed
redirected to error
student home
page
2. STUDENT MODULE
43
Leave Management System – Version 1.0
Applied leave Unit testing Logical Medium Medium Medium Coding Fixed
not updated in error
leave table
Date format Unit testing Syntax Medium Medium Medium Coding Fixed
mismatch error
44
Leave Management System – Version 1.0
Multiple rows Unit testing Logical Medium Medium Medium Coding Fixed
not retrieved error
45
Leave Management System – Version 1.0
Incorrect student Unit testing Logical Medium Medium Medium Coding Fixed
details retrieved error
Duplicate values Unit testing Logical Medium Medium Medium Coding Fixed
retrieved for error
same entry
On input 1 flow Unit testing Logical Medium Medium Medium Coding Fixed
not transferred to error
main page
3. STAFF MODULE
4. ATTENDANCE MODULE
46
Leave Management System – Version 1.0
DETECT
47
Leave Management System – Version 1.0
Screen Shots
LOGIN MODULE
48
Leave Management System – Version 1.0
STUDENT MODULE
49
Leave Management System – Version 1.0
50
Leave Management System – Version 1.0
STAFF MODULE
51
Leave Management System – Version 1.0
52
Leave Management System – Version 1.0
Code Review
53
Leave Management System – Version 1.0
CODE REVIEW
Code Review is used to review the coding and report the user as how they can use the
variables, how to proceed with loop, array, functions and logical concepts.
54
Leave Management System – Version 1.0
Conclusion
55
Leave Management System – Version 1.0
CONCLUSION
The project Leave Management System has been developed based on the business
requirements. The project has met its objectives. The system reliability is high and enough
security has been provided. The system is very simple in design and to implement. The new
computerized system was found to be much faster, reliable and user friendly.
As the project Leave management system consists of student details, it enables the
registered students to access the application and also students can apply for leave, the leave
details are stored separately. In future we have planned to make this project online process by
adding extra modules such as add student, remove student, add class and etc, so that new
student can register their details online and can apply for leave through online.
56
Leave Management System – Version 1.0
Bibliography
57
Leave Management System – Version 1.0
BIBLIOGRAPHY
Books Referred:
1. www.google.com
2. www.amazon.com
3. www.howstuffworks.com
4. www.studentstechnology.com
58