Sei sulla pagina 1di 58

Leave Management System – Version 1.

KARPAGAM COLLEGE OF ENGINEERING


COIMBTORE-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
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
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 26
7 Defect Log 43
8 Application Screen Shots 47
9 Code Review 52
10 Conclusion
54
11 Bibliography
57

3
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 using C
language as a front end and back end as oracle.

4
Leave Management System – Version 1.0

Requirements Specification Document

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:

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

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

8
Leave Management System – Version 1.0

9
Leave Management System – Version 1.0

Design Documentation

Background – Leave Management System

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

2.1. Login module

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

2.2. Student Module

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

2.3. Staff Module

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.

Calling Function fnStaffMainMenu


Functions called by
fnStaffMainMenu
this function

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

Return Values None


Displays report for an individual person.
Description
Leave details and attendance details of particular student is displayed.
Calling Function fnReport
Functions called by
fnReport
this function

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

2.4. Attendance Module

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.

Table Name : STUDENT_DETAILS


Primary Key : studentid
Not null : studentid

15
Leave Management System – Version 1.0

Field Name Data Type Description

Studentid Varchar2(10) It describes the student id

It describes the password of the


PassWord Varchar2(15)
student
It describes the name of the
Studentname Varchar2(20)
student
It describes the attendance
Att_percent Float(126)
percentage of student
It describes the class details of
class Varchar2(10)
student
It describes the total number of
Totalleave Number
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

It describes the password for


Password Varchar2(15)
staff

Staffname Varchar2(20) It describes the name of the staff

It describes the class for which


Class Varchar2(20)
the staff is in-charge

Table Name : LEAVE

Field Name Data Type Description

Studentid Varchar2(10) It describe the student id

16
Leave Management System – Version 1.0

It describes the start date of the


leavedate Date
leave
It describes the reason for the
Leavereason char(50)
leave
It describes the status of the
Status char(20)
leave

1. TABLE STRUCTURE IN ORACLE

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

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

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;

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;

19
Leave Management System – Version 1.0

20
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 – Expected Reference To


Conditio Result Specification
n Documentation

21
Leave Management System – Version 1.0

Login Module

Login_fnLogin_Student Call fnLogin passing None Accept the fnLogin


Student and - which user name
is the only valid and display
student user id the student
main menu
Login_fnLogin_Invalid Call fnLogin by None If user name fnLogin
passing entered is
Invalid(NEGATIVE wrong then
TEST CASE) application
displays the
error
message and
terminated.
Login_fnLogin_Staff Call fnLogin passing None Accept the fnLogin
Staff and - which is user name
the only valid staff and display
user id the staff
main menu
Login_fnLogin_Invalid Call fnLogin by None If user name fnLogin
passing Invalid entered is
(NEGATIVE TEST wrong then
CASE) application
displays the
error
message and
terminated.
Student Module

Student_fnStudentMainMe Enter the choice 0 in None Display error fnStudentMain


nu_choice_0 StudentMainMenu message. Menu
which is an invalid
choice(NEGATIVE
TEST CASE)
Student_fnStudentMainMe Enter the choice 1 in None Display the fnStudentMain
nu_choice_1 StudentMainMenu student Menu
which is valid choice details

Student_fnStudentMainMe Enter the choice 2 in None Display the fnStudentMain


nu_choice_2 StudentMainMenu leave Menu
which is valid choice application

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

Student_fnStudentMainMe Enter the choice 4 in None Exits from fnStudentMain


nu_choice_4 StudentMainMenu student main Menu
which is valid choice menu

Staff_fnStaffMainMenu_ch Enter the choice 0 in None Display error fnStaffMainMen


oice_0 StaffMainMenu message. u
which is invalid
choice(NEGATIVE
TEST CASE)

Staff_fnStaffMainMenu_ch Enter the choice 1 in None Displays the fnStaffMainMen


oice_1 StaffMainMenu leave applied u
which is valid choice by the
students and
asks for
confirmation

