برنامه ثبت مشخصات اشخاص به زبان C++ همراه سورس کد

در این برنامه مشخصات اشخاص در فایل ذخیره میشود و عملیاتی چون جستجو بر اساس شهر و تاریخ تولد و ... حذف بر اساس نام و فامیلی و آدرس و تغییر قالب برنامه تعبیه شده است

در این برنامه از توابع گرافیکی برای ترسیم و طراحی استفاده شده تا نمایی زیبا به برنامه داده شود

با اجرای فایل صفحه ورود به برنامه ظاهر میشود که با وارد کردن نام خود و اگر پسوردی برای برنامه تنظیم نکرده باشین فقط کلید اینتر را زده تا وارد برنامه شوید

 

صفحه اول برنامه :

 

صفحه مربوط به ثبت مشخصات اشخاص :

 

زیر منوی مربوط به جستجو در بین داده های ثبت شده :

 

نتیجه یک نمونه جستجو :

 

اگر موردی یافت نشد :

 

نمایش همه داده های ثبت شده در برنامه :

 

قابلیت ویرایش مشخصات ثبت شده که با وارد کردن نام و فامیلی پنل مربطه باز میشود :

 

پنل مربوط به ویرایش مشخصات ثبت شده اگر رویه گزینه Edit کلید اینتر را بزنید برنامه تک تک گزینه ها را در حال ویرایش قرار میدهد

 

تغییر پسورد ورود به برنامه :

 

پنل مربوط به اشتباه وارد شدن پسورد :

 

تنظیمات برنامه که شامل غیرفعال کردن صدای منوها و تم برنامه را شامل میشود

 

 

مشخصات برنامه که اطلاعات بیشتر به زبان فارسی داخل فایل ذخیره می شود :

متنی که در فایل مزبور ذخیره میشود :

                                      به نام خداوند بخشنده مهربان
                      با سلام خدمت شما دوست عزيز که از اين برنامه استفاده مي کنيد
اين برنامه يک بانک اطلاعاتي است که شامل اضافه کردن-جستجو-حذف-ويرايش-پسورد-تنظيمات-تماس بامن
 وخروج ازبرنامه مي باشد اين برنامه غيرقابل دستکاري است يعني هيچ کس به غيرازشما نمي تواندازاين برنامه
             استفاده کند مي توانيد برنامه را به هرپوشه اي که مي خواهيد انتقال بدهيد بااين شرط
           که تمام فايل ها را کپي کنيد يا حداقل چهار فايل اصلي را کپي کنيد که به ترتيب عبارتند از
              asghar.datوsystem.datوtrip.chrوbank.exe
  هميشه پسورد خود راحفظ باشيد زيرابا فراموش کردن پسورد ديگرراهي براي ديدن اطلاعات نداريدبراي امنيت
بيشترهميشه سعي کنيد که پسورد را فقط خودشما داشته باشيد وازدادن پسورد به ديگران خودداري کنيدتاهيچ مشکلي
پيش نيايداگريک زمان ديديد که برنامه اجازه دست يابي به اطلاعات را نمي دهديعني اينکه با انتخاب هرگزينه برنامه
ازشماپسورد پيشين را مي خواهدنگران نباشيد اين يک امنيت طراحي شده براي برنامه مي باشدحتمابرنامه تشخيص
 داده که پسورد واردشده اشتباه است بنابراين ازشماآخرين پسوردي راکه باآن وارد برنامه شده ايد رامي خواهد
شمابراي اين کار به قسمت تغييرپسورد مي رويد بعد بازاين کادربازمي شودشما باواردکردن پسورد قبلي کادرتغيير
 پسوردبازمي شود درقسمت اول شمافقط اينتررازده بعد بادادن پسوردجديدوتاييدآن به راحتي مي توانيد اين امنيت
  را براي اطلاعات خودداشته باشيداگرپسوردي راکه آخرين بار برنامه رابا آن بازکرده ايدرابه يادنداشته باشيد
ديگرنمي توانيد به اطلاعات خوددسترسي داشته باشيد براي دسترسي دوباره مي توانيدفايل اصغر.دات رابراي من
              ارسال کنيدتامن پسوردجديدي براي شما ارسال کنم تاباآن پسوردبرنامه رااجرا کنيد
         درضمن من اصغرکوهي دانشجوي رشته کامپيوترهستم باآرزوي توفيق براي شما دوستان عزيز

سورس کد کامل این برنامه :

#include stdio.h
#include stdlib.h
#include dos.h
#include conio.h
#include graphics.h
#include iostream.h
#include string.h

struct rank{
int ak[14];
int ak1[4];};
struct rank ra;

struct asghar{
char password[30],n[15],f[20],np[15],tt[15],mt[35],tel[15],job[30],va[5],je[5],fa[5];};
struct asghar st;

FILE *fp,*pa,*fd,*fr;
char c,fn[15],ff[20],tab[50],user[15],p8[30];
int we=0,ww=0,man=0,male=0,female=0,married=0,bachelor=0,barasy=0,qq=0,aa=1,k=100,y1=0,x1=0,x2=0,y2=0,y3=0,shah=0,ch=0;
float cod,sh;
/*8888888888888888888888888888888888888888888888888888888888 zed 8888888888*/
void zed(void)
{
setfillstyle(ra.ak[1],ra.ak[0]);bar(3,3,637,477);
setfillstyle(11,8);bar(20,20,151,234);
setfillstyle(ra.ak[4],ra.ak[3]);bar(15,15,143,226);
setcolor(ra.ak[2]);rectangle(1,1,639,479);
setcolor(ra.ak[5]);rectangle(15,15,144,226);
setcolor(15);
for(we=50;we<=65;we++)
    {line(137,we,146,57);line(137,we+25,146,82);}
fclose(fp);
fclose(fd);
}
void zedsearch(void)
{
setcolor(ra.ak[5]);
setfillstyle(11,8);bar(162,20,307,259);
setfillstyle(ra.ak[4],ra.ak[3]);bar(157,15,300,251);
rectangle(157,15,300,251);
fclose(fp);
fclose(fd);
}
/*888888888888888888888888888888888888888888888888888888888 help 88888888888*/
void help(void){
fp=fopen("c:\\help.txt","w");
fprintf(fp,"                                      به نام خداوند بخشنده مهربان\n");
fprintf(fp,"                      با سلام خدمت شما دوست عزيز که از اين برنامه استفاده مي کنيد\n");
fprintf(fp,"اين برنامه يک بانک اطلاعاتي است که شامل اضافه کردن-جستجو-حذف-ويرايش-پسورد-تنظيمات-تماس بامن\n");
fprintf(fp," وخروج ازبرنامه مي باشد اين برنامه غيرقابل دستکاري است يعني هيچ کس به غيرازشما نمي تواندازاين برنامه\n");
fprintf(fp,"             استفاده کند مي توانيد برنامه را به هرپوشه اي که مي خواهيد انتقال بدهيد بااين شرط\n");
fprintf(fp,"           که تمام فايل ها را کپي کنيد يا حداقل چهار فايل اصلي را کپي کنيد که به ترتيب عبارتند از\n");
fprintf(fp,"              asghar.datوsystem.datوtrip.chrوbank.exe\n");
fprintf(fp,"  هميشه پسورد خود راحفظ باشيد زيرابا فراموش کردن پسورد ديگرراهي براي ديدن اطلاعات نداريدبراي امنيت\n");
fprintf(fp,"بيشترهميشه سعي کنيد که پسورد را فقط خودشما داشته باشيد وازدادن پسورد به ديگران خودداري کنيدتاهيچ مشکلي\n");
fprintf(fp,"پيش نيايداگريک زمان ديديد که برنامه اجازه دست يابي به اطلاعات را نمي دهديعني اينکه با انتخاب هرگزينه برنامه\n");
fprintf(fp,"ازشماپسورد پيشين را مي خواهدنگران نباشيد اين يک امنيت طراحي شده براي برنامه مي باشدحتمابرنامه تشخيص\n");
fprintf(fp," داده که پسورد واردشده اشتباه است بنابراين ازشماآخرين پسوردي راکه باآن وارد برنامه شده ايد رامي خواهد\n");
fprintf(fp,"شمابراي اين کار به قسمت تغييرپسورد مي رويد بعد بازاين کادربازمي شودشما باواردکردن پسورد قبلي کادرتغيير\n");
fprintf(fp," پسوردبازمي شود درقسمت اول شمافقط اينتررازده بعد بادادن پسوردجديدوتاييدآن به راحتي مي توانيد اين امنيت\n");
fprintf(fp,"  را براي اطلاعات خودداشته باشيداگرپسوردي راکه آخرين بار برنامه رابا آن بازکرده ايدرابه يادنداشته باشيد\n");
fprintf(fp,"ديگرنمي توانيد به اطلاعات خوددسترسي داشته باشيد براي دسترسي دوباره مي توانيدفايل اصغر.دات رابراي من\n");
fprintf(fp,"              ارسال کنيدتامن پسوردجديدي براي شما ارسال کنم تاباآن پسوردبرنامه رااجرا کنيد\n");
fprintf(fp,"         درضمن من اصغرکوهي دانشجوي رشته کامپيوترهستم باآرزوي توفيق براي شما دوستان عزيز\n");
fclose(fp);
}
/*888888888888888888888888888888888888888888888888888888888 packardan 88888*/
void sound(void)
{for(qq=1;qq<10;qq++){sound(qq*800);delay(7);nosound();}}
/*888888888888888888888888888888888888888888888888888888888 packardan 88888*/
void sound3(void)
{for(qq=0 ;qq<75;qq++){sound(qq*100);delay(6);nosound();}}
/*888888888888888888888888888888888888888888888888888888888 packardan 88888*/
void sound4(void)
{for(qq=60;qq>0;qq--){sound(qq*100);delay(13);nosound();}}
/*888888888888888888888888888888888888888888888888888888888 packardan 88888*/
void sound5(void)
{for(qq=40;qq>0;qq--){sound(qq*80);delay(14);nosound();}}
/*888888888888888888888888888888888888888888888888888888888 tamas 8888888888*/
void tamas(void)
{
settextstyle(1,0,4);setcolor(15);
setfillstyle(1,8);bar(10,270,630,470);
setlinestyle(1,1,3);rectangle(10,270,630,470);setlinestyle(0,0,ra.ak1[2]);
setcolor(14);
outtextxy(20,305,"dar driyve  file         ra ejra konid.");
outtextxy(20,340,"in file be sorat farsi mibashad.");
outtextxy(20,380,"Email : ");
outtextxy(20,420,"web siyte :");
setcolor(15);outtextxy(186,305,"C    help.txt");
we=15;ww=0;y1=15;
while(!kbhit())
  {
   setcolor(random(15));
   outtextxy(140,380,"asghar.kohi@gmail.com");
   outtextxy(210,420,"www.ArtaRoyan.ir");
   setcolor(15);outtextxy(we,270,"asghar.kohi");
   delay(200);
   setcolor(8);outtextxy(we,270,"asghar.kohi");
   if(y1>=475){ww=1;for(qq=1;qq<10;qq++){sound(qq*1000);delay(22);nosound();}}
   if(y1<=15){ww=0;we=15;for(qq=1;qq<10;qq++){sound(qq*1000);delay(22);nosound();}}
   if(ww==0){we+=10;y1+=10;}
   if(ww==1){we-=10;y1-=10;}
   }
c=NULL;setfillstyle(ra.ak[1],ra.ak[0]);bar(5,260,638,475);
help();
settextstyle(0,0,0);
}
/*888888888888888888888888888888888888888888888888888888888 khata 888888888*/
void khata(void)
{
setfillstyle(1,7);bar(335,115,600,170);setcolor(15);outtextxy(380,120,"Search is Complete.");
outtextxy(340,130,"there are no results to display.");if(ra.ak1[0]==1)sound3();setfillstyle(1,4);bar(440,145,475,160);outtextxy(450,150,"OK");
rectangle(335,115,600,170);getch();
}
/*88888888888888888888888888888888888888888888888888888888 hazffamily 888888*/
void hazffamily(void){
fp=fopen("asghar.dat","w");
fd=fopen("asghardel.dat","a+b");rewind(fd);
fread(&st,sizeof(struct asghar),1,fd);
while(!feof(fd)){
	fwrite(&st,sizeof(struct asghar),1,fp);
	fread(&st,sizeof(struct asghar),1,fd);
   }
fclose(fp);fclose(fd);
}
/*888888888888888888888888888888888888888888888888888888888 khata1 88888888*/
void khata1(void){
setfillstyle(1,7);bar(280,300,600,400);outtextxy(290,320,"Are you sure you want to delete this");outtextxy(290,331,"information ?");
setfillstyle(1,8);bar(280,300,600,315);
setcolor(ra.ak[5]);rectangle(280,300,600,400);
if(ra.ak1[0]==1)sound4();
setcolor(4);setfillstyle(1,4);sector(320,360,0,360,4,14);sector(320,380,0,360,4,4);
setcolor(14);outtextxy(285,305,"Confirm Multiple File Delete");
aa=1;
 while(c!=5)
   {
   setcolor(4);
   setfillstyle(1,8);bar(422,360,460,380);outtextxy(430,365,"yes");
   setfillstyle(1,8);bar(510,360,545,380);outtextxy(520,365,"no");
   if(aa==1){setcolor(13);setfillstyle(1,4);bar(422,360,460,380);rectangle(422,360,460,380);setcolor(15);outtextxy(430,365,"yes");}
   if(aa==2){setcolor(13);setfillstyle(1,4);bar(510,360,545,380);rectangle(510,360,545,380);setcolor(15);outtextxy(520,365,"no");}
       while(!kbhit())
	 {we+=30;if(we>=360)we=0;
	 setcolor(random(15));ellipse(320,365,we,we+30,23,23);
	 delay(10);
	 }
   c=getch();
   if(c==13){
	if(aa==1){
	   hazffamily();c=5;
	   }
	if(aa==2)c=5;
	 }
   if(c==0)
   c=getch();
       if(c==75){aa--;if(aa==0)aa=2;}
       if(c==77){aa++;if(aa==3)aa=1;}
   }
 setfillstyle(ra.ak[1],ra.ak[0]);
 for(we=280;we<=440;we++){
  bar(we,300,we+1,450);
  bar(880-we,300,881-we,450);
  }
}
/*888888888888888888888888888888888888888888888888888888888 passkhata 88888*/
void passkhata(void){
	setcolor(4);setfillstyle(1,7);bar(230,350,470,400);
	rectangle(230,350,470,400);line(230,360,470,360);
	if(ra.ak1[0]==1)sound5();
	setcolor(15);outtextxy(235,352,"ERROR!!! ");setcolor(14);
	setfillstyle(1,4);bar(335,380,365,390);outtextxy(343,382,"ok");
}
/*888888888888888888888888888888888888888888888888888888888 packardan 88888*/
void tozih(void){
	outtextxy(50,275,"Totality Person :");
	outtextxy(50,309,"Totality female :");
	outtextxy(50,324,"Totality male :");
	outtextxy(50,352,"Totality Married :");
	outtextxy(50,370,"Totality bachelor :");
}
/*8888888888888888888888888888888888888888888888888888888888 asghar 888888888*/
void select(int x1,int x2,int y2,int y3){
aa=1;
while(c!=5)
  {
  setcolor(15);
  circle(x1,y2,8);circle(x2,y2,8);
  setcolor(y3);setfillstyle(1,y3);
  pieslice(x1,y2,0,360,5);pieslice(x2,y2,0,360,5);
  if(aa==1){setcolor(15);circle(x1,y2,8);setcolor(0);setfillstyle(1,0);pieslice(x1,y2,0,360,5);}
  if(aa==2){setcolor(15);circle(x2,y2,8);setcolor(0);setfillstyle(1,0);pieslice(x2,y2,0,360,5);}
   c=getch();
      if(c==13)
	{
	if(aa==2)c=5;
	if(aa==1)c=5;
	}
     if(c==0)
       {
       c=getch();
       if(c==75){aa--;if(aa==0)aa=2;}
       if(c==77){aa++;if(aa==3)aa=1;}
       }
   }
}
/*8888888888888888888888888888888888888888888888888888888888 asghar 888888888*/
void asghar(void)
{int x=580,y=400;ww=4;we=15;y1=0;
settextstyle(0,0,0);
while(!kbhit())
   {
	 ww+=we;
	 we=ww-we;
	 ww=ww-we;
   setcolor(ww);
   outtextxy(x-(strlen(user)/2*9),y-20,user);
   outtextxy(x,y,"");

   outtextxy(x+6,y-7,"");
   outtextxy(x+14,y-10,"");
   outtextxy(x+23,y-7,"");
   outtextxy(x+27,y,"");
   outtextxy(x+27,y+8,"");
   outtextxy(x+23,y+15,"");
   outtextxy(x+18,y+22,"");
   outtextxy(x+13,y+29,"");
   outtextxy(x+8,y+36,"");

   outtextxy(x-6,y-7,"");
   outtextxy(x-14,y-10,"");
   outtextxy(x-23,y-7,"");
   outtextxy(x-27,y,"");
   outtextxy(x-27,y+8,"");
   outtextxy(x-23,y+15,"");
   outtextxy(x-18,y+22,"");
   outtextxy(x-13,y+29,"");
   outtextxy(x-8,y+36,"");
   outtextxy(x,y+43,"");
   delay(50);
   setfillstyle(ra.ak[1],ra.ak[0]);bar(540,360,620,455);
   }
}
/*888888888888888888888888888888888888888888888888888888888 passmakan 88888*/
void passmakan(int y1){
while(!kbhit()){
   setcolor(random(15));
   outtextxy(510,y1,"");
   delay(50);
  }
}
/*888888888888888888888888888888888888888888888888888888888 passneshan 8888*/
void passneshan(void){
	clrscr();
	for(we=0;we<ww;we++)
	cout<<"*";
}
/*888888888888888888888888888888888888888888888888888888888 printadd 888888*/
void printadd(int y1){
	if(y1==1||y1==20){bar(20,25,137,40);outtextxy(25,30,"ADD     Person");}
	if(y1==2||y1==20){bar(20,50,137,65);outtextxy(25,55,"Search  Person");}
	if(y1==3||y1==20){bar(20,75,137,90);outtextxy(25,80,"Del     Person");}
	if(y1==4||y1==20){bar(20,100,137,115);outtextxy(25,105,"Edit    Person");}
	if(y1==5||y1==20){bar(20,125,137,140);outtextxy(25,130,"Chenge  Passw");}
	if(y1==6||y1==20){bar(20,150,137,165);outtextxy(25,155,"Options");}
	if(y1==7||y1==20){bar(20,175,137,190);outtextxy(25,180,"Contact With I");}
	if(y1==8||y1==20){bar(20,200,137,215);outtextxy(25,205,"Exit");}
}
/*88888888888888888888888888888888888888888888888888888888printsearch 88888*/
void printsearch(int y1){
	if(y1==1||y1==20){bar(162,25,295,40);outtextxy(165,30,"Name and Family");}
	if(y1==2||y1==20){bar(162,50,295,65);outtextxy(165,55,"Family");}
	if(y1==3||y1==20){bar(162,75,295,90);outtextxy(165,80,"Birth Year");}
	if(y1==4||y1==20){bar(162,100,295,115);outtextxy(165,105,"Birth Stead");}
	if(y1==5||y1==20){bar(162,125,295,140);outtextxy(165,130,"Number Tel");}
	if(y1==6||y1==20){bar(162,150,295,165);outtextxy(165,155,"Job");}
	if(y1==7||y1==20){bar(162,175,295,190);outtextxy(165,180,"Married or Bache");}
	if(y1==8||y1==20){bar(162,200,295,215);outtextxy(165,205,"male or female");}
	if(y1==9||y1==20){bar(162,225,295,240);outtextxy(165,230,"Disply All");}
}
/*888888888888888888888888888888888888888888888888888888888 packardan 88888*/
void packardan(void){
	for(we=0;we<15;we++)   st.n[we]=NULL;
	for(we=0;we<20;we++)   st.f[we]=NULL;
	for(we=0;we<15;we++)   st.np[we]=NULL;
	for(we=0;we<15;we++)   st.tt[we]=NULL;
	for(we=0;we<35;we++)   st.mt[we]=NULL;
	for(we=0;we<15;we++)   st.tel[we]=NULL;
	for(we=0;we<30;we++)   st.job[we]=NULL;
	for(we=0;we<5;we++)    st.va[we]=NULL;
	for(we=0;we<5;we++)    st.je[we]=NULL;
	for(we=0;we<5;we++)    st.fa[we]=NULL;
	for(we=0;we<30;we++)   st.password[we]=NULL;
}
/*8888888888888888888888888888888888888888888888888888888 codexit 888888888*/
void codexit(void){
	for(we=0;we<strlen(st.n);we++)   st.n[we]-=k;
	for(we=0;we<strlen(st.f);we++)   st.f[we]-=k;
	for(we=0;we<strlen(st.np);we++)   st.np[we]-=k;
	for(we=0;we<strlen(st.tt);we++)   st.tt[we]-=k;
	for(we=0;we<strlen(st.mt);we++)   st.mt[we]-=k;
	for(we=0;we<strlen(st.tel);we++)   st.tel[we]-=k;
	for(we=0;we<strlen(st.job);we++)   st.job[we]-=k;
	for(we=0;we<strlen(st.va);we++)    st.va[we]-=k;
	for(we=0;we<strlen(st.je);we++)    st.je[we]-=k;
	for(we=0;we<strlen(st.fa);we++)    st.fa[we]-=k;
}
/*8888888888888888888888888888888888888888888888888888888 codstart 88888888*/
void codstart(void){
	for(we=0;we<strlen(st.n);we++)   st.n[we]+=k;
	for(we=0;we<strlen(st.f);we++)   st.f[we]+=k;
	for(we=0;we<strlen(st.np);we++)   st.np[we]+=k;
	for(we=0;we<strlen(st.tt);we++)   st.tt[we]+=k;
	for(we=0;we<strlen(st.mt);we++)   st.mt[we]+=k;
	for(we=0;we<strlen(st.tel);we++)   st.tel[we]+=k;
	for(we=0;we<strlen(st.job);we++)   st.job[we]+=k;
	for(we=0;we<strlen(st.va);we++)    st.va[we]+=k;
	for(we=0;we<strlen(st.je);we++)    st.je[we]+=k;
	for(we=0;we<strlen(st.fa);we++)    st.fa[we]+=k;
}
/*8888888888888888888888888888888888888888888888888888888888 asghar 888888888*/
void selectbar(void){
   while(!kbhit()){
	setcolor(random(15));
	if(aa==1)outtextxy(295,337,"  ");
	if(aa==2)outtextxy(415,337,"  ");
	delay(100);
	}
	setcolor(8);
	outtextxy(295,337,"  ");
	outtextxy(415,337,"  ");
}
/*8888888888888888888888888888888888888888888888888888 namayesh11 888888888*/
void namayesh11(void){
	man++;
	if(!strcmp(st.je,"f"))female++;
	if(!strcmp(st.je,"m"))male++;
	if(!strcmp(st.va,"m"))married++;
	if(!strcmp(st.va,"b"))bachelor++;
}
/*888888888888888888888888888888888888888888888888888888 namayesh 888888888*/
void namayesh(int aa,struct asghar,char ff[20]){
female=0;male=0;man=0;married=0;bachelor=0;
rewind(fp);
fread(&st,sizeof(struct asghar),1,fp);
while(!feof(fp))
  {
    codexit();
    if(aa==2)if(!strcmp(st.f,ff))namayesh11();
    if(aa==3)if(!strcmp(st.tt,ff))namayesh11();
    if(aa==4)if(!strcmp(st.mt,ff))namayesh11();
    if(aa==5)if(!strcmp(st.tel,ff))namayesh11();
    if(aa==6)if(!strcmp(st.job,ff))namayesh11();
    if(aa==7)if(!strcmp(st.va,ff))namayesh11();
    if(aa==8)if(!strcmp(st.je,ff))namayesh11();
    fread(&st,sizeof(struct asghar),1,fp);
  }
setcolor(ra.ak[13]);rectangle(45,265,245,385);line(45,295,245,295);line(45,340,245,340);
setcolor(ra.ak[12]);
tozih();
window(27,18,27,18);clrscr();cout<<man;
window(27,20,27,20);clrscr();cout<<female;
window(27,21,27,21);clrscr();cout<<male;
window(27,23,27,23);clrscr();cout<<married;
window(27,24,27,24);clrscr();cout<<bachelor;
}
/*888888888888888888888888888888888888888888888888888888 neshankar 88888888*/
void neshankar(int y1,int we){
while(!kbhit()){
   setcolor(random(15));
   outtextxy(y1,we,"");
   delay(100);
   setcolor(8);outtextxy(y1,we,"");
   }
setcolor(14);
}
/*8888888888888888888888888888888888888888888888888888 search familyshekl 888*/
void searchfamilyshekl(void){
setcolor(ra.ak[5]);setfillstyle(1,8);bar(310,15,635,60);rectangle(310,15,635,60);
setcolor(ra.ak[12]);
}
/*8888888888888888888888888888888888888888888888888888 search familyshekl1 88*/
void familyshekl1(int y1,struct asghar){
setcolor(15);outtextxy(340,y1+2,st.n);setcolor(4);outtextxy(450,y1+2,st.f);
setcolor(15);
}
/*888888888888888888888888888888888888888888888888888888888 addshekl 888888*/
void addshekl(void){
	setcolor(14);
	setfillstyle(9,5);
	outtextxy(205,53,"Name:");bar(246,46,385,65);
	outtextxy(205,85,"Family:");bar(262,78,441,97);
	outtextxy(205,117,"Father Name:");bar(302,110,449,129);
	outtextxy(205,148,"Birth Year:");bar(294,142,425,161);
	outtextxy(205,180,"Birth Stead:");bar(302,174,585,193);
	outtextxy(205,211,"Number Tel:");bar(294,206,425,225);
	outtextxy(205,242,"Job:");bar(238,238,505,257);

	outtextxy(205,275,"Bachelor               Married");setcolor(15);circle(280,280,8);circle(370,280,8);setcolor(14);
	outtextxy(205,306,"male                   female ");setcolor(15);circle(280,310,8);circle(370,310,8);
	setcolor(15);setfillstyle(1,7);bar(280,350,350,370);outtextxy(290,355,"Save");
	setcolor(15);setfillstyle(1,7);bar(400,350,470,370);outtextxy(410,355,"Cancel");
}
/*888888888888888888888888888888888888888888888888888888888 peykham 88888*/
void peykham(void){
	if(aa==2){searchfamilyshekl();outtextxy(313,20,"Please enter the Family in the box below");}
	if(aa==3){searchfamilyshekl();outtextxy(313,20,"Please enter the Birth Year in the box");outtextxy(600,33,"below");}
	if(aa==4){searchfamilyshekl();outtextxy(313,20,"Please enter the Birth Stead in the box");outtextxy(600,33,"below");}
	if(aa==5){searchfamilyshekl();outtextxy(313,20,"Please enter the Telepon in the box below");}
	if(aa==6){searchfamilyshekl();outtextxy(313,20,"Please enter the Job in the box below");}
	if(aa==7){searchfamilyshekl();outtextxy(313,20,"Please enter the Married or Bachelor in the");setcolor(15);outtextxy(449,20,"M          B");outtextxy(325,50,"M or B");setcolor(14);outtextxy(605,33,"box");outtextxy(600,47,"below");}
	if(aa==8){searchfamilyshekl();outtextxy(313,20,"Please enter the Male or Female in the");setcolor(15);outtextxy(449,20,"M       F");outtextxy(325,50,"M or F");setcolor(14);outtextxy(605,33,"box");outtextxy(600,47,"below");}
}
/*888888888888888888888888888888888888888888888888888888888 asle 8888888888*/
void asle(void){
	setcolor(ra.ak[8]);
	setfillstyle(ra.ak[7],ra.ak[6]);
	printadd(20);
}
/*888888888888888888888888888888888888888888888888888888 harecat 8888888888*/
void harecat(void){
	setcolor(ra.ak[11]);setfillstyle(ra.ak[10],ra.ak[9]);
	if(aa==1){printadd(aa);setcolor(ra.ak[8]);rectangle(20,25,137,40);}
	if(aa==2){printadd(aa);setcolor(ra.ak[8]);rectangle(20,50,137,65);}
	if(aa==3){printadd(aa);setcolor(ra.ak[8]);rectangle(20,75,137,90);}
	if(aa==4){printadd(aa);setcolor(ra.ak[8]);rectangle(20,100,137,115);}
	if(aa==5){printadd(aa);setcolor(ra.ak[8]);rectangle(20,125,137,140);}
	if(aa==6){printadd(aa);setcolor(ra.ak[8]);rectangle(20,150,137,165);}
	if(aa==7){printadd(aa);setcolor(ra.ak[8]);rectangle(20,175,137,190);}
	if(aa==8){printadd(aa);setcolor(ra.ak[8]);rectangle(20,200,137,215);}
}
/*888888888888888888888888888888888888888888888888888888888 chak 8888888888*/
int chak(void){
    ch=0;y3=0;
    for(we=0;we<30;we++)p8[we]=NULL;
    pa=fopen("system.dat","r");fread(p8,30,1,pa);fclose(pa);
    fp=fopen("asghar.dat","r");rewind(fp);
    fread(&st,sizeof(struct asghar),1,fp);fclose(fp);
    if(shah==100)y3=1;
    if(strlen(st.je)==0&&strlen(st.va)==0)y3=1;
    if(!strcmp(st.password,p8))y3=1;
    if(y3==0)
	{
	for(we=0;we<30;we++)p8[we]=NULL;
	setfillstyle(1,8);setcolor(15);bar(150,280,500,350);rectangle(150,280,500,350);
	outtextxy(160,290,"previouse password : ");
	window(22,21,60,21);clrscr();c=NULL;ww=0;
	   while(c!=13){c=getch();if(c!=13){p8[ww]=c;if(c==8){p8[ww]=NULL;p8[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;}passneshan();}
	    ww=60;
	    for(we=0;we<strlen(p8);we++){p8[we]+=ww;ww+=(3+we);if(ww==123)ww=30;if(ww==135)ww=10;}
	if(!strcmp(st.password,p8))y3=1;
	else {passkhata();outtextxy(235,365,"the password that you type is");outtextxy(235,375,"not correct.");getch();}
	setfillstyle(ra.ak[1],ra.ak[0]);bar(140,270,510,460);
	}
if(y3==1)return ch=1;
}
/*88888888888888888888888888888888888888888888888888888888 add 888888888888*/
void addadd(void){
	for(we=0;we<30;we++)p8[we]=NULL;
	pa=fopen("system.dat","r");
	fread(p8,30,1,pa);fclose(pa);
	for(we=0;we<strlen(p8);we++)
	st.password[we]=p8[we];
}
/*88888888888888888888888888888888888888888888888888888888 add 888888888888*/
void add(void){
ch=chak();
if(ch==1)
{
 c=NULL;
 fp=fopen("asghar.dat","a+b");
 setfillstyle(1,8);bar(200,20,600,380);setcolor(15);
 rectangle(200,20,600,380);
 line(200,34,600,34);
 setcolor(11);outtextxy(345,24,"Add Person");
 packardan();
 addshekl();
 ww=0;c=NULL;
 window(32,4,48,4);clrscr();while(c!=13){y1=395;we=55;neshankar(y1,we);c=getch();if(c!=13){st.n[ww]=c;if(c==8){st.n[ww]=NULL;st.n[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=14){ww=14;st.n[14]=NULL;st.n[15]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.n[we];}ww=0;c=NULL;
 window(34,6,55,6);clrscr();while(c!=13){y1=451;we=87;neshankar(y1,we);c=getch();if(c!=13){st.f[ww]=c;if(c==8){st.f[ww]=NULL;st.f[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=19){ww=19;st.f[19]=NULL;st.f[20]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.f[we];}ww=0;c=NULL;
 window(39,8,56,8);clrscr();while(c!=13){y1=459;we=119;neshankar(y1,we);c=getch();if(c!=13){st.np[ww]=c;if(c==8){st.np[ww]=NULL;st.np[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=14){ww=14;st.np[14]=NULL;st.np[15]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.np[we];}ww=0;c=NULL;
 window(38,10,53,10);clrscr();while(c!=13){y1=435;we=151;neshankar(y1,we);c=getch();if(c!=13){st.tt[ww]=c;if(c==8){st.tt[ww]=NULL;st.tt[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=14){ww=14;st.tt[14]=NULL;st.tt[15]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.tt[we];}ww=0;c=NULL;
 window(39,12,73,12);clrscr();while(c!=13){y1=590;we=183;neshankar(y1,we);c=getch();if(c!=13){st.mt[ww]=c;if(c==8){st.mt[ww]=NULL;st.mt[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=34){ww=34;st.mt[34]=NULL;st.mt[35]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.mt[we];}ww=0;c=NULL;
 window(38,14,53,14);clrscr();while(c!=13){y1=435;we=215;neshankar(y1,we);c=getch();if(c!=13){st.tel[ww]=c;if(c==8){st.tel[ww]=NULL;st.tel[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=14){ww=14;st.tel[14]=NULL;st.tel[15]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.tel[we];}ww=0;c=NULL;
 window(31,16,63,16);clrscr();while(c!=13){y1=515;we=247;neshankar(y1,we);c=getch();if(c!=13){st.job[ww]=c;if(c==8){st.job[ww]=NULL;st.job[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=29){ww=29;st.job[29]=NULL;st.job[30]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.job[we];}ww=0;c=NULL;
 x1=280;x2=370;y2=280;y3=8;
 select(x1,x2,y2,y3);
 if(aa==2){st.va[0]='m';setcolor(15);rectangle(487,271,496,288);setcolor(14);outtextxy(502,275,"=Total Bairn");window(62,18,62,18);clrscr();c=getch();cout<<c;st.fa[0]=c;}
 if(aa==1){st.va[0]='b';}
 y2=310;
 c=NULL;aa=1;
 select(x1,x2,y2,y3);
 if(aa==1){st.je[0]='m';}
 if(aa==2){st.je[0]='f';}
 addadd();
 c=NULL;aa=1;
 codstart();
 while(c!=5)
     {
   setcolor(15);setfillstyle(1,7);bar(400,350,470,370);bar(280,350,350,370);outtextxy(290,355,"Save");outtextxy(410,355,"Cancel");
   if(aa==1){setcolor(15);setfillstyle(1,4);bar(280,350,350,370);outtextxy(290,355,"Save");rectangle(280,350,350,370);}
   if(aa==2){setcolor(15);setfillstyle(1,4);bar(400,350,470,370);outtextxy(410,355,"Cancel");rectangle(400,350,470,370);}
   selectbar();
   c=getch();
   if(c==13)
	{
	if(aa==1){fwrite(&st,sizeof(struct asghar),1,fp);c=5;}
	if(aa==2)c=5;
	}
   if(c==0)
       {
       c=getch();
       if(c==75){aa--;if(aa==0)aa=2;}
       if(c==77){aa++;if(aa==3)aa=1;}
       }
   }
 c=NULL;
 packardan();
 zed();
 fclose(fp);
 aa=1;
}
if(ch==0){tamas();getch();}
}
/*------------------------------------------------------ asle search -------*/
void aslesearch(void){
	setcolor(ra.ak[8]);
	setfillstyle(ra.ak[7],ra.ak[6]);
	printsearch(20);
}
/*------------------------------------------------------ harecat search -------*/
void harecatsearch(void){
	setcolor(ra.ak[11]);
	setfillstyle(ra.ak[10],ra.ak[9]);
	if(aa==1){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,25,295,40);}
	if(aa==2){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,50,295,65);}
	if(aa==3){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,75,295,90);}
	if(aa==4){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,100,295,115);}
	if(aa==5){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,125,295,140);}
	if(aa==6){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,150,295,165);}
	if(aa==7){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,175,295,190);}
	if(aa==8){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,200,295,215);}
	if(aa==9){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,225,295,240);}
}
/*888888888888888888888888888888888888888888888888888888888 Display all 8888*/
void displayall(void){
int y2=0,y3=0,qq1=1;
man=0;male=0;female=0;married=0;bachelor=0;y1=20;sh=0;
ch=chak();
qq=1;
if(ch==1)
{
 fp=fopen("asghar.dat","r");
 qq=0;barasy=0;cod=1;
 rewind(fp);
 fread(&st,sizeof(struct asghar),1,fp);
 while(!feof(fp))
  {
   codexit();
   sh++;
   namayesh11();
   fread(&st,sizeof(struct asghar),1,fp);
  }
  packardan();
 setcolor(ra.ak[12]);rectangle(45,265,245,390);line(45,295,245,295);line(45,340,245,340);
 setcolor(ra.ak[13]);
 tozih();
 window(27,18,27,18);clrscr();cout<<man;
 window(27,20,27,20);clrscr();cout<<female;
 window(27,21,27,21);clrscr();cout<<male;
 window(27,23,27,23);clrscr();cout<<married;
 window(27,24,27,24);clrscr();cout<<bachelor;
	    sh=sh/40;
  gcvt(sh,0,tab);
  if(sh>1)outtextxy(290,460,tab);
  rewind(fp);y1=20;sh=1;
  fread(&st,sizeof(struct asghar),1,fp);
  while(!feof(fp))
       {
	codexit();
	setfillstyle(1,7);bar(315,y1,630,y1+10);
	setcolor(ra.ak[13]);rectangle(315,y1,630,y1+10);
	line(338,y1,338,y1+10);
	y3=qq%3;
	if(y3==0)y2=0;
	if(y3!=0){y2=15;y3=0;}
	setcolor(y2);qq++;
	outtextxy(340,y1+2,st.n);
	outtextxy(470,y1+2,st.f);
	setcolor(4);
	gcvt(cod,5,tab);
	outtextxy(320,y1+2,tab);
	cod++;
	fread(&st,sizeof(struct asghar),1,fp);
	y1+=10;
	if(cod>=44)
	    {
	    setcolor(15);
	    outtextxy(50,450,"Press any kay to contine ...");
	    gcvt(sh,0,tab);outtextxy(290,450,tab);
	    }
	if(cod>=45)
	    {
	    cod=1;sh++;if(qq1>=30)qq1=1;y1=20;y3++;getch();setfillstyle(ra.ak[1],ra.ak[0]);bar(310,3,630,478);bar(45,440,460,457);
	    }
	}
}
if(ch==0)tamas();
getch();
setfillstyle(ra.ak[1],ra.ak[0]);bar(310,3,630,478);bar(45,260,460,470);
fclose(fp);
}
/*888888888888888888888888888888888888888888888888888888888 search family 888*/
void entersearchfamily(int aa)
{c=NULL;
int oo=0,y3=0,asghar=0;
man=0;female=0;male=0;married=0;bachelor=0;y1=0;
ch=chak();
if(ch==1)
{
 fp=fopen("asghar.dat","r");
 qq=1;
 rewind(fp);
 peykham();
 for(ww=0;ww<20;ww++)
 ff[ww]=NULL;
 window(41,3,75,3);clrscr();
 ww=0;
    while(c!=13)
      {
	  c=getch();
	  setfillstyle(ra.ak[1],ra.ak[0]);bar(307,75,638,478);
	  if(c!=13)
	     {
	      ff[ww]=c;
	      if(c==8){ff[ww]=NULL;ff[ww-1]=NULL;ww--;if(ww==-1)ww=0;}
	       else ww++;
	      }
	  clrscr();
	  for(we=0;we<ww;we++)
	  cout<<ff[we];
	    y1=75;rewind(fp);cod=1;
	       fread(&st,sizeof(struct asghar),1,fp);
	       while(!feof(fp))
		    {
		      codexit();
			oo=0;
		      if(aa==2)for(we=0;we<ww;we++)if(st.f[we]==ff[we])oo++;
		      if(aa==3)for(we=0;we<ww;we++)if(st.tt[we]==ff[we])oo++;
		      if(aa==4)for(we=0;we<ww;we++)if(st.mt[we]==ff[we])oo++;
		      if(aa==5)for(we=0;we<ww;we++)if(st.tel[we]==ff[we])oo++;
		      if(aa==6)for(we=0;we<ww;we++)if(st.job[we]==ff[we])oo++;
		      if(aa==7)for(we=0;we<ww;we++)if(st.va[we]==ff[we])oo++;
		      if(aa==8)for(we=0;we<ww;we++)if(st.je[we]==ff[we])oo++;
		      if(oo==ww)
		       {
			setfillstyle(1,7);bar(315,y1,630,y1+10);
			setcolor(14);rectangle(315,y1,630,y1+10);
			line(338,y1,338,y1+10);
			setcolor(0);
 gcvt(cod,5,tab);
 outtextxy(320,y1+2,tab);
 cod++;
 for(we=12;we<strlen(st.n);we++)st.n[we]=NULL;
 if(aa==2){familyshekl1(y1,st);outtextxy(590,y1+2,st.je);setcolor(4);outtextxy(605,y1+2,st.va);setcolor(15);outtextxy(620,y1+2,st.fa);}
 if(aa==3){familyshekl1(y1,st);outtextxy(550,y1+2,st.tt);}
 if(aa==4){familyshekl1(y1,st);outtextxy(550,y1+2,st.mt);}
 if(aa==5){familyshekl1(y1,st);outtextxy(550,y1+2,st.tel);}
 if(aa==6){familyshekl1(y1,st);outtextxy(550,y1+2,st.job);}
 if(aa==7){familyshekl1(y1,st);outtextxy(590,y1+2,st.je);setcolor(4);outtextxy(605,y1+2,st.va);setcolor(15);outtextxy(620,y1+2,st.fa);}
 if(aa==8){familyshekl1(y1,st);outtextxy(590,y1+2,st.je);setcolor(4);outtextxy(605,y1+2,st.va);setcolor(15);outtextxy(620,y1+2,st.fa);}
			y1+=10;
		       }
		    fread(&st,sizeof(struct asghar),1,fp);
		    }
      }
 namayesh(aa,st,ff);
 setcolor(14);
 if(man!=0)outtextxy(324,65,"  1             2                3 4 5");
 setcolor(14);outtextxy(50,390,"1> Name");
 setcolor(15);outtextxy(50,400,"2> Family");
 setcolor(14);outtextxy(50,410,"3> male or female");
 setcolor(15);outtextxy(50,420,"4> Married or Bachelor");
 setcolor(14);outtextxy(50,430,"5> Total Bairn");
 setcolor(15);
 setfillstyle(ra.ak[1],ra.ak[0]);bar(307,75,638,478);
 y1=75;rewind(fp);
 fread(&st,sizeof(struct asghar),1,fp);
 cod=0;barasy=0;
 man=man/40;sh=1;
 while(!feof(fp))
     {
     codexit();
 if(aa==2)if(!strcmp(st.f,ff))asghar=1;
 if(aa==3)if(!strcmp(st.tt,ff))asghar=1;
 if(aa==4)if(!strcmp(st.mt,ff))asghar=1;
 if(aa==5)if(!strcmp(st.tel,ff))asghar=1;
 if(aa==6)if(!strcmp(st.job,ff))asghar=1;
 if(aa==7)if(!strcmp(st.va,ff))asghar=1;
 if(aa==8)if(!strcmp(st.je,ff))asghar=1;
	if(asghar==1)
	{
	cod++;barasy++;asghar=0;
	setfillstyle(1,7);bar(315,y1,630,y1+10);
	setcolor(14);rectangle(315,y1,630,y1+10);
	line(338,y1,338,y1+10);
	setcolor(0);
	gcvt(cod,5,tab);
	outtextxy(320,y1+2,tab);
		for(we=12;we<strlen(st.n);we++)st.n[we]=NULL;for(we=15;we<strlen(st.f);we++)st.f[we]=NULL;
		setcolor(15);outtextxy(340,y1+2,st.n);setcolor(4);outtextxy(450,y1+2,st.f);setcolor(15);outtextxy(590,y1+2,st.je);setcolor(4);outtextxy(605,y1+2,st.va);setcolor(15);outtextxy(620,y1+2,st.fa);
		      if(cod>=40)
		      {
		      setcolor(15);
		      outtextxy(50,450,"Press any kay to contine ...");rectangle(45,445,300,460);
		      gcvt(sh,0,tab);
		      outtextxy(290,450,tab);
		      if(man==1)outtextxy(290,465,"1");if(man==2)outtextxy(290,465,"2");if(man==3)outtextxy(290,465,"3");if(man==4)outtextxy(290,465,"4");if(man==5)outtextxy(290,465,"5");
		      cod=0;sh++;y1=65;y3++;getch();setfillstyle(ra.ak[1],ra.ak[0]);bar(310,75,630,478);bar(45,440,460,475);
		      }
		y1+=10;
	}
   fread(&st,sizeof(struct asghar),1,fp);
   }
 if(barasy==0)khata();
 }
if(ch==0)tamas();
getch();
setfillstyle(ra.ak[1],ra.ak[0]);bar(307,2,638,478);bar(45,260,460,475);
c=NULL;
packardan();
fclose(fp);
}
/*888888888888888888888888888888888888888888888888888888888 namefamil 888888*/
void namefamil(void)
{float cod1;
char cod2[15];
y1=0;
c=NULL;barasy=0;
ch=chak();
if(ch==1)
{
 fp=fopen("asghar.dat","r");
 setfillstyle(1,8);bar(310,15,635,90);
 setcolor(ra.ak[12]);outtextxy(313,20,"Please enter the Name and Family in the");outtextxy(313,33,"box below.");
 setcolor(ra.ak[5]);rectangle(310,15,635,90);
   setcolor(15);outtextxy(320,55,"Name             Family");
 for(ww=0;ww<15;ww++)fn[ww]=NULL;
 for(ww=0;ww<20;ww++)ff[ww]=NULL;
 window(58,5,78,5);clrscr();
 window(41,5,56,5);clrscr();
 ww=0;
     while(c!=13)
      {
	  c=getch();
	  if(c!=13)
	     {
	      fn[ww]=c;
	      if(c==8){fn[ww]=NULL;fn[ww-1]=NULL;ww--;if(ww==-1)ww=0;}
	       else ww++;
	      }
	  clrscr();
	  for(we=0;we<ww;we++)
	  cout<<fn[we];rewind(fp);
	  fread(&st,sizeof(struct asghar),1,fp);
	  y1=80;
	  setfillstyle(1,8);bar(310,80,635,90);
	  setfillstyle(ra.ak[1],ra.ak[0]);bar(310,90,638,478);
	  setcolor(ra.ak[5]);rectangle(310,15,635,90);
	  setcolor(15);
	  while(!feof(fp))
	     {
		barasy=0;
		for(we=0;we<strlen(st.n);we++)   st.n[we]-=k;
		for(we=0;we<ww;we++)
		if(st.n[we]==fn[we])
		barasy++;
		if(barasy==ww)
		  {
		  setfillstyle(1,7);bar(320,y1,447,y1+10);
		  outtextxy(320,y1,st.n);
		  y1+=10;
		  }
	    fread(&st,sizeof(struct asghar),1,fp);
	    }
      }
 setfillstyle(1,8);bar(310,80,635,90);
 setfillstyle(ra.ak[1],ra.ak[0]);bar(310,90,638,478);
 setcolor(ra.ak[5]);rectangle(310,15,635,90);
 ww=0;barasy=0;
 window(58,5,78,5);clrscr();
    while(c!=12)
      {
	  c=getch();
	  if(c!=13)
	     {
	      ff[ww]=c;
	      if(c==8){ff[ww]=NULL;ff[ww-1]=NULL;ww--;if(ww==-1)ww=0;}
	       else ww++;
	      }
	  clrscr();
	  for(we=0;we<ww;we++)
	  cout<<ff[we];
	  if(c==13)c=12;rewind(fp);
	  fread(&st,sizeof(struct asghar),1,fp);
	  y1=80;
	  setfillstyle(1,8);bar(310,80,635,90);
	  setfillstyle(ra.ak[1],ra.ak[0]);bar(310,90,638,478);
	  setcolor(ra.ak[5]);rectangle(310,15,635,90);setcolor(15);
	  while(!feof(fp))
	     {
		barasy=0;
		for(we=0;we<strlen(st.f);we++)   st.f[we]-=k;
		for(we=0;we<ww;we++)
		if(st.f[we]==ff[we])
		barasy++;
		if(barasy==ww)
		  {
		  setfillstyle(1,7);bar(456,y1,623,y1+10);
		  outtextxy(456,y1,st.f);
		  y1+=10;
		  }
	    fread(&st,sizeof(struct asghar),1,fp);
	    }

	}
 setfillstyle(1,8);bar(310,80,635,90);
 setfillstyle(ra.ak[1],ra.ak[0]);bar(310,90,638,478);
 setcolor(ra.ak[5]);rectangle(310,15,635,90);
 cod=0;
 rewind(fp);
 fread(&st,sizeof(struct asghar),1,fp);
 while(!feof(fp))
	{
	codexit();
	if(!strcmp(st.n,fn)&&!strcmp(st.f,ff))
	cod++;
	fread(&st,sizeof(struct asghar),1,fp);
	}
 qq=0;cod1=0;
 gcvt(cod,5,tab);
 rewind(fp);
 fread(&st,sizeof(struct asghar),1,fp);
 while(!feof(fp))
	{
	codexit();
	if(!strcmp(st.n,fn))
	if(!strcmp(st.f,ff))
		{
		setcolor(15);qq++;cod1++;
		gcvt(cod1,5,cod2);
		setfillstyle(1,8);bar(10,265,350,465);
		rectangle(10,265,350,465);
		setcolor(14);
		outtextxy(15,270,"Name :");
		outtextxy(15,290,"Family :");
		outtextxy(15,310,"Father Name :");
		outtextxy(15,330,"Birth Year :");
		outtextxy(15,350,"Birth Stead :");
		outtextxy(15,370,"Number Tel :");
		outtextxy(15,390,"Job :");
		outtextxy(15,410,"Bachelor or Married :");
		outtextxy(15,430,"Male or Female :");
		outtextxy(15,450,"Total Bairn :");
		setcolor(15);
		outtextxy(67,270,st.n);
		outtextxy(85,290,st.f);
		outtextxy(125,310,st.np);
		outtextxy(115,330,st.tt);
		outtextxy(125,350,st.mt);
		outtextxy(115,370,st.tel);
		outtextxy(57,390,st.job);
		if(st.va[0]=='b')outtextxy(188,410,"Bachelor");
		if(st.va[0]=='m')outtextxy(188,410,"Married");
		if(st.je[0]=='f')outtextxy(150,430,"Female");
		if(st.je[0]=='m')outtextxy(150,430,"Male");
		outtextxy(123,450,st.fa);
		outtextxy(360,360,"Press any kay to contine ...");
		outtextxy(380,400,"Total :");
		outtextxy(450,400,tab);
		outtextxy(450,385,cod2);
		getch();
		setfillstyle(ra.ak[1],ra.ak[0]);bar(355,350,600,450);
		}
	fread(&st,sizeof(struct asghar),1,fp);
	}
     if(qq==0)khata();
     setfillstyle(ra.ak[1],ra.ak[0]);bar(307,3,638,478);bar(5,260,460,475);
}
if(ch==0){tamas();getch();}
c=NULL;
fclose(fp);
}
/*888888888888888888888888888888888888888888888888888888888 entersearch 8888*/
void entersearch(int aa){
	if(aa==1)namefamil();
	if(aa>1&&aa<9)entersearchfamily(aa);
	if(aa==9)displayall();
}
/*888888888888888888888888888888888888888888888888888888888 search 888888888*/
void search(void){
c=NULL;
aa=1;
zedsearch();
setcolor(15);for(we=50;we<=65;we++)line(137,we,157,57);
while(c!=5)
  {
  aslesearch();
  harecatsearch();
  if(ra.ak1[1]==1)asghar();
  if(ra.ak1[0]==1)sound();
  c=getch();
   if(c==0)
      {
       c=getch();
       if(c==75)c=5;
       if(c==72){aa--;if(aa==0)aa=9;}
       if(c==80){aa++;if(aa==10)aa=1;}
       }
   if(c==13)entersearch(aa);
}
zed();c=NULL;
aa=2;
}
/*888888888888888888888888888888888888888888888888888888888 DEL 888888888888*/
/*--------------------------------------------------------- asle DEL -------*/
void asledel(void){
	setcolor(ra.ak[8]);
	setfillstyle(ra.ak[7],ra.ak[6]);
	printsearch(20);
	bar(162,225,295,240);outtextxy(165,230,"Del All");
}
/*------------------------------------------------------ harecat DEL -------*/
void harecatdel(void){
	setcolor(ra.ak[11]);
	setfillstyle(ra.ak[10],ra.ak[9]);
	if(aa==1){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,25,295,40);}
	if(aa==2){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,50,295,65);}
	if(aa==3){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,75,295,90);}
	if(aa==4){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,100,295,115);}
	if(aa==5){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,125,295,140);}
	if(aa==6){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,150,295,165);}
	if(aa==7){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,175,295,190);}
	if(aa==8){printsearch(aa);setcolor(ra.ak[8]);rectangle(162,200,295,215);}
	if(aa==9){bar(162,225,295,240);outtextxy(165,230,"Del All");setcolor(ra.ak[8]);rectangle(162,225,295,240);}
}
/*888888888888888888888888888888888888888888888888888888888 DEL all888888888*/
void delall(void){
int w1=171,ran;
aa=1;c=NULL;
ch=chak();
if(ch==1)
{
 setcolor(ra.ak[12]);setfillstyle(1,7);bar(150,300,550,400);outtextxy(160,320,"Are you sure you want to delete all information");
 setcolor(14);
 setfillstyle(1,8);bar(150,300,550,315);outtextxy(155,305,"Confirm Multiple File Delete");
 setcolor(ra.ak[5]);rectangle(150,300,550,400);
 setfillstyle(1,4);setcolor(4);sector(200,350,0,360,3,10);
 pieslice(200,365,0,360,3);setcolor(15);circle(200,355,20);
 if(ra.ak1[0]==1)sound4();
 while(c!=5)
   {
   setcolor(4);
   setfillstyle(1,8);bar(372,350,410,370);outtextxy(380,355,"yes");
   setfillstyle(1,8);bar(460,350,495,370);outtextxy(470,355,"no");
   if(aa==1){setcolor(13);setfillstyle(1,4);bar(372,350,410,370);rectangle(372,350,410,370);setcolor(15);outtextxy(380,355,"yes");}
   if(aa==2){setcolor(13);setfillstyle(1,4);bar(460,350,495,370);rectangle(460,350,495,370);setcolor(15);outtextxy(470,355,"no");}
   while(!kbhit())
      {we+=30;if(we>=360)we=0;
      w1+=2;ran=random(15);setcolor(random(15));
      if(aa==1)outtextxy(379,375," ");
      if(aa==2)outtextxy(467,375," ");
      setfillstyle(1,ran);setcolor(ran);sector(200,350,0,360,3,10);setcolor(random(15));ellipse(200,350,0,360,3,10);
      setfillstyle(1,ran);setcolor(ran);pieslice(200,365,0,360,3);setcolor(random(15));ellipse(200,355,we,we+30,20,20);circle(200,365,3);
      if(w1>=285){delay(250);w1=171;}
      setcolor(15);rectangle(170,385,300,395);
      setcolor(4);rectangle(w1,386,w1+15,394);
      delay(100);
      setcolor(7);rectangle(w1,386,w1+15,394);
      outtextxy(379,375," ");outtextxy(467,375," ");
      }
   c=getch();
   if(c==13)
	{
	if(aa==1)
	   {
	   fp=fopen("asghar.dat","w");fclose(fp);c=5;
	   }
	if(aa==2)c=5;
	 }
   if(c==0)
   c=getch();
       if(c==75){aa--;if(aa==0)aa=2;}
       if(c==77){aa++;if(aa==3)aa=1;}
   }
 setfillstyle(ra.ak[1],ra.ak[0]);
 for(we=150;we<=350;we++)
  {
  bar(we,300,we+1,450);
  bar(700-we,300,701-we,450);
  }
}
if(ch==0){tamas();getch();}
c=NULL;aa=9;
}
/*888888888888888888888888888888888888888888888888888888888 DELfamily 888888*/
void family(int aa){
man=0;female=0;male=0;married=0;bachelor=0;y1=0;barasy=0;c=NULL;barasy=0;
ch=chak();
if(ch==1)
{
 for(we=0;we<20;we++)ff[we]=NULL;
 randomize();
 setcolor(14);setfillstyle(1,8);bar(310,15,635,60);rectangle(310,15,635,60);
 peykham();
 fp=fopen("asghar.dat","a+b");
 for(ww=0;ww<20;ww++)
 ff[ww]=NULL;
 window(41,3,75,3);clrscr();
 ww=0;
    while(c!=13)
      {
	  c=getch();
	  setfillstyle(ra.ak[1],ra.ak[0]);bar(307,75,638,478);
	  if(c!=13)
	     {
	      ff[ww]=c;
	      if(c==8){ff[ww]=NULL;ff[ww-1]=NULL;ww--;if(ww==-1)ww=0;}
	       else ww++;
	      }
	  clrscr();
	  for(we=0;we<ww;we++)
	  cout<<ff[we];
	  rewind(fp);y1=38;
	  fread(&st,sizeof(struct asghar),1,fp);
	  setfillstyle(1,8);bar(310,48,599,60);
	  setfillstyle(ra.ak[1],ra.ak[0]);bar(310,60,638,478);
	  setcolor(ra.ak[5]);rectangle(310,15,635,60);
	  setcolor(15);
	  while(!feof(fp))
	     {
			codexit();
			barasy=0;
		      if(aa==2)for(we=0;we<ww;we++)if(st.f[we]==ff[we])barasy++;
		      if(aa==3)for(we=0;we<ww;we++)if(st.tt[we]==ff[we])barasy++;
		      if(aa==4)for(we=0;we<ww;we++)if(st.mt[we]==ff[we])barasy++;
		      if(aa==5)for(we=0;we<ww;we++)if(st.tel[we]==ff[we])barasy++;
		      if(aa==6)for(we=0;we<ww;we++)if(st.job[we]==ff[we])barasy++;
		      if(aa==7)for(we=0;we<ww;we++)if(st.va[we]==ff[we])barasy++;
		      if(aa==8)for(we=0;we<ww;we++)if(st.je[we]==ff[we])barasy++;
	       if(barasy==ww)
		  {
		  y1+=10;
		  setfillstyle(1,7);bar(320,y1,599,y1+10);
		  if(aa==2)outtextxy(320,y1,st.f);
		  if(aa==3)outtextxy(320,y1,st.tt);
		  if(aa==4)outtextxy(320,y1,st.mt);
		  if(aa==5)outtextxy(320,y1,st.tel);
		  if(aa==6)outtextxy(320,y1,st.job);
		  if(aa==7)outtextxy(320,y1,st.va);
		  if(aa==8)outtextxy(320,y1,st.je);
		  }
		  fread(&st,sizeof(struct asghar),1,fp);
	      }
       }
 namayesh(aa,st,ff);
 setfillstyle(1,8);bar(310,48,599,60);
 setfillstyle(ra.ak[1],ra.ak[0]);bar(310,60,638,478);
 setcolor(ra.ak[5]);rectangle(310,15,635,60);
 rewind(fp);setcolor(15);
 fread(&st,sizeof(struct asghar),1,fp);
 fd=fopen("asghardel.dat","w");
 for(we=0;we<strlen(ff);we++)   ff[we]+=k;
 barasy=0;
 while(!feof(fp))
    {
	if(aa==2)if(!strcmp(st.f,ff))barasy++;
	else
	    {
	    fwrite(&st,sizeof(struct asghar),1,fd);
	    }
	if(aa==3)if(!strcmp(st.tt,ff))barasy++;
	else
	    {
	    fwrite(&st,sizeof(struct asghar),1,fd);
	    }
	if(aa==4)if(!strcmp(st.mt,ff))barasy++;
	else
	    {
	    fwrite(&st,sizeof(struct asghar),1,fd);
	    }
	if(aa==5)if(!strcmp(st.tel,ff))barasy++;
	else
	    {
	    fwrite(&st,sizeof(struct asghar),1,fd);
	    }
	if(aa==6)if(!strcmp(st.job,ff))barasy++;
	else
	    {
	    fwrite(&st,sizeof(struct asghar),1,fd);
	    }
	if(aa==7)if(!strcmp(st.va,ff))barasy++;
	else
	    {
	    fwrite(&st,sizeof(struct asghar),1,fd);
	    }
	if(aa==8)if(!strcmp(st.je,ff))barasy++;
	else
	    {
	    fwrite(&st,sizeof(struct asghar),1,fd);
	    }
	fread(&st,sizeof(struct asghar),1,fp);
    }
 if(barasy==0)
   {
   for(we=0;we<strlen(ff);we++)    ff[we]-=k;
   setfillstyle(1,7);bar(335,95,600,150);setcolor(15);outtextxy(340,100,"Could Not Find ");
   setcolor(14);
   if(aa==7)if(ff[0]=='m')outtextxy(460,100,"Married");
   if(aa==7)if(ff[0]=='b')outtextxy(460,100,"bachelor");
   if(aa==8)if(ff[0]=='m')outtextxy(460,100,"Male");
   if(aa==8)if(ff[0]=='f')outtextxy(460,100,"female");
   outtextxy(460,100,ff);setcolor(15);
   setfillstyle(1,4);bar(440,125,475,140);outtextxy(450,130,"OK");
   rectangle(335,95,600,150);
   }
 if(barasy!=0)khata1();
 if(barasy==0){if(ra.ak1[0]==1)sound3();getch();}
 fclose(fp);
 fclose(fd);
 setfillstyle(ra.ak[1],ra.ak[0]);bar(310,3,638,478);bar(45,260,460,460);
}
c=NULL;
if(ch==0){tamas();getch();}
}
/*888888888888888888888888888888888888888888888888888888888 delnamefamil 888888*/
void delnamefamil(void){
int s1=0;
barasy=0;man=0;female=0;male=0;married=0;bachelor=0;aa=1;qq=0;y1=0;
ch=chak();
if(ch==1)
{
 c=NULL;
 for(we=0;we<15;we++)fn[we]=NULL;
 for(we=0;we<20;we++)fn[we]=NULL;
 fp=fopen("asghar.dat","a+b");
 setcolor(14);setfillstyle(1,8);bar(310,15,635,90);
 outtextxy(313,20,"Please enter the Name and Family in the");outtextxy(313,33,"box below.");
 setcolor(ra.ak[5]);rectangle(310,15,635,90);
 setcolor(15);outtextxy(320,55,"Name             Family");
 for(ww=0;ww<15;ww++)fn[ww]=NULL;
 for(ww=0;ww<20;ww++)ff[ww]=NULL;
 window(58,5,78,5);clrscr();
 window(41,5,56,5);clrscr();
 ww=0;
     while(c!=13)
      {
	  c=getch();
	  if(c!=13)
	     {
	      fn[ww]=c;
	      if(c==8){fn[ww]=NULL;fn[ww-1]=NULL;ww--;if(ww==-1)ww=0;}
	       else ww++;
	      }
	  clrscr();
	  for(we=0;we<ww;we++)
	  cout<<fn[we];rewind(fp);
	  fread(&st,sizeof(struct asghar),1,fp);
	  y1=80;
	  setfillstyle(1,8);bar(310,80,635,90);
	  setfillstyle(ra.ak[1],ra.ak[0]);bar(310,90,638,478);
	  setcolor(ra.ak[5]);rectangle(310,15,635,90);
	  setcolor(15);
	  while(!feof(fp))
	     {
		barasy=0;
		for(we=0;we<strlen(st.n);we++)   st.n[we]-=k;
		for(we=0;we<ww;we++)
		if(st.n[we]==fn[we])
		barasy++;
		if(barasy==ww)
		  {
		  setfillstyle(1,7);bar(320,y1,447,y1+10);
		  outtextxy(320,y1,st.n);
		  y1+=10;
		  }
	    fread(&st,sizeof(struct asghar),1,fp);
	    }
      }
 setfillstyle(1,8);bar(310,80,635,90);
 setfillstyle(ra.ak[1],ra.ak[0]);bar(310,90,638,478);
 setcolor(ra.ak[5]);rectangle(310,15,635,90);
 ww=0;barasy=0;
 window(58,5,78,5);clrscr();
	    while(c!=12)
      {
	  c=getch();
	  if(c!=13)
	     {
	      ff[ww]=c;
	      if(c==8){ff[ww]=NULL;ff[ww-1]=NULL;ww--;if(ww==-1)ww=0;}
	       else ww++;
	      }
	  clrscr();
	  for(we=0;we<ww;we++)
	  cout<<ff[we];
	  if(c==13)c=12;rewind(fp);
	  fread(&st,sizeof(struct asghar),1,fp);
	  y1=80;
	  setfillstyle(1,8);bar(310,80,635,90);
	  setfillstyle(ra.ak[1],ra.ak[0]);bar(310,90,638,478);
	  setcolor(ra.ak[5]);rectangle(310,15,635,90);
	  setcolor(15);
	  while(!feof(fp))
	     {
		barasy=0;
		for(we=0;we<strlen(st.f);we++)   st.f[we]-=k;
		for(we=0;we<ww;we++)
		if(st.f[we]==ff[we])
		barasy++;
		if(barasy==ww)
		  {
		  setfillstyle(1,7);bar(456,y1,623,y1+10);
		  outtextxy(456,y1,st.f);
		  y1+=10;
		  }
	    fread(&st,sizeof(struct asghar),1,fp);
	    }
	}
 setfillstyle(1,8);bar(310,80,635,90);
 setfillstyle(ra.ak[1],ra.ak[0]);bar(310,90,638,478);
 setcolor(ra.ak[5]);rectangle(310,15,635,90);
	for(we=0;we<strlen(fn);we++)   fn[we]+=k;
	for(we=0;we<strlen(ff);we++)   ff[we]+=k;
 fd=fopen("asghardel.dat","w");
 rewind(fp);
 fread(&st,sizeof(struct asghar),1,fp);
 qq=0;man=0;
 while(!feof(fp))
      {
	if(!strcmp(st.n,fn))
	if(!strcmp(st.f,ff))
	   {
	     qq++;s1=1;
	     for(we=0;we<strlen(st.va);we++)    st.va[we]-=k;
	     for(we=0;we<strlen(st.je);we++)    st.je[we]-=k;
	   namayesh11();
	   }
	     if(s1==0)
	     {
		fwrite(&st,sizeof(struct asghar),1,fd);
	     }
	fread(&st,sizeof(struct asghar),1,fp);s1=0;
  }
 setcolor(ra.ak[13]);rectangle(45,265,245,385);line(45,295,245,295);line(45,340,245,340);
 setcolor(ra.ak[12]);
 tozih();
 window(27,18,27,18);clrscr();cout<<man;
 window(27,20,27,20);clrscr();cout<<female;
 window(27,21,27,21);clrscr();cout<<male;
 window(27,23,27,23);clrscr();cout<<married;
 window(27,24,27,24);clrscr();cout<<bachelor;
 fclose(fp);
 fclose(fd);setcolor(15);
 if(qq!=0)khata1();
 if(qq==0)
    {
    for(we=0;we<strlen(fn);we++)    fn[we]-=k;
    for(we=0;we<strlen(ff);we++)    ff[we]-=k;
   setfillstyle(1,7);bar(335,110,600,165);setcolor(15);outtextxy(340,118,"Could Not Find :");
   setcolor(14);outtextxy(470,115,fn);
   outtextxy(470+(strlen(fn)*9),115,ff);
   setcolor(15);if(ra.ak1[0]==1)sound3();
   setfillstyle(1,4);bar(440,140,475,155);outtextxy(450,145,"OK");
   setcolor(ra.ak[5]);rectangle(335,110,600,165);
   getch();
   }
 setfillstyle(ra.ak[1],ra.ak[0]);bar(307,3,638,478);bar(45,260,460,460);
 fclose(fp);
 fclose(fd);
}
if(ch==0){tamas();getch();}
aa=1;
}
/*888888888888888888888888888888888888888888888888888888888 DEL 888888888888*/
void enterdel(int aa){
	if(aa==1)delnamefamil();
	if(aa>1&&aa<9)family(aa);
	if(aa==9)delall();
}
/*888888888888888888888888888888888888888888888888888888888 DEL 888888888888*/
void del(void){
c=NULL;aa=1;
zedsearch();
setcolor(15);for(we=75;we<=90;we++)line(137,we,157,82);
while(c!=6)
  {
  asledel();
  harecatdel();
  if(ra.ak1[1]==1)asghar();
  if(ra.ak1[0]==1)sound();
  c=getch();
   if(c==0)
      {
       c=getch();
       if(c==75)c=6;
       if(c==72){aa--;if(aa==0)aa=9;}
       if(c==80){aa++;if(aa==10)aa=1;}
       }
   if(c==13)enterdel(aa);
}
zed();c=NULL;aa=3;
}
/*888888888888888888888888888888888888888888888888888888888 Edit Fill 888888*/
void editfill(struct asghar,float cod,float mn)
{char eee[15];
setfillstyle(ra.ak[1],ra.ak[0]);bar(160,3,638,478);
setfillstyle(1,8);bar(200,20,600,380);setcolor(15);
rectangle(200,20,600,380);
line(200,34,600,34);
setcolor(11);outtextxy(340,24,"Edit Person");
codexit();
addshekl();
setcolor(15);setfillstyle(1,7);bar(280,350,350,370);outtextxy(290,355,"Save");
setcolor(15);setfillstyle(1,7);bar(400,350,470,370);outtextxy(410,355,"Delete");
if(st.va[0]=='b'){setcolor(15);circle(280,280,8);setcolor(0);setfillstyle(1,0);pieslice(280,280,0,360,5);}
if(st.va[0]=='m'){setcolor(15);circle(370,280,8);setcolor(0);setfillstyle(1,0);pieslice(370,280,0,360,5);setcolor(15);rectangle(487,271,496,288);setcolor(14);outtextxy(502,275,"=Total Bairn");window(62,18,62,18);clrscr();cout<<st.fa;}
if(st.je[0]=='m'){setcolor(15);circle(280,310,8);setcolor(0);setfillstyle(1,0);pieslice(280,310,0,360,5);}
if(st.je[0]=='f'){setcolor(15);circle(370,310,8);setcolor(0);setfillstyle(1,0);pieslice(370,310,0,360,5);}
window(32,4,48,4);clrscr();cout<<st.n;
window(34,6,55,6);clrscr();cout<<st.f;
window(39,8,56,8);clrscr();cout<<st.np;
window(38,10,53,10);clrscr();cout<<st.tt;
window(39,12,73,12);clrscr();cout<<st.mt;
window(38,14,53,14);clrscr();cout<<st.tel;
window(31,16,63,16);clrscr();cout<<st.job;
c=NULL;aa=1;
setfillstyle(1,8);bar(300,400,500,450);setcolor(15);rectangle(300,400,500,450);
gcvt(mn,5,eee);
outtextxy(265,422,eee);
outtextxy(200,432,"Total :");
gcvt(cod,5,tab);
outtextxy(265,432,tab);
while(c!=5)
   {
   setcolor(15);setfillstyle(1,7);bar(315,415,380,435);bar(420,415,485,435);outtextxy(330,422,"Edit");outtextxy(435,422,"Next");
   if(aa==1){setcolor(15);setfillstyle(1,4);bar(315,415,380,435);outtextxy(330,422,"Edit");rectangle(315,415,380,435);}
   if(aa==2){setcolor(15);setfillstyle(1,4);bar(420,415,485,435);outtextxy(435,422,"Next");rectangle(420,415,485,435);}
   while(!kbhit())
	{
	setcolor(random(15));
	if(aa==1)outtextxy(325,405,"  ");
	if(aa==2)outtextxy(430,405,"  ");
	delay(100);
	}
	setcolor(8);
	outtextxy(325,405,"  ");
	outtextxy(430,405,"  ");
   c=getch();
   if(c==13)
	{
	if(aa==1)c=5;
	if(aa==2)c=5;
	}
   if(c==0)
       {
       c=getch();
       if(c==75){aa--;if(aa==0)aa=2;}
       if(c==77){aa++;if(aa==3)aa=1;}
       }
   }
if(aa==2){codstart();fwrite(&st,sizeof(struct asghar),1,fd);aa=4;}
if(aa==1)
{
  ww=0;c=NULL;
  c=NULL;y1=0;we=0;
  window(32,4,48,4);clrscr();cout<<st.n;while(c!=13){y1=395;we=55;neshankar(y1,we);setcolor(14);c=getch();if(c!=13){st.n[ww]=c;for(we=ww+1;we<15;we++)st.n[we]=NULL;if(c==8){st.n[ww]=NULL;st.n[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=14){ww=14;st.n[14]=NULL;st.n[15]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.n[we];}ww=0;c=NULL;clrscr();cout<<st.n;
  window(34,6,55,6);clrscr();cout<<st.f;while(c!=13){y1=451;we=87;neshankar(y1,we);setcolor(14);c=getch();if(c!=13){st.f[ww]=c;for(we=ww+1;we<20;we++)st.f[we]=NULL;if(c==8){st.f[ww]=NULL;st.f[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=19){ww=19;st.f[19]=NULL;st.f[20]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.f[we];}ww=0;c=NULL;clrscr();cout<<st.f;
  window(39,8,56,8);clrscr();cout<<st.np;while(c!=13){y1=459;we=119;neshankar(y1,we);setcolor(14);c=getch();if(c!=13){st.np[ww]=c;for(we=ww+1;we<15;we++)st.np[we]=NULL;if(c==8){st.np[ww]=NULL;st.np[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=14){ww=14;st.np[14]=NULL;st.np[15]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.np[we];}ww=0;c=NULL;clrscr();cout<<st.np;
  window(38,10,53,10);clrscr();cout<<st.tt;while(c!=13){y1=435;we=151;neshankar(y1,we);setcolor(14);c=getch();if(c!=13){st.tt[ww]=c;for(we=ww+1;we<15;we++)st.tt[we]=NULL;if(c==8){st.tt[ww]=NULL;st.tt[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=14){ww=14;st.tt[14]=NULL;st.tt[15]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.tt[we];}ww=0;c=NULL;clrscr();cout<<st.tt;
  window(39,12,73,12);clrscr();cout<<st.mt;while(c!=13){y1=590;we=183;neshankar(y1,we);setcolor(14);c=getch();if(c!=13){st.mt[ww]=c;for(we=ww+1;we<35;we++)st.mt[we]=NULL;if(c==8){st.mt[ww]=NULL;st.mt[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=34){ww=34;st.mt[34]=NULL;st.mt[35]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.mt[we];}ww=0;c=NULL;clrscr();cout<<st.mt;
  window(38,14,53,14);clrscr();cout<<st.tel;while(c!=13){y1=435;we=215;neshankar(y1,we);setcolor(14);c=getch();if(c!=13){st.tel[ww]=c;for(we=ww+1;we<15;we++)st.tel[we]=NULL;if(c==8){st.tel[ww]=NULL;st.tel[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=14){ww=14;st.tel[14]=NULL;st.tel[15]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.tel[we];}ww=0;c=NULL;clrscr();cout<<st.tel;
  window(31,16,63,16);clrscr();cout<<st.job;while(c!=13){y1=515;we=247;neshankar(y1,we);setcolor(14);c=getch();if(c!=13){st.job[ww]=c;for(we=ww+1;we<30;we++)st.job[we]=NULL;if(c==8){st.job[ww]=NULL;st.job[ww-1]=NULL;ww--;if(ww==-1)ww=0;}else ww++;if(ww>=29){ww=29;st.job[29]=NULL;st.job[30]=NULL;}}clrscr();for(we=0;we<ww;we++)cout<<st.job[we];}ww=0;c=NULL;clrscr();cout<<st.job;
  if(st.va[0]=='b')aa=1;
  if(st.va[0]=='m')aa=2;
  c=NULL;
  while(c!=5)
     {
     setcolor(15);circle(280,280,8);circle(370,280,8);setcolor(8);setfillstyle(1,8);pieslice(280,280,0,360,5);pieslice(370,280,0,360,5);
     if(aa==1){setcolor(15);circle(280,280,8);setcolor(0);setfillstyle(1,0);pieslice(280,280,0,360,5);}
     if(aa==2){setcolor(15);circle(370,280,8);setcolor(0);setfillstyle(1,0);pieslice(370,280,0,360,5);}
     while(!kbhit()){setcolor(random(15));outtextxy(320,280,"");delay(100);setcolor(8);outtextxy(320,280,"");}
     c=getch();
     if(c==13)
	{
	if(aa==2)
	   {
	   st.va[0]='m';setcolor(15);rectangle(487,271,496,288);setcolor(14);outtextxy(502,275,"=Total Bairn");window(62,18,62,18);clrscr();cout<<st.fa;while(!kbhit()){setcolor(random(15));outtextxy(475,277,"");delay(100);}setcolor(15);rectangle(487,271,496,288);setcolor(14);outtextxy(502,275,"=Total Bairn");window(62,18,62,18);clrscr();c=getch();cout<<c;st.fa[0]=c;c=5;
	   }
	if(aa==1)
	   {
	   st.va[0]='b';setfillstyle(1,8);bar(487,271,596,288);st.fa[0]=NULL;c=5;
	   }
	 }
   if(c==0)
   c=getch();
       if(c==75){aa--;if(aa==0)aa=2;}
       if(c==77){aa++;if(aa==3)aa=1;}
   }
  c=NULL;
  setcolor(8);outtextxy(475,277,"");
  if(st.je[0]=='m')aa=1;
  if(st.je[0]=='f')aa=2;
  while(c!=5)
    {
     setcolor(15);circle(370,310,8);circle(280,310,8);setcolor(8);setfillstyle(1,8);pieslice(280,310,0,360,5);pieslice(370,310,0,360,5);
     if(aa==1){setcolor(15);circle(280,310,8);setcolor(0);setfillstyle(1,0);pieslice(280,310,0,360,5);}
     if(aa==2){setcolor(15);circle(370,310,8);setcolor(0);setfillstyle(1,0);pieslice(370,310,0,360,5);}
     while(!kbhit())
	 {
	 setcolor(random(15));outtextxy(320,311,"");
	 delay(100);
	 setcolor(8);outtextxy(320,311,"");
	 }
   c=getch();
   if(c==13)
	{
	if(aa==1)
	   {

	   st.je[0]='m';c=5;
	   }
	if(aa==2)
	   {
	   st.je[0]='f';c=5;
	   }
	 }
   if(c==0)
   c=getch();
       if(c==75){aa--;if(aa==0)aa=2;}
       if(c==77){aa++;if(aa==3)aa=1;}
   }
  c=NULL;aa=1;
  while(c!=5)
     {
     setcolor(15);setfillstyle(1,7);bar(400,350,470,370);bar(280,350,350,370);outtextxy(290,355,"Save");outtextxy(410,355,"Delete");
     if(aa==1){setcolor(15);setfillstyle(1,4);bar(280,350,350,370);outtextxy(290,355,"Save");rectangle(280,350,350,370);}
     if(aa==2){setcolor(15);setfillstyle(1,4);bar(400,350,470,370);outtextxy(410,355,"Delete");rectangle(400,350,470,370);}
     selectbar();
   c=getch();
   if(c==13)
	{
	if(aa==1){codstart();fwrite(&st,sizeof(struct asghar),1,fd);c=5;}
	if(aa==2)c=5;
	}
   if(c==0)
       {
       c=getch();
       if(c==75){aa--;if(aa==0)aa=2;}
       if(c==77){aa++;if(aa==3)aa=1;}
       }
   }
   c=NULL;aa=4;
  }
}