-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEvent Management System.cpp
459 lines (456 loc) · 13.2 KB
/
Event Management System.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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
#include<bits/stdc++.h>
#include<string.h>
#include<conio.h>
#define max 100
using namespace std;
class User
{
public:
char name[1000];
char address[1000];
char id[1000];
char phone[12];
char date[20];
float payment_advance;
int booking_id;
};
class Event
{
public:
int time;
char stype;
string ven;
int gs;
int EventNumber;
int cost;
int info;
class User usr;
class Event addEvent(int);
void searchEvent(int);
void deleteEvent(int);
void displayEvent(Event);
};
class Event Events[max];
int cnt=0;
Event Event::addEvent(int ev)
{
class Event Event;
Event.EventNumber=ev;
cout<<"\n Total Guest : ";
cin>>Event.gs;
cout<<"\n Total Time (in minutes) : ";
cin>>Event.time;
cout<<"\n Venue Name : ";
cin>>Event.ven;
Event.info=0;
cout<<"\n Event Added Successfully!";
getch();
return Event;
}
void Event::searchEvent(int ev)
{
int i,found=0;
for(i=0; i<cnt; i++)
{
if(Events[i].EventNumber==ev)
{
found=1;
break;
}
}
if(found==1)
{
cout<<"\n\t\t\t\t\t--------Event Details--------\n\n";
if(Events[i].info==1)
{
cout<<"\n Event is Booked. ";
}
else
{
cout<<"\n\n Event is Available. ";
}
displayEvent(Events[i]);
getch();
}
else
{
cout<<"\n Event not Found. ";
getch();
}
}
void Event::displayEvent(Event tempEvent)
{
cout<<"\n\n User Information \n";
cout<<"\n Event Number : "<<tempEvent.EventNumber;
cout<<"\n Total Guest : "<<tempEvent.gs;
cout<<"\n Total Time : "<<tempEvent.time;
cout<<"\n Venue Name : " <<tempEvent.ven; //Your Preferred Venue For Booking
}
class EventMen:protected Event
{
public:
void checkIn();
void getAvailEvent();
void searchUser(char *);
void checkOut(int);
void GuestSummary(char *);
};
void EventMen::GuestSummary(char *uname)
{
system("cls");
int z;
cout<<"\n\n For Guest Info Type 1 & To Know About Us Type 2 : ";
cin>>z;
if(z==1)
{
if(cnt==0)
{
cout<<"\n\n No Event Booked !!";
}
for(int i=0; i<cnt; i++)
{
if(Events[i].info==1)
{
cout<<"\n\t\t\t\t___________ Guest Summary ___________\n\n";
cout<<"\n\n User First Name : "<<Events[i].usr.name;
cout<<"\n\n Event Number : "<<Events[i].EventNumber;
cout<<"\n\n Address (only city) : "<<Events[i].usr.address;
cout<<"\n\n Phone : "<<Events[i].usr.phone;
}
}
}
else if(z==2)
{
cout<<"\n\t\t\t\t About Event Management \n\n";
cout<<"\n Celebrate any occassion with us to make your event more special in reasonale price.\n You can also customize the decors.\n We work on any venue you prefer "<<endl;
cout<<" Payment Methods : Bkash/Nagad; \n Or Your Nearest XY Bank"<<endl;
cout<<" Contact NOW Email : [email protected]"<<endl;
cout<<" Phone: 01234567890" <<endl;
cout<<" Address: Chittagong, Bangladesh";
cout<<"\n Saturday-Thursday \n Opening & Closing Hour : 9AM To 9PM"<<endl;
cout<<" Appointments: facebook.com"<<endl;
cout<<" Thank You :) ! "<<endl<<endl;
}
getch();
}
void EventMen::checkIn()
{
int i,found=0,ev;
class Event Event;
cout<<"\n Enter Event number : ";
cin>>ev;
for(i=0; i<cnt; i++)
{
if(Events[i].EventNumber==ev)
{
found=1;
break;
}
}
if(found==1)
{
if(Events[i].info==1)
{
cout<<"\n Sorry, We Are already Booked.";
getch();
return;
}
system("cls");
cout<<"\n\t\t\t\t___________ Book Event ___________\n\n";
cout<<"\n\n Enter booking id: ";
cin>>Events[i].usr.booking_id;
cout<<"\n\n Enter User Name(First Name): ";
cin>>Events[i].usr.name;
cout<<"\n\n Enter Address (only city): ";
cin>>Events[i].usr.address;
cout<<"\n\n Enter Phone: ";
cin>>Events[i].usr.phone;
cout<<"\n\n Enter Date: ";
cin>>Events[i].usr.date;
cout<<"\n\n Enter Advance Payment: ";
cin>>Events[i].usr.payment_advance;
Events[i].info=1;
cout<<"\n\n User Logged-in Successfully..";
getch();
}
}
void EventMen::getAvailEvent()
{
int i,found=0;
for(i=0; i<cnt; i++)
{
if(Events[i].info==0)
{
displayEvent(Events[i]);
cout<<"\n\n Press Enter for Next Event\n";
found=1;
getch();
}
}
if(found==0)
{
cout<<"\n All Events Date Are Booked";
getch();
}
}
void EventMen::searchUser(char *uname)
{
int i,found=0;
for(i=0; i<cnt; i++)
{
if(Events[i].info==1 && stricmp(Events[i].usr.name,uname)==0)
{
system("cls");
cout<<"\n\n\t\t\t\t _________ User Information _________ ";
cout<<"\n\n User Name: "<<Events[i].usr.name;
cout<<"\n\n Event Number: "<<Events[i].EventNumber;
cout<<"\n\n Press Enter For Next Record. ";
found=1;
getch();
}
}
if(found==0)
{
cout<<"\n\n No Event Found. ";
getch();
}
}
class Account
{
int acc_no;
int amount;
public:
Account()
{
cout<<"\n\n Enter Account No : ";
cin>>acc_no;
amount = 0;
}
void deposit(int num)
{
if(num == acc_no)
{
string date;
cout<<"\n Enter Amount : ";
cin>>amount;
cout<<"\n Transferred To Account No 211224. "<< endl;
cout<<"\n Branch Name : XY Bank"<< endl;
cout<<"\n Transaction Date : ";
cin>>date;
cout<<endl;
cout<<" Event Confirmed, Thank You :)! "<< endl;
}
else
cout<<"\n Incorrect account number. Try Again. "<<endl;
}
};
void EventMen::checkOut(int EventNum)
{
int i,found=0,TotalGuests,TotalTime,j;
double billAmount=0;
string p;
for(i=0; i<cnt; i++)
{
if(Events[i].info==1 && Events[i].EventNumber==EventNum)
{
found=1;
break;
}
}
if(found==1)
{
system("cls");
cout<<"\n\n\t\t\t\t _________ Event Details _________ ";
cout<<"\n\n\n Enter Number Of Guest: ";
cin>>TotalGuests;
cout<<"\n\n Total Time(In Minutes) : ";
cin>>TotalTime;
cout <<"\n\n Total Table Booked : "; //one table = minimum 6 person
j = ceil(TotalGuests/6);
cout << j <<endl;
double cp;
double TotalStaff, CostH, CostM, OneStaffCost,X, TotalFoodCost, AverageCost, DepositAmount,TotalCost;
double PerHourCost = 30.00;
double PerMinCost = 0.50;
double CostOfMeal = 100.00;
double CarParking = 1000.00;
double Lighting = 1500.00;
// Total Staff Number
X = TotalGuests / 10;
TotalStaff = ceil(X);
// One Staffs Cost
CostM = (TotalTime % 60) * PerMinCost;
CostH = (TotalTime / 60) * PerHourCost;
OneStaffCost = CostM+CostH;
// Cost of Food
TotalFoodCost = (TotalGuests * CostOfMeal) ;
// Average Cost Per Person
AverageCost = (TotalFoodCost / TotalGuests);
// Total Cost
TotalCost = TotalFoodCost + (OneStaffCost * TotalStaff)+ Lighting + CarParking;
// Advance (30%) Amount
DepositAmount = TotalCost * (.30);
cout<<"\n\n\t\t\t\t __________Event Costing Details__________\n\n";
cout<<"\n\n User Name : "<<Events[i].usr.name;
cout<<"\n\n Event Number : "<<Events[i].EventNumber;
cout<<"\n\n Address : "<<Events[i].usr.address;
cout<<"\n\n Phone : "<<Events[i].usr.phone;
cout<<"\n\n Number Of Staffs : " << TotalStaff << fixed << setprecision(3) << endl<< endl;
cout<<" Average Cost (Per Staff) : " << OneStaffCost <<endl<< endl;
cout<<" Total Food Cost : "<< TotalFoodCost << endl <<endl;
cout<<" Average Cost (Per Person) : " << AverageCost<<endl<<endl;
cout<<" Total Amount : " << TotalCost << endl<< endl;
cout<<" To reserve the event , Please Deposit 30% of Total Amount including VAT" << endl<< endl;
cout<<" Deposit Needed : " << DepositAmount << endl<< endl;
cout<<" Advance Paid: "<<Events[i].usr.payment_advance<<" /-"<<endl;
cout<<"\n Total Payable: "<<TotalCost - Events[i].usr.payment_advance<<"/- only";
Events[i].info=0;
Account acc;
int num;
cout<<"\n Re-enter Account No : ";
cin>>num;
acc.deposit(num);
cout<< endl<<endl;
}
getch();
}
void manageEvents()
{
class Event Event;
int opt,ev,i,flag=0;
char ch;
do
{
system("cls");
cout<<"\n\t\t\t\t _________ Manage Events _________";
cout<<"\n\n 1. Add Event";
cout<<"\n\n 2. Search Event";
cout<<"\n\n 3. Back to Main Menu";
cout<<"\n\n Select Option: ";
cin>>opt;
switch(opt)
{
case 1:
cout<<"\n Enter Event Number : ";
cin>>ev;
i=0;
for(i=0; i<cnt; i++)
{
if(Events[i].EventNumber==ev)
{
flag=1;
}
}
if(flag==1)
{
cout<<"\n Event Number is Present. \n\n Please Enter An Unique Number : ";
flag=0;
getch();
}
else
{
Events[cnt]=Event.addEvent(ev);
cnt++;
}
break;
case 2:
cout<<"\n Enter Event number: ";
cin>>ev;
Event.searchEvent(ev);
break;
case 3:
break;
default:
cout<<"\n\n Error, Please Enter Correct Option ";
break;
}
}
while(opt!=3);
}
int main()
{
class EventMen hm;
int i,j,opt,ev,f;
char ch;
char uname[1000];
system("cls");
do
{
system("cls");
cout<<"\t\t\t\t -------------------------------"<<endl;
cout<<"\t\t\t\t | EVENT MANAGEMENT SYSTEM |"<<endl;
cout<<"\t\t\t\t -------------------------------"<<endl;
cout<<"\n------------------------------------------------------------------------------------------------------------------------\n";
cout<<"\n-------------------------------------------- Event Details -------------------------------------------------------------"<<endl;
cout<<"\n------------------------------------------------------------------------------------------------------------------------"<<endl;
cout<<"\n\t\t\t\t 1. Manage Events ";
cout<<"\n\t\t\t\t 2. Book Event ";
cout<<"\n\t\t\t\t 3. Available & Booked Event Info";
cout<<"\n\t\t\t\t 4. Search User ";
cout<<"\n\t\t\t\t 5. Costings of Event ";
cout<<"\n\t\t\t\t 6. About Us & Guest Summary ";
cout<<"\n\n Enter Option: " ;
cin>>opt;
switch(opt)
{
case 1:
manageEvents();
break;
case 2:
if(cnt==0)
{
cout<<"\n Events data is not available.\n\n Please add the Events first.";
getch();
}
else
hm.checkIn();
break;
case 3:
if(cnt==0)
{
cout<<"\n Events data is not available.\n\n Please add the Events first.";
getch();
}
else
hm.getAvailEvent();
break;
case 4:
if(cnt==0)
{
cout<<"\n Events are not available.\n\n Please add the Events first.";
getch();
}
else
{
cout<<"\n\n User Name : ";
cin>>uname;
hm.searchUser(uname);
}
break;
case 5:
if(cnt==0)
{
cout<<"\n Events are not available.\n\n Please add the Events first.";
getch();
}
else
{
cout<<"\n\n Enter Event Number : ";
cin>>ev;
hm.checkOut(ev);
}
break;
case 6:
hm.GuestSummary(uname);
break;
case 7:
cout<<"\n THANK YOU! ";
break;
default:
cout<<"\n\n Please Enter correct option ";
break;
}
}
while(opt!=7);
getch();
}