Advertisement
prasansa

code

Mar 29th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<string.h>
  4. #include<stdlib.h>
  5. #define rw 80
  6. #define cl 50
  7. FILE*fp, *fp1, *f1, *f2;
  8. int s,z;
  9. char fn1[]="opd12.patient";
  10. char fn2[]="oopd12.patient";
  11. struct hospital
  12. {
  13. char name[20], address[20], ch;
  14. int age, roomno,sn;
  15. char disease[30], department[30], date[15];
  16. char recommendation[50], category[30];
  17. char test[15][20];
  18. float testfee[15];
  19. float totalfee;
  20. float balance;
  21. }p,q;
  22. char string[20];
  23. typedef struct hospital alka;
  24. void newrecord(int l);
  25. void print();
  26. void displaytest();
  27. void mainscreen();
  28. void newrecord1();
  29. void displaydepartment();
  30. void edit1();
  31. void editrecord();
  32. void switch1();
  33. int main()
  34. {
  35. int a, i,n,y;
  36. char c,d;
  37. char date1[15],date2[15], string1[20];
  38. unsigned int tsz;
  39. clrscr();
  40. mainscreen();
  41. label3:
  42. textcolor(3);
  43. gotoxy(23, 15);
  44. cprintf("Enter today's date(yyyy/mm/dd)");
  45. fflush(stdin);gotoxy(28, 19);
  46. scanf("%[^\n]", date2);
  47. if ((date2[4]!='/')||(date2[7]!='/')||(date2[5]>'3')||(date2[8]>'3')
  48. {
  49. clrscr();
  50. mainscreen();
  51. gotoxy(23, 13);
  52. textcolor(4+128);
  53. cprintf("wrong entry");
  54. goto label3;
  55. }
  56. clrscr();
  57. mainscreen();
  58. label1;
  59. textcolor(15);
  60. lowvideo();
  61. gotoxy(22, 15);
  62. textcolor(14);
  63. cprintf("Enter the corresponding no");
  64. gotoxy(22, 19);
  65. textcolor(10);
  66. cprintf("1.Add new patient record");
  67. gotoxy(22, 21);
  68. cprintf("2.Search or edit record");
  69. gotoxy(22, 23);
  70. cprintf("3.Know the records of patients");
  71. gotoxy(22, 25);
  72. cprintf("4.Delete the records");
  73. gotoxy(25, 30);
  74. fflush(stdin);
  75. scanf("%c", &d);
  76. switch(d)
  77. {
  78. case '1':
  79. {
  80. {
  81. if((fp=fopen(fn1,"rb"))==NULL)
  82. s=1;
  83. else
  84. {
  85. while(fread(&p,sizeof(alka),1,fp))
  86. s=1+p.sn;
  87. }
  88. fclose(fp);
  89. }
  90. clrscr();
  91. mainscreen();
  92. label:
  93. gotoxy(22, 19);
  94. textcolor(7);
  95. cprintf("Enter 'o' for O.P.D & 'e' for Emergency");
  96. gotoxy(35, 21);
  97. fflush(stdin);
  98. scanf("%c", &c);
  99. if(c=='o'
  100. ) }
  101.  
  102. }
  103. }
  104. }
  105. }
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement