Sie sind auf Seite 1von 57

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

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: Date: Coimbatore 29.12.2011

Ms.Rajeshwari, Professor and Head, Department of Information Technology, Faculty Guide.

Leave Management System Version 1.0

CONTENTS

S.No 1 2 3 4 5 6 7 8 9 10 11 Abstract

Description Requirements Specifications Design Documentation Database Design Test Plan Sample Coding Defect Log Application Screen Shots Code Review Conclusion Bibliography

Page number 4 5 10 16 22 26 43 47 52 54 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 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. percent of the student calculated automatically and updated. Students cannot apply for more leave when their attendance percent is below

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 1 2 3 4 5 6 7 Requirements Login Student details Leave Application Leave Status Leave confirmation Report Attendance Status To be implemented To be implemented To be implemented To be implemented To be implemented To be implemented To be implemented

LIST OF FILES SUPPLIED:


S.No 1 2 3 4 5 6 7 Login.c Student.c Application.c Status.c Confirm.c Report.c Attendance.c Files Description This file contains code for student and staff authentication. This file consists of code details for maintaining student attendance and leave details. This file consists of code for leave application. This file consists of code for displaying leave application status details. This file consists of code for accepting or rejecting the leave application. This file consists of code for displaying attendance and leave report of all students 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
7

Leave Management System Version 1.0

ii. iii.

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

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.

Leave Management System Version 1.0

10

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

Leave Management System Version 1.0

2.1. Login module Function: main


Parameters Return Values Description Calling Function Functions called by this function int argc, char** argv Integer Return code to OS 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 --fnLogin,fnStudentMainMenu,fnStaffMainMenu

Function: fnLogin
Parameters Return Values Description Calling Function Functions called by this function None None 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. Main fnStudentMainMenu,fnStaffMainMenu

2.2. Student Module Function: fnStudentMainMenu


Parameters Return Values Description Calling Function Functions called by this function None None Displays the student main menu. Then waits for users input using scanf function. Until the user types in a selection, control will not be returned to the calling function. main fnStudentDetails, fnLeaveApplication and fnLeaveStatus,fnLogin

12

Leave Management System Version 1.0

Function: fnStudentDetails
Parameters Return Values Description Calling Function Functions called by this function None None Displays student details like name,Register number. Displays the current attendance percentage of student. fnSudentMainMenu fnStudentMainMenu

Function: fnLeaveApplication
Parameters Return Values Description Calling Function Functions called by this function None None Displays the application form to the student for applying leave. User fills the form and post the application. fnStudentMainMenu fnAttendance, fnStudentMainMenu

Function: fnLeaveStatus
Parameters Return Values Description Calling Function Functions called by this function None None Displays the status of leave applied by the student. fnStudentMainMenu fnStudentMainMenu

2.3. Staff Module Function: fnStaffMainMenu


Parameters Return Values Description Calling Function Functions called by None None Displays the staff main menu. Then waits for users input using scanf function. Until the user types in a selection, control will not be returned to the calling function. Main fnConfirmLeave,fnReport, fnLogin
13

Leave Management System Version 1.0

this function

Function: fnConfirmLeave
Parameters Return Values None None Displays all the leave applied by the students. Displays the options for Confirming or rejecting the leave applied by the student for every leave. fnStaffMainMenu fnStaffMainMenu

Description

Calling Function Functions called by this function

Function: fnReport
Parameters Return Values Description Calling Function Functions called by this function None None Displays options for displaying report. Based on the type of the report selected by the user the report will be displayed. fnStaffMainMenu fnOverallReport,fnIndividualReport,fnLeaveReport, fnStaffMainMenu

Function: fnOverallReport
Parameters Return Values Description Calling Function Functions called by this function None None Displays the overall leave report of the particular class. Displays details of all students and their leave details. fnReport fnReport

Function: fnIndividualReport

14

Leave Management System Version 1.0

Parameters Return Values Description Calling Function Functions called by this function

None None Displays report for an individual person. Leave details and attendance details of particular student is displayed. fnReport fnReport

Function: fnLeaveReport
Parameters Return Values Description Calling Function Functions called by this function None None Displays leave details in the class. Displays details of students who took leave on a particular day. fnReport fnReport

2.4. Attendance Module Function: fnAttendance


Parameters Return Values Description Calling Function Functions called by this function None fAttetndancePercent-Current attendance percentage of the student. Calculates the attendance percentage of the student based on the leave taken. fnStudentDetails None

15

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 Primary Key Not null : STUDENT_DETAILS : studentid : studentid

