⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 user.cpp

📁 这是一个人力资源管理软件。运行MAIN.CPP 进入“登陆信息”。 要进入员工管理页面请如下输入 empid - JOEL ,password - JOEL 进入管理人员界面: empid - ADM
💻 CPP
📖 第 1 页 / 共 2 页
字号:
{
mouse.hidemouseptr();
setbk();
settextstyle(0,0,0);
button edit1(260,370,350,400);
//button back(350,370,440,402);
//back.show();
//button back(578,432,614,464);
//back.show(4);
button back(594,443,15,15);
back.tbutton(2);
back.show();

o.open("back.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN BACK.DAT");getch();}
o.read(picture,10000);
o.close();
putimage(580,427,picture,0);

edit1.show(4);

o.open("edit.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN EDIT.DAT");getch();}
o.read(picture,10000);
o.close();

putimage(262,372,picture,0);
//putimage(353,372,backlog,0);
//outtextxy(400,384,"BACK");
setcolor(15);
outtextxy(310,383,"EDIT");
button down(130,350,520,355);
down.show(0);
char ts[13],td[13],ti[13],tc[13],te[13];
itoa(basic,ts,10);
itoa(DA,td,10);
itoa(empPF,ti,10);
itoa(emprPF,te,10);
itoa(NPF,tc,10);

o.open("logo.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN LOGO.DAT");getch();}
o.read(picture,10000);
o.close();

putimage(20,20,picture,0);
setcolor(YELLOW);
outtextxy(190,100,"BASIC          :-"); outtextxy(350,100,ts);
outtextxy(190,150,"DA             :-"); outtextxy(350,150,td);
outtextxy(190,200,"EMPLOYEE PF    :-"); outtextxy(350,200,ti);
outtextxy(190,250,"EMPLOYER PF    :-");outtextxy(350,250,te);
outtextxy(190,300,"NET PF         :-");outtextxy(350,300,tc);

while(1)
{
mouse.showmouseptr();

if(back.check()==TRUE)
{personalmain();return;}
if(edit1.check()==TRUE)
{modifyPF();return;}
}
}


void user::sfprofile()
{
mouse.hidemouseptr();
setbk();
button change(270,410,350,445);
//button back(380,410,470,445);
//back.show();
//outtextxy(432,424,"BACK");
//putimage(382,414,backlog,0);
change.show(4);setcolor(15);outtextxy(317,424,"EDIT");

o.open("edit.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN EDIT.DAT");getch();}
o.read(picture,10000);
o.close();

putimage(272,414,picture,0);
//button back(578,432,614,464);
//back.show(4);
button back(594,443,15,15);
back.tbutton(2);
back.show();
o.open("back.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN BACK.DAT");getch();}
o.read(picture,10000);
o.close();
putimage(580,427,picture,0);

button down(100,390,570,395);
down.show(0);
settextstyle(0,0,0);
setcolor(YELLOW);
char td[13];
char tf[13];
char tm[13];
itoa(NOD,td,10);
itoa(NOF,tf,10);
itoa(NOM,tm,10);

o.open("logo.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN LOGO.DAT");getch();}
o.read(picture,10000);
o.close();

putimage(20,20,picture,0);
int w=370;
outtextxy(130,100,"FATHER'S NAME      :-");  outtextxy(w,100,father);
outtextxy(130,150,"MOTHER'S NAME      :-");  outtextxy(w,150,mother);
outtextxy(130,200,"FAMILY DEPENDANTS  :-");  outtextxy(w,200,td);
outtextxy(130,250,"FAMILY MEMBERS     :-");  outtextxy(w,250,tf);
outtextxy(130,300,"FAMILY MINORS      :-");  outtextxy(w,300,tm);
outtextxy(130,350,"NATIVE             :-");  outtextxy(w,350,native);

while(1)
{
mouse.showmouseptr();
if(back.check()==TRUE)
{personalmain();}
if(change.check()==TRUE){modifyfamily();}
}
}

void user::sloandetails()
{
mouse.hidemouseptr();
setbk();

o.open("logo.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN LOGO.DAT");getch();}
o.read(picture,10000);
o.close();

putimage(20,20,picture,0);


settextstyle(0,0,0);
char am[13];
char inte[13];
char apaid[13];
char month[13];
char no[13];
char bal[13];
button down(100,395,570,400);
down.show(0);

itoa(balance,bal,10);
itoa(noofinstall,no,10);
itoa(amounttobepaid,apaid,10);
itoa(months,month,10);
itoa(amountl,am,10);
itoa(interest,inte,10);

int w=370;
//button back(380,420,470,450);
//back.show();
//outtextxy(427,433,"BACK");
//putimage(382,422,backlog,0);
//button back(578,432,614,464);
//back.show(4);
button back(594,443,15,15);
back.tbutton(2);
back.show();
o.open("back.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN BACK.DAT");getch();}
o.read(picture,10000);
o.close();
putimage(580,427,picture,0);

button modify(260,420,350,450);
modify.show(4);setcolor(15);outtextxy(310,433,"EDIT");
setcolor(14);
outtextxy(130,90,"TYPE OF LOAN        :-");  outtextxy(w,90,typel);
outtextxy(130,130,"DATE                :-");  outtextxy(w,130,whenl);
outtextxy(130,170,"LOAN TAKEN          :-");  outtextxy(w,170,am);
outtextxy(130,210,"INTEREST            :-");  outtextxy(w,210,inte);
outtextxy(130,250,"MONTHLY PAYABLE     :-");  outtextxy(w,250,month);
outtextxy(130,290,"AMOUNT TO BE PAID   :-");  outtextxy(w,290,apaid);
outtextxy(130,330,"NO. OF INSTALLMENTS :-"); outtextxy(w,330,no);
outtextxy(130,370,"BALANCE             :-");  outtextxy(w,370,bal);



o.open("edit.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN EDIT.DAT");getch();}
o.read(picture,10000);
o.close();

putimage(262,422,picture,0);

while(1)
{
mouse.showmouseptr();
if(back.check()==TRUE)
{personalmain();return; }
if(modify.check()==TRUE)
{modifyloan();
return;

}

}
}

void user::sappreciation()
{
mouse.hidemouseptr();
setbk();
char a[13],b[13];
itoa(incbasic,a,10);
itoa(inccash,b,10);
setcolor(14);
outtextxy(130,150,"POST UPGRADATION     :-");    outtextxy(370,150,postup);
outtextxy(130,200,"INC. IN BASIC        :-");	 outtextxy(370,200,a);
outtextxy(130,250,"INCENTIVES           :-");	 outtextxy(370,250,inckind);
outtextxy(130,300,"CASH                 :-");    outtextxy(370,300,b);
button down(50,320,550,325);
down.show(0);
button edit(260,370,350,400);
edit.show(0);
setcolor(15);
o.open("edit.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN EDIT.DAT");getch();}
o.read(picture,10000);
o.close();
putimage(262,372,picture,0);
outtextxy(297,380,"EDIT");
button back(594,443,15,15);
back.tbutton(2);
back.show();
o.open("back.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN BACK.DAT");getch();}
o.read(picture,10000);
o.close();
putimage(580,427,picture,0);
while(1)
{
mouse.showmouseptr();

if(edit.check()==TRUE)
{
appreciation();return;
}
if(back.check()==TRUE)
{
workflow();return;
}
}
}



