message-1
message-1
#include <string>
#include <vector>
#include <unordered_map>
#include <algorithm>
#include <fstream>
// Default constructor
User() : username(""), password(""), contactInfo("") {}
// Parameterized constructor
User(string u, string p, string c) : username(u), password(p), contactInfo(c)
{}
while (true) {
cout << "\nAdmin Menu\n";
cout << "1. Event Booking\n";
cout << "2. Hall Booking\n";
cout << "3. Cancel Event\n";
cout << "4. View Events\n";
cout << "5. Exit\n";
cout << "Choose an option: ";
cin >> option;
switch (option) {
case 1:
bookEventAndHall(eventList);
break;
case 2:
bookEventAndHall(eventList); // Same function for hall booking for
now
break;
case 3: {
string eventID;
cout << "Enter event ID to cancel: ";
cin >> eventID;
eventList.cancelEvent(eventID);
break;
}
case 4:
eventList.displayEvents();
break;
case 5:
return; // Exit admin menu
default:
cout << "Invalid option. Try again." << endl;
}
}
}
int main() {
EventList eventList;
int option;
bool isAdminLoggedIn = false;
while (true) {
cout << "\nWelcome to the Event Management System\n";
cout << "1. Register\n";
cout << "2. Login as Admin\n";
cout << "3. Exit\n";
cout << "Choose an option: ";
cin >> option;
switch (option) {
case 1:
registerAdminOrUser(eventList);
break;
case 2:
isAdminLoggedIn = loginAdmin(eventList);
if (isAdminLoggedIn) {
cout << "Admin logged in successfully.\n";
adminMenu(eventList); // Go to Admin Menu
} else {
cout << "Invalid login credentials.\n";
}
break;
case 3:
cout << "Exiting the system...\n";
return 0; // Exit program
default:
cout << "Invalid option. Try again." << endl;
}
}
}