16

Leave Management System Version 1.0

Field Name Studentid PassWord Studentname Att_percent class Totalleave

Data Type Varchar2(10) Varchar2(15) Varchar2(20) Float(126) Varchar2(10) Number

Description It describes the student id It describes the password of the student It describes the name of the student It describes the attendance percentage of student It describes the class details of student It describes the total number of leave took by the student

Table Name Primary Key Unique key Not null

: STAFF_DETAILS : staffid : class : staffed

Field Name Staffid Password Staffname Class

Data Type Varchar2(10) Varchar2(15) Varchar2(20) Varchar2(20)

Description It describes the staff id It describes the password for staff It describes the name of the staff It describes the class for which the staff is in-charge

Table Name

: LEAVE

Field Name Studentid

Data Type Varchar2(10)

Description It describe the student id

17

Leave Management System Version 1.0

leavedate Leavereason Status

Date char(50) char(20)

It describes the start date of the leave It describes the reason for the leave It describes the status of the 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 ----------------------------------------STUDENTID PASSWORD STUDENTNAME ATT_PERCENT CLASS TOTALLEAVE
18

Null? -------NOT NULL

Type ---------------VARCHAR2(10) VARCHAR2(15) VARCHAR2(20) FLOAT(126) VARCHAR2(20) NUMBER

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 ----------------------------------------STAFFID PASSWORD STAFFNAME CLASS Null? -------- NOT NULL Type ------------------VARCHAR2(10) VARCHAR2(15) VARCHAR2(20) 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? -------19

Type ------------------

Leave Management System Version 1.0

STUDENTID LEAVEDATE LEAVEREASON STATUS NOTE:

VARCHAR2(10) VARCHAR2(20) CHAR(50) CHAR(20)

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 FROM STUDENT_DETAILS INTO WHERE :STUDENTNAME,:CLASS,:ATT_PER 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

Leave Management System Version 1.0

21

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

Leave Management System Version 1.0

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

Login_fnLogin_Invalid

None

fnLogin

Login_fnLogin_Staff

Call fnLogin passing Staff and - which is the only valid staff user id Call fnLogin by passing Invalid (NEGATIVE TEST CASE)

None

fnLogin

Login_fnLogin_Invalid

None

fnLogin

Student Module

Student_fnStudentMainMe nu_choice_0

Enter the choice 0 in None StudentMainMenu which is an invalid choice(NEGATIVE TEST CASE) Enter the choice 1 in None StudentMainMenu which is valid choice Enter the choice 2 in None StudentMainMenu which is valid choice
23

Display error message.

fnStudentMain Menu

Student_fnStudentMainMe nu_choice_1 Student_fnStudentMainMe nu_choice_2

Display the student details Display the leave application

fnStudentMain Menu fnStudentMain Menu

Leave Management System Version 1.0

Student_fnStudentMainMe nu_choice_3

Enter the choice 3 in None StudentMainMenu which is valid choice

form for applying leave Displays the status of leave applied by the student Exits from student main menu Display error message.

fnStudentMain Menu

Student_fnStudentMainMe nu_choice_4

Enter the choice 4 in None StudentMainMenu which is valid choice Enter the choice 0 in StaffMainMenu which is invalid choice(NEGATIVE TEST CASE) None

fnStudentMain Menu

Staff_fnStaffMainMenu_c hoice_0

fnStaffMainMe nu

Staff_fnStaffMainMenu_c hoice_1

Enter the choice 1 in None StaffMainMenu which is valid choice

Displays the leave applied by the students and asks for confirmation Displays the menu for report Exits from staff main menu

fnStaffMainMe nu

Staff_fnStaffMainMenu_c hoice_2

Enter the choice 2 in None StaffMainMenu which is valid choice Enter the choice 3 in None StaffMainMenu which is valid choice

fnStaffMainMe nu

Staff_fnStaffMainMenu_c hoice_3

fnStaffMainMe nu

Staff_fnStaffMainMenu_fn Report_choice_0

Enter the choice 0 in Report which is invalid choice(NEGATIVE TEST CASE)

None

Displays error message

fnReport

24

Leave Management System Version 1.0

Staff_fnStaffMainMenu_fn Report_choice_1

Enter the choice 1 in Report which is valid choice Enter the choice 2 in Report which is valid choice Enter the choice 3 in Report which is valid choice

None

Displays the fnReport overall report of students Displays the fnReport individual report of a student Displays fnReport details of students who took leave on a particular day. Exits from fnReport the Report menu