int user::no_of_user_in_index()
{
fstream k;
k.open("index.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
if(!k.good()){cleardevice();setcolor(RED);outtextxy(150,150,"ERROR IN INDEX.DAT");getch();exit(1);}
int a=k.tellg();
k.seekg(0,ios::end);
int b=k.tellg();
int c=(b-a)/16;
k.close();
return c;
}


int user::no_of_user_in_user()
{
fstream k;
k.open("user.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
if(!k.good()){cleardevice();setcolor(RED);outtextxy(150,150,"ERROR IN USER.DAT");getch();exit(1);}
int a=k.tellg();
k.seekg(0,ios::end);
int b=k.tellg();
int c=(b-a)/sizeof(user);
k.close();
return c;
}


int user::search(char *id)
{
char a;
char temp[13];
int rrr;
fstream l;
l.open("index.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!l.good()){cleardevice();setcolor(RED);outtextxy(150,150,"ERROR IN INDEX.DAT");getch();exit(1);}
while(!l.eof())
{
l.read(&a,1);
l.read(temp,13);
l.read((char *)&rrr,2);
if(strcmp(temp,id)==0 && a!='*' ){return rrr;}
}
return (-1);
}

void user::spayslip()
{
mouse.hidemouseptr();
setbk();

o.open("logo.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN LOGO.DAT");getch();}
o.read(picture,10000);
o.close();

putimage(20,20,picture,0);
button down(120,390,520,395);
down.show(0);
//button back(578,432,614,464);
//back.show(4);
button back(594,443,15,15);
back.tbutton(2);
back.show();
o.open("back.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN BACK.DAT");getch();}
o.read(picture,10000);
o.close();
putimage(580,427,picture,0);
//button back(200,400,290,430);
button modify(260,420,350,450);
//back.show();
modify.show(4);

o.open("edit.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN EDIT.DAT");getch();}
o.read(picture,10000);
o.close();

putimage(262,422,picture,0);
setcolor(15);
outtextxy(310,433,"EDIT");
/*button back(578,432,614,464);
back.show(4);
putimage(580,435,backlog,0);*/

char a[13],b[13],c[13],d[13],e[13],f[13],g[13],h[13],i[13],j[13];
itoa(otherd,j,10);
itoa(basic,a,10);
itoa(DA,b,10);
itoa(HRA,c,10);
itoa(conveyance,d,10);
itoa(splallow,e,10);
itoa(NPF,f,10);
itoa(taxd,g,10);
itoa(grossearn,h,10);
itoa(nets,i,10);
setcolor(YELLOW);
outtextxy(150,100,"BASIC           :-");outtextxy(330,100,a);
outtextxy(150,130,"DA              :-");outtextxy(330,130,b);
outtextxy(150,160,"HRA             :-");outtextxy(330,160,c);
outtextxy(150,190,"CONVEYANCE      :-");outtextxy(330,190,d);
outtextxy(150,220,"SPL ALLOWANCE   :-");outtextxy(330,220,e);
outtextxy(150,250,"PF              :-");outtextxy(330,250,f);
outtextxy(150,280,"OTHER DEDUCTION :-");outtextxy(330,280,j);
outtextxy(150,310,"TAX DEDUCTION   :-");outtextxy(330,310,g);
outtextxy(150,340,"GROSS EARNING   :-");outtextxy(330,340,h);
outtextxy(150,370,"NET SALARY      :-");outtextxy(330,370,i);

while(1)
{
mouse.showmouseptr();
if(back.check()==TRUE)
{personalmain();return;}
if(modify.check()==TRUE)
{modifypayslip();return;}
}
}
void user::spprofile()
{
mouse.hidemouseptr();
setbk();
char string[13];
loopc(string);

o.open("logo.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN LOGO.DAT");getch();}
o.read(picture,10000);
o.close();

putimage(20,20,picture,0);
itoa(age,string,10);

button down(70,379,570,384);
down.show(0);

button modify(260,400,350,432);
//button back(380,400,490,432);
int xx=330;
int aa=150;

settextstyle(0,0,0);
setcolor(YELLOW);
outtextxy(aa,90,"FIRST NAME   :");   moveto(xx,90);	outtext((const char*)&fname);
outtextxy(aa,110,"LAST  NAME   :");   moveto(xx,110);	outtext((const char*)&lname);
outtextxy(aa,130,"ADDRESS      :");   moveto(xx,130);    outtext((const char*)&add1);
				    moveto(xx,150);	outtext((const char*)&addc);
				    moveto(xx,170);	outtext((const char*)&adds);
