-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
96 lines (85 loc) · 1.54 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
Implemedted by: Annastasha Chang See May (78855)
*/
#include <iostream>
#include <Windows.h>
#include <unistd.h>
#include <string>
#include <fstream>
#include <vector>
//#include <conio.h>
//#include <cstdlib>
//#include <iomanip>
#include "display.h"
#include "admin.h"
#include "patient.h"
#include "doctor.h"
#include "nurse.h"
#include "medical_assistant.h"
#include "specialist.h"
#include "appointment.h"
#include "hospital.h"
using namespace std;
user u;
admin ad;
patient p;
doctor doc;
nurse n;
medical_assistant ma;
specialist sp;
appointment app;
int main(int argc, char** argv) {
start:
if(app.check_appointment_expired()==true){
int getRole=-1;
switch(display_welcome()){
case 1:{ //Login
switch(u.choose_role()){
case 0:{
break;
}
case 1:{ //ADMIN
if(ad.login()==true) ad.main_menu();
break;
}
case 2:{ //PATIENT
if(p.login()==true) p.main_menu();
break;
}
case 3:{ //DOCTOR
if(doc.login(3)==true) doc.main_menu();
break;
}
case 4:{ //NURSE
if(n.login(4)==true) n.main_menu();
break;
}
case 5:{ //MEDICAL ASSISTANT
if(ma.login(5)==true) ma.main_menu();
break;
}
case 6:{ //SPECIALIST
if(sp.login(6)==true) sp.main_menu();
break;
}
default:{
break;
}
}
break;
}
case 2:{//signup
u.userSignup();
break;
}
default:{
break;
}
}
goto start;
}
else{
system("CLS"); cout << ">>> Fail to fetch data"; sleep(2);
}
return 0;
}