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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
|
case 'c':
case 'C':
cout<<"\t\n<><> DENTIST AND CLINIC BACKGROUND <><>\n"<<endl;
cout<<"MCD Aesthetics Dental Clinic,"<<"where beautiful smiles begin...\nLocated @ 970 Gil Carlos Poblacion,Baliuag,Bulacan\n\nSince May 4,2016\n"<<endl;
cout<<"Dentist: Doctor Maria Carla H. Dizon\n\nGraduated at UP Manila,\n\nOctober 31,2007(Year Graduated)\n\nSecretary: Lizel Dionisio"<<endl;
cout << endl << " Go back to main menu? (Y/N): ";
cin >> home;
if (home == 'y' || home == 'Y')
{
goto start;
}
else if (home == 'N' || home == 'n')
{
system("exit");
}
else
{
goto start;
}
break;
case 'd':
case 'D':
cout<<"\n <><> CLINIC HOURS <><>\n"<<endl;
cout<<"Mondays-Fridays: 9am to 6pm\nThursdays: CLOSED\nSaturdays-Sundays: 10am-5pm "<<endl;
cout << endl << " Go back to main menu? (Y/N): ";
cin >> home;
if (home == 'y' || home == 'Y')
{
goto start;
}
else if (home == 'N' || home == 'n')
{
system("exit");
}
else
{
goto start;
}
break;
case 'e':
case 'E':
cout<<"\n\t\t\t<><> PATIENT RESERVATION <><>\nPlease fill up the form:\n\n";
myFile.open("AppointmentList.txt",ios::app|ios::in|ios::out);
myFile.seekg(0,ios::beg);
cout<<"\nPATIENT DETAILS\n";
while(getline(myFile,strOutput,'|')){
if(lineCounter==1){
strOutput.erase(std::remove(strOutput.begin(), strOutput.end(), '\n'), strOutput.end());
myPatient.name=strOutput;
}else if(lineCounter==2){
myPatient.age=strOutput;
}else if(lineCounter==3){
myPatient.address=strOutput;
}else if(lineCounter==4){
myPatient.ptcrn=strOutput;
}else if(lineCounter==5){
myPatient.cntnum=strOutput;
lineCounter = 0;
cout<<"*********************************************\n";
cout<<"\nName: "<<myPatient.name<<"\nAge: "<<myPatient.age<<"\nAddress: "<<myPatient.address<<"\nPatient's Concern: "<<myPatient.ptcrn<<"\nContact Number: "<<myPatient.cntnum<<"\n";
}
lineCounter ++;
}
myFile.close();
cout << endl << " Go back to main menu? (Y/N): ";
cin >> home;
if (home == 'y' || home == 'Y')
{
goto start;
}
else if (home == 'N' || home == 'n')
{
system("exit");
}
else
{
goto start;
}
cout<<endl;
break;
case 'f':
case 'F':
cout<<"\n\t\t\t<><> PATIENT RESERVATION <><>\nPlease fill up the form:\n\n";
seek1.open( "AppointmentList.txt");
seek2.open( "AppointmentList.txt", fstream::in | fstream::out | fstream::ate | ios::app);
cin.ignore();
temp1.open("temp.txt");
cout << "Which record do you want to remove? "<<endl;
getline(cin, s_delete);
while (getline(seek1,temp))
{
if (temp.find(s_delete) == string::npos){
temp1 << temp << endl;
}
}
temp1.close();
seek1.close();
seek2.close();
remove("AppointmentList.txt");
rename("temp.txt","AppointmentList.txt");
cout <<endl<<"Delete success.\n";
cout << endl << " Go back to main menu? (Y/N): ";
cin >> home;
if (home == 'y' || home == 'Y')
{
goto start;
}
else if (home == 'N' || home == 'n')
{
system("exit");
}
else
{
goto start;
}
cout<<endl;
break;
default:
cout<<"\nYou have entered invalid input, Please try again."<<endl;
cout << endl << " Go back to main menu? (Y/N): ";
cin >> home;
if (home == 'y' || home == 'Y')
{
goto start;
}
else if (home == 'N' || home == 'n')
{
system("exit");
}
else
{
goto start;
}
}
}
return 0;
}
|