-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhotel.py
executable file
·427 lines (421 loc) · 22.4 KB
/
hotel.py
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
import tkinter as tk
from tkinter import ttk
import random
import datetime
from datetime import date
from tkinter.font import Font
from tkinter import messagebox
import smtplib, ssl
import mysql.connector as mysql
class Hotel(tk.Frame):
Accounts={}
def __init__(self,master):
tk.Frame.__init__(self,master)
root.geometry("900x700")
self.grid()
self.text1=tk.Label(text="WELCOME TO THE GREAT INDIAN HOTEL",bg="brown",fg="white",font=("Comic Sans MS",36))
self.text1.grid(row=0,column=4,padx=50,pady=30)
self.text2=tk.Button(text="Click here to know more about us",fg="indigo",font=("Comic Sans MS",30),command=self.Wiki)
self.text2.grid(row=1,column=4,padx=50,pady=30)
self.text3=tk.Button(text="1. Check-in",fg="indigo",font=("Comic Sans MS",30),command=self.checkIn)
self.text3.grid(row=3,column=4,padx=50,pady=30)
self.text4=tk.Button(text="2. Check-out",fg="indigo",font=("Comic Sans MS",30),command=self.checkOut)
self.text4.grid(row=4,column=4,padx=50,pady=30)
self.text5=tk.Button(text="3. Check Availability",fg="indigo",font=("Comic Sans MS",30),command=self.checkAvailability)
self.text5.grid(row=5,column=4,padx=50,pady=30)
self.text6=tk.Button(text="4. Quit",fg="indigo",font=("Comic Sans MS",30),command=root.quit)
self.text6.grid(row=6,column=4,padx=10,pady=10)
def insert(self):
con=mysql.connect(host="localhost",user="root",password="Hanumanji1",database="hotel")
cursor=con.cursor()
cursor.execute("insert into customer values('"+ self.Uname +"','"+ self.Upasscode +"')")
cursor.execute("commit");
con.close()
return
def Wiki(self):
self.w=tk.Toplevel(self)
self.w.title("Information")
self.w.geometry("800x800")
self.Wi=tk.Frame(self.w)
self.Wi.grid()
self.text3=tk.Label(self.Wi,
text='''THE GREAT INDIAN HOTEL was established in the year 2000
with the aim of becoming one of the best hotels across our
country and the rest is history. Three friends Shreyansh,
Sourabh and Tanishq stared the initiative and today the
world knows what they have accomplished.''',fg="purple",font=("Comic Sans MS",20))
self.text3.grid(padx=10,pady=10)
self.text4=tk.Button(self.Wi,text="Back to homepage",font=("Comic Sans MS",26),command=self.w.destroy)
self.text4.grid(padx=10,pady=10)
def checkIn(self):
self.w=tk.Toplevel(self)
self.w.title("Check in")
self.w.geometry("700x700")
self.Wi=tk.Frame(self.w)
self.Wi.grid()
self.Usertext=tk.Label(self.Wi,text="USERNAME",font=("Comic Sans MS",20))
self.Usertext.grid(row=1,column=0,padx=10,pady=10,columnspan=2)
self.username=tk.Entry(self.Wi)
self.username.grid(row=1,column=2)
self.Passtext=tk.Label(self.Wi,text="PASSWORD",font=("Comic Sans MS",20))
self.Passtext.grid(row=2,column=0,padx=10,pady=10,columnspan=2)
self.password=tk.Entry(self.Wi,show="*")
self.password.grid(row=2,column=2)
self.enter=tk.Button(self.Wi,text="Proceed",font=("Comic Sans MS",26),command=self.AccessAcc)
self.enter.grid(row=3,column=0,padx=10,pady=10)
self.exit=tk.Button(self.Wi,text="Back",command=self.w.destroy,font=("Comic Sans MS",26))
self.exit.grid(row=3,column=1,padx=10,pady=10)
self.createAcc=tk.Button(self.Wi,text="Enter Customer Details",font=("Comic Sans MS",26),command=self.Create)
self.createAcc.grid(row=4,column=0,padx=10,pady=10,columnspan=2)
def checkOut(self):
self.w=tk.Toplevel(self)
self.w.title("Check Out")
self.w.geometry("700x700")
self.Wi=tk.Frame(self.w)
self.Wi.grid()
self.Usertext=tk.Label(self.Wi,text="Enter Room no",font=("Comic Sans MS",20))
self.Usertext.grid(row=1,column=0,padx=10,pady=10,columnspan=2)
self.username=tk.Entry(self.Wi)
self.username.grid(row=1,column=2)
self.enter=tk.Button(self.Wi,text="Proceed",font=("Comic Sans MS",26),command=self.showmesg)
self.enter.grid(row=3,column=0,padx=10,pady=10)
self.exit=tk.Button(self.Wi,text="Back",command=self.w.destroy,font=("Comic Sans MS",26))
self.exit.grid(row=3,column=1,padx=10,pady=10)
def showmesg(self):
messagebox.showinfo("THANKS!", message="Thankyou for your stay!, you were amazing, Visit again :)")
def checkAvailability(self):
self.w=tk.Toplevel(self)
self.w.title("Check Availability")
self.w.geometry("700x400")
self.Wi=tk.Frame(self.w)
self.Wi.grid()
self.room=tk.Label(self.Wi,text="Choose the type of room",font=("Comic Sans MS",26))
self.room.grid(row=1,column=0,padx=10,pady=10)
self.type=tk.StringVar()
self.room_type=ttk.Combobox(self.Wi,textvariable=self.type)
self.room_type['values']=("Deluxe","Premium","Double bed","Single Bed")
self.room_type.grid(row=1,column=1,padx=10,pady=10)
self.ch=tk.Button(self.Wi,text="Check no of rooms available",font=("Comic Sans MS",26),command=self.shw)
self.ch.grid(row=3,column=0,padx=10,pady=10)
self.ch1=tk.Button(self.Wi,text="Back",command=self.w.destroy,font=("Comic Sans MS",26))
self.ch1.grid(row=3,column=1,padx=10,pady=10)
def shw(self):
messagebox.showinfo("Room available", message="No of rooms available : "+str(random.randint(100,200)))
def AccessAcc(self):
self.e1=self.username.get()
self.e2=self.password.get()
if (self.e1 in Hotel.Accounts):
if (Hotel.Accounts[self.e1]["Password"]==self.e2):
self.Trans=tk.Toplevel(self)
self.MainWin()
else:
messagebox.showerror("Error", message="The details are wrong buddy!!!")
else:
messagebox.showerror("Error", message="The details are incomplete buddy!!!")
def MainWin(self):
self.Transf=tk.Frame(self.Trans)
self.Transf.grid()
self.Trans.geometry("800x400")
self.Welco=tk.Label(self.Transf,text=("WELCOME "+str(self.Uname).upper()+"!"),font=("Comic Sans MS",40),fg="blue")
self.Welco.grid(row=0,column=0,padx=10,pady=10)
self.now = datetime.datetime.now()
self.date=tk.Label(self.Transf,text=("Date:"+str(self.now.day)+"/"+str(self.now.month)+"/"+str(self.now.year)),font=("Comic Sans MS",26))
self.date.grid(row=3,column=0,padx=10,pady=10)
self.Time=tk.Label(self.Transf,font=("Comic Sans MS",26))
self.Time.grid(row=4,column=0,padx=10,pady=10)
self.Plan=tk.Button(self.Transf,text="Book your Stay",font=("Comic Sans MS",26),command=self.PlanTicket)
self.Plan.grid(row=5,column=0,padx=10,pady=10)
self.Oth=tk.Button(self.Transf,text="Others",font=("Comic Sans MS",26),command=self.OthScr)
self.Oth.grid(row=8,column=0,padx=10,pady=10)
self.Logout=tk.Button(self.Transf,text="Logout",font=("Comic Sans MS",26),command=self.Trans.destroy)
self.Logout.grid(row=9,column=3,padx=10,pady=10)
self.clock()
def clock(self):
self.time = datetime.datetime.now().strftime("Time: %H:%M:%S")
self.Time.config(text=self.time)
self.Transf.after(1000, self.clock)
def PlanTicket(self):
self.Transf.destroy()
self.PlanWin=tk.Frame(self.Trans)
self.Trans.geometry("950x400")
self.PlanWin.grid()
self.Date1=tk.Label(self.PlanWin,text="From Date",font=("Comic Sans MS",20))
self.Date1.grid(row=3,column=0)
self.Day1=tk.StringVar()
self.Month1=tk.StringVar()
self.Year1=tk.StringVar()
self.Daybox1=ttk.Combobox(self.PlanWin,textvariable=self.Day1)
self.Daybox1['values']=('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31')
self.Daybox1.grid(row=3,column=1)
self.Monthbox1=ttk.Combobox(self.PlanWin,textvariable=self.Month1)
self.Monthbox1['values']=('January','February','March','April','May','June','July','August','September','October','November','December')
self.Monthbox1.grid(row=3,column=2)
self.Yearbox1=ttk.Combobox(self.PlanWin,textvariable=self.Year1)
self.Yearbox1['values']=('2019','2020')
self.Yearbox1.grid(row=3,column=3,padx=10,pady=10)
self.Date=tk.Label(self.PlanWin,text="To Date",font=("Comic Sans MS",20))
self.Date.grid(row=4,column=0,padx=10,pady=10)
self.Day=tk.StringVar()
self.Month=tk.StringVar()
self.Year=tk.StringVar()
self.Daybox=ttk.Combobox(self.PlanWin,textvariable=self.Day)
self.Daybox['values']=('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31')
self.Daybox.grid(row=4,column=1,padx=10,pady=10)
self.Monthbox=ttk.Combobox(self.PlanWin,textvariable=self.Month)
self.Monthbox['values']=('January','February','March','April','May','June','July','August','September','October','November','December')
self.Monthbox.grid(row=4,column=2,padx=10,pady=10)
self.Yearbox=ttk.Combobox(self.PlanWin,textvariable=self.Year)
self.Yearbox['values']=('2019','2020')
self.Yearbox.grid(row=4,column=3,padx=10,pady=10)
self.room=tk.Label(self.PlanWin,text="Choose the type of room",font=("Comic Sans MS",20))
self.room.grid(row=5,column=0,padx=10,pady=10)
self.type=tk.StringVar()
self.room_type=ttk.Combobox(self.PlanWin,textvariable=self.type)
self.room_type['values']=("Deluxe","Premium","Double bed","Single Bed")
self.room_type.grid(row=5,column=1)
self.nod=tk.Label(self.PlanWin,text="Enter no of days to stay",font=("Comic Sans MS",20))
self.nod.grid(row=6,column=0,padx=10,pady=10)
self.noda=tk.Entry(self.PlanWin,textvariable=self.nod)
self.noda.grid(row=6,column=1,padx=10,pady=10)
self.people=tk.Label(self.PlanWin,text="Number of People",font=("Comic Sans MS",20))
self.people.grid(row=8,column=0,padx=10,pady=10)
self.peoples=tk.StringVar()
self.npeople=tk.Entry(self.PlanWin,textvariable=self.peoples)
self.npeople.grid(row=8,column=1)
self.CFare=tk.Button(self.PlanWin,text="Calculate Fare",font=("Comic Sans MS",20),command=self.Fare)
self.CFare.grid(row=9,column=0,padx=10,pady=10)
self.Canc=tk.Button(self.PlanWin,text="Cancel",font=("Comic Sans MS",20),command=self.Trans.destroy)
self.Canc.grid(row=9,column=1,padx=10,pady=10)
def Combine6(self):
self.PlanWin.destroy()
self.MainWin()
def Fare(self):
self.fare=0.0
if (self.peoples.get()==0):
messagebox.showerror("Error", message="Number of People Field Cannot be empty",parent=self.PlanWin)
else:
self.Calculate()
def Calculate(self):
self.noda1=self.noda.get()
self.people1=self.peoples.get()
self.type1=self.type.get()
if(self.type1=="Deluxe"):
self.fare=int(self.noda1)*int(self.people1)*7000
elif(self.type1=="Premium"):
self.fare=int(self.noda1)*int(self.people1)*5000
elif(self.type1=="Double Bed"):
self.fare=int(self.noda1)*int(self.people1)*3000
else:
self.fare=int(self.noda1)*int(self.people1)*2500
self.dis()
def dis(self):
self.PlanWin.destroy()
self.w=tk.Toplevel(self)
self.w.title("Check Availability")
self.w.geometry("600x400")
self.Wi=tk.Frame(self.w)
self.Wi.grid()
self.cn=tk.Label(self.Wi,text="Customer Name : ",font=("Comic Sans MS",20))
self.cn.grid(row=1,column=0,padx=10,pady=10)
self.cn=tk.Label(self.Wi,text=str(self.Uname).upper(),fg="blue",font=("Comic Sans MS",20))
self.cn.grid(row=1,column=1,padx=10,pady=10)
self.cn1=tk.Label(self.Wi,text="Room Type : ",font=("Comic Sans MS",20))
self.cn1.grid(row=2,column=0,padx=10,pady=10)
self.cn1=tk.Label(self.Wi,text=str(self.type1).upper(),fg="blue",font=("Comic Sans MS",20))
self.cn1.grid(row=2,column=1,padx=10,pady=10)
self.pr=tk.Label(self.Wi,text="Total price to be paid : Rs",font=("Comic Sans MS",20))
self.pr.grid(row=3,column=0,padx=10,pady=10)
self.pr1=tk.Label(self.Wi,text=str(self.fare),fg="blue",font=("Comic Sans MS",20))
self.pr1.grid(row=3,column=1,padx=10,pady=10)
self.pe=tk.Label(self.Wi,text="Total no of people to stay : ",font=("Comic Sans MS",20))
self.pe.grid(row=4,column=0,padx=10,pady=10)
self.pe=tk.Label(self.Wi,text=str(self.people1),fg="blue",font=("Comic Sans MS",20))
self.pe.grid(row=4,column=1,padx=10,pady=10)
self.da=tk.Label(self.Wi,text="Total no of days to stay : ",font=("Comic Sans MS",20))
self.da.grid(row=5,column=0,padx=10,pady=10)
self.da=tk.Label(self.Wi,text=str(self.noda1),fg="blue",font=("Comic Sans MS",20))
self.da.grid(row=5,column=1)
self.pr2=tk.Button(self.Wi,text="OK",font=("Comic Sans MS",17),command=self.Combination)
self.pr2.grid(row=6,column=1,padx=10,pady=10)
def princombo(self,event):
pass
def Combination(self):
self.w.destroy()
self.MainWin()
def Combine8(self):
self.TickWin.destroy()
self.MainWin()
def OthScr(self):
self.Transf.destroy()
self.Trans.geometry("550x550")
self.OthFr=tk.Frame(self.Trans)
self.OthFr.grid()
self.Alt=tk.Label(self.OthFr,text="ACCOUNT ALTERATION SCREEN",font=("Comic Sans MS",20),fg="red")
self.Alt.grid(padx=10,pady=10)
self.AccMod=tk.Button(self.OthFr,text="Account Modification",font=("Comic Sans MS",20),command=self.Combine3)
self.AccMod.grid(padx=10,pady=10)
self.ChanPass=tk.Button(self.OthFr,text="Change Password",font=("Comic Sans MS",20),command=self.ChangePassword)
self.ChanPass.grid(padx=10,pady=10)
self.ClosAcc=tk.Button(self.OthFr,text="Closing Account",font=("Comic Sans MS",20),command=self.Closing)
self.ClosAcc.grid(padx=10,pady=10)
self.back=tk.Button(self.OthFr,text="Go Back",font=("Comic Sans MS",20),command=self.Goback)
self.back.grid(padx=10,pady=10)
self.Ext=tk.Button(self.OthFr,text="Exit",font=("Comic Sans MS",20),command=self.Trans.destroy)
self.Ext.grid(padx=10,pady=10)
def Closing(self):
self.closure=messagebox.askyesno("Warning!",message="Are you sure you want to close your account?",parent=self.Trans)
if self.closure:
del Hotel.Accounts[self.Uname]
self.Trans.destroy()
else:
pass
def Goback(self):
self.OthFr.destroy()
self.MainWin()
def Combine3(self):
self.ModAsk=messagebox.askyesno(message="Are you sure you want to modify your account?",parent=self.Trans)
if self.ModAsk==True:
self.Trans.destroy()
self.Create()
else:
self.OthFr.destroy()
self.MainWin()
def ChangePassword(self):
self.OthFr.destroy()
self.Trans.geometry("700x400")
self.Chaf=tk.Frame(self.Trans)
self.Chaf.grid()
self.ChafHead=tk.Label(self.Chaf,text="CHANGE PASSWORD",font=("Comic Sans MS",30))
self.ChafHead.grid(row=0,column=0,padx=10,pady=10)
self.ChafMess=tk.Label(self.Chaf,text="Enter New Password",font=("Comic Sans MS",20))
self.ChafMess.grid(row=2,column=0,padx=10,pady=10)
self.ChafNew=tk.Entry(self.Chaf)
self.ChafNew.grid(row=2,column=2,padx=10,pady=10)
self.PasChan=tk.Button(self.Chaf,text="CHANGE",font=("Comic Sans MS",20),command=self.StNewPass)
self.PasChan.grid(row=3,column=0,padx=10,pady=10)
self.ChanCan=tk.Button(self.Chaf,text="CANCEL",font=("Comic Sans MS",20),command=self.Combine1)
self.ChanCan.grid(row=3,column=1,padx=10,pady=10)
def StNewPass(self):
self.Newpass=self.ChafNew.get()
Hotel.Accounts[self.Uid]["Password"]=self.Newpass
self.Chaf.destroy()
self.PasChd=tk.Frame(self.Trans)
self.PasChd.grid()
self.PasMess=tk.Label(self.PasChd,text="Password Successfully Changed!",font=("Comic Sans MS",20))
self.PasMess.grid()
self.PasOk=tk.Button(self.PasChd,text="Ok",font=("Comic Sans MS",20),command=self.Combine2)
self.PasOk.grid()
def Combine1(self):
self.Chaf.destroy()
self.MainWin()
def Combine2(self):
self.PasChd.destroy()
self.MainWin()
def Create(self):
self.Wind=tk.Toplevel(self)
self.Wind.title("Create/Modify Account")
self.Window=tk.Frame(self.Wind)
self.Window.grid()
self.Wind.geometry("800x800")
self.id=tk.Label(self.Window,text="USER ID",font=("Comic Sans MS",20))
self.id.grid(row=0,column=0,padx=10,pady=10,columnspan=2)
self.Id=tk.Entry(self.Window)
self.Id.grid(row=0,column=2)
self.passcode=tk.Label(self.Window,text="Password",font=("Comic Sans MS",20))
self.passcode.grid(row=1,column=0,padx=10,pady=10,columnspan=2)
self.Passcode=tk.Entry(self.Window)
self.Passcode.grid(row=1,column=2)
self.name=tk.Label(self.Window,text="Name",font=("Comic Sans MS",20))
self.name.grid(row=2,column=0,padx=10,pady=10,columnspan=2)
self.Name=tk.Entry(self.Window)
self.Name.grid(row=2,column=2)
self.gender=tk.Label(self.Window,text="Gender",font=("Comic Sans MS",20))
self.gender.grid(row=3,column=0,columnspan=2)
self.genop=tk.IntVar()
self.g1=tk.Radiobutton(self.Window,text="Male",font=("Comic Sans MS",20),variable=self.genop,value=1)
self.g2=tk.Radiobutton(self.Window,text="Female",font=("Comic Sans MS",20),variable=self.genop,value=2)
self.g3=tk.Radiobutton(self.Window,text="Transgender",font=("Comic Sans MS",20),variable=self.genop,value=3)
self.g1.grid(row=3,column=2)
self.g2.grid(row=3,column=3)
self.g3.grid(row=3,column=4)
self.dob=tk.Label(self.Window,text="Date Of Birth",font=("Comic Sans MS",20))
self.dob.grid(row=4,column=0,padx=10,pady=10,columnspan=2)
self.Dob=tk.Entry(self.Window)
self.Dob.grid(row=4,column=2,padx=10,pady=10)
self.occu=tk.Label(self.Window,text="Occupation",font=("Comic Sans MS",20))
self.occu.grid(row=5,column=0,padx=10,pady=10,columnspan=2)
self.Occu=tk.Entry(self.Window)
self.Occu.grid(row=5,column=2,padx=10,pady=10)
self.phoneno=tk.Label(self.Window,text="Phone Number",font=("Comic Sans MS",20))
self.phoneno.grid(row=6,column=0,padx=10,pady=10,columnspan=2)
self.Phoneno=tk.Entry(self.Window)
self.Phoneno.grid(row=6,column=2,padx=10,pady=10)
self.nat=tk.Label(self.Window,text="Nationality",font=("Comic Sans MS",20))
self.nat.grid(row=7,column=0,padx=10,pady=10,columnspan=2)
self.Nat=tk.Entry(self.Window)
self.Nat.grid(row=7,column=2,padx=10,pady=10)
self.address=tk.Label(self.Window,text="Address",font=("Comic Sans MS",20))
self.address.grid(row=8,column=0,padx=10,pady=10,columnspan=2)
self.Address=tk.Entry(self.Window)
self.Address.grid(row=8,column=2,padx=10,pady=10)
self.Sub=tk.Button(self.Window,text="Submit",font=("Comic Sans MS",26),command=self.submit)
self.Can=tk.Button(self.Window,text="Cancel",font=("Comic Sans MS",26),command=self.Wind.destroy)
self.Sub.grid(row=9,column=0,padx=10,pady=10)
self.Can.grid(row=9,column=1,padx=10,pady=10)
def submit(self):
self.Uid=self.Id.get()
self.Upasscode=self.Passcode.get()
self.Uname=self.Name.get()
self.Ugender=self.genop
self.Udob=self.Dob.get()
self.Uoccu=self.Occu.get()
self.Uphoneno=self.Phoneno.get()
self.Unat=self.Nat.get()
self.Uaddress=self.Address.get()
Hotel.Accounts[self.Uid]={"User ID":self.Uid,"Password":self.Upasscode,"Name":self.Uname,"Gender":self.Ugender,"Date of Birth":self.Udob,"Occupation":self.Uoccu,"Phone Number":self.Uphoneno,"Nationality":self.Unat,"Address":self.Uaddress}
self.insert()
self.Window.destroy()
self.Term()
def Term(self):
self.TermWin=tk.Frame(self.Wind)
self.TermWin.grid()
self.Wind.geometry("1100x400")
self.TermHead=tk.Label(self.TermWin,text="TERMS AND CONDITIONS",fg="red",font=("Comic Sans MS",26))
self.TermHead.grid(row=0,column=0,padx=10,pady=10)
self.Mess=tk.Label(self.TermWin, text="By submitting your registration information, you indicate that you have read, understood and accepted the services offered.",font=("Comic Sans MS",17))
self.Mess.grid(row=1,column=0,padx=10,pady=10)
self.Checkvar=tk.IntVar()
self.Accept=tk.Checkbutton(self.TermWin,text="I have read the terms and conditions.",font=("Comic Sans MS",20),variable=self.Checkvar)
self.Accept.deselect()
self.Accept.grid(row=2,column=0,padx=10,pady=10)
self.oka=tk.Button(self.TermWin,text="Agree and continue",font=("Comic Sans MS",20),command=self.Combine4)
self.oka.grid(row=3,column=0,padx=10,pady=10)
def Combine5(self):
self.Wind.destroy()
self.Create()
def Combine4(self):
if self.Checkvar.get()==0:
messagebox.showerror("Error", message="Please accept the terms and conditions!!")
else:
self.Congrats()
def Congrats(self):
self.TermWin.destroy()
self.CongScr=tk.Frame(self.Wind)
self.CongScr.grid()
self.Wind.geometry("700x400")
self.Udisp=tk.Label(self.CongScr,text=("Your Username = "+str(self.Uid)),font=("Comic Sans MS",20))
self.Udisp.grid(padx=10,pady=10)
self.Pdisp=tk.Label(self.CongScr,text=("Your Passcode = "+str(self.Upasscode)),font=("Comic Sans MS",20))
self.Pdisp.grid(padx=10,pady=10)
self.Disp=tk.Label(self.CongScr,text="You Have 5 Seconds to Note Your Username And Password....",font=("Comic Sans MS",20))
self.Disp.grid(padx=10,pady=10)
self.Prog=ttk.Progressbar(self.CongScr,mode="determinate",value=0,maximum=90)
self.Prog.grid(padx=10,pady=10)
self.Prog.start(50)
self.Wind.after(3000,lambda:self.Wind.destroy())
root=tk.Tk()
root.title("Hotel")
root.geometry("900x700")
app=Hotel(master=root)
app.mainloop()
root.destroy()