Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<conio.h>
- #include<string.h>
- #include<stdlib.h>
- #define rw 80
- #define cl 50
- FILE*fp, *fp1, *f1, *f2;
- int s,z;
- char fn1[]="opd12.patient";
- char fn2[]="oopd12.patient";
- struct hospital
- {
- char name[20], address[20], ch;
- int age, roomno,sn;
- char disease[30], department[30], date[15];
- char recommendation[50], category[30];
- char test[15][20];
- float testfee[15];
- float totalfee;
- float balance;
- }p,q;
- char string[20];
- typedef struct hospital alka;
- void newrecord(int l);
- void print();
- void displaytest();
- void mainscreen();
- void newrecord1();
- void displaydepartment();
- void edit1();
- void editrecord();
- void switch1();
- int main()
- {
- int a, i,n,y;
- char c,d;
- char date1[15],date2[15], string1[20];
- unsigned int tsz;
- clrscr();
- mainscreen();
- label3:
- textcolor(3);
- gotoxy(23, 15);
- cprintf("Enter today's date(yyyy/mm/dd)");
- fflush(stdin);gotoxy(28, 19);
- scanf("%[^\n]", date2);
- if ((date2[4]!='/')||(date2[7]!='/')||(date2[5]>'3')||(date2[8]>'3')
- {
- clrscr();
- mainscreen();
- gotoxy(23, 13);
- textcolor(4+128);
- cprintf("wrong entry");
- goto label3;
- }
- clrscr();
- mainscreen();
- label1;
- textcolor(15);
- lowvideo();
- gotoxy(22, 15);
- textcolor(14);
- cprintf("Enter the corresponding no");
- gotoxy(22, 19);
- textcolor(10);
- cprintf("1.Add new patient record");
- gotoxy(22, 21);
- cprintf("2.Search or edit record");
- gotoxy(22, 23);
- cprintf("3.Know the records of patients");
- gotoxy(22, 25);
- cprintf("4.Delete the records");
- gotoxy(25, 30);
- fflush(stdin);
- scanf("%c", &d);
- switch(d)
- {
- case '1':
- {
- {
- if((fp=fopen(fn1,"rb"))==NULL)
- s=1;
- else
- {
- while(fread(&p,sizeof(alka),1,fp))
- s=1+p.sn;
- }
- fclose(fp);
- }
- clrscr();
- mainscreen();
- label:
- gotoxy(22, 19);
- textcolor(7);
- cprintf("Enter 'o' for O.P.D & 'e' for Emergency");
- gotoxy(35, 21);
- fflush(stdin);
- scanf("%c", &c);
- if(c=='o'
- ) }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement