5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 1/57
Leave Management System – Version 1.0
KARPAGAM COLLEGE OF ENGINEERINGCOIMBTORE-32
LEAVE MANAGEMENT SYSTEM
A PROJECT REPORT
Submitted as a part of INFOSYS CAMPUS CONNECT Training
By,
S.DIVYA SWATHI (08EE025)
DAHLIA JESVINE(08EE060)
OF
ELECTRICAL AND ELECTRONICS ENGINEERING
1
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 2/57
Leave Management System – Version 1.0
BONAFIDE CERTIFICATE
A certified project on is the bonafide work done by,S.Divya Swathi (08EE025) and Dahlia Jesvine (08EE060)
under the guidance of Ms.Rajeshwari, Professor and Head,
Department of Information Technology, and Karpagam
College of Engineering.
Endorsed by
Place: Coimbatore
Date: 29.12.2011
Ms.Rajeshwari,
Professor and Head,
Department of Information Technology,
Faculty Guide.
2
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 3/57
Leave Management System – Version 1.0
CONTENTS
S.No Description Page number
1 Abstract 4
2 Requirements Specifications 5
3 Design Documentation 10
4 Database Design 16
5 Test Plan 22
6 Sample Coding 267 Defect Log 43
8 Application Screen Shots 47
9 Code Review 52
10 Conclusion54
11 Bibliography57
3
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 4/57
Leave Management System – Version 1.0
ABSTRACT
The “Leave management system” software is user-friendly software. The main
objective of the system is which shows and helps you to collect most of the information about
Leave details of students.
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 usingC language as a front end and back end as oracle.
4
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 5/57
Leave Management System – Version 1.0
Requirements Specification Document
BACKGROUND:
5
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 6/57
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:
S.No Requirements Status
1 Login To be implemented
2 Student details To be implemented
3 Leave Application To be implemented
4 Leave Status To be implemented
5 Leave confirmation To be implemented6 Report To be implemented
7 Attendance To be implemented
LIST OF FILES SUPPLIED:
S.No Files Description
1 Login.c This file contains code for student and staff authentication.
2 Student.c This file consists of code details for maintaining student
attendance and leave details.
3 Application.c This file consists of code for leave application.
4 Status.c This file consists of code for displaying leave application
status details.
5 Confirm.c This file consists of code for accepting or rejecting the leave
application.
6 Report.c This file consists of code for displaying attendance and
leave report of all students
7 Attendance.c This file consists of code for calculating attendance
percentage.
1. LOGIN
6
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 7/57
Leave Management System – Version 1.0
• Should accept the user name.
• Should accept the password.
• The password should be of length between 5-10.
• The password should not be displayed on the screen.
• In case of wrong user name or password, deny access and display an error message.
• User name and password should be stored in a separate table.
• The user name can be either student or staff.
• Staff has the privilege to access all the student details..
• Once the student is authenticated, the main page containing the attendance details will
be displayed.
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
7
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 8/57
Leave Management System – Version 1.0
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:
• Status of the leave applied by student is displayed.
Accepted
Rejected
Posted
• If the leave accepted by the advisor the status will be Accepted.
• If the leave rejected by the advisor the status will be Rejected.
8
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 9/57
Leave Management System – Version 1.0
• If the advisor not yet viewed the application the status will be Posted.
• If the status is pending student can make modification with the application.
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.
9
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 10/57
Leave Management System – Version 1.0
10
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 11/57
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.
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.
This section describes the detailed design of the various modules in the Leave Management system.
11
Background – Leave Management System
1.High-Level Design
2. Detailed Design
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 12/57
Leave Management System – Version 1.0
Function: main
Parameters int argc, char** argv
Return Values Integer – Return code to OS
Description
Calls fnLogin to check the username and password
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
this functionfnLogin,fnStudentMainMenu,fnStaffMainMenu
Function: fnLogin
Parameters None
Return Values None
Description
Accepts the user id and the password from the user. If the user id and password
are valid, then returns VALID to the calling function. Otherwise returns
INVALID.
Calling Function Main
Functions called by
this function fnStudentMainMenu,fnStaffMainMenu
Function: fnStudentMainMenu
Parameters None
Return Values None
Description
Displays the student main menu. Then waits for user’s input using scanf
function. Until the user types in a selection, control will not be returned to the
calling function.
Calling Function main
Functions called by
this functionfnStudentDetails, fnLeaveApplication and fnLeaveStatus,fnLogin
12
2.1. Login module
2.2. Student Module
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 13/57
Leave Management System – Version 1.0
Function: fnStudentDetails
Parameters None
Return Values None
DescriptionDisplays student details like name,Register number.
Displays the current attendance percentage of student.Calling Function fnSudentMainMenu
Functions called by
this functionfnStudentMainMenu
Function: fnLeaveApplication
Parameters None
Return Values None
DescriptionDisplays the application form to the student for applying leave.
User fills the form and post the application.Calling Function fnStudentMainMenu
Functions called by
this functionfnAttendance, fnStudentMainMenu
Function: fnLeaveStatus
Parameters None
Return Values None
Description Displays the status of leave applied by the student.Calling Function fnStudentMainMenu
Functions called by
this functionfnStudentMainMenu
Function: fnStaffMainMenu
Parameters None
Return Values None
Description
Displays the staff main menu. Then waits for user’s input using scanf function.
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
13
2.3. Staff Module
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 14/57
Leave Management System – Version 1.0
this function
Function: fnConfirmLeave
Parameters None
Return Values None
Description
Displays all the leave applied by the students.
Displays the options for Confirming or rejecting the leave applied by the student
for every leave.
Calling Function fnStaffMainMenu
Functions called by
this functionfnStaffMainMenu
Function: fnReport
Parameters None
Return Values None
DescriptionDisplays options for displaying report.
Based on the type of the report selected by the user the report will be displayed.
Calling Function fnStaffMainMenu
Functions called bythis function
fnOverallReport,fnIndividualReport,fnLeaveReport, fnStaffMainMenu
Function: fnOverallReport
Parameters None
Return Values None
DescriptionDisplays the overall leave report of the particular class.
Displays details of all students and their leave details.
Calling Function fnReportFunctions called by
this functionfnReport
Function: fnIndividualReport
14
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 15/57
Leave Management System – Version 1.0
Parameters None
Return Values None
DescriptionDisplays report for an individual person.
Leave details and attendance details of particular student is displayed.
Calling Function fnReport
Functions called by
this functionfnReport
Function: fnLeaveReport
Parameters None
Return Values None
DescriptionDisplays leave details in the class.
Displays details of students who took leave on a particular day.
Calling Function fnReport
Functions called by
this functionfnReport
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
this function None
15
2.4. Attendance Module
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 16/57
Leave Management System – Version 1.0
Database Design
Online Leave Management System is developed using C and oracle consists of the following tables.
Table Name : STUDENT_DETAILS
Primary Key : studentid
Not null : studentid
16
DATABASE DESIGN
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 17/57
Leave Management System – Version 1.0
Field Name Data Type Description
Studentid Varchar2(10) It describes the student id
PassWord Varchar2(15) It describes the password of thestudent
Studentname Varchar2(20)It describes the name of the
student
Att_percent Float(126)It describes the attendance
percentage of student
class Varchar2(10)It describes the class details of
student
Totalleave Number It describes the total number of
leave took by the student
Table Name : STAFF_DETAILS
Primary Key : staffid
Unique key : class
Not null : staffed
Field Name Data Type Description
Staffid Varchar2(10) It describes the staff id
Password Varchar2(15)It describes the password for
staff
Staffname Varchar2(20) It describes the name of the staff
Class Varchar2(20)It describes the class for which
the staff is in-charge
Table Name : LEAVE
Field Name Data Type Description
Studentid Varchar2(10) It describe the student id
17
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 18/57
Leave Management System – Version 1.0
leavedate DateIt describes the start date of the
leave
Leavereason char(50)It describes the reason for the
leave
Status char(20)
It describes the status of the
leave
Table Structure
Table: Student
SQL> create table STUDENT_DETAILS(studentid varchar2(10) primary key,password
varchar2(15),studentname varchar2
(20),att_percent float,class varchar2(20),totalleave number);
Table created.
SQL> desc student_details;
Name Null? Type
----------------------------------------- -------- ----------------
STUDENTID NOT NULL VARCHAR2(10)
PASSWORD VARCHAR2(15)
STUDENTNAME VARCHAR2(20)
ATT_PERCENT FLOAT(126)
CLASS VARCHAR2(20)
TOTALLEAVE NUMBER
18
1. TABLE STRUCTURE IN ORACLE
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 19/57
Leave Management System – Version 1.0
Table: Staff
SQL> create table STAFF_DETAILS(staffid varchar2(10) ,password varchar2(15),staffname
varchar2(20),class varchar2(20) );
Table created.
SQL>Alter table STAFF_DETAILS ADD CONSTRAINT prkey1 primary key(staffid);
Table altered
SQL>Alter table STAFF_DETAILS ADD CONSTRAINT unkey1 unique(class);
Table altered
SQL> desc staff_details;
Name Null? Type
----------------------------------------- -------- - -------------------
STAFFID NOT NULL VARCHAR2(10)
PASSWORD VARCHAR2(15)
STAFFNAME VARCHAR2(20)CLASS VARCHAR2(20)
Table: Leave
SQL> create table LEAVE(studentid varchar2(10),leavedate varchar2(20),leavereason
char(50), status char(20));
Table created.
SQL> desc leave;
Name Null? Type
----------------------------------------- -------- ------------------
19
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 20/57
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;
5. The below query is used to retrieve the student details
SELECT STUDENTNAME ,CLASS,ATT_PERCENT INTO
:STUDENTNAME,:CLASS,:ATT_PER FROM STUDENT_DETAILS WHERE
STUDENTID=:ACSTULOGINID ;
6. The below query is used to retrieve the leave status
SELECT STATUS INTO :STATUS FROM LEAVE WHERE
STUDENTID=:ACSTULOGINID AND LEAVEDATE=:DATE;
20
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 21/57
Leave Management System – Version 1.0
21
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 22/57
Leave Management System – Version 1.0
Unit Test Plan
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.
Test Case Name Test Procedure Pre –
Conditio
n
Expected
Result
Reference To
Specification
Documentation
22
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 23/57
Leave Management System – Version 1.0
Login Module
Login_fnLogin_Student Call fnLogin passingStudent and - which
is the only validstudent user id
None Accept theuser name
and displaythe studentmain menu
fnLogin
Login_fnLogin_Invalid Call fnLogin by passing
Invalid(NEGATIVE
TEST CASE)
None If user nameentered is
wrong then
applicationdisplays the
error
message and
terminated.
fnLogin
Login_fnLogin_Staff Call fnLogin passingStaff and - which isthe only valid staff
user id
None Accept theuser nameand display
the staff
main menu
fnLogin
Login_fnLogin_Invalid Call fnLogin by
passing Invalid(NEGATIVE TEST
CASE)
None If user name
entered iswrong then
application
displays the
error
message andterminated.
fnLogin
Student Module
Student_fnStudentMainMenu_choice_0
Enter the choice 0 inStudentMainMenu
which is an invalid
choice(NEGATIVETEST CASE)
None Display error message.
fnStudentMainMenu
Student_fnStudentMainMe
nu_choice_1
Enter the choice 1 in
StudentMainMenu
which is valid choice
None Display the
student
details
fnStudentMain
Menu
Student_fnStudentMainMe
nu_choice_2
Enter the choice 2 in
StudentMainMenuwhich is valid choice
None Display the
leaveapplication
fnStudentMain
Menu
23
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 24/57
Leave Management System – Version 1.0
form for
applyingleave
Student_fnStudentMainMenu_choice_3
Enter the choice 3 inStudentMainMenu
which is valid choice
None Displays thestatus of
leave applied by thestudent
fnStudentMainMenu
Student_fnStudentMainMe
nu_choice_4
Enter the choice 4 in
StudentMainMenu
which is valid choice
None Exits from
student main
menu
fnStudentMain
Menu
Staff_fnStaffMainMenu_c
hoice_0
Enter the choice 0 in
StaffMainMenuwhich is invalidchoice(NEGATIVE
TEST CASE)
None Display error
message.
fnStaffMainMe
nu
Staff_fnStaffMainMenu_c
hoice_1
Enter the choice 1 in
StaffMainMenuwhich is valid choice
None Displays the
leave applied by the
students and
asks for
confirmation
fnStaffMainMe
nu
Staff_fnStaffMainMenu_choice_2
Enter the choice 2 inStaffMainMenu
which is valid choice
None Displays themenu for
report
fnStaffMainMenu
Staff_fnStaffMainMenu_choice_3
Enter the choice 3 inStaffMainMenu
which is valid choice
None Exits fromstaff main
menu
fnStaffMainMenu
Staff_fnStaffMainMenu_fnReport_choice_0
Enter the choice 0 inReport which is
invalid
choice(NEGATIVETEST CASE)
None Displayserror
message
fnReport
24
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 25/57
Leave Management System – Version 1.0
Staff_fnStaffMainMenu_fn
Report_choice_1
Enter the choice 1 in
Report which is
valid choice
None Displays the
overall report
of students
fnReport
Staff_fnStaffMainMenu_fn
Report_choice_2
Enter the choice 2 in
Report which is
valid choice
None Displays the
individual
report of a
student
fnReport
Staff_fnStaffMainMenu_fn
Report_choice_3
Enter the choice 3 in
Report which isvalid choice
None Displays
details of students who
took leave on
a particular day.
fnReport
Staff_fnStaffMainMenu_fnReport_choice_4
Enter the choice 4 inReport which is
valid choice
None Exits fromthe Report
menu
fnReport
25
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 26/57
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>
26
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 27/57
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"
27
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 28/57
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);
28
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 29/57
Leave Management System – Version 1.0
printf("\nEnter the password: ");
scanf("%s",acstupassword);
ilen=strlen(acstuloginid);
EXEC SQL
select STUDENTID into :aclogin from STUDENT_DETAILS where
STUDENTID=:acstuloginid AND PASSWORD=:acstupassword;
EXEC SQL COMMIT;
aclogin[ilen]='\0';
if(strcmp(acstuloginid,aclogin)==0)
{
printf("\nSUCCESS");
fnStudentMainMenu();
}
else
{
printf("\nINVALID USERNAME AND PASSWORD");
}
break;
case 2:
printf("\nEnter the userid: ");
scanf("%s",acstloginid);
printf("\nEnter the password: ");
scanf("%s",acstpassword);
ilen=strlen(acstloginid);
EXEC SQL
select STAFFID into :aclogin from STAFF_DETAILS where
STAFFID=:acstloginid AND PASSWORD =:acstpassword;
EXEC SQL COMMIT;
aclogin[ilen]='\0';
if(strcmp(acstloginid,aclogin)==0)
{
printf("\nSUCESS");
fnStaffMainMenu();
}
29
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 30/57
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;
30
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 31/57
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
31
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 32/57
Leave Management System – Version 1.0
* Input Parameters: None
* Returns: None
*********************************************************************************/
void fnLeaveApplication()
{
printf("\nLEAVE APPLICATION");
printf("\n--------------------------------");
EXEC SQL
select TOTALLEAVE,ATT_PERCENT into :ino_days,:fatt_per from
STUDENT_DETAILS where STUDENTID=:acstuloginid;
EXEC SQL COMMIT;
if(fatt_per<=75.00)
{
printf("\n!!!!!!!!!!!!!NO MORE LEAVES!!!!!!!!!!!!");
}
else
{
printf("\nEnter no of days:");
scanf("%d",&idays);
printf("\nEnter the leave date (dd-mmm-yyyy):");
scanf("%s",acdate);
printf("\nEnter the Reason(Medical,onduty,casual):");
scanf("%s",acreason);
no_days=no_days+days;
fnAttendance(ino_days);
EXEC SQL
insert into LEAVE values(:acstuloginid,:acdate,:acreason,'posted');
EXEC SQL COMMIT;
printf("\n\n***LEAVE POSTED SUCCESSFULLY***");
}
printf("\n\n\t\t\tpress 1 to go to student main menu");
scanf("%d",&ich);
if(ich==1)
fnStudentMainMenu();
32
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 33/57
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
33
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 34/57
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
34
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 35/57
Leave Management System – Version 1.0
* Description: Displays reoprts on leave and confirms student leaves
* Author: S.Divya Swathi
* Date: 29.12.2011
*********************************************************************************/
#include <stdio.h>
#include <conio.h>
#include<string.h>
#include<staff.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: fnConfirmLeave()
* Description: Accepts or Rejects the leave applied by student
* Input Parameters: None
* Returns: None
*********************************************************************************/
void fnConfirmLeave()
{
printf("\nCONFIRM LEAVE");
printf("\n----------------------------");
EXEC SQL
DECLARE confirm_cursor CURSOR FOR
35
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 36/57
Leave Management System – Version 1.0
SELECT studentid,leavedate,leavereason
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);
36
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 37/57
Leave Management System – Version 1.0
if(ch==1)
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;
37
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 38/57
Leave Management System – Version 1.0
EXEC SQL COMMIT WORK RELEASE;
}
/*********************************************************************************
* 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()
38
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 39/57
Leave Management System – Version 1.0
* Description: Generates leave report for a particular day
* Input Parameters: None
* Returns: None
*********************************************************************************/
void fnLeaveReport()
{
printf("\nLEAVE REPORT FOR A DAY");
printf("\n---------------------------");
printf("\nEnter the date(dd-mmm-yyyy):");
scanf("%s",acdate);
printf("\n%s",acdate);
printf("\n---------");
EXEC SQL
DECLARE leave_cursor CURSOR FOR SELECT STUDENTID,LEAVEREASON
FROM LEAVE WHERE DATE=:date AND STATUS='Accepted';
EXEC SQL OPEN leave_cursor;
EXEC SQL WHENEVER NOT FOUND DO break;
for (;;)
{
EXEC SQL FETCH leave_cursor INTO :acstudentid,:acreason;
printf("\n%s\t%s",studentid,reason);
}
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()
39
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 40/57
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()
40
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 41/57
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>
41
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 42/57
Leave Management System – Version 1.0
#include<string.h>
#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;
}
42
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 43/57
Leave Management System – Version 1.0
Defect Log
43
1. LOGIN MODULE
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 44/57
Leave Management System – Version 1.0
44
DESCRIPTION DETECTED
STAGE
TYPE
OF
DETECT
SEVERITY IMPACT PRIORITY INJECT
STAGE
ACTION
TAKEN
Valid userid
detected as
invalid
Unit testing Logical
error
Medium Medium Medium Coding Fixed
Flow not
redirected to
staff home page
Unit testing Logical
error
Medium Medium Medium Coding Fixed
Missed
semicolon
Unit testing Syntax
error
Medium Medium Medium Coding Fixed
Flow notredirected tostudent home
page
Unit testing Logicalerror
Medium Medium Medium Coding Fixed
Retrieved
studentid
contains junk value
Unit testing Logical
error
Medium Medium Medium Coding Fixed
DESCRIPTION DETECTED
STAGE
TYPE
OF
DETECT
SEVERITY IMPACT PRIORITY INJECT
STAGE
ACTION
TAKEN
Retrieved wrong
details from
table
Unit testing Logical
error
Medium Medium Medium Coding Fixed
Applied leave
not updated inleave table
Unit testing Logical
error
Medium Medium Medium Coding Fixed
Date formatmismatch
Unit testing Syntaxerror
Medium Medium Medium Coding Fixed
Flow
terminates
abruptly
Unit
testing
Logical
error
complex complex complex Coding Fixed
On input 1
flow not
transfer to
Unit
testing
Logical
error
Medium Medium Medium Coding Fixed
2. STUDENT MODULE
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 45/57
Leave Management System – Version 1.0
45
DESCRIPTION DETECTED
STAGE
TYPE
OF
DETECT
SEVERITY IMPACT PRIORITY INJECT
STAGE
ACTION
TAKEN
Multiple rowsnot retrieved
Unit testing Logicalerror
Medium Medium Medium Coding Fixed
Incorrect student
details retrieved
Unit testing Logical
error
Medium Medium Medium Coding Fixed
Duplicate valuesretrieved for
same entry
Unit testing Logicalerror
Medium Medium Medium Coding Fixed
Attendance
percent notdisplayed
Unit testing Logical
error
Medium Medium Medium Coding Fixed
On input 1 flownot transferred to
main page
Unit testing Logicalerror Medium Medium Medium Coding Fixed
3. STAFF MODULE
4. ATTENDANCE MODULE
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 46/57
Leave Management System – Version 1.0
46
DESCRIPTION DETECTED
STAGE
TYPE
OF
DETECT
SEVERITY IMPACT PRIORITY INJECT
STAGE
ACTION
TAKEN
Attendance
percent not
updated on new
leave entry
Unit testing Logical
error
Medium Medium Medium Coding Fixed
Attendance
percent updated
as 0 for every
entry
Unit testing Logical
error
Medium Medium Medium Coding Fixed
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 47/57
Leave Management System – Version 1.0
Screen Shots
LOGIN MODULE
47
Steps to Execute the Project
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 48/57
Leave Management System – Version 1.0
STUDENT MODULE
48
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 49/57
Leave Management System – Version 1.0
49
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 50/57
Leave Management System – Version 1.0
STAFF MODULE
50
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 51/57
Leave Management System – Version 1.0
51
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 52/57
Leave Management System – Version 1.0
Code Review
52
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 53/57
Leave Management System – Version 1.0
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.
S.No Module Name Function Name Line
Number
Description
1 Login Module fnLogin 20 The data type for login id is
declared as array of character.
Instead we can declare it as
int so access can be made
easy.
2 Student Module fnStudentDetails 32 Function does not display thetotal number of leaves. We
can include the code to
display number of leaves.
3 Staff Module fnConfirmLeave 49 Vaiable reason is declared as
a character array of size 50
but reason may not exceed 10
so we can alter the size of
array.
4 Attendance
Module
fnAttendance 31 The function completes the
task and it updates the outputin function itself and there is
no return of output to the
calling module. So make the
function to return the result to
calling function.
53
CODE REVIEW
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 54/57
Leave Management System – Version 1.0
Conclusion
54
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 55/57
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 enoughsecurity 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.
55
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 56/57
Leave Management System – Version 1.0
Bibliography
56
5/12/2018 Report Leave Management System (1) - slidepdf.com
http://slidepdf.com/reader/full/report-leave-management-system-1 57/57
Leave Management System – Version 1.0
BIBLIOGRAPHY
Books Referred:
1. Alex Homer , “Professional VB.NET 1.1”, 2004 Edition,
Wrox publications
2. Steven Holzner, “Visual Basic.NET Black Book”, 2003 Edition,
Dreamtech Publications
3. Steven Feuerstein and Billpribyl, “Oracle pl\Sql programming”
, P.1104(EST), O’reilly & associates, Inc, 2005.
4. Microsoft Sql server 2008 Management and Administrator by
Ross Misty.
5. Roger S Pressman, “Software Engineering”, 2000 Edition,
Dreamtech PublicationsWebsites:
1. www.google.com
2. www.amazon.com
3. www.howstuffworks.com
4. www.studentstechnology.com
57
Top Related