outtextxy(aa,190,"PIN          :");   moveto(xx,190);	outtext((const char*)&addp);
outtextxy(aa,210,"DEPARTMENT   :");   moveto(xx,210);     outtext((const char*)&dept);
outtextxy(aa,230,"POSITION     :");   moveto(xx,230);	outtext((const char*)&pos);
outtextxy(aa,250,"AGE          :");   moveto(xx,250);   outtext((const char*)&string);
outtextxy(aa,270,"ID           :");   moveto(xx,270);	outtext((const char*)&ID);
outtextxy(aa,290,"PHONE        :");   moveto(xx,290);	outtext((const char*)&phone);
outtextxy(aa,310,"E-MAIL       :");   moveto(xx,310);	outtext((const char*)&email);
outtextxy(aa,330,"SEX          :");   moveto(xx,330);	outtext((const char*)&sex);
outtextxy(aa,350,"M\S           :");   moveto(xx,350);	outtext((const char*)&ms);
modify.show(4);
//back.show();

o.open("edit.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN EDIT.DAT");getch();}
o.read(picture,10000);
o.close();

putimage(262,402,picture,0);
setcolor(15);
outtextxy(310,412,"EDIT");
//outtextxy(430,412,"BACK");
//putimage(382,403,backlog,0);
//button back(578,432,614,464);
//back.show(4);
button back(594,443,15,15);
back.tbutton(2);
back.show();
o.open("back.dat",ios::in|ios::out|ios::nocreate|ios::noreplace|ios::binary);
if(!o.good()){cleardevice();outtextxy(200,200,"ERROR IN BACK.DAT");getch();}
o.read(picture,10000);
o.close();
putimage(580,427,picture,0);


while(1)
{
mouse.showmouseptr();
if(back.check()==TRUE)
{personalmain();}
if(modify.check()==TRUE)
{
modifypersonal();
return;
}
/*current.spprofile();*/
}
}


int user::search_delete()
{
char a;
char temp[13];
int rrr;
fstream l;
l.open("index.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!l.good()){cleardevice();setcolor(RED);outtextxy(150,150,"ERROR IN INDEX.DAT");getch();exit(1);}
while(!l.eof())
{
l.read(&a,1);
l.read(temp,13);
l.read((char *)&rrr,2);
//if(strcmp(temp,id)==0 && a!='*' ){return rrr;}
if(a=='*'){ return rrr;}
}
return (-1);
}





void user::overwrite(int m,user *a)
{
fstream f,l;
f.open("USER.DAT",ios::in|ios::out|ios::nocreate|ios::binary|ios::noreplace);
if(!f.good()){cleardevice();setcolor(RED);outtextxy(150,150,"ERROR IN USER.DAT");getch();exit(1);}
l.open("INDEX.DAT",ios::in|ios::out|ios::nocreate|ios::binary|ios::noreplace);
if(!l.good()){cleardevice();setcolor(RED);outtextxy(150,150,"ERROR IN INDEX.DAT");getch();exit(1);}
f.seekp(0+(sizeof(user)*m),ios::beg);
l.seekp(0+(16*m),ios::beg);
f.write((const char*)a,sizeof(user));
l.write((const char*)a,16);
f.close();
l.close();
}


int user::no_of_user_in_index_notdeleted()
{
int c=0;
char a;
char temp[13];
int rrr;
fstream l;
l.open("index.dat",ios::in|ios::out|ios::binary|ios::nocreate|ios::noreplace);
if(!l.good()){cleardevice();setcolor(RED);outtextxy(150,150,"ERROR IN INDEX.DAT");getch();exit(1);}
while(!l.eof())
{
l.read(&a,1);
l.read(temp,13);
l.read((char *)&rrr,2);
if(a!='*'){ c++;}
}
return c;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -