Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ANDREWS GANJ
PROJECT ON HOTEL
MANAGEMENT
TABLE OF CONTENTS
Certificate
Acknowledgement
Requirements
General directions
Modules used
Source code
Output
Limitations
Bibliography
Acknowledgement
Date: 21/12/2019
Registration No. :
__________________ __________________
HEADER FILES AND THEIR
PURPOSE
CODING
#HOTEL MANAGEMENT SYSTEM USING GUI
'''
File name: Hotel Management System
GUI.py
Author: Himanshu Maithani
Date created: 21/12/2019
Date last modified: 21/12/2019
Python Version: 3.7
'''
import tkinter as tk
from tkinter import ttk
import sys
LARGE_FONT=("Verdana",18)
SMALL_FONT=("Verdana",14)
SMALLER_FONT=("Verdana",10)
Details={'a':"a",'b':"b"}
#Update dictionary using insert method
#len(Details)
def insert(UsernameR,PasswordR,EmailR,PhoneR):
#print("Insert Works")
#Fields cannot be left empty by user.
if(len(UsernameR.get())==0 or len(PasswordR.get())==0
or len(EmailR.get())==0 or len(PhoneR.get())==0):
popupmsg("Fields cannot be Empty","Fill All
Fields","OK")
sys.exit(1)
else:
if UsernameR.get() not in Details:
Details[UsernameR.get()]=PasswordR.get() #Add to
dictionary with Username as Key and Password as value
print(Details)
ResetReg(UsernameR,EmailR,PhoneR,PasswordR)
#Clearing Out Fields
def CheckCred(Username,Password):
#print("CheckCred Works")
if(len(Username.get())==0 or len(Password.get())==0):
popupmsg("Invalid Credentials","Invalid Login","Try
Again")
else:
if Username.get() in Details:
#print("Inside")
r=tk.Tk()
r.geometry('500x500')
r.wm_title("Successfully Logged In")
rlbl=tk.Label(r,text="Welcome to
Booking.com",font=LARGE_FONT)
rlbl.pack(pady=20,padx=20)
rlbl1=tk.Label(r,text="Username:
"+Username.get(),font=SMALL_FONT)
rlbl1.pack(pady=10,padx=10)
rlbl2=tk.Label(r,text=
"You have Successfully Logged in.\n Book
affordable and comfortable rooms. :)",
font=SMALLER_FONT)
rlbl2.pack(pady=10,padx=10)
r.mainloop()
else:
Reset(Username,Password)
popupmsg("Invalid Credentials","Invalid Login","Try
Again")
def popupmsg(msg,heading,buttonText):
popup=tk.Tk()
popup.geometry('300x150')
popup.wm_title(heading)
label=tk.Label(popup,text=msg,font=SMALLER_FONT)
label.pack(side="top",fill="x",pady=20,padx=20)
b1=ttk.Button(popup,text=buttonText,command=popup.de
stroy)
b1.pack()
popup.mainloop()
class GUI(tk.Tk):
def __init__(self,*args,**kwargs):
tk.Tk.__init__(self,*args,**kwargs)
for F in (StartPage,RegPage,SuccessRegPage):
frame=F(container,self)
self.frames[F]= frame
frame.grid(row=0,column=0,sticky="nsew")
self.show_frame(StartPage)
def show_frame(self,cont):
frame=self.frames[cont]
frame.tkraise()
def __init__(self,parent,controller):
nameEnterV=tk.StringVar()
passEnterV=tk.StringVar()
tk.Frame.__init__(self,parent) #Parent Class is the GUI
class
Wel=tk.Label(self,text="Welcome To HHAS
Hotels",font=LARGE_FONT)
Wel.pack(pady=10,padx=10)
LIFB=tk.Label(self,text="Log In for
Booking",font=SMALL_FONT)
LIFB.pack(pady=10,padx=10)
Username=tk.Label(self,text="Username",font=("Verdana",
11))
Username.pack(pady=5,padx=5)
nameEnter=tk.Entry(self,bd=4,textvariable=nameEnterV)
nameEnter.pack()
Password=tk.Label(self,text="Password",font=("Verdana",1
1))
Password.pack(pady=5,padx=5)
passEnter=tk.Entry(self,show='*',bd=4,textvariable=passE
nterV)
passEnter.pack()
Loginbutton=ttk.Button(self,text="Log
in",command=lambda:CheckCred(nameEnter,passEnter))
Loginbutton.pack(pady=20,padx=25)
ResButton=ttk.Button(self,text="Reset",command=lambda
: Reset(nameEnter,passEnter))
ResButton.pack(pady=10,padx=10)
NU=tk.Label(self,text="New
User?",font=("Verdana",12))
NU.pack(pady=25,padx=15)
RH=ttk.Button(self,text="Register Here",
command=lambda:
controller.show_frame(RegPage))
RH.pack()
def Reset(Username,Password):
Username.delete(0,'end')
Password.delete(0,'end')
class RegPage(tk.Frame):
def __init__(self,parent,controller):
nameEnterV=tk.StringVar()
passEnterV=tk.StringVar()
tk.Frame.__init__(self,parent)
UsernameR=tk.Label(self,text="Username",font=("Verdana
",11))
UsernameR.pack(pady=5,padx=5)
nameEnter=tk.Entry(self,bd=4,textvariable=nameEnterV)
nameEnter.pack()
Email=tk.Label(self,text="EmailID",font=("Verdana",11))
Email.pack(pady=5,padx=5)
emailEnter=tk.Entry(self,bd=4)
emailEnter.pack()
Phone=tk.Label(self,text="Phone
Number",font=("Verdana",11))
Phone.pack(pady=5,padx=5)
phoneEnter=tk.Entry(self,bd=4)
phoneEnter.pack()
PasswordR=tk.Label(self,text="Password",font=("Verdana",
11))
PasswordR.pack(pady=5,padx=5)
passEnter=tk.Entry(self,show='*',bd=4,textvariable=passE
nterV)
passEnter.pack()
SU=ttk.Button(self,text="Sign Up
",command=lambda:
[insert(nameEnter,passEnter,emailEnter,phoneEnter),contr
oller.show_frame(SuccessRegPage)])
SU.pack(pady=15,padx=15)
ResetButton=ttk.Button(self,text="Reset",command=lamb
da:ResetReg(nameEnter,emailEnter,phoneEnter,passEnter))
ResetButton.pack(pady=15,padx=15)
AHA=tk.Label(self,text="Already have an
account?",font=SMALLER_FONT)
AHA.pack(pady=30,padx=10)
Loginbutton2=ttk.Button(self,text="Go to Login
Page",command=lambda:controller.show_frame(StartPage)
)
Loginbutton2.pack(pady=0,padx=25)
def ResetReg(Nentry,Eentry,Pentry,Passentry):
Nentry.delete(0,'end')
Eentry.delete(0,'end')
Pentry.delete(0,'end')
Passentry.delete(0,'end')
class SuccessRegPage(tk.Frame):
def __init__(self,parent,controller):
tk.Frame.__init__(self,parent)
label=ttk.Label(self,text="Succesfully
Registered",font=SMALL_FONT)
label.pack(pady=10,padx=10)
app=GUI()
#Calling the class
app.geometry('600x600')
app.mainloop()
#Tkinter functionality
OUTPUT
LIMITATIONS
1. Cannot store data as there is no back end
program to store any data.
2. Minimum functionality as the main focus was
on Tkinter module in python.
3. It is not in an exe (Application) format and will
require python IDLE and Tkinter module
downloaded on the PC.
REQUIREMENTS
HARDWARE REQUIRED
Compact Drive
Processor : Pentium III
Ram : 64 MB
Hard disk: 20 GB.
SOFTWARE REQUIRED
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
BIBLIOGRAPHY
Computer Science with Python
By- Sumitra Arora
Sites like Stack Overflow
https://stackoverflow.com/
https://www.geeksforgeeks.org/
wweportal.com
www.cbseportal.com
fejjhhhdhiwww.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com