Staff_fnStaffMainMenu_fn Report_choice_2 Staff_fnStaffMainMenu_fn Report_choice_3

None

None

Staff_fnStaffMainMenu_fn Report_choice_4

Enter the choice 4 in Report which is valid choice

None

25

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

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 * * Author: Dahlia Jesvine * Date: 29.12.2011 *********************************************************************************/ #include <stdio.h> #include <conio.h> #include<string.h> #include "dos.h"
27

user.

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

is valid, then calls the appropriate home page

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

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

for leave

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

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

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

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

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

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

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

leave l where st.class=:class AND

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

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

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

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

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

Leave Management System Version 1.0

Defect Log

1. LOGIN MODULE

43

Leave Management System Version 1.0

2. STUDENT 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 Flow not redirected to staff home page Missed semicolon Flow not redirected to student home page Retrieved studentid contains junk value Unit testing Logical error Syntax error Logical error Medium Medium Medium Coding Fixed

Unit testing Unit testing

Medium Medium

Medium Medium

Medium Medium

Coding Coding

Fixed Fixed

Unit testing

Logical error

Medium

Medium

Medium

Coding

Fixed

Flow Unit Logical complex complex complex Coding Fixed terminates testing error DESCRIPTION DETECTED TYPE SEVERITY IMPACT PRIORITY INJECT ACTION abruptly STAGE OF STAGE TAKEN DETECT Retrieved wrong Unit testing Logical Medium Medium Medium Coding Fixed details from error Logical Medium Medium Medium Coding Fixed table On input 1 Unit flow not testing error transfer to Applied leave Unit testing Logical Medium Medium Medium Coding Fixed not updated in error leave table Date format mismatch Unit testing Syntax error Medium Medium Medium Coding Fixed

44

Leave Management System Version 1.0

3. STAFF MODULE

4. ATTENDANCE MODULE

DESCRIPTION DETECTED TYPE SEVERITY IMPACT PRIORITY INJECT ACTION STAGE OF STAGE TAKEN DETECT Multiple rows not retrieved Incorrect student details retrieved Duplicate values retrieved for same entry Attendance percent not displayed On input 1 flow not transferred to main page Unit testing Logical error Logical error Logical error Medium Medium Medium Coding Fixed

Unit testing

Medium

Medium

Medium

Coding

Fixed

Unit testing

Medium

Medium

Medium

Coding

Fixed

Unit testing

Logical error

Medium

Medium

Medium

Coding

Fixed

Unit testing

Logical error

Medium

Medium

Medium

Coding

Fixed

45

Leave Management System Version 1.0

DESCRIPTION DETECTED TYPE SEVERITY IMPACT PRIORITY INJECT ACTION STAGE OF STAGE TAKEN DETECT Attendance percent not updated on new leave entry Attendance percent updated as 0 for every entry Unit testing Logical error Medium Medium Medium Coding Fixed

Unit testing

Logical error

Medium

Medium

Medium

Coding

Fixed

46

Leave Management System Version 1.0

Screen Shots

Steps to Execute the Project LOGIN MODULE


47

Leave Management System Version 1.0

STUDENT MODULE

48

Leave Management System Version 1.0

49

Leave Management System Version 1.0

STAFF MODULE

50

Leave Management System Version 1.0

51

Leave Management System Version 1.0

Code Review

52

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 1 Module Name Login Module Function Name fnLogin Line Number 20 Description 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. Function does not display the total number of leaves. We can include the code to display number of leaves. 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. The function completes the 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.

Student Module

fnStudentDetails

32

Staff Module

fnConfirmLeave

49

Attendance Module

fnAttendance

31

53

Leave Management System Version 1.0

Conclusion

54

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.

55

Leave Management System Version 1.0

Bibliography

56

Leave Management System Version 1.0

BIBLIOGRAPHY

Books Referred: Alex Homer , Professional VB.NET 1.1, 2004 Edition, Wrox publications
2.

1.

Steven Holzner, Visual Basic.NET Black Book, 2003 Edition, Dreamtech Publications

3. Steven Feuerstein and Billpribyl, Oracle pl\Sql programming , P.1104(EST), Oreilly & associates, Inc, 2005. 4. Microsoft Sql server 2008 Management and Administrator by Ross Misty. 5. Roger S Pressman, Software Engineering, 2000 Edition, Dreamtech Websites: www.google.com www.amazon.com www.howstuffworks.com www.studentstechnology.com Publications

1. 2. 3. 4.

57

Das könnte Ihnen auch gefallen