Payroll Management System
Payroll Management System
On
PAYROLL
MANAGEMENT
SYSTEM
…………………….
CLASS--XII
ACKNOWLEDGEMENT
2. Source Code
3. Output
4. Requirement
6. Conclusion
7. System design
8. Bibliography
INTRODUCTION
The PAYROLL SYSTEM is used to maintain a list of employees’ names, addresses and employment
information and is used to interactively calculate and print payroll checks.
Overview
The purpose of this section is to obtain agreement regarding the objectives the system must meet. Ultimately
this segment defines the boundaries of the effort. The “ Payroll system” helps administrator honor their
professional commitments by following a tailored version of the organization’s standard process. This
application is supported by a database consisting of employee’s salary details and their leave allowances.
Based on these details at the end of every month the application automatically credits the employee’s bank
account with their salary. The amount of salary credited into employees account is a variant of their leave
allowances .This Payroll Processing application also considers employee’s income tax regulations and loan
payment details. Based on these considerations the salary of each employee is deducted at the source. Taking
into account all these aspects the appropriate accounts of each employee are credited. This application also
includes generation of salary slips to every employee.
Customer
The payroll Processing System is an application of LBRCE–JKC. Its target user group consists of Admin,
Employees.
Purpose
The Purpose of the project is to maintain the information regarding the employee and generates the pay slip.
SOURCE CODE
//***************************************************************
// HEADER FILE USED IN PROJECT
//****************************************************************
#include<stdio.h>
#include<conio.h>
#include<stdio.h>
#include<fstream.h>
#include<process.h>
#include<iomanip.h>
#include<string.h>
#include<ctype.h>
//******************FUNCTION PROTOTYPE****************
void intromain();
int checkpass();
void intro();
void admin_menu();
void write_emp_infor();
char *getemployees();
void display_emp_sp(char n[15]);
void admin_menu1();
void emp_tabular();
void display_all_emp();
void emp_modify_menu();
void display_emp_sp1(char enm[15]);
void display_emp_sp2(char enm[15]);
void display_emp_sp3(char enm[15]);
void display_emp_sp4(char enm[15]);
void display_emp_sp5(char enm[15]);
void delete_emp_record(char enm[15]);
void admin_salary();
int getsalid();
void write_emp_salary(char eid[5]);
void display_sal_allmonthyear(char mm[5],int yy);
void display_sal_slip(char eid[5],char month[5]);
void display_sal_slip(char eid[5],char month[5]);
void showSalaryheadings(int c);
void show_salary_modify_menu();
void modify_sal_emp(char num[5],char mm[5],int yy);
void modify_HRA_DA_emp(char num[5],char mm[5],int yy);
void modify_BONUS_emp(char num[5],char mm[5],int yy);
void modify_OTHER_emp(char num[5],char mm[5],int yy);
void modify_pf_emp(char num[5],char mm[5],int yy);
void admin_leave(char num[5]);
void emp_LEAVE_menu();
int getleavestatus(char eid[5]);
void set_leave(char eid[5]);
void displayall_leave();
void gen_report(char num[5],int yy);
//******************FUNCTION PROTOTYPE****************
//*************leave class
class leave
{
char eid[5];
char dateofleaveFrom[15];
char dateofleaveTo[15];
char desc[80];
char status;
public:
char getstatus()
{ return status; }
void setstatus()
{ status='n'; }
char *get_leave_eid()
{ return eid; }
char *get_leave_dTFrom()
{ return dateofleaveFrom; }
char *get_leave_desc()
{ return desc; }
char *get_leave_dTTO()
{ return dateofleaveTo; }
void input_leave(int c,char ed[5])
{
strcpy(eid,ed);
gotoxy(5,c);
cout<<"DATE OF LEAVE FROM(eg:05/02/1999) : ";cin>>dateofleaveFrom;
c=c+1;
gotoxy(5,c);
cout<<"DATE OF LEAVE TO (eg:05/02/1999) : ";cin>>dateofleaveTo;
c=c+1;
gotoxy(5,c);
cout<<"PURPOSE OF LEAVE: ";
cin.ignore();
cin.getline(desc,80);
status='y';
}
void showsLEAVE_VER(int c)
{
gotoxy(5,c);
cout<<eid<<setw(12)<<dateofleaveFrom<<setw(12)<<dateofleaveTo<<setw(12)<<desc;
if(status=='y')
{ cout<<setw(15)<<"ON LEAVE";
}else {cout<<setw(15)<<"BACK ON WORK"; } } };
//*************leave class
//*************class salary****************************
class emp_salary
{
int sal_id;
char semp_id[5];
float basicsal,netsal;
int HRA,DA,otherall;
int bonus,PFamt;
//*********date of salary given
int dd,yy;
char mm[5];
public:
int getyear()
{ return yy; }
char *getmonth()
{ return mm; }
int getsalid()
{ return sal_id; }
float getbasicsal()
{ return basicsal; }
int getHRA()
{ return HRA; }
int getDA()
{ return DA; }
int getother()
{ return otherall; }
int getbonus()
{ return bonus; }
char *getsempid()
{ return semp_id; }
int getPF()
{ return PFamt; }
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE EMP ID TO BE SEARCHED AND TO DELETE:";
gotoxy(55,9);
cin>>num;
delete_emp_record(num);
break;
case '6': break;
default:cout<<"\a";admin_menu1();
}
}
employee cust;
char tmpnm[35];
ifstream inFile;
int fpos1=-1;
inFile.open("employee.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
int flag=0;
while(inFile.read((char *) &cust, sizeof(employee)))
{
if(strcmpi(cust.getempid(),enm)==0)
{ clrscr();
intromain();
cust.showempdatamulti();
flag=1;
}
}
inFile.close();
if(flag==0)
{ cout<<"\n\nrecord not exist";}
else
{
//*******modifying the records starts here
fstream File;
File.open("employee.dat",ios::binary|ios::in|ios::out);
if(!File)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
while(File.read((char *) &cust, sizeof(employee)))
{
if(strcmpi(cust.getempid(),enm)==0)
{ fpos1=(int)File.tellg();
break;
}
}
File.seekp(fpos1-sizeof(employee),ios::beg);
gotoxy(1,12);
cout<<"*****************************************************************************";
gotoxy(1,13);
cout<<"================ENTER NEW VALUES FOR THE RECORDS GIVEN ABOVE=================";
gotoxy(5,14);
cout<<"\nEnter the Name :";
cin.ignore();
cin.getline(tmpnm,35);
cust.set_name(tmpnm);
File.write((char *) &cust, sizeof(employee));
File.close();
}
}
//**************************modify the fathers name
//*****************Emp modify Name of employee
void display_emp_sp2(char enm[15])
{
employee cust;
char tmpnm[35];
ifstream inFile;
int fpos1=-1;
inFile.open("employee.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
int flag=0;
while(inFile.read((char *) &cust, sizeof(employee)))
{
if(strcmpi(cust.getempid(),enm)==0)
{ clrscr();
intromain();
cust.showempdatamulti();
flag=1;
}
}
inFile.close();
if(flag==0)
{ cout<<"\n\nrecord not exist";}
else
{
//*******modifying the records starts here
fstream File;
File.open("employee.dat",ios::binary|ios::in|ios::out);
if(!File)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
while(File.read((char *) &cust, sizeof(employee)))
{
if(strcmpi(cust.getempid(),enm)==0)
{ fpos1=(int)File.tellg();
break;
}
}
File.seekp(fpos1-sizeof(employee),ios::beg);
gotoxy(1,12);
cout<<"*****************************************************************************";
gotoxy(1,13);
cout<<"================ENTER NEW VALUES FOR THE RECORDS GIVEN ABOVE=================";
gotoxy(5,14);
cout<<"\nEnter the Fathers Name :";
cin.ignore();
cin.getline(tmpnm,35);
cust.set_father_name(tmpnm);
File.write((char *) &cust, sizeof(employee));
File.close();
}
}
//**************************modify the fathers name
//*****************Emp modify address
void display_emp_sp3(char enm[15])
{
employee cust;
char tmpadd[35],tmpcity[15],tmpstate[25];
ifstream inFile;
int fpos1=-1;
inFile.open("employee.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
int flag=0;
while(inFile.read((char *) &cust, sizeof(employee)))
{
if(strcmpi(cust.getempid(),enm)==0)
{ clrscr();
intromain();
cust.showempdatamulti();
flag=1;
}
}
inFile.close();
if(flag==0)
{ cout<<"\n\nrecord not exist";}
else
{
//*******modifying the records starts here
fstream File;
File.open("employee.dat",ios::binary|ios::in|ios::out);
if(!File)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
while(File.read((char *) &cust, sizeof(employee)))
{
if(strcmpi(cust.getempid(),enm)==0)
{ fpos1=(int)File.tellg();
break;
}
}
File.seekp(fpos1-sizeof(employee),ios::beg);
gotoxy(1,12);
cout<<"*****************************************************************************";
gotoxy(1,13);
cout<<"================ENTER NEW VALUES FOR THE RECORDS GIVEN ABOVE=================";
gotoxy(5,14);
cout<<"\nEnter the ADDRESS :";
cin.ignore();
cin.getline(tmpadd,35);
gotoxy(5,15);
cout<<"\nEnter the CITY :";
cin.clear();
//cin.ignore();
cin.getline(tmpcity,15);
gotoxy(5,16);
cout<<"\nEnter the STATE :";
cin.clear();
//cin.ignore();
cin.getline(tmpstate,25);
cust.set_address(tmpadd,tmpcity,tmpstate);
File.write((char *) &cust, sizeof(employee));
File.close();
}
}
//**************************modify the address
//*****************Emp modify phone number
void display_emp_sp4(char enm[15])
{
employee cust;
char tmpph[15];
ifstream inFile;
int fpos1=-1;
inFile.open("employee.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
int flag=0;
while(inFile.read((char *) &cust, sizeof(employee)))
{
if(strcmpi(cust.getempid(),enm)==0)
{ clrscr();
intromain();
cust.showempdatamulti();
flag=1;
}
}
inFile.close();
if(flag==0)
{ cout<<"\n\nrecord not exist";}
else
{
//*******modifying the records starts here
fstream File;
File.open("employee.dat",ios::binary|ios::in|ios::out);
if(!File)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
while(File.read((char *) &cust, sizeof(employee)))
{
if(strcmpi(cust.getempid(),enm)==0)
{ fpos1=(int)File.tellg();
break;
}
}
File.seekp(fpos1-sizeof(employee),ios::beg);
gotoxy(1,12);
cout<<"*****************************************************************************";
gotoxy(1,13);
cout<<"================ENTER NEW VALUES FOR THE RECORDS GIVEN ABOVE=================";
gotoxy(5,14);
cout<<"Enter the NEW MOBILE NUMBER :";
gotoxy(10,15);
cin>>tmpph;
cust.set_phone(tmpph);
File.write((char *) &cust, sizeof(employee));
File.close();
}
}
//**************************modify the phone number
//*****************Emp modify Department designation
void display_emp_sp5(char enm[15])
{
employee cust;
char ds[35],dpt[15],dj[15];
ifstream inFile;
int fpos1=-1;
inFile.open("employee.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
int flag=0;
while(inFile.read((char *) &cust, sizeof(employee)))
{
if(strcmpi(cust.getempid(),enm)==0)
{ clrscr();
intromain();
cust.showempdatamulti();
flag=1;
}
}
inFile.close();
if(flag==0)
{ cout<<"\n\nrecord not exist";}
else
{
//*******modifying the records starts here
fstream File;
File.open("employee.dat",ios::binary|ios::in|ios::out);
if(!File)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
while(File.read((char *) &cust, sizeof(employee)))
{
if(strcmpi(cust.getempid(),enm)==0)
{ fpos1=(int)File.tellg();
break;
}
}
File.seekp(fpos1-sizeof(employee),ios::beg);
char ch;
gotoxy(1,12);
cout<<"*****************************************************************************";
gotoxy(1,13);
cout<<"================ENTER NEW VALUES FOR THE RECORDS GIVEN ABOVE=================";
gotoxy(5,14);
cout<<"DESIGNATION(M for manager,A for asst-manager,S for superwiser,W for worker:";
gotoxy(6,15);
cin>>ch;
switch(ch)
{
case 'M':strcpy(ds,"MANAGER");
break;
case 'A':strcpy(ds,"ASST-MANAGER");
break;
case 'S':strcpy(ds,"SUPERWISER");
break;
default:
strcpy(ds,"WORKER");
}
//***************for department****************
int choice;
gotoxy(5,16);
cout<<"DEPARTMENT:(1.SALES 2.FINANCE 3.PRODUCTION 4.ACCOUNTS 5. DISTRIBUTION";
gotoxy(10,17);
cin>>choice;
switch(choice)
{
case 1: strcpy(dpt,"SALES");
break;
case 2: strcpy(dpt,"FINANCE");
break;
case 3: strcpy(dpt,"PRODUCTION");
break;
case 4: strcpy(dpt,"ACCOUNTS");
break;
case 5: strcpy(dpt,"DISTRIBUTION");
break;
}
//******************desgnation
gotoxy(5,19);
cout<<"Enter Date Of Joining:";
gotoxy(5,20);
cin>>dj;
cust.setdes_dep_doj(ds,dpt,dj);
File.write((char *) &cust, sizeof(employee));
File.close();
}
}
//**************************modify the Designation , Department
//*****************************deletion of employee record**************
void delete_emp_record(char enm[15])
{
employee cust;
// char ds[35],dpt[15]dj[15];
ifstream inFile;
//int fpos1=-1;
inFile.open("employee.dat",ios::binary);
if(!inFile)
{
cout<<"File could not be open !! Press any Key...";
getch();
return;
}
int flag=0;
while(inFile.read((char *) &cust, sizeof(employee)))
{
if(strcmpi(cust.getempid(),enm)==0)
{ clrscr();
intromain();
cust.showempdatamulti();
flag=1;
}
}
inFile.close();
char ch;
if(flag==0)
cout<<"\n\nrecord not exist";
else
{
//*******deletion of the records starts from here
gotoxy(1,15);
cout<<"*****************************************************************************";
gotoxy(5,16);
cout<<"======DO YOU WANT TO DELETE THE RECORDS GIVEN ABOVE[YES(Y) OR NO (N)========";
gotoxy(2,17);
cin>>ch;
if (toupper(ch)=='Y')
{
ofstream outFile;
outFile.open("Temp2.dat",ios::binary);
ifstream objiff("employee.dat",ios::binary);
objiff.seekg(0,ios::beg);
while(objiff.read((char *) &cust, sizeof(employee)))
{
if(strcmpi(cust.getempid(),enm)!=0)
{
outFile.write((char *) &cust, sizeof(employee)); }
}
outFile.close();
objiff.close();
remove("employee.dat");
rename("Temp2.dat","employee.dat");
//againopenandclosecust();
gotoxy(30,20);
cout<<"----------------------------Record Deleted----------------------------------";
}
}
getch();
}
//**********************************************************************
//********************salary menu
void admin_salary()
{
clrscr();
char ch2;
int yy;
char num[15],month1[5];
//************************************************************
clrscr();
intromain();
gotoxy(20,6);
cout<<"============SALARY AND BONUS MENU====================";
gotoxy(22,7);
cout<<"1.MONTHLY SALARY INFORMATION OF EMPLOYEE";
gotoxy(22,8);
cout<<"2.DISPLAY SALARY SLIP OF EMPLOYEE";
gotoxy(22,9);
cout<<"3.DISPLAY SALARY OF ALL EMPLOYEES MONTHWISE EACH YEAR";
gotoxy(22,10);
//cout<<"4.DISPLAY SALARY OF EMPLOYEES YEARWISE";
//gotoxy(22,11);
cout<<"4.MODIFY THE SALARY INFORMATIONS";
gotoxy(22,11);
cout<<"5.DELETE THE SALARY INFORMATIONS";
gotoxy(22,12);
cout<<"6.BACK TO MAIN MENU";
gotoxy(18,13);
cout<<"Please Enter Your Choice (1-6) ";
gotoxy(55,14);
//**********************************************************
ch2=getche();
switch(ch2)
{
case '1':
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE EMP ID TO BE SEARCHED:";
gotoxy(55,9);
cin>>num;
write_emp_salary(num);
break;
case '2': clrscr();
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE EMP ID AND MONTH TO BE SEARCHED:";
gotoxy(55,9);
cin>>num;
cin>>month1;
display_sal_slip(num,month1);
break;
case '3':
//********************
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE MONTH AND YEAR TO BE SEARCHED:";
gotoxy(55,9);
cin>>month1;
cin>>yy;
//display_sal_allmonthyear(char mm[5],int yy)
display_sal_allmonthyear(month1,yy);
break;
case '4':
show_salary_modify_menu();
break;
case '5':
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE EMP ID TO BE SEARCHED:";
gotoxy(55,9);
cin>>num;
display_emp_sp5(num);
break;
case '6': break;
default:cout<<"\a";admin_menu1();
}
}
//*********************salary menu***************************
//************************entry of salary in a file
//****************employee write function inot file emp.dat****************
void write_emp_salary(char eid[5])
{
ofstream objoff;
ifstream objiff;
employee eobj;
emp_salary salobj;
int flag=-1;
objiff.open("employee.dat",ios::binary);
clrscr();
intromain();
int r;
while(objiff.read((char*)&eobj,sizeof(employee)))
{
if(strcmp(eobj.getempid(),eid)==0)
{
clrscr();
intromain();
eobj.showempdatamulti();
//strcpy(str1,eobj.getdesg());
flag=1;
break;
}
}
objiff.close();
if(flag==-1)
{ cout<<"\n\nrecord not exist";
getch();
}else
{
r=getsalid();
objoff.open("salary.dat",ios::binary|ios::app);
if(r>=1000) //1000
{
r=1; // r=100
}
salobj.input_salaryinfo(eid,r);
objoff.write((char*)&salobj,sizeof(emp_salary));
gotoxy(10,20);
cout<<"***************CUSTOMER RECORD SAVED******************* ";
}
objoff.close();
cin.ignore();
getch();
}
//***************get salary number
int getsalid()
{
ifstream objiff;
int count=0;
emp_salary salobj;
objiff.open("salary.dat",ios::binary);
objiff.seekg(0,ios::beg);
if(!objiff)
{
cout<<"File could not be open !! Press any Key...";
getch();
}
//**************temporary hiding these lines
while(objiff.read((char*)&salobj,sizeof(emp_salary)))
{
count++;
}
//***********jump to the last line
objiff.seekg(count-sizeof(emp_salary),ios::beg);
objiff.read((char *) &salobj, sizeof(emp_salary));
count=salobj.getsalid();
count++;
objiff.close();
return count;
}
//******************get salary number
//***************************entry of salary into file
//******************************************************************************
// DISPLAY ALL THE salary TABULAR FORM
//******************************************************************************
void display_sal_slip(char eid[5],char month[5])
{
ifstream objiff2;
ifstream objiff;
employee eobj;
emp_salary salobj;
int flag=-1;
objiff.open("employee.dat",ios::binary);
clrscr();
intromain();
while(objiff.read((char*)&eobj,sizeof(employee)))
{
if(strcmp(eobj.getempid(),eid)==0)
{
clrscr();
intromain();
eobj.showempdatamulti();
flag=1;
break;
}
}
objiff.close();
if(flag==-1)
{ cout<<"\n\nrecord not exist";
getch();
}else
{
objiff2.open("salary.dat",ios::binary);
while(objiff2.read((char *) &salobj, sizeof(emp_salary)))
{
if(strcmp(salobj.getsempid(),eid)==0 && strcmpi(salobj.getmonth(),month)==0)
{
salobj.showsalreportMONTHLY();
break;
}
}
}
objiff2.close();
getch();
}
//**************************salary tabular forms ends**********************************
void display_sal_allmonthyear(char mm[5],int yy)
{
int c1=7;
emp_salary salobj;
ifstream objiff2;
objiff2.open("salary.dat",ios::binary);
clrscr();
intromain();
showSalaryheadings(c1);
c1++;
while(objiff2.read((char *) &salobj, sizeof(emp_salary)))
{
if((salobj.getyear()==yy) && strcmpi(salobj.getmonth(),mm)==0)
{
if(c1<=25)
{
salobj.showsalreportYEARLY(c1);
c1++;
}else
{
clrscr();
intromain();
c1=7;
showSalaryheadings(c1);
c1++;
salobj.showsalreportYEARLY(c1);
c1++;
} } }
objiff2.close();
getch();
}
void showSalaryheadings(int c)
{
gotoxy(1,c);
cout<<"EMPID :"<<"BASICSAL"<<setw(6)<<"HRA"<<setw(5)<<"DA"<<" , OTHER ALLOW"<<setw(7) <<"BONUS"
<<setw(5)<<"PFamt"<<setw(9)<<"NETSAL"<<setw(8)<<"DOJ";
}
//************************modify salary information
void show_salary_modify_menu()
{
clrscr();
char ch2;
char num[15];
char month1[5];
int yy;
//************************************************************
clrscr();
intromain();
gotoxy(20,6);
cout<<"============EMPLOYEES SALARY MODIFY MENU====================";
gotoxy(22,7);
cout<<"1.SEARCH AND MODIFY BASIC SALARY";
gotoxy(22,8);
cout<<"2.SEARCH AND MODIFY HRA AND DA";
gotoxy(22,9);
cout<<"3.SEARCH AND MODIFY BONUS";
gotoxy(22,10);
cout<<"4.SEARCH AND MODIFY OTHER ALLOWANCES";
gotoxy(22,11);
cout<<"5.SEARCH AND MODIFY PROVIDENT FUND AMOUNT";
gotoxy(22,12);
cout<<"6.BACK TO MAIN MENU";
gotoxy(18,13);
cout<<"Please Enter Your Choice (1-6) ";
gotoxy(55,13);
//**********************************************************
ch2=getche();
switch(ch2)
{
case '1':
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE EMP ID TO BE SEARCHED:: ";
cin>>num;
gotoxy(10,9);
cout<<"*****ENTER MONTH (eg:JAN,FEB..) TO BE SEARCHED:";
cin>>month1;
gotoxy(10,10);
cout<<"*****ENTER YEAR (eg:2012) TO BE SEARCHED:";
cin>>yy;
modify_sal_emp(num,month1,yy);
break;
case '2':
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE EMP ID TO BE SEARCHED:: ";
cin>>num;
gotoxy(10,9);
cout<<"*****ENTER MONTH (eg:JAN,FEB..) TO BE SEARCHED:";
cin>>month1;
gotoxy(10,10);
cout<<"*****ENTER YEAR (eg:2012) TO BE SEARCHED:";
cin>>yy;
modify_HRA_DA_emp(num,month1,yy);
break;
case '3':
//********************
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE EMP ID TO BE SEARCHED:: ";
cin>>num;
gotoxy(10,9);
cout<<"*****ENTER MONTH (eg:JAN,FEB..) TO BE SEARCHED:";
cin>>month1;
gotoxy(10,10);
cout<<"*****ENTER YEAR (eg:2012) TO BE SEARCHED:";
cin>>yy;
modify_BONUS_emp(num,month1,yy);
break;
case '4':
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE EMP ID TO BE SEARCHED:: ";
cin>>num;
gotoxy(10,9);
cout<<"*****ENTER MONTH (eg:JAN,FEB..) TO BE SEARCHED:";
cin>>month1;
gotoxy(10,10);
cout<<"*****ENTER YEAR (eg:2012) TO BE SEARCHED:";
cin>>yy;
modify_OTHER_emp(num,month1,yy);
break;
case '5':
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE EMP ID TO BE SEARCHED:: ";
cin>>num;
gotoxy(10,9);
cout<<"*****ENTER MONTH (eg:JAN,FEB..) TO BE SEARCHED:";
cin>>month1;
gotoxy(10,10);
cout<<"*****ENTER YEAR (eg:2012) TO BE SEARCHED:";
cin>>yy;
modify_pf_emp(num,month1,yy);
break;
case '6': break;
default:cout<<"\a";admin_menu1();
}
}
objiff2.open("salary.dat",ios::binary|ios::in|ios::out);
objiff2.seekp(fpos1-sizeof(emp_salary),ios::beg);
gotoxy(1,12);
cout<<"*****************************************************************************";
gotoxy(1,13);
cout<<"===ENTER NEW VALUES FOR HRA and DA FOR THE RECORDS GIVEN ABOVE===";
gotoxy(5,14);
cin>>tmpHRA>>tmpDA;
salobj.setHRADA(tmpHRA,tmpDA);
objiff2.write((char *) &salobj, sizeof(emp_salary));
}
objiff2.close();
getch();
}
void modify_BONUS_emp(char num[5],char mm[5],int yy)
{
fstream objiff2;
ifstream objiff;
employee eobj;
emp_salary salobj;
int flag=-1;
int tmpbn;
objiff.open("employee.dat",ios::binary);
clrscr();
intromain();
while(objiff.read((char*)&eobj,sizeof(employee)))
{
if(strcmp(eobj.getempid(),num)==0)
{
clrscr();
intromain();
eobj.showempdatamulti();
flag=1;
break;
}
}
objiff.close();
int fpos1=-1;
if(flag==-1)
{ cout<<"\n\nrecord not exist";
getch();
}else
{
objiff2.open("salary.dat",ios::binary|ios::in|ios::out);
while(objiff2.read((char *) &salobj, sizeof(emp_salary)))
{
if(strcmp(salobj.getsempid(),num)==0 && strcmpi(salobj.getmonth(),mm)==0 && (salobj.getyear()==yy))
{
salobj.showsalreportMONTHLY();
fpos1=(int)objiff2.tellg();
break;
}
}
objiff2.seekp(fpos1-sizeof(emp_salary),ios::beg);
gotoxy(1,12);
cout<<"*****************************************************************************";
gotoxy(1,13);
cout<<"===ENTER NEW VALUES FOR BONUS FOR THE RECORDS GIVEN ABOVE==========";
gotoxy(5,14);
cin>>tmpbn;
salobj.setbonus(tmpbn);
objiff2.write((char *) &salobj, sizeof(emp_salary));
}
objiff2.close();
getch();
}
void modify_OTHER_emp(char num[5],char mm[5],int yy)
{
fstream objiff2;
ifstream objiff;
employee eobj;
emp_salary salobj;
int flag=-1;
int tmpOT=0;
objiff.open("employee.dat",ios::binary);
clrscr();
intromain();
while(objiff.read((char*)&eobj,sizeof(employee)))
{
if(strcmp(eobj.getempid(),num)==0)
{
clrscr();
intromain();
eobj.showempdatamulti();
flag=1;
break;
}
}
objiff.close();
int fpos1=-1;
if(flag==-1)
{ cout<<"\n\nrecord not exist";
getch();
}else
{
objiff2.open("salary.dat",ios::binary|ios::in|ios::out);
salobj.setotherall(tmpOT);
objiff2.write((char *) &salobj, sizeof(emp_salary));
}
objiff2.close();
getch();
}
void modify_pf_emp(char num[5],char mm[5],int yy)
{
fstream objiff2;
ifstream objiff;
employee eobj;
emp_salary salobj;
int flag=-1;
int tmpPF=0;
objiff.open("employee.dat",ios::binary);
clrscr();
intromain();
while(objiff.read((char*)&eobj,sizeof(employee)))
{
if(strcmp(eobj.getempid(),num)==0)
{
clrscr();
intromain();
eobj.showempdatamulti();
flag=1;
break;
}
}
objiff.close();
int fpos1=-1;
if(flag==-1)
{ cout<<"\n\nrecord not exist";
getch();
}else
{
objiff2.open("salary.dat",ios::binary|ios::in|ios::out);
while(objiff2.read((char *) &salobj, sizeof(emp_salary)))
{
if(strcmp(salobj.getsempid(),num)==0 && strcmpi(salobj.getmonth(),mm)==0 && (salobj.getyear()==yy))
{
salobj.showsalreportMONTHLY();
fpos1=(int)objiff2.tellg();
break;
}
}
objiff2.seekp(fpos1-sizeof(emp_salary),ios::beg);
gotoxy(1,12);
cout<<"*****************************************************************************";
gotoxy(1,13);
cout<<"==ENTER NEW VALUES FOR PROVIDENT FUND FOR THE RECORDS GIVEN ABOVE========";
gotoxy(5,14);
cin>>tmpPF;
salobj.setPF(tmpPF);
objiff2.write((char *) &salobj, sizeof(emp_salary));
}
objiff2.close();
getch();
}
//************************modify salary information
//***************leave
void admin_leave(char num[5])
{
ofstream objiff2;//("leave.dat",ios::binary|ios::app);
ifstream objiff;
employee eobj;
leave leaveobj;
int flag=-1;
objiff.open("employee.dat",ios::binary);
clrscr();
intromain();
while(objiff.read((char*)&eobj,sizeof(employee)))
{
if(strcmp(eobj.getempid(),num)==0)
{
clrscr();
intromain();
eobj.showempdatamulti();
flag=1;
break;
}
}
objiff.close();
if(flag==-1)
{
gotoxy(10,25);
cout<<"****************record not exist***********************";
getch();
}else
{ //**********************check status of leave********************
int pos=getleavestatus(num);
//**********************check status of leave********************
if(pos==0)
{
gotoxy(1,14);
cout<<"*****************************************************************************";
gotoxy(1,15);
cout<<"you are on leave or please check your status of leave";
getch();
}else
{
gotoxy(1,14);
cout<<"*****************************************************************************";
objiff2.open("leave.dat",ios::binary|ios::app);
leaveobj.input_leave(15,num);
objiff2.write((char *) &leaveobj, sizeof(leave));
objiff2.close();
}} }
//***********************MENU 1 CUSTOMERS ENDS HERE*************************
int getleavestatus(char eid[5])
{
int flag=1;
ifstream objiff2;
leave leaveobj;
objiff2.open("leave.dat",ios::binary);
objiff2.seekg(0,ios::beg);
if(!objiff2)
{
cout<<"File could not be open !! Press any Key...";
//return flag;
getch();
}
while(objiff2.read((char*)&leaveobj,sizeof(leave)))
{
if(leaveobj.getstatus()=='y' && strcmpi(leaveobj.get_leave_eid(),eid)==0)
{
flag=0;
}else
{
flag=1;
}
}
objiff2.close();
return flag;
}
void emp_LEAVE_menu()
{
clrscr();
char ch2;
char eid[5];
//************************************************************
clrscr();
intromain();
gotoxy(20,6);
cout<<"============LEAVE MENU====================";
gotoxy(22,7);
cout<<"1.LEAVE TO THE EMPLOYEE";
gotoxy(22,8);
cout<<"2.STATUS OF THE LEAVE(BACK TO WORK)";
gotoxy(22,9);
cout<<"3.EMPLOYEE LEAVE DETAILS";
gotoxy(22,10);
cout<<"Please Enter Your Choice (1-4) ";
gotoxy(22,11);
//**********************************************************
ch2=getche();
switch(ch2)
{
case '1':
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE EMP ID TO BE SEARCHED:: ";
cin>>eid;
admin_leave(eid);
break;
case '2':
clrscr();
intromain();
gotoxy(10,8);
cout<<"*****ENTER THE EMP ID TO BE SEARCHED:: ";
cin>>eid;
set_leave(eid);
break;
case '3':
clrscr();
intromain();
displayall_leave();
break;
default:cout<<"\a";admin_menu1();
}
}
}
objiff2.close();
}
void displayall_leave()
{
ifstream objiff2;
leave leaveobj;
objiff2.open("leave.dat",ios::binary);
objiff2.seekg(0,ios::beg);
if(!objiff2)
{
cout<<"File could not be open !! Press any Key...";
getch();
}
clrscr();
intromain();
gotoxy(5,8);
cout<<"EMPID"<<setw(12)<<"DATEOFLEAVE"<<setw(12)<<"DATEOFLEAVE"<<setw(12)<<"DESCRIPTION"<<setw(10)<
<"STATUS";
gotoxy(1,9);
cout<<"***************************************************************************";
int x=10;
while(objiff2.read((char*)&leaveobj,sizeof(leave)))
{
leaveobj.showsLEAVE_VER(x);
x++;
}
objiff2.close();
getch();
}
//*****************Emp modify Name of employee
//*******************report of employee******************
void gen_report(char num[5],int yy)
{
ifstream objiff3;
leave leaveobj;
objiff3.open("leave.dat",ios::binary);
ifstream objiff2;
ifstream objiff;
employee eobj;
emp_salary salobj;
int flag=-1;
objiff.open("employee.dat",ios::binary);
objiff2.open("salary.dat",ios::binary);
clrscr();
intromain();
while(objiff.read((char*)&eobj,sizeof(employee)))
{
if(strcmp(eobj.getempid(),num)==0)
{
clrscr();
intromain();
eobj.showempdatamulti();
flag=1;
break;
}
}
objiff.close();
//int fpos1=-1;
if(flag==-1)
{ cout<<"\n\nrecord not exist";
getch();
}else
{
int c=13;
gotoxy(1,c);
c++;
cout<<"BASIC SAL"<<setw(5)<<"HRA"<<setw(4)<<"DA"<<" ,
"<<"OTHERALLOW"<<setw(7)<<"BONUS"<<setw(5)<<"PF";
cout<<setw(12)<<"NETSALARY"<<setw(8)<<"DOJ";
gotoxy(1,c);
cout<<"========================================================================";
c++;
while(objiff2.read((char *) &salobj, sizeof(emp_salary)))
{
if(strcmp(salobj.getsempid(),num)==0 && (salobj.getyear()==yy))
{
salobj.showsalreportYEARLY(c);
c++;
}
}
gotoxy(1,c);
cout<<"========================================================================";
c++;
gotoxy(1,c);
cout<<"******************EMPLOYEE LEAVE INFORMATION ***************************";
c++;
gotoxy(1,c);
cout<<"EMPID"<<setw(15)<<"DATEOFLEAVE"<<setw(15)<<"DATEOFLEAVE"<<setw(15)<<"DESCRIPTION"<<setw(14)<
<"STATUS";
c++;
gotoxy(1,c);
cout<<"***************************************************************************";
c++;
while(objiff3.read((char*)&leaveobj,sizeof(leave)))
{
if(strcmpi(leaveobj.get_leave_eid(),num)==0)
{
leaveobj.showsLEAVE_VER(c);
c++;
}}}
objiff2.close();
objiff3.close();
getch();
}
//*******************report of employee******************
OUTPUT
REQUIREMENT
SOFTWARE AND HARDWARE REQUIREMENTS
1. Software Requirements
TURBO C++
MS DOS
WINDOWS XP
MICROSOFT OFFICE ACCESS 2003
Hardware Requirements
CPU – Intel Core 2 Duo E7300
RAM – 1 GB (MIN)
Hard disk – 160 GB
Operating System – Windows XP with Service Pack 3 (CHT)
ADVANTAGES AND DISADVANTAGES
Advantages of existing system
It is very simple in nature & doesn’t provide much functionality, thus reducing complexity of the system.It
doesn’t require employees to know about computers at all i.e. it doesn’t require training its employees any
special technique except of simple bill preparation and book keeping. Because of manual work it doesn’t
require any investment in computers or any other peripherals. Since there is no systems at all there is no
need to keep available the facilities like 24- hour power backup or other facilities.
The disadvantages of current system are all those associated with manual working systems. It is time
consuming to produce bills or reports as compared to any other computerized system. Humans are more
probes to errors so always possibility of errors in producing results. As all the work done is written on
registers if any register is missed or damaged it is simply very difficult to produce to present accurate
figures.Employees can make fraud by writing wrong entries on register and take away the money and it is
simply impossible to catch the defaulter because there is no proof.
Conclusion
This project has many future applications like it can be used in any of the Retail Outlet of Any Type
companies. This project was build keeping in mind all the requirements of these outlets and they can be
implemented in any such type of organization with very few modification. With modifications it can be
possible for Employee Attendance to control all retail outlets by connecting them through a network.
Because of this software all they need is a Server application and any type of connectivity to that server.
SYSTEM DESIGN
1.Internet resources
Bibliography
www.google.com
www.scribd.com
www.files32.com
2. Books
The C++ Programming Language , 3rd Edition / Stroustrup Addison-Wesley.
Effective C++ : 50 Specific Ways to Improve Your Programs and Designs, 2nd Edition
More Effective C++ : 35 New Ways to Improve Your Programs and Designs
and Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library