Staff_fnStaffMainMenu_ch Enter the choice 2 in None Displays the fnStaffMainMen


oice_2 StaffMainMenu menu for u
which is valid choice report

Staff_fnStaffMainMenu_ch Enter the choice 3 in None Exits from fnStaffMainMen


oice_3 StaffMainMenu staff main u
which is valid choice menu

Staff_fnStaffMainMenu_fn Enter the choice 0 in None Displays fnReport


Report_choice_0 Report which is error
invalid message
choice(NEGATIVE
TEST CASE)

23
Leave Management System – Version 1.0

Staff_fnStaffMainMenu_fn Enter the choice 1 in None Displays the fnReport


Report_choice_1 Report which is overall report
valid choice of students

Staff_fnStaffMainMenu_fn Enter the choice 2 in None Displays the fnReport


Report_choice_2 Report which is individual
valid choice report of a
student
Staff_fnStaffMainMenu_fn Enter the choice 3 in None Displays fnReport
Report_choice_3 Report which is details of
valid choice students who
took leave on
a particular
day.
Staff_fnStaffMainMenu_fn Enter the choice 4 in None Exits from fnReport
Report_choice_4 Report which is the Report
valid choice menu

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

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

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

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

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

* 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
SELECT studentid,leavedate,leavereason

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

* 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()
{

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

DESCRIPTION DETECTED TYPE SEVERITY IMPACT PRIORITY INJECT ACTION


STAGE OF STAGE TAKEN
DETECT
Valid userid Unit testing Logical Medium Medium Medium Coding Fixed
detected as error
invalid

42
Leave Management System – Version 1.0

Flow not Unit testing Logical Medium Medium Medium Coding Fixed
redirected to error
staff home page

Missed Unit testing Syntax Medium Medium Medium Coding Fixed


semicolon error

Flow not Unit testing Logical Medium Medium Medium Coding Fixed
redirected to error
student home
page

Retrieved Unit testing Logical Medium Medium Medium Coding Fixed


studentid error
contains junk
value

2. STUDENT MODULE

43
Leave Management System – Version 1.0

DESCRIPTION DETECTED TYPE SEVERITY IMPACT PRIORITY INJECT ACTION


STAGE OF STAGE TAKEN
DETECT
Retrieved wrong Unit testing Logical Medium Medium Medium Coding Fixed
details from error
table

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

Flow Unit Logical complex complex complex Coding Fixed


terminates testing error
abruptly

On input 1 Unit Logical Medium Medium Medium Coding Fixed


flow not testing error
transfer to

DESCRIPTION DETECTED TYPE SEVERITY IMPACT PRIORITY INJECT ACTION


STAGE OF STAGE TAKEN
DETECT

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

Attendance Unit testing Logical Medium Medium Medium Coding Fixed


percent not error
displayed

On input 1 flow Unit testing Logical Medium Medium Medium Coding Fixed
not transferred to error
main page

3. STAFF MODULE

4. ATTENDANCE MODULE

DESCRIPTION DETECTED TYPE SEVERITY IMPACT PRIORITY INJECT ACTION


STAGE OF STAGE TAKEN

46
Leave Management System – Version 1.0

DETECT

Attendance Unit testing Logical Medium Medium Medium Coding Fixed


percent not error
updated on new
leave entry

Attendance Unit testing Logical Medium Medium Medium Coding Fixed


percent updated error
as 0 for every
entry

47
Leave Management System – Version 1.0

Screen Shots

Steps to Execute the Project

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.

S.No Module Name Function Name Line Description


Number
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 the
total 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 fnAttendance 31 The function completes the
Module task and it updates the output
in function itself and there is
no return of output to the
calling module. So make the
function to return the result to
calling function.

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. 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 Publications
Websites:

1. www.google.com
2. www.amazon.com
3. www.howstuffworks.com
4. www.studentstechnology.com

58

Potrebbero piacerti anche