Computer Science Project

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 104

SANT NANDLAL SMRITI

Vidya mandir
GHATSILA

AISSCE
2023 – 2024

COMPUTER SCIENCE PROJECT


ON

HOTEL MANAGEMENT SYSTEM

NAME: MANAB BERA


CLASS: XII SCIENCE
ROLL NO.:

CERTIFICATE
This is to certify that MANAB BERA of class XII Science, Roll no.
of Sant Nandlal Smriti Vidya Mandir has successfully completed his
computer practical for the AISSCE as prescribed by CBSE in the year
2023-2024.

Mr. Saikat Kumar Roy Mrs. NeelKamal Sinha


(HOD, Computer Science) (Principal)

SIGNATURE OF EXTERNAL

ACKNOWLEDGEMENT
I, MANAB BERA of XII Science, Roll no.
have completed this investigatory project of computer
successfully under the guidance of our computer
teachers Mr. Saikat Kumar Roy. Without their help, I
couldn't have completed the project on time.
At last but not the least, I just want to express my
hearties thanks to my computer teacher, family and
friends whose continuous help and inspirations had
encouraged me to complete this project.

CONTENTS
 Introduction

 Library modules and their purposes

 Data files created

 Coding

 Output

 Conclusion

 Bibliography

INTRODUCTION
Hotel management system project in python is a console application with the use
of graphics. This project is divided into two programs. One for the main GUI page
and another for login, create new user and forgot password panel. The main GUI
page contents various frames Le, Reserve, Admin Panel, Rooms and Contacts.
In Reserve Panel, user's all personal information gets entered in sql (in backend)
which is required for Room Booking. After filling the required details customer can
reserve and choose the payment method of their choice. It also contains a filter
section where the customer can find the room of his/her liking.

In Admin Panel, the details of hotel is shown like no. of customers, no. of rooms
reserved and available and it contains the admin login within it. Once admin logins
he/she can add, remove and edit rooms as well as view customer details.

In Rooms Panel, the details of each room is shown. Whether that room is reserved
or not and ac, wifiare available ornot.

In Contacts Panel, we can see various departments' head and contacts for
customers so that customers can contact them for any inconvenience.

Of course we have taken care of the security too so to use this software the user
need to register and login to get access. In case user forgot the password the user
can change the password by providing correct email id and username.

This project uses the concept of following python topics:

 tkinter - To provide the best GUI interface for user to understand easily what
they have to do.
 if /elif /else - To conditional operators to work on certain conditions.
 try/except - To perform certain work and except error occurred while performing
that work.
 sqlite3- For database connectivity.

LIBRARY MODULES AND


THEIR PURPOSE
from tkinter import*

from tkinter import ttk

import time

import datetime

from PIL import ImageTk. Image

import os

import sqlite3

from tkinter import messagebox

from tkcalendar import DateEntry

1. tkinter library is used to provide graphical user interface for the user.

2. Ttk function from tkinter library is used for making tables to store data.

3. time is used to store the customers' details of reservation in that time.

4. Datetime module is imported to work with the date as well as time.

5. The ImageTk modules contains support to create and modify Tkinter Bitmap image
and Photolmage objects from PIL images.

6. os module is used for checking the existing of the files.

7. Sqlite3 library is used for establishing the connectivity between database for
keeping and fetching records.

8. Messagebox from tkinter library is used to deliver proper message to the user of
this software to inform what is going on while executing this program.

9. tkcalendar is a python module that provides the Calendar and DateEntry widgets for
Tkinter.

DATA FILES CREATED


• hms is a database where tables have been created and used to
store, modify and delete the customer data, room booking
details and hotel details.

• Users is a database where tables have been created and used


to contain details of all the users who register.
SOURCE
CODE

from tkinter import *


from tkcalendar import*
from tkinter import messagebox
from tkinter import ttk
import sqlite3
from random import randint
from PIL import ImageTk,Image
from datetime import date, datetime
import os

global d1
d1=sqlite3.connect('hms.db')
#----Register table-----
d1.execute('''Create table if not exists c_register(
c_name TEXT,
c_email VARCHAR(60),
c_user VARCHAR(50),
c_password VARCHAR(50),
c_id VARCHAR(30))''')
#------Room details table-----
d1.execute('''
Create table if not exists r_detail(
r_no INTEGER(50) PRIMARY KEY,
r_ac VARCHAR(20),
r_bed VARCHAR(10),
r_wifi VARCHAR(10),
r_type VARCHAR(10),
r_price INTEGER(50),
r_available VARCHAR(50))
''')

#----guest details table----------


d1.execute('''Create table if not exists g_detail(
b_id INTEGER(20) PRIMARY KEY,
r_no INTEGER(50),
c_name TEXT,
c_id VARCHAR(30),
c_phone INTEGER(13),
c_vid VARCHAR(20),
c_gender VARCHAR(30),
c_address VARCHAR(200),
t_child INTEGER(20),
t_adult INTEGER(20),
child_name VARCHAR(200),
adult_name VARCHAR(200),
checkin VARCHAR(20),
checkout VARCHAR(20))
''')
#----booking table------
d1.execute('''
Create table if not exists booking(
b_id INTEGER(20) PRIMARY KEY,
r_no INTEGER(20),
c_name TEXT,
c_id VARCHAR(30),
c_phone INTEGER(13),
c_gender VARCHAR(30),
c_address VARCHAR(200),
bon_date VARCHAR(20),
bby_date VARCHAR(20),
nb_day INTEGER(10),
t_child INTEGER(20),
t_adult INTEGER(20),
price INTEGER(20),
payment VARCHAR(20))
''')
#-----PAYMENT INFO table--------
d1.execute('''
Create table if not exists payment(
p_id INTEGER(20) PRIMARY KEY,
b_id INTEGER(20),
r_no INTEGER(20),
c_name TEXT,
c_id VARCHAR(30),
c_phone INTEGER(13),
c_gender VARCHAR(30),
c_address VARCHAR(200),
bon_date VARCHAR(20),
bby_date VARCHAR(20),
nb_day INTEGER(10),
t_child INTEGER(20),
t_adult INTEGER(20),
price INTEGER(20),
payment VARCHAR(20))
''')
#-------------------------------------------------------------------------------------------------------
def printing(ss):
ask=messagebox.askquestion("showinfo","Do you want to print recipt!")
xo=""
d2=d1.cursor()
d2.execute("Select * from payment")
data=d2.fetchall()
for i in data:
if i[1]==int(ss):
xo=i
op=["Payment Id : ","Booking Id : ","Room no. : ","Name : ","Email Id : ","Phone no. :
","Gender : ","Address : ","Date of booking : ","Booking date : ","No. of days : ","Total child :
","Total adult : ","Price : ","Payment method : "]
if ask=='yes':
with open("print.txt",'w') as frob:
frob.writelines(("-"*20)+"PAYMENT RECIPT"+("-"*20)+"\n")
frob.flush()
for i in range(15):
frob.writelines(op[i]+str(xo[i])+"\n")
frob.flush()
frob.writelines(("-"*54)+"\n")
frob.flush()
os.startfile("print.txt","print")
def mainframe(yn,ye,lu):
root=Tk()

root.title("HOTEL MANAGEMENT SYSTEM")


root.geometry('1270x630+10+20')
root.resizable(0,0)

y=IntVar()
#-----booking id----
def b_entry():
d2=d1.cursor()
d2.execute("SELECT b_id FROM booking")
data=d2.fetchall()
global a
a=0
for i in range(5):
a=a*10+(randint(0,9))
for i in data:
if a==i:
b_entry()
else:
break
def main():
#-----relax---
def relax():
b6.config(text="☰",font=("Georgia",13,"bold"),height=2,width=5,command=menu)
mf.destroy()
if y.get()==1:
fra.destroy()
elif y.get()==2:
cfr.destroy()
#-----menus-------
def menu():
def dest1():
fra.destroy()
mb1.config(command=profile)
def dest2():
cfr.destroy()
mb2.config(command=contact)
def exit1():
if y.get()==1:
dest1()
elif y.get()==2:
dest2()
b6.config(text="☰",font=("Georgia",13,"bold"),height=2,width=5,command=menu)
mf.destroy()
ask=messagebox.askquestion("Logout","Do you want to exit!")
if ask=='yes':
root.destroy()
login()
elif ask=="no":
b6.config(text="☰",font=("Georgia",13,"bold"),height=2,width=5,command=menu
)
mf.destroy()
elif y.get()==1:
fra.destroy()
elif y.get()==2:
cfr.destroy()
def profile():
d2=d1.cursor()
d2.execute("Select * from c_register")
dat=d2.fetchall()
for i in dat:
if yn in i and ye in i:
pz=i
cfp=IntVar()
def done(rr):

al=""
if cfp.get()==1:
d1.execute("Update c_register set c_name = '{}' Where c_name='{}' and
c_email='{}'".format(rr,pz[0],pz[1]))
d1.commit()
messagebox.showinfo("showinfo","Updation successful")
l1.config(text=('Name : %s'%(rr)))
if cfp.get()==2:
d1.execute("Update c_register set c_password = '{}' Where c_name='{}' and
c_email='{}'".format(rr,pz[0],pz[1]))
d1.commit()
messagebox.showinfo("showinfo","Updation successful")
l4.config(text=('Password : %s'%(len(rr)*"*")))

if y.get()==1:
dest1()
elif y.get()==2:
dest2()
mb1.config(command=dest1)
global fra
fra=Frame(root,width=350,height=300,bg="gray70",highlightbackground="black",
highlightthickness=3)
fra.place(x=773,y=47)
il=Label(fra,text="PROFILE",bd=0,font=('Times',20,'bold'),bg="gray70")
il.place(x=115,y=11)

def username():
t=Toplevel()
t.geometry("300x150+880+50")
t.title("Profile Edit")
t.config(bg="gray85")
l=Label(t,text="Enter your new name :",font=('Times',16),bg="gray85")
l.place(x=10,y=10)
ee=Entry(t,font=('Times',16),width=17,bd=2)
ee.place(x=10,y=50)
ee.focus()
cfp.set(1)
bu=Button(t,text="EDIT",font=('Times',16),width=10,bd=2,command=lambda:don
e(ee.get()))
bu.place(x=30,y=100)
t.mainloop()

def password():
t=Toplevel()
t.geometry("300x150+880+50")
t.title("Profile Edit")
t.config(bg="gray85")
l=Label(t,text="Enter your new password :",font=('Times',16),bg="gray85")
l.place(x=10,y=10)
ee=Entry(t,font=('Times',16),width=17,bd=2)
ee.place(x=10,y=50)
ee.focus()
cfp.set(2)
bu=Button(t,text="EDIT",font=('Times',16),width=10,bd=2,command=lambda:don
e(ee.get()))
bu.place(x=30,y=100)
t.mainloop()

l1=Label(fra,text=('Name : %s'%(pz[0])),font=("Times",13,"bold"),bg="gray70")
l1.place(x=20,y=80)
l2=Label(fra,text=('Email Id : %s'%(pz[1])),font=("Times",13,"bold"),bg="gray70")
l2.place(x=20,y=120)
l3=Label(fra,text=('Username : %s'%(pz[2])),font=("Times",13,"bold"),bg="gray70")
l3.place(x=20,y=160)
l4=Label(fra,text=('Password : %s'%
(len(pz[3])*"*")),font=("Times",13,"bold"),bg="gray70")
l4.place(x=20,y=200)
l5=Label(fra,text=('Identity : %s'%(pz[4])),font=("Times",13,"bold"),bg="gray70")
l5.place(x=20,y=240)
img=ImageTk.PhotoImage(Image.open("image/edit_image.jpg"))
b1=Button(fra,image=img,bd=0,bg="gray70",activebackground="gray70",command
=username)
b1.image=img
b1.place(x=270,y=78)
b2=Button(fra,image=img,bd=0,bg="gray70",activebackground="gray70",command
=password)
b2.image=img
b2.place(x=270,y=198)

y.set(1)
def contact():
if y.get()==1:
dest1()
elif y.get()==2:
dest2()
mb2.config(command=dest2)
global cfr
cfr=Frame(root,width=350,height=400,bg="gray70",highlightbackground="black",
highlightthickness=3)
cfr.place(x=773,y=47)
y.set(2)
l=Label(cfr,width=46,height=25,bg="White")
l.place(x=7,y=7)
img1=ImageTk.PhotoImage(Image.open("image/manajor.jpg"))
imgl1=Label(cfr,image=img1,bd=0)
imgl1.image=img1
imgl1.place(x=15,y=15)
img2=ImageTk.PhotoImage(Image.open("image/reception.jpg"))
imgl2=Label(cfr,image=img2,bd=0)
imgl2.image=img2
imgl2.place(x=15,y=100)
img3=ImageTk.PhotoImage(Image.open("image/chief.jpg"))
imgl3=Label(cfr,image=img3,bd=0)
imgl3.image=img3
imgl3.place(x=15,y=187)
img4=ImageTk.PhotoImage(Image.open("image/roomservice.jpg"))
imgl4=Label(cfr,image=img4,bd=0)
imgl4.image=img4
imgl4.place(x=15,y=287)

l1=Label(cfr,text="Mr.Ashok Kumar ",font=("times",13),bg="white")


l1.place(x=88,y=31)
l1=Label(cfr,text="Manager",font=("times",13),bg="white")
l1.place(x=88,y=10)
l1=Label(cfr,text="Extention : 023",font=("times",13),bg="white")
l1.place(x=88,y=50)
l1=Label(cfr,text="Mail : Manager20@hms.com",font=("times",13),bg="white")
l1.place(x=88,y=70)

l1=Label(cfr,bg="white",text="Customer Executive",font=("times",13))
l1.place(x=88,y=100)
l1=Label(cfr,bg="white",text="Extention : 091",font=("times",13))
l1.place(x=88,y=140)
l1=Label(cfr,bg="white",text="Mr.Deepak Shaw ",font=("times",13))
l1.place(x=88,y=120)
l1=Label(cfr,bg="white",text="Mail : Rec68@hms.com",font=("times",13))
l1.place(x=88,y=160)

l1=Label(cfr,bg="white",text="Restaurant",font=("times",13))
l1.place(x=88,y=187)
l1=Label(cfr,bg="white",text="Mr.Kailash (Head) ",font=("times",13))
l1.place(x=88,y=207)
l1=Label(cfr,bg="white",text="Extention : 073",font=("times",13))
l1.place(x=88,y=227)
l1=Label(cfr,bg="white",text="Mail : Res230@hms.com",font=("times",13))
l1.place(x=88,y=247)

l1=Label(cfr,bg="white",text="Room Service",font=("times",13))
l1.place(x=88,y=285)
l1=Label(cfr,bg="white",text="Extention : 026",font=("times",13))
l1.place(x=88,y=325)
l1=Label(cfr,bg="white",text="Ms. Kajal (Head) ",font=("times",13))
l1.place(x=88,y=305)
l1=Label(cfr,bg="white",text="Mail : Roomsev209@hms.com",font=("times",13))
l1.place(x=88,y=345)
b6.config(text='X',font=("MS reference sans snif",13,"bold"),width=6,command=relax)
global mf
mf=Frame(root,width=150,height=200,bg="gray70",highlightbackground="black",
highlightthickness=3)
mf.place(x=1120,y=47)
mb1=Button(mf,text="PROFILE",font=("Georgia",10,"bold"),
fg="white",activeforeground="white",bg="black",
activebackground="black",bd=0,height=2,width=15,command=profile)
mb1.place(x=2,y=15)

mb2=Button(mf,text="CONTACT INFO",font=("Georgia",10,"bold"),
fg="white",activeforeground="white",bg="black",
activebackground="black",bd=0,height=2,width=15,command=contact)
mb2.place(x=2,y=75)

mb3=Button(mf,text="[<-- LOGOUT",font=("Georgia",10,"bold"),
fg="white",activeforeground="white",bg="black",
activebackground="black",bd=0,height=2,width=15,command=exit1)
mb3.place(x=2,y=135)
#----------frames-------------
c=IntVar()
j=IntVar()
j.set(0)
def des():
b6.config(text="☰",font=("Georgia",13,"bold"),height=2,width=5,command=menu)
if j.get()==1:
tx.destroy()
if c.get()==1:
f1.destroy()
elif c.get()==2:
f2.destroy()
elif c.get()==3:
f3.destroy()
elif c.get()==4:
f4.destroy()
elif c.get()==5:
f5.destroy()
elif c.get()==6:
f6.destroy()
elif c.get()==7:
f7.destroy()
elif c.get()==8:
f8.destroy()
elif c.get()==9:
f9.destroy()

img=PhotoImage(file="main2.png")
def home():
des()
global f1
f1=Frame(root,width=1046,height=580)
f1.place(x=225,y=50)
il=Label(f1,image=img,bd=0)
il.image=img
il.place(x=0,y=0)
c.set(1)
def reservation():
def disable(*argu):
c5.configure(state="disabled")
def enable(*argu):
c5.configure(state="normal")
def d(e):
c0.config(state="disable")
def n(e):
c0.config(state="normal")
des()
global f2
f2=Frame(root,width=1046,height=580)
f2.place(x=225,y=50)
c.set(2)
img1=ImageTk.PhotoImage(Image.open("image/reservation.png"))
il=Label(f2,image=img1,bd=0)
il.image=img1
il.place(x=0,y=0)

style=ttk.Style()
style.theme_use("clam")
style.configure("TCombobox",bd=5,fieldbackground="gray90",background="gray90",f
oreground="black")
#----multi frames---
rf1=Frame(f2,width=700,height=40,bg="gray60",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf1.place(x=34,y=15)
rf2=Frame(f2,width=520,height=480,bg="gray60",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf2.place(x=34,y=80)
rf3=Frame(f2,width=420,height=480,bg="gray60",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf3.place(x=579,y=80)

rf4=Frame(rf3,width=350,height=200,bg="gray80",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf4.place(x=30,y=250)

l=Label(rf1,text="RESERVATION",width=43,font=("Georgia",25,"bold"),fg="black",bg=
"gray60")
l.pack()
l0=Label(rf2,text="Booking ID :",font=("Times",13,"bold"),fg="black",bg="gray60")
l0.place(x=0,y=35)
l1=Label(rf2,text="Room No. :",font=("Times",13,"bold"),fg="black",bg="gray60")
l1.place(x=0,y=65)
l2=Label(rf2,text="Customer
Name :",font=("Times",13,"bold"),fg="black",bg="gray60")
l2.place(x=0,y=95)
l3=Label(rf2,text="Customer Email
ID :",font=("Times",13,"bold"),fg="black",bg="gray60")
l3.place(x=0,y=125)
l4=Label(rf2,text="Customer Phone
No. :",font=("Times",13,"bold"),fg="black",bg="gray60")
l4.place(x=0,y=155)
l5=Label(rf2,text="Customer
Gender :",font=("Times",13,"bold"),fg="black",bg="gray60")
l5.place(x=0,y=185)
l6=Label(rf2,text="Customer
Address :",font=("Times",13,"bold"),fg="black",bg="gray60")
l6.place(x=0,y=215)
l7=Label(rf2,text="Booking Date :",font=("Times",13,"bold"),fg="black",bg="gray60")
l7.place(x=0,y=245)
l8=Label(rf2,text="No. Of Days :",font=("Times",13,"bold"),fg="black",bg="gray60")
l8.place(x=0,y=275)
l9=Label(rf2,text="Total Children :",font=("Times",13,"bold"),fg="black",bg="gray60")
l9.place(x=0,y=305)
l10=Label(rf2,text="Total Adult :",font=("Times",13,"bold"),fg="black",bg="gray60")
l10.place(x=0,y=335)

def p(event):
global cal,dw
dw=Toplevel()
dw.grab_set()
dw.title("calendar")
dw.geometry('250x220+590+370')

cal=Calendar(dw,selectmode='day',date_pattern='dd/mm/y')
cal.place(x=0,y=0)

sb=Button(dw,text="select",command=g)
sb.place(x=90,y=190)
def g():
global wox
today = date.today()
y = today.year
m = today.month
d = today.day
wox=f"{d}/{m}/{y}"
d1=datetime.strptime(wox,"%d/%m/%Y")
d2=datetime.strptime(cal.get_date(),"%d/%m/%Y")
result=d2-d1
if result.days<0:
dw.destroy()
messagebox.showerror("showerror","Please enter correct date!")

elif result.days>=0:
c7.delete(0,END)
c7.insert(0,cal.get_date())
dw.destroy()

c0=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c0.place(x=200,y=35)
c0.bind('<FocusIn>',enable)

c1=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c1.place(x=200,y=65)
c1.bind('<FocusIn>',enable)

c2=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c2.place(x=200,y=95)
c2.bind('<FocusIn>',enable)

c3=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c3.place(x=200,y=125)
c3.bind('<FocusIn>',enable)
c4=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c4.place(x=200,y=155)
c4.bind('<FocusIn>',enable)

c5=ttk.Combobox(rf2,font=("Times",13,"bold"),values=["Male","Female","Others"],widt
h=29)
c5.place(x=200,y=185)
c5.bind('<FocusOut>',disable)
c5.bind('<FocusIn>',enable)

c6=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c6.place(x=200,y=215)
c6.bind('<FocusIn>',enable)

c7=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c7.place(x=200,y=245)
c7.bind('<FocusIn>',enable)
c7.insert(0,"dd/mm/yyyy")
c7.bind("<1>",p)

c8=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c8.place(x=200,y=275)
c8.bind('<FocusIn>',enable)

c9=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c9.place(x=200,y=305)
c9.bind('<FocusIn>',enable)

c10=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c10.place(x=200,y=335)
c10.bind('<FocusIn>',enable)
def clean():
for w in rf4.winfo_children():
w.destroy()
def search():
clean()
t=False
query="select * from r_detail"
cursor=d1.execute(query)
data=cursor.fetchall()
for i in data:
if r1.get()==i[1] and r2.get()==i[3] and r3.get()==i[2] and r4.get().capitalize()==i[4]
and i[6]=="yes":
Label(rf4,text=("Room no.-"+str(i[0])),
font=("Times",13,"bold"),bg="gray80").place(x=5,y=5)
Label(rf4,text=("Price -"+str(i[5])+"/day"),
font=("Times",13,"bold"),bg="gray80").place(x=5,y=27)
Label(rf4,text=("Room available"),
font=("Times",13,"bold"),bg="gray80").place(x=5,y=49)

t=True
if t==False:
Label(rf4,text=("All rooms are booked/No such room available!"),
font=("Times",13),bg="gray80").place(x=5,y=5)
def up(s):
f=False
che=False
d2=d1.cursor()
d2.execute("Select * from booking")
data=d2.fetchall()
d2.execute("Select * from g_detail")
data2=d2.fetchall()
for i in data:
for j in data2:
if i[0]==j[0]:
messagebox.showinfo("showinfo","Cannot Unreserve this Id\nAs this had
checked in/checked out!")
che=False
break
else:
che=True
if che==True:
for i in data:
if i[0]==int(ee.get()):
tx.destroy()
d1.execute("Delete from booking where b_id={}".format(int(s)))
d1.commit()
j.set(0)
f=True
messagebox.showinfo("showinfo","Unreservation successfull!")
break
else:
f=False
if f==False:
messagebox.showerror("showerror","Invalid booking id!")

def unre():
global tx,ee
tx=Toplevel()
tx.geometry("300x150+180+50")
tx.title("UNRESERVATION")
tx.config(bg="gray85")
l=Label(tx,text="Enter the booking id :",font=('Times',16),bg="gray85")
l.place(x=10,y=10)
ee=Entry(tx,font=('Times',16),width=17,bd=2)
ee.place(x=10,y=50)
ee.focus()
bu=Button(tx,text="UNRESERVE",font=('Times',16),width=15,bd=2,command=lam
bda:up(ee.get()))
bu.place(x=28,y=100)
j.set(1)
tx.mainloop()
def entry():
li=["Male","Female","Others"]
kl=True
j=True
f=False
today = date.today()
y = today.year
m = today.month
d = today.day
wox=f"{d}/{m}/{y}"
d2=d1.cursor()
d2.execute("Select * from booking")
data=d2.fetchall()
for i in c2.get():
if i.isalpha() or i.isspace():
f=True
else:
f=False
break
for i in data:
if int(c1.get())==i[1] and c7.get()==i[8] :
j=False
if c5.get().capitalize() not in li:
kl=False
if c1.get()=="" or c2.get()=="" or c3.get()=="" or c4.get()=="" or c5.get()=="" or
c6.get()=="" or c7.get()=="" or c8.get()=="" or c9.get()=="" or c10.get()=="" :
messagebox.showerror("showerror","All fields are required!")
else:
if f==False:
messagebox.showerror("showerror","Invalid name entry!")
elif "@" not in c3.get() and "." not in c3.get():
messagebox.showerror("showerror","Invalid mail id!")
elif len(c4.get())!=10:
messagebox.showerror("showerror","Invalid Phone no.!")
elif j==False:
messagebox.showerror("showerror","Room no. %s is unavailable on %s"%
(c1.get(),c7.get()))
elif kl==False:
messagebox.showerror("showerror","Invalid gender entry!")
elif c8.get().isalpha() or c8.get() in "~`!@#$%^&*()-_+={[]};:<>?/.,''":
messagebox.showerror("showerror","Invalid days entry!")
elif int(c9.get())>4 and int(c10.get())>4:
messagebox.showerror("showerror","No. of adult and child\nout of capacity!")
else:
pay=Tk()
pay.title("Payment")
pay.geometry("300x280+50+20")
#pay.config(bg="sea green")
r=StringVar()
r.set("Cash")
def p_entry():
d2=d1.cursor()
d2.execute("SELECT p_id FROM payment")
data=d2.fetchall()
global u
u=0
for i in range(5):
u=u*10+(randint(0,9))
for i in data:
if u==i:
p_entry()
else:
break

def c(value):
query="Insert into booking values({},{},'{}','{}',{},'{}','{}','{}','{}',{},{},{},
{},'{}')".format(c0.get(),c1.get(),
c2.get().title(),c3.get(),
c4.get(),c5.get().capita
lize(),
c6.get().title(),wox,c7.g
et(),
c8.get(),c9.get(),
c10.get(),g,value)
d1.execute(query)
d1.commit()
query="Insert into payment values({},{},{},'{}','{}',{},'{}','{}','{}','{}',{},{},{},
{},'{}')".format(u,c0.get(),c1.get(),
c2.get().title(),c3.get(),
c4.get(),c5.get().capita
lize(),
c6.get().title(),wox,c7.g
et(),
c8.get(),c9.get(),
c10.get(),g,value)
d1.execute(query)
d1.commit()
messagebox.showinfo("showinfo","Reservation successfull")
dref()
def dref():
pay.destroy()
printing(u)
c0.delete(0,END)
c1.delete(0,END)
c2.delete(0,END)
c3.delete(0,END)
c4.delete(0,END)
c5.delete(0,END)
c6.delete(0,END)
c7.delete(0,END)
c8.delete(0,END)
c9.delete(0,END)
c10.delete(0,END)
b_entry()
c0.insert(0,a)
c7.insert(0,"dd-mm-yyyy")

global g
g=0
cu=d1.cursor()
cu.execute("Select * from r_detail")
data=cu.fetchall()
for i in data:
if i[0]==int(c1.get()):
g=i[5]*int(c8.get())
break
p_entry()
l1=Label(pay,text=("Payment ID : %d"%
(u)),font=("Times",18)).place(x=10,y=10)
l2=Label(pay,text=("Price : %d"%(g)),font=("Times",18)).place(x=10,y=40)
r0=Radiobutton(pay,text="",variable=r,value="",font=("Times",18)).place(x=5,y
=70)
r1=Radiobutton(pay,text="Cash",variable=r,value="Cash",font=("Times",18))
r1.place(x=5,y=70)
r2=Radiobutton(pay,text="Credit",variable=r,value='Credit',font=("Times",18))
r2.place(x=5,y=100)
r3=Radiobutton(pay,text="Debit",variable=r,value="Debit",font=("Times",18))
r3.place(x=5,y=130)
r4=Radiobutton(pay,text="UPI",variable=r,value="UPI",font=("Times",18))
r4.place(x=5,y=160)
b1=Button(pay,width=20,text="PAY",font=("Times",18),bg="sea
green",command=lambda:c(r.get()))
b1.place(x=15,y=200)
pay.mainloop()

c0.insert(0,a)
c0.bind("<FocusIn>",d)
c0.bind("<FocusOut>",n)
b1=Button(rf2,text="RESERVE",font=("georgia",15,"bold"),bd=1,width=15,fg="black",
bg="gray40",activeforeground="black",activebackground="gray40",command=e
ntry)
b1.place(x=30,y=380)

b2=Button(rf2,text="UNRESERVE",font=("Georgia",15,"bold"),bd=1,width=15,fg="bla
ck",
bg="gray40",activeforeground="black",activebackground="gray40",command=u
nre)
b2.place(x=255,y=380)
img=ImageTk.PhotoImage(Image.open("image/refresh.png"))
'''rb=Button(rf2,image=img,bd=0,width=20,command=c_entry)
rb.image=img
rb.place(x=461,y=38)'''
#---room search----
def de(e):
r1.config(state="disable")
r2.config(state="disable")
r3.config(state="disable")
r4.config(state="disable")
def en(e):
r1.config(state="normal")
r2.config(state="normal")
r3.config(state="normal")
r4.config(state="normal")

rl=Label(rf3,text="ROOM
SEARCH",font=("Georgia",25,"bold"),fg="black",bg="gray60")
rl.place(x=60,y=10)
LabelFrame(rf3,width=315,height=6,bg='black',bd=10,relief=RIDGE).place(x=45,y=50
)
rl0=Label(rf3,text="AC\t:",font=("Times",13,"bold"),fg="black",bg="gray60")
rl0.place(x=10,y=75)
rl1=Label(rf3,text="WIFI\t:",font=("Times",13,"bold"),fg="black",bg="gray60")
rl1.place(x=10,y=105)
rl2=Label(rf3,text="BED\t:",font=("Times",13,"bold"),fg="black",bg="gray60")
rl2.place(x=10,y=135)
rl3=Label(rf3,text="TYPE\t:",font=("Times",13,"bold"),fg="black",bg="gray60")
rl3.place(x=10,y=165)
r1=ttk.Combobox(rf3,font=("Times",13,"bold"),values=["yes","no"],width=29)
r1.place(x=100,y=75)
r1.bind('<FocusOut>',de)
r1.bind('<FocusIn>',en)
r2=ttk.Combobox(rf3,font=("Times",13,"bold"),values=["yes","no"],width=29)
r2.place(x=100,y=105)
r2.bind('<FocusOut>',de)
r2.bind('<FocusIn>',en)
r3=ttk.Combobox(rf3,font=("Times",13,"bold"),values=["1","2","3","4"],width=29)
r3.place(x=100,y=135)
r3.bind('<FocusOut>',de)
r3.bind('<FocusIn>',en)
r4=ttk.Combobox(rf3,font=("Times",13,"bold"),values=["Single","Double","Couple"],wi
dth=29)
r4.place(x=100,y=165)
r4.bind('<FocusOut>',de)
r4.bind('<FocusIn>',en)
rb=Button(rf3,text='Find
Room',bd=2,font=("Georgia",13,"bold"),width=25,bg="gray80",
activebackground="gray80",command=search)
rb.place(x=60,y=200)

def payment():
des()
global f3
f3=Frame(root,width=1046,height=580)
f3.place(x=224,y=50)
c.set(3)
img1=ImageTk.PhotoImage(Image.open("image/payment.jpg"))
il=Label(f3,image=img1,bd=0)
il.image=img1
il.place(x=0,y=0)
def clean():
for w in fe.winfo_children():
w.destroy()
def pri():
clean()
op=["Payment Id : ","Booking Id : ","Room no. : ","Name : ","Email Id : ","Phone
no. : ","Gender : ","Address : ","Date of booking : ","Booking date : ","No. of days : ","Total
child : ","Total adult : ","Price : ","Payment method : "]
ii=7
if ty==True:
for i in range(15):
Label(fe,text=(op[i]
+str(xo[i])),font=("Times",13,"bold"),bg="gray80").place(x=10,y=ii)
ii+=25
else:
Label(fe,text=xo,font=("Times",13,"bold"),bg="gray80").place(x=10,y=7)

def p_search():
global xo,ty
ty=False
xo=""
d3=d1.cursor()
d3.execute("Select * from payment")
o=d3.fetchall()
for i in o:
if i[1]==int(q.get()):
xo=i
ty=True
break
else:
xo="No Payment Record!"
pri()
def transfer():
printing(q.get())
#----multi frames---
rf1=Frame(f3,width=600,height=40,bg="bisque3",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf1.place(x=134,y=10)
rf2=Frame(f3,width=767,height=490,bg="bisque3",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf2.place(x=134,y=75)
pl=Label(rf1,text="PAYMENT
INFORMATION",width=34,font=("Georgia",25,"bold"),fg="black",bg="bisque3")
pl.pack()
Label(rf2,text="Enter Booking ID :
",font=("Times",15,"bold"),fg="black",bg="bisque3").place(x=20,y=10)
q=Entry(rf2,width=28,font=("Times",15,"bold"),fg="black",bg="bisque2")
q.place(x=200,y=10)
Button(rf2,text="SEARCH",width=15,font=("Times",15,"bold"),fg="black",bg="bisque4"
,
activeforeground="black",activebackground="steel
blue1",command=p_search).place(x=520,y=5)
Button(rf2,text="Print Recipt",width=15,font=("georgia",10),fg="black",bg="green",
activeforeground="black",activebackground="green",command=transfer).place(x
=620,y=435)
fe=Frame(rf2,width=500,height=400,bd=7,relief=RIDGE,bg="gray80")
fe.place(x=105,y=60)

def ro_detail():
des()
global f4

f4=Frame(root,width=1046,height=580)
f4.place(x=225,y=50)
img1=ImageTk.PhotoImage(Image.open("image/room.png"))
il=Label(f4,image=img1,bd=0)
il.image=img1
il.place(x=0,y=0)
c.set(4)
#----multi frames---
rf2=Frame(f4,width=944,height=570,bg="lemon chiffon3",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf2.place(x=50,y=5)
pl=Label(rf2,text="ROOM DETAILS",font=("Georgia",25,"bold"),fg="black",bg="lemon
chiffon3")
pl.place(x=330,y=4)

query="select * from r_detail order by r_no"


cursor=d1.execute(query)
data=cursor.fetchall()

style=ttk.Style()
style.theme_use("clam")
style.configure("Treeview",font=("Times",14),background="gray90",fieldbackground="
gray90",foreground="black",rowheight=25)
style.configure("Heading",font=("georgia",15),foreground="black")
style.configure("TCombobox",fieldbackground="gray90",background="gray90",foregr
ound="black")

frame=Frame(rf2,width=990,height=210,relief=FLAT,bg="gray90")
frame.place(x=15,y=240)

scroll_v=Scrollbar(frame)
scroll_v.pack(side=RIGHT,fill=Y)
scroll_h=Scrollbar(frame,orient=HORIZONTAL)
scroll_h.pack(side=BOTTOM,fill=X)

m=ttk.Treeview(frame,columns=("Room
No.",'AC','Bed(s)',"Wifi","Type","Price/Day","Available"),
yscrollcommand=scroll_v.set,xscrollcommand=scroll_h.set)
m.pack(fill=BOTH)

scroll_v.config(command=m.yview)
scroll_v.pack(side=RIGHT,fill=Y)
scroll_h.config(command=m.xview)
scroll_h.pack(side=BOTTOM,fill=X)
#-------define columns---------
#-------column format----------
m.column("#0",width=0,stretch=NO,minwidth=0)
m.column("Room No.",anchor=CENTER,width=120,stretch=NO,minwidth=0)
m.column("AC",anchor=CENTER,width=100,stretch=NO,minwidth=0)
m.column("Bed(s)",anchor=CENTER,width=100,stretch=NO,minwidth=0)
m.column("Wifi",anchor=CENTER,width=100,stretch=NO,minwidth=0)
m.column("Type",anchor=CENTER,width=150,stretch=NO,minwidth=0)
m.column("Price/Day",anchor=CENTER,width=150,stretch=NO,minwidth=0)
m.column("Available",anchor=CENTER,width=145,stretch=NO,minwidth=0)

#--------Heading----------------
m.heading("#0",text='',anchor=W)
m.heading("Room No.",text="Room No.",anchor=CENTER)
m.heading("AC",text="AC",anchor=CENTER)
m.heading("Bed(s)",text="Bed(s)",anchor=CENTER)
m.heading("Wifi",text="Wifi",anchor=CENTER)
m.heading("Type",text="Type",anchor=CENTER)
m.heading("Price/Day",text="Price/Day",anchor=CENTER)
m.heading("Available",text="Available",anchor=CENTER)

#-------Insert data-----------
global count
count=0
r_list=[]
for i in data:
r_list.append(i[0])
m.insert(parent='',index='end',iid=count,text="Parent",values=(i))
count+=1

rnl=Label(rf2,text="Room No. :",font=("georgia",14),fg="black",bg="lemon chiffon3")


rnl.place(x=60,y=50)
rnl=Label(rf2,text="AC\t:",font=("georgia",14),fg="black",bg="lemon chiffon3")
rnl.place(x=60,y=76)
rnl=Label(rf2,text="BED(s)\t:",font=("georgia",14),fg="black",bg="lemon chiffon3")
rnl.place(x=60,y=100)
rnl=Label(rf2,text="WIFI\t:",font=("georgia",14),fg="black",bg="lemon chiffon3")
rnl.place(x=60,y=123)
rtl=Label(rf2,text="Type\t:",font=("georgia",14),fg="black",bg="lemon chiffon3")
rtl.place(x=60,y=147)
rpl=Label(rf2,text="Price\t:",font=("georgia",14),fg="black",bg="lemon chiffon3")
rpl.place(x=60,y=173)
ral=Label(rf2,text="Available\t:",font=("georgia",14),fg="black",bg="lemon chiffon3")
ral.place(x=60,y=197)

#---room----
def de(e):
rn.config(state="disable")
rac.config(state="disable")
rbd.config(state="disable")
rw.config(state="disable")
rt.config(state="disable")
rp.config(state="disable")
ra.config(state="disable")
def en(e):
rn.config(state="normal")
rac.config(state="normal")
rbd.config(state="normal")
rw.config(state="normal")
rt.config(state="normal")
rp.config(state="normal")
ra.config(state="normal")

l1=["yes","no"]
l2=[1,2,3,4]
l3=["Single","Double","Couple"]
l4=[2000,2500,3000,3500,4000,4500,5000,5500]
rn=ttk.Combobox(rf2,font=("georgia",13),width=20,values=r_list)
rn.place(x=210,y=54)
rn.bind('<FocusOut>',de)
rn.bind('<FocusIn>',en)
rac=ttk.Combobox(rf2,font=("georgia",13),width=20,values=l1)
rac.place(x=210,y=78)
rac.bind('<FocusOut>',de)
rac.bind('<FocusIn>',en)
rbd=ttk.Combobox(rf2,font=("georgia",13),width=20,values=l2)
rbd.place(x=210,y=103)
rbd.bind('<FocusOut>',de)
rbd.bind('<FocusIn>',en)
rw=ttk.Combobox(rf2,font=("georgia",13),width=20,values=l1)
rw.place(x=210,y=128)
rw.bind('<FocusOut>',de)
rw.bind('<FocusIn>',en)
rt=ttk.Combobox(rf2,font=("georgia",13),width=20,values=l3)
rt.place(x=210,y=153)
rt.bind('<FocusOut>',de)
rt.bind('<FocusIn>',en)
rp=ttk.Combobox(rf2,font=("georgia",13),width=20,values=l4)
rp.place(x=210,y=178)
rp.bind('<FocusOut>',de)
rp.bind('<FocusIn>',en)
ra=ttk.Combobox(rf2,font=("georgia",13),width=20,values=l1)
ra.place(x=210,y=203)
ra.bind('<FocusOut>',de)
ra.bind('<FocusIn>',en)

def execute():
r_list=[]
global count
x=rt.get()
x=x.capitalize()
if rn.get()=='' or rac.get()=='' or rbd.get()=='' or rw.get()=='' or rt.get()=='' or
ra.get()=='' or rp.get()=='':
messagebox.showerror("showerror","All field should be filled")
elif x=='Couple' and int(rbd.get())!=1:
messagebox.showerror("showerror","For Couple bed room there is not more
than 1 bed")
elif rac.get()in l1 or rbd.get()in l2 or rw.get()in l1 or x in l3 or ra.get()in l1 or
rp.get()in l4:
m.insert(parent='',index='end',iid=count,text="",values=(rn.get(),rac.get(),rbd.get(
),rw.get(),x,rp.get(),ra.get()))
query="Insert into r_detail values({},'{}','{}','{}','{}',
{},'{}')".format(rn.get(),rac.get(),rbd.get(),rw.get(),x,rp.get(),ra.get())
d1.execute(query)
d1.commit()
r_list.append(rn.get())
#---Delete---
rn.delete(0,END)
rac.delete(0,END)
rbd.delete(0,END)
rw.delete(0,END)
rt.delete(0,END)
rp.delete(0,END)
ra.delete(0,END)
else:
messagebox.showerror("showerror","Wrong field input")
count+=1

def update():
x=rt.get()
x=x.capitalize()
if rn.get()=='' or rac.get()=='' or rbd.get()=='' or rw.get()=='' or rt.get()=='' or
ra.get()=='' or rp.get()=='':
messagebox.showerror("showerror","All field should be filled")
elif x=='Couple' and rbd.get()!=1:
messagebox.showerror("showerror","For Couple bed room there is not more
than 1 bed")
elif rac.get()in l1 or rbd.get()in l2 or rw.get()in l1 or x in l3 or ra.get()in l1 or
rp.get()in l4:
select=m.focus()
m.item(select,text="",values=(rac.get(),rbd.get(),rw.get(),x,rp.get(),ra.get()))
query="UPDATE r_detail set
r_ac='{}',r_bed='{}',r_wifi='{}',r_type='{}',r_price={},r_available='{}' where
r_no={}".format(rac.get(),rbd.get(),rw.get(),x,rp.get(),ra.get(),rn.get())
d1.execute(query)
d1.commit()
#--Delete---
rn.delete(0,END)
rac.delete(0,END)
rbd.delete(0,END)
rw.delete(0,END)
rt.delete(0,END)
rp.delete(0,END)
ra.delete(0,END)
else:
messagebox.showerror("showerror","Wrong field input")
def delete():
r_list=[]
for record in m.get_children():
m.delete(record)
de="Delete from r_detail where r_no={}".format(rn.get())
d1.execute(de)
d1.commit()
query="select * from r_detail"
cursor=d1.execute(query)
data=cursor.fetchall()
c=0
for i in data:
m.insert(parent='',index='end',iid=c,text="",values=(i))
c+=1
r_list.append(i[0])
def search():
se=False
for record in m.get_children():
m.delete(record)
query="select * from r_detail"
cursor=d1.execute(query)
data=cursor.fetchall()
c=0
for i in data:
if rn.get()in i :
se=True
m.insert(parent='',index='end',iid=c,text="",values=(i))
c+=1
if se==False:
messagebox.showerror("showerror","No such room availsble")

def refresh():
ro_detail()
b1=Button(rf2,text="ADD",font=("Times",13),bd=2,width=20,fg="black",
bg="gray90",activeforeground="black",activebackground="gray90",command=e
xecute)
b1.place(x=500,y=70)
b2=Button(rf2,text="UPDATE",font=("Times",13),bd=2,width=20,fg="black",
bg="gray90",activeforeground="black",activebackground="gray90",command=u
pdate)
b2.place(x=500,y=118)
b3=Button(rf2,text="DELETE",font=("Times",13),bd=2,width=20,fg="black",
bg="gray90",activeforeground="black",activebackground="gray90",command=d
elete)
b3.place(x=500,y=166)
b4=Button(rf2,text="SEARCH",font=("Times",13),bd=2,width=20,fg="black",
bg="gray90",activeforeground="black",activebackground="gray90",command=s
earch)
b4.place(x=700,y=70)
b5=Button(rf2,text="REFRESH",font=("Times",13),bd=2,width=20,fg="black",
bg="gray90",activeforeground="black",activebackground="gray90",command=r
efresh)
b5.place(x=700,y=118)

def re_detail():
des()
global f5
f5=Frame(root,width=1046,height=580)
f5.place(x=225,y=50)
img1=ImageTk.PhotoImage(Image.open("image/re_detail.jpg"))
il=Label(f5,image=img1,bd=0)
il.image=img1
il.place(x=0,y=0)
c.set(5)
query="select * from booking"
cursor=d1.execute(query)
data=cursor.fetchall()
style=ttk.Style()
style.theme_use("clam")
style.configure("Treeview",font=("times",15),bg="gray80",rowheight=30)
style.configure("Heading",font=("times",15),foreground="Black")

def tree():
des()
re_detail()
def search():
for record in m.get_children():
m.delete(record)
query="select * from booking"
cursor=d1.execute(query)
data=cursor.fetchall()
c=0
for i in data:
if q.get()!="":
if int(q.get())==i[0] :
m.insert(parent='',index='end',iid=c,text="",values=(i))
c+=1
#----multi frames---
rf1=Frame(f5,width=600,height=40,bg="skyblue1",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf1.place(x=34,y=10)
rf2=Frame(f5,width=967,height=480,bg="skyblue1",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf2.place(x=34,y=75)
pl=Label(rf1,text="RESERVATION
DETAILS",width=43,font=("Georgia",25,"bold"),fg="black",bg="skyblue1")
pl.pack()
Label(rf2,text="Enter Booking Id :
",font=("Times",15,"bold"),fg="black",bg="skyblue1").place(x=20,y=10)
q=Entry(rf2,width=28,font=("Times",15,"bold"),fg="black",bg="skyblue3")
q.place(x=200,y=10)
bb=Button(rf2,text="SEARCH",width=15,font=("Times",15,"bold"),fg="black",bg="skyb
lue3",
activeforeground="black",activebackground="bisque4",command=search)
bb.place(x=520,y=5)
bb=Button(rf2,text="Reset",width=15,font=("Times",15,"bold"),fg="black",bg="skyblue
3",
activeforeground="black",activebackground="skyblue3",command=tree)
bb.place(x=740,y=5)
def search():
for record in m.get_children():
m.delete(record)
query="select * from g_detail"
cursor=d1.execute(query)
data=cursor.fetchall()
c=0
for i in data:
if q.get() in i:
m.insert(parent='',index='end',iid=c,text="",values=(i))
c+=1
#-----Tree view---

frame=Frame(rf2)
frame.place(x=30,y=80,width=900)

scroll_v=Scrollbar(frame)
scroll_v.pack(side=RIGHT,fill=Y)

scroll_h=Scrollbar(frame,orient=HORIZONTAL)
scroll_h.pack(side=BOTTOM,fill=X)

m=ttk.Treeview(frame,yscrollcommand=scroll_v.set,xscrollcommand=scroll_h.set)
m.pack(fill=BOTH)

scroll_v.config(command=m.yview)
scroll_h.config(command=m.xview)
#-------define columns---------
m['columns']=("Booking ID","Room No.","Name","Email Id",
"Phone No.","Gender","Address","Date of Booking",
"Booking Date","No. of Day(s)",
"No. of child(s)","No. of adult(s)",
"Price","Payment Method")
#-------column format----------
m.column("#0",width=0,stretch=NO,minwidth=0)
m.column("Booking ID",anchor=CENTER,width=100,minwidth=150)
m.column("Room No.",anchor=CENTER,width=100,minwidth=150)
m.column("Name",anchor=CENTER,width=200,minwidth=250)
m.column("Email Id",anchor=CENTER,width=200,minwidth=250)
m.column("Phone No.",anchor=CENTER,width=200,minwidth=220)
m.column("Gender",anchor=CENTER,width=150,minwidth=180)
m.column("Address",anchor=CENTER,width=200,minwidth=250)
m.column("Date of Booking",anchor=CENTER,width=150,minwidth=200)
m.column("Booking Date",anchor=CENTER,width=150,minwidth=200)
m.column("No. of Day(s)",anchor=CENTER,width=150,minwidth=200)
m.column("No. of child(s)",anchor=CENTER,width=300,minwidth=150)
m.column("No. of adult(s)",anchor=CENTER,width=200,minwidth=150)
m.column("Price",anchor=CENTER,width=150,minwidth=150)
m.column("Payment Method",anchor=CENTER,width=150,minwidth=250)

#--------Heding----------------
m.heading("#0",text='',anchor=W)
m.heading("Booking ID",text="Booking ID",anchor=CENTER)
m.heading("Room No.",text="Room No.",anchor=CENTER)
m.heading("Name",text="Name",anchor=CENTER)
m.heading("Email Id",text="Email Id",anchor=CENTER)
m.heading("Phone No.",text="Phone No.",anchor=CENTER)
m.heading("Gender",text="Gender",anchor=CENTER)
m.heading("Address",text="Address",anchor=CENTER)
m.heading("Date of Booking",text="Date of Booking",anchor=CENTER)
m.heading("Booking Date",text="Booking Date",anchor=CENTER)
m.heading("No. of Day(s)",text="No. of Day(s)",anchor=CENTER)
m.heading("No. of child(s)",text="No. of child(s)",anchor=CENTER)
m.heading("No. of adult(s)",text="No. of adult(s)",anchor=CENTER)
m.heading("Price",text="Price",anchor=CENTER)
m.heading("Payment Method",text="Payment Method",anchor=CENTER)

#-------Insert data-----------
global count
count=0
for i in data:
m.insert(parent='',index='end',iid=count,text="Parent",values=(i))
count+=1

def g_detail():
des()
global f6
f6=Frame(root,width=1046,height=580)
f6.place(x=225,y=50)
c.set(6)
img1=ImageTk.PhotoImage(Image.open("image/guest.png"))
il=Label(f6,image=img1,bd=0)
il.image=img1
il.place(x=0,y=0)

query="select * from g_detail"


cursor=d1.execute(query)
data=cursor.fetchall()
style=ttk.Style()
style.theme_use("clam")
style.configure("Treeview",font=("times",15),bg="gray80",rowheight=30)
style.configure("Heading",font=("times",15),foreground="Black")
def tree():
des()
g_detail()
def search():
for record in m.get_children():
m.delete(record)
query="select * from g_detail"
cursor=d1.execute(query)
data=cursor.fetchall()
c=0
for i in data:
if q.get() in i:
m.insert(parent='',index='end',iid=c,text="",values=(i))
c+=1

#----multi frames---
rf1=Frame(f6,width=600,height=40,bg="skyblue1",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf1.place(x=34,y=10)
rf2=Frame(f6,width=967,height=480,bg="skyblue1",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf2.place(x=34,y=75)
pl=Label(rf1,text="GUEST
DETAILS",width=43,font=("Georgia",25,"bold"),fg="black",bg="skyblue1")
pl.pack()
Label(rf2,text="Enter Booking Id :
",font=("Times",15,"bold"),fg="black",bg="skyblue1").place(x=20,y=10)
q=Entry(rf2,width=28,font=("Times",15,"bold"),fg="black",bg="skyblue3")
q.place(x=200,y=10)
bb=Button(rf2,text="SEARCH",width=15,font=("Times",15,"bold"),fg="black",bg="skyb
lue3",
activeforeground="black",activebackground="skyblue3",command=search)
bb.place(x=520,y=5)
bb=Button(rf2,text="Reset",width=15,font=("Times",15,"bold"),fg="black",bg="skyblue
3",
activeforeground="black",activebackground="skyblue3",command=tree)
bb.place(x=740,y=5)
#-----Tree view---

frame=Frame(rf2)
frame.place(x=30,y=80,width=900)

scroll_v=Scrollbar(frame)
scroll_v.pack(side=RIGHT,fill=Y)

scroll_h=Scrollbar(frame,orient=HORIZONTAL)
scroll_h.pack(side=BOTTOM,fill=X)

m=ttk.Treeview(frame,yscrollcommand=scroll_v.set,xscrollcommand=scroll_h.set)
m.pack(fill=BOTH)

scroll_v.config(command=m.yview)
scroll_h.config(command=m.xview)
#-------define columns---------
m['columns']=("Booking ID","Room No.","Name","Email Id",
"Phone No.","Varification ID","Gender",
"Address","No. of child(s)","No. of adult(s)","Name of children(s)","Name of
adult(s)",
"Checkin Date","Checkout Date")
#-------column format----------
m.column("#0",width=0,stretch=NO,minwidth=0)
m.column("Booking ID",anchor=CENTER,width=100,minwidth=150)
m.column("Room No.",anchor=CENTER,width=100,minwidth=150)
m.column("Name",anchor=CENTER,width=200,minwidth=250)
m.column("Email Id",anchor=CENTER,width=200,minwidth=250)
m.column("Phone No.",anchor=CENTER,width=200,minwidth=220)
m.column("Varification ID",anchor=CENTER,width=150,minwidth=200)
m.column("Gender",anchor=CENTER,width=150,minwidth=180)
m.column("Address",anchor=CENTER,width=200,minwidth=250)
m.column("No. of child(s)",anchor=CENTER,width=300,minwidth=150)
m.column("No. of adult(s)",anchor=CENTER,width=200,minwidth=150)
m.column("Name of children(s)",anchor=CENTER,width=200,minwidth=350)
m.column("Name of adult(s)",anchor=CENTER,width=300,minwidth=350)
m.column("Checkin Date",anchor=CENTER,width=150,minwidth=150)
m.column("Checkout Date",anchor=CENTER,width=150,minwidth=150)

#--------Heding----------------
m.heading("#0",text='',anchor=W)
m.heading("Booking ID",text="Booking ID",anchor=CENTER)
m.heading("Room No.",text="Room No.",anchor=CENTER)
m.heading("Name",text="Name",anchor=CENTER)
m.heading("Email Id",text="Email Id",anchor=CENTER)
m.heading("Phone No.",text="Phone No.",anchor=CENTER)
m.heading("Varification ID",text="Varification ID",anchor=CENTER)
m.heading("Gender",text="Gender",anchor=CENTER)
m.heading("Address",text="Address",anchor=CENTER)
m.heading("No. of child(s)",text="No. of child(s)",anchor=CENTER)
m.heading("No. of adult(s)",text="No. of adult(s)",anchor=CENTER)
m.heading("Name of children(s)",text="Name of children(s)",anchor=CENTER)
m.heading("Name of adult(s)",text="Name of adult(s)",anchor=CENTER)
m.heading("Checkin Date",text="Checkin Date",anchor=CENTER)
m.heading("Checkout Date",text="Checkout Date",anchor=CENTER)
#-------Insert data-----------
global count
count=0
for i in data:
m.insert(parent='',index='end',iid=count,text="Parent",values=(i))
count+=1

def c_in():
des()
global f7
f7=Frame(root,width=1046,height=580)
f7.place(x=225,y=50)
c.set(7)
img1=ImageTk.PhotoImage(Image.open("image/checkin.png"))
il=Label(f7,image=img1,bd=0)
il.image=img1
il.place(x=0,y=0)
style=ttk.Style()
style.theme_use("clam")
style.configure("TCombobox",bd=5,fieldbackground="gray90",background="gray90",f
oreground="black")
def auto():
oo=False
d2=d1.cursor()
d2.execute("Select * from booking")
data=d2.fetchall()
for i in data:
if int(c0.get())==i[0]:
oo=True
c1.delete(0,END)
c2.delete(0,END)
c3.delete(0,END)
c4.delete(0,END)
c6.delete(0,END)
c7.delete(0,END)
c1.insert(0,i[1])
c2.insert(0,i[2])
c3.insert(0,i[3])
c4.insert(0,i[4])
c6.insert(0,i[5])
c7.insert(0,i[6])
if oo==False:
messagebox.showerror("showerror","Invalid bookin id or\nPlease Book room
first!")
c1.delete(0,END)
c2.delete(0,END)
c3.delete(0,END)
c4.delete(0,END)
c5.delete(0,END)
c6.delete(0,END)
c7.delete(0,END)
c8.delete(0,END)
c9.delete(0,END)
c10.delete(0,END)
c11.delete(0,END)
c12.delete(0,END)
c12.insert(0,"dd/mm/yyyy")

def check():
if c0.get()=="" or c1.get()=="" or c2.get()=="" or c3.get()=="" or c4.get()=="" or
c5.get()=="" or c6.get()=="" or c7.get()=="" or c8.get()=="" or c9.get()=="" or c10.get()=="" or
c11.get()=="" or c12.get()=="":
messagebox.showerror("showerror","All fields are required!")
else:
today = date.today()
y = today.year
m = today.month
d = today.day
wox=f"{d}/{m}/{y}"
cuu=False
qq="Select * from booking"
d2=d1.execute(qq)
da=d2.fetchall()
for cc in da:
if int(c0.get())==cc[0]:
cuu=True
i=cc
break
if cuu==False:
messagebox.showerror("showerror","Invalid Booking Id\nPlease Book room
first!")
else:
if c10.get().isalpha() or c10.get().isspace() or c11.get().isalpha() or
c11.get().isspace():
if c1.get()!=str(i[1]):
messagebox.showerror("showerror","Please enter correct Room no.\
nWhich you have entered during booking!")
elif c2.get()!=i[2]:
messagebox.showerror("showerror","Please enter correct Name\nWhich
you have entered during booking!")
elif c3.get()!=i[3]:
messagebox.showerror("showerror","Please enter correct Email Id\
nWhich you have entered during booking!")
elif c4.get()!=str(i[4]):
messagebox.showerror("showerror","Please enter correct Phone no.\
nWhich you have entered during booking!")
elif c5.get().isalpha()or c5.get() in "~`!@#$%^&*()_ +={}[]:;''<.>,?/\|" or
len(c5.get())>12:
messagebox.showerror("showerror","Invalid Varificatio Id\nPlease enter
correct Verification Id")
elif len(c5.get())!=12:
messagebox.showerror("showerror","Invalid Varificatio Id\nPlease enter
correct Verification Id")
elif c6.get()!=i[5]:
messagebox.showerror("showerror","Please enter correct Gender\
nWhich you have entered during booking!")
elif c7.get()!=i[6]:
messagebox.showerror("showerror","Please enter correct Address\
nWhich you have entered during booking!")
elif c12.get()!=wox:
messagebox.showerror("showerror","Please enter current date")
else:
q="Insert into g_detail values({},{},'{}','{}',{},'{}','{}','{}',{},
{},'{}','{}','{}','{}')".format(c0.get(),
c1.get(),c2.ge
t(),
c3.get(),c4.ge
t(),
c5.get(),c6.ge
t(),
c7.get(),c8.ge
t(),
c9.get(),c10.g
et().title(),
c11.get().title(),
c12.get(),"None")
d1.execute(q)
d1.commit()
d1.execute("Update r_detail set r_available = '{}' where r_no =
{}".format("no",c1.get()))
d1.commit()
messagebox.showinfo("showinfo","Check In succesfull!")
c0.delete(0,END)
c1.delete(0,END)
c2.delete(0,END)
c3.delete(0,END)
c4.delete(0,END)
c5.delete(0,END)
c6.delete(0,END)
c7.delete(0,END)
c8.delete(0,END)
c9.delete(0,END)
c10.delete(0,END)
c11.delete(0,END)
c12.delete(0,END)
c12.insert(0,wox)
else:
messagebox.showerror("showerror","Invalid child(s)/adult(s) entry!")

def g():
global wox
today = date.today()
y = today.year
m = today.month
d = today.day
wox=f"{d}/{m}/{y}"

#----multi frames---
rf1=Frame(f7,width=600,height=40,bg="light steel blue",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf1.place(x=214,y=5)
rf2=Frame(f7,width=591,height=500,bg="light steel blue",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf2.place(x=214,y=70)
pl=Label(rf1,text="CHECK
IN",width=26,font=("Georgia",25,"bold"),fg="black",bg="light steel blue")
pl.pack()

def disable(*argu):
c6.configure(state="disabled")
def dee1(*argu):
c12.configure(state="disabled")
def enable(*argu):
c6.configure(state="normal")
c12.configure(state="normal")
#---Labels----
l0=Label(rf2,text="Booking ID :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l0.place(x=35,y=15)
l1=Label(rf2,text="Room No. :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l1.place(x=35,y=45)
l2=Label(rf2,text="Name :",font=("Times",13,"bold"),fg="black",bg="light steel blue")
l2.place(x=35,y=75)
l3=Label(rf2,text="Email ID :",font=("Times",13,"bold"),fg="black",bg="light steel blue")
l3.place(x=35,y=105)
l4=Label(rf2,text="Phone No. :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l4.place(x=35,y=135)
l5=Label(rf2,text="Verification Id :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l5.place(x=35,y=165)
l6=Label(rf2,text="Gender :",font=("Times",13,"bold"),fg="black",bg="light steel blue")
l6.place(x=35,y=195)
l7=Label(rf2,text="Address :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l7.place(x=35,y=225)
l8=Label(rf2,text="Total Children :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l8.place(x=35,y=255)
l9=Label(rf2,text="Total Adult :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l9.place(x=35,y=285)
l10=Label(rf2,text="Child(s) Name :",font=("Times",13,"bold"),fg="black",bg="light
steel blue")
l10.place(x=35,y=315)
l11=Label(rf2,text="Adult(s) Name :",font=("Times",13,"bold"),fg="black",bg="light
steel blue")
l11.place(x=35,y=345)
l12=Label(rf2,text="Checkin Date :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l12.place(x=35,y=375)

c0=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c0.place(x=235,y=15)
c0.bind('<FocusIn>',enable)

c1=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c1.place(x=235,y=45)
c1.bind('<FocusIn>',enable)

c2=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c2.place(x=235,y=75)
c2.bind('<FocusIn>',enable)

c3=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c3.place(x=235,y=105)
c3.bind('<FocusIn>',enable)

c4=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c4.place(x=235,y=135)
c4.bind('<FocusIn>',enable)

c5=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c5.place(x=235,y=165)
c5.bind('<FocusIn>',enable)

c6=ttk.Combobox(rf2,font=("Times",13,"bold"),values=["male","female","others"],width
=29)
c6.place(x=235,y=195)
c6.bind('<FocusOut>',disable)
c6.bind('<FocusIn>',enable)

c7=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c7.place(x=235,y=225)
c7.bind('<FocusIn>',enable)

c8=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c8.place(x=235,y=255)
c8.bind('<FocusIn>',enable)

c9=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c9.place(x=235,y=285)
c9.bind('<FocusIn>',enable)

c10=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c10.place(x=235,y=315)
c10.bind('<FocusIn>',enable)

c11=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c11.place(x=235,y=345)
c11.bind('<FocusIn>',enable)

c12=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c12.place(x=235,y=375)
g()
c12.insert(0,wox)
c12.bind('<FocusIn>',dee1)
c12.bind('<FocusOut>',enable)

bb1=Button(rf2,text="AUTO
FILL",width=20,font=("Times",15),fg="black",bg="gray70",
activeforeground="black",activebackground="gray70",command=auto)
bb1.place(x=50,y=420)
bb2=Button(rf2,text="CHECKIN",width=20,font=("Times",15),fg="black",bg="gray70",
activeforeground="black",activebackground="gray70",command=check)
bb2.place(x=300,y=420)

def c_out():
des()
global f8
f8=Frame(root,width=1046,height=580)
f8.place(x=225,y=50)
c.set(8)
img1=ImageTk.PhotoImage(Image.open("image/checkout.jpg"))
il=Label(f8,image=img1,bd=0)
il.image=img1
il.place(x=0,y=0)
style=ttk.Style()
style.theme_use("clam")
style.configure("TCombobox",bd=5,fieldbackground="gray90",background="gray90",f
oreground="black")

#----multi frames---
rf1=Frame(f8,width=600,height=40,bg="light steel blue",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf1.place(x=214,y=5)
rf2=Frame(f8,width=591,height=500,bg="light steel blue",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf2.place(x=214,y=70)
pl=Label(rf1,text="CHECK
OUT",width=26,font=("Georgia",25,"bold"),fg="black",bg="light steel blue")
pl.pack()

def auto():
oo=False
d2=d1.cursor()
d2.execute("Select * from g_detail")
data=d2.fetchall()
for i in data:
if int(c0.get())==i[0]:
oo=True
c1.delete(0,END)
c2.delete(0,END)
c3.delete(0,END)
c4.delete(0,END)
c5.delete(0,END)
c6.delete(0,END)
c7.delete(0,END)
c8.delete(0,END)
c9.delete(0,END)
c10.delete(0,END)
c11.delete(0,END)
#--insert--
c1.insert(0,i[1])
c2.insert(0,i[2])
c3.insert(0,i[3])
c4.insert(0,i[4])
c5.insert(0,i[5])
c6.insert(0,i[6])
c7.insert(0,i[7])
c8.insert(0,i[8])
c9.insert(0,i[9])
c10.insert(0,i[10])
c11.insert(0,i[11])
if oo==False:
messagebox.showerror("showerror","Invalid booking id or\nNo Guest with
booking id %d had checked in!"%(int(c0.get())))
c1.delete(0,END)
c2.delete(0,END)
c3.delete(0,END)
c4.delete(0,END)
c5.delete(0,END)
c6.delete(0,END)
c7.delete(0,END)
c8.delete(0,END)
c9.delete(0,END)
c10.delete(0,END)
c11.delete(0,END)
def check():
if c0.get()=="" or c1.get()=="" or c2.get()=="" or c3.get()=="" or c4.get()=="" or
c5.get()=="" or c6.get()=="" or c7.get()=="" or c8.get()=="" or c9.get()=="" or c10.get()=="" or
c11.get()=="" or c12.get()=="":
messagebox.showerror("showerror","All fields are required!")
else:
today = date.today()
y = today.year
m = today.month
d = today.day
wox=f"{d}/{m}/{y}"
cuu=False
qq="Select * from g_detail"
d2=d1.execute(qq)
da=d2.fetchall()
for i in da:
if int(c0.get())==i[0]:
cuu=True
cc=i
break
if cuu==False:
messagebox.showerror("showerror","Invalid Booking Id\nNo Guest with
booking id %d had checked in!"%(int(c0.get())))
else:
if c1.get()!=str(i[1]):
messagebox.showerror("showerror","Please enter correct Room no.\
nWhich you have entered during booking and checkin!")
elif c2.get()!=i[2]:
messagebox.showerror("showerror","Please enter correct Name\nWhich
you have entered during booking and checkin!")
elif c3.get()!=i[3]:
messagebox.showerror("showerror","Please enter correct Email Id\nWhich
you have entered during booking and checkin!")
elif c4.get()!=str(i[4]):
messagebox.showerror("showerror","Please enter correct Phone no.\
nWhich you have entered during booking and checkin!")
elif c5.get().isalpha()or c5.get() in "~`!@#$%^&*()_ +={}[]:;''<.>,?/\|" or
len(c5.get())!=12:
messagebox.showerror("showerror","Invalid Varificatio Id\nPlease enter
correct Verification Id")
elif c6.get()!=i[6]:
messagebox.showerror("showerror","Please enter correct Gender\nWhich
you have entered during booking and checkin!")
elif c7.get()!=i[7]:
messagebox.showerror("showerror","Please enter correct Address\nWhich
you have entered during booking and checkin!")
elif int(c8.get())!=i[8]:
messagebox.showerror("showerror","Please enter correct No. of child(s)\
nWhich you have entered during booking and checkin!")
elif int(c9.get())!=i[9]:
messagebox.showerror("showerror","Please enter correct No. of adult(s)\
nWhich you have entered during booking and checkin!")
elif c10.get()!=i[10]:
messagebox.showerror("showerror","Please enter correct Name of child(s)\
nWhich you have entered during booking and checkin!")
elif c11.get()!=i[11]:
messagebox.showerror("showerror","Please enter correct Name of adult(s)\
nWhich you have entered during booking and checkin!")
elif c12.get()!=wox:
messagebox.showerror("showerror","Please enter current date")
else:
q="Update g_detail set checkout='{}' where
b_id={}".format(c12.get(),c0.get())
d1.execute(q)
d1.commit()
d1.execute("Update r_detail set r_available = '{}' where r_no =
{}".format("yes",c1.get()))
d1.commit()
messagebox.showinfo("showinfo","Check Out succesfull!")
c0.delete(0,END)
c1.delete(0,END)
c2.delete(0,END)
c3.delete(0,END)
c4.delete(0,END)
c5.delete(0,END)
c6.delete(0,END)
c7.delete(0,END)
c8.delete(0,END)
c9.delete(0,END)
c10.delete(0,END)
c11.delete(0,END)
c12.delete(0,END)
c12.insert(0,wox)
def disable(*argu):
c6.configure(state="disable")
def enable(*argu):
c6.configure(state="normal")
c12.configure(state="normal")
def dee1(*argu):
c12.configure(state="disable")
def g():
global wox
today = date.today()
y = today.year
m = today.month
d = today.day
wox=f"{d}/{m}/{y}"
#---Labels----
l0=Label(rf2,text="Booking ID :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l0.place(x=35,y=15)
l1=Label(rf2,text="Room No. :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l1.place(x=35,y=45)
l2=Label(rf2,text="Name :",font=("Times",13,"bold"),fg="black",bg="light steel blue")
l2.place(x=35,y=75)
l3=Label(rf2,text="Email ID :",font=("Times",13,"bold"),fg="black",bg="light steel blue")
l3.place(x=35,y=105)
l4=Label(rf2,text="Phone No. :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l4.place(x=35,y=135)
l5=Label(rf2,text="Verification Id :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l5.place(x=35,y=165)
l6=Label(rf2,text="Gender :",font=("Times",13,"bold"),fg="black",bg="light steel blue")
l6.place(x=35,y=195)
l7=Label(rf2,text="Address :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l7.place(x=35,y=225)
l8=Label(rf2,text="Total Children :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l8.place(x=35,y=255)
l9=Label(rf2,text="Total Adult :",font=("Times",13,"bold"),fg="black",bg="light steel
blue")
l9.place(x=35,y=285)
l10=Label(rf2,text="Child(s) Name :",font=("Times",13,"bold"),fg="black",bg="light
steel blue")
l10.place(x=35,y=315)
l11=Label(rf2,text="Adult(s) Name :",font=("Times",13,"bold"),fg="black",bg="light
steel blue")
l11.place(x=35,y=345)
l12=Label(rf2,text="Checkout Date :",font=("Times",13,"bold"),fg="black",bg="light
steel blue")
l12.place(x=35,y=375)

c0=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c0.place(x=235,y=15)
c0.bind('<FocusIn>',enable)

c1=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c1.place(x=235,y=45)
c1.bind('<FocusIn>',enable)

c2=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c2.place(x=235,y=75)
c2.bind('<FocusIn>',enable)

c3=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c3.place(x=235,y=105)
c3.bind('<FocusIn>',enable)

c4=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c4.place(x=235,y=135)
c4.bind('<FocusIn>',enable)

c5=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c5.place(x=235,y=165)
c5.bind('<FocusIn>',enable)
c6=ttk.Combobox(rf2,font=("Times",13,"bold"),values=["male","female","others"],width
=29)
c6.place(x=235,y=195)
c6.bind('<FocusOut>',disable)
c6.bind('<FocusIn>',enable)

c7=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c7.place(x=235,y=225)
c7.bind('<FocusIn>',enable)

c8=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c8.place(x=235,y=255)
c8.bind('<FocusIn>',enable)

c9=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c9.place(x=235,y=285)
c9.bind('<FocusIn>',enable)

c10=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c10.place(x=235,y=315)
c10.bind('<FocusIn>',enable)

c11=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c11.place(x=235,y=345)
c11.bind('<FocusIn>',enable)

c12=Entry(rf2,font=("Times",13,"bold"),bd=1,bg="gray85",width=31)
c12.place(x=235,y=375)
g()
c12.insert(0,wox)
c12.bind('<FocusIn>',dee1)
c12.bind('<FocusOut>',enable)

bb1=Button(rf2,text="AUTO
FILL",width=20,font=("Times",15),fg="black",bg="gray70",
activeforeground="black",activebackground="gray70",command=auto)
bb1.place(x=50,y=420)
bb2=Button(rf2,text="CHECKOUT",width=20,font=("Times",15),fg="black",bg="gray70
",
activeforeground="black",activebackground="gray70",command=check)
bb2.place(x=300,y=420)

def sorting():
des()
global f9
f9=Frame(root,width=1046,height=580)
f9.place(x=225,y=50)
c.set(9)
img1=ImageTk.PhotoImage(Image.open("image/main_interface.png"))
il=Label(f9,image=img1,bd=0)
il.image=img1
il.place(x=0,y=0)
query="select * from g_detail"
cursor=d1.execute(query)
data=cursor.fetchall()
style=ttk.Style()
style.theme_use("clam")
style.configure("Treeview",font=("times",15),bg="gray80",rowheight=30)
style.configure("Heading",font=("times",15),foreground="Black")
style.configure("TCombobox",fieldbackground="gray90",background="gray90",foregr
ound="black")

def sort(v,k):
lk=""
lj=""
if v=="Booking ID":
lk="b_id"
if v=="Room No.":
lk="r_no"
if v=="Name":
lk="c_name"
if v=="Email Id":
lk="c_id"
if v=="Phone No.":
lk="c_phone"
if v=="Varification ID":
lk="c_vid"
if v=="Gender":
lk="c_gender"
if v=="Address":
lk="c_address"
if v=="No. of child(s)":
lk="t_child"
if v=="No. of adult(s)":
lk="t_adult"
if v=="Checkin Date":
lk="checkin"
if v=="Checkout Date":
lk="checkout"
if k.upper()=="ASCEDING":
lj="ASC"
if k.upper()=="DESCENDING":
lj="DESC"
for record in m.get_children():
m.delete(record)
query="select * from g_detail order by {} {}".format(lk,lj)
cursor=d1.execute(query)
data=cursor.fetchall()
c=0
for i in data:
m.insert(parent='',index='end',iid=c,text="",values=(i))
c+=1

ll=["Booking ID","Room No.","Name","Email Id",


"Phone No.","Varification ID","Gender",
"Address","No. of child(s)","No. of adult(s)",
"Checkin Date","Checkout Date"]
#----multi frames---
rf1=Frame(f9,width=600,height=40,bg="bisque3",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf1.place(x=34,y=10)
rf2=Frame(f9,width=967,height=480,bg="bisque3",bd=7,relief=RIDGE)
#highlightbackground="black",highlightthickness=3)
rf2.place(x=34,y=75)
pl=Label(rf1,text="GUEST
DETAILS",width=43,font=("Georgia",25,"bold"),fg="black",bg="bisque3")
pl.pack()
Label(rf2,text="Sorting By :
",font=("Times",15,"bold"),fg="black",bg="bisque3").place(x=40,y=10)
Label(rf2,text="Sorting In :
",font=("Times",15,"bold"),fg="black",bg="bisque3").place(x=40,y=40)

def desable(*argu):
q1.configure(state="disabled")
q2.configure(state="disabled")
def enable(*argu):
q1.configure(state="normal")
q2.configure(state="normal")
q1=ttk.Combobox(rf2,font=("georgia",15),width=22,values=ll)
q1.place(x=190,y=10)
q1.bind('<FocusOut>',desable)
q1.bind('<FocusIn>',enable)
q2=ttk.Combobox(rf2,font=("georgia",15),width=22,values=["Ascending","Descending
"])
q2.place(x=190,y=40)
q2.insert(0,"Ascending")
q2.bind('<FocusOut>',desable)
q2.bind('<FocusIn>',enable)
bb=Button(rf2,text="SORT",width=15,font=("Times",15,"bold"),fg="black",bg="bisque4
",
activeforeground="black",activebackground="bisque4",command=lambda:sort(q1
.get(),q2.get()))
bb.place(x=520,y=15)

#-----Tree view---

frame=Frame(rf2)
frame.place(x=30,y=100,width=900)

scroll_v=Scrollbar(frame)
scroll_v.pack(side=RIGHT,fill=Y)

scroll_h=Scrollbar(frame,orient=HORIZONTAL)
scroll_h.pack(side=BOTTOM,fill=X)

m=ttk.Treeview(frame,yscrollcommand=scroll_v.set,xscrollcommand=scroll_h.set)
m.pack(fill=BOTH)
scroll_v.config(command=m.yview)
scroll_h.config(command=m.xview)
#-------define columns---------
m['columns']=("Booking ID","Room No.","Name","Email Id",
"Phone No.","Varification ID","Gender",
"Address","No. of child(s)","No. of adult(s)","Name of children(s)","Name of
adult(s)",
"Checkin Date","Checkout Date")
#-------column format----------
m.column("#0",width=0,stretch=NO,minwidth=0)
m.column("Booking ID",anchor=CENTER,width=100,minwidth=150)
m.column("Room No.",anchor=CENTER,width=100,minwidth=150)
m.column("Name",anchor=CENTER,width=200,minwidth=250)
m.column("Email Id",anchor=CENTER,width=200,minwidth=250)
m.column("Phone No.",anchor=CENTER,width=200,minwidth=220)
m.column("Varification ID",anchor=CENTER,width=150,minwidth=200)
m.column("Gender",anchor=CENTER,width=150,minwidth=180)
m.column("Address",anchor=CENTER,width=200,minwidth=250)
m.column("No. of child(s)",anchor=CENTER,width=300,minwidth=150)
m.column("No. of adult(s)",anchor=CENTER,width=200,minwidth=150)
m.column("Name of children(s)",anchor=CENTER,width=200,minwidth=350)
m.column("Name of adult(s)",anchor=CENTER,width=300,minwidth=350)
m.column("Checkin Date",anchor=CENTER,width=150,minwidth=150)
m.column("Checkout Date",anchor=CENTER,width=150,minwidth=150)

#--------Heding----------------
m.heading("#0",text='',anchor=W)
m.heading("Booking ID",text="Booking ID",anchor=CENTER)
m.heading("Room No.",text="Room No.",anchor=CENTER)
m.heading("Name",text="Name",anchor=CENTER)
m.heading("Email Id",text="Email Id",anchor=CENTER)
m.heading("Phone No.",text="Phone No.",anchor=CENTER)
m.heading("Varification ID",text="Varification ID",anchor=CENTER)
m.heading("Gender",text="Gender",anchor=CENTER)
m.heading("Address",text="Address",anchor=CENTER)
m.heading("No. of child(s)",text="No. of child(s)",anchor=CENTER)
m.heading("No. of adult(s)",text="No. of adult(s)",anchor=CENTER)
m.heading("Name of children(s)",text="Name of children(s)",anchor=CENTER)
m.heading("Name of adult(s)",text="Name of adult(s)",anchor=CENTER)
m.heading("Checkin Date",text="Checkin Date",anchor=CENTER)
m.heading("Checkout Date",text="Checkout Date",anchor=CENTER)

#-------Insert data-----------
global count
count=0
for i in data:
m.insert(parent='',index='end',iid=count,text="Parent",values=(i))
count+=1

fr1=Frame(root,width=1270,height=50,bg="gray70",
highlightbackground="black",
highlightthickness=3)
fr1.pack()
l=Label(fr1,text="H O T E L M A N A G E M E N T S Y S T E M",
font=("Georgia",22,"bold"),fg="black",bg="gray70")
l.place(x=350,y=2)
from time import strftime
def my_time():
t=strftime('%H:%M:%S %p\n%x')
l.config(text=t)
l.after(1000,my_time)

l=Label(fr1,font=("times",12,"bold"),bg="gray70")
l.place(x=1,y=0)
my_time()

fr=Frame(root,width=226,height=582,bg="gray70",
highlightbackground="black",
highlightthickness=3)
fr.place(x=0,y=48)

b0=Button(fr,text="HOME",
font=("Georgia",11,"bold"),fg="white",
activeforeground="white",bg="black",
activebackground="black",bd=0,height=2,width=21,command=home)
b0.place(x=2,y=10)

b1=Button(fr,text="RESERVATION",
font=("Georgia",11,"bold"),fg="white",
activeforeground="white",bg="black",
activebackground="black",bd=0,height=2,width=21,command=reservation)
b1.place(x=2,y=70)

b2=Button(fr,text="PAYMENT INFO",font=("Georgia",11,"bold"),
fg="white",activeforeground="white",bg="black",
activebackground="black",bd=0,height=2,width=21,command=payment)
b2.place(x=2,y=130)

b3=Button(fr,text="ROOM DETAILS",font=("Georgia",11,"bold"),
fg="white",activeforeground="white",bg="black",
activebackground="black",bd=0,height=2,width=21,command=ro_detail)
b3.place(x=2,y=190)

b4=Button(fr,text="RESERVATION DETAILS",font=("Georgia",11,"bold"),
fg="white",activeforeground="white",bg="black",
activebackground="black",bd=0,height=2,width=21,command=re_detail)
b4.place(x=2,y=250)

b5=Button(fr,text="GUEST DETAILS",font=("Georgia",11,"bold"),
fg="white",activeforeground="white",bg="black",
activebackground="black",bd=0,height=2,width=21,command=g_detail)
b5.place(x=2,y=310)

b6=Button(fr1,text="☰",font=("Georgia",13,"bold"),
fg="white",activeforeground="white",bg="black",
activebackground="black",bd=0,height=2,width=5,command=menu)
b6.place(x=1200,y=0)

b7=Button(fr,text="CHECK IN",font=("Georgia",11,"bold"),
fg="white",activeforeground="white",bg="black",
activebackground="black",bd=0,height=2,width=21,command=c_in)
b7.place(x=2,y=370)

b8=Button(fr,text="CHECK OUT",font=("Georgia",11,"bold"),
fg="white",activeforeground="white",bg="black",
activebackground="black",bd=0,height=2,width=21,command=c_out)
b8.place(x=2,y=430)
b9=Button(fr,text="SORTING",font=("Georgia",11,"bold"),
fg="white",activeforeground="white",bg="black",
activebackground="black",bd=0,height=2,width=21,command=sorting)
b9.place(x=2,y=490)
if lu.upper()=="CUSTOMER":
b3.config(state="disable")
b4.config(state="disable")
b5.config(state="disable")
b7.config(state="disable")
b8.config(state="disable")
b9.config(state="disable")

home()
c.set(0)

la=Label(fr,text="Made by : Cs grp.9 2023-24",font=("Times",12),bg="gray70")


la.place(x=20,y=545)
root.mainloop()
b_entry()
main()
#forget password page
def forget():
def des1():
forget_window.destroy()
login()
def forcheck():
if e1.get()=='' or e2.get()=='' or e3.get()=='' or e4.get()=='' or e5.get()=='':
messagebox.showerror("showerror","All fields are required.....")
elif "@" and "." not in e2.get():
messagebox.showerror("showerror","Invalid Mail Id.....")
elif e4.get()==e3.get():
s="UPDATE c_register SET c_password='{}' WHERE c_user='{}' and c_email='{}' and
c_id='{}'".format(e4.get(),e1.get(),e2.get(),e5.get())
d1.execute(s)
d1.commit()
messagebox.showinfo("showinfo","Update successfull.....")
des1()
else:
messagebox.showerror("showerror","Wrong Password.....")

def hide():
e4.config(show=('*'))
openeye.config(file="eye_close.png")
eyeButton.config(command=show)

def show():
openeye.config(file="eye_open.png")
e4.config(show=(''))
eyeButton.config(command=hide)

login_window.destroy()
global forget_window
forget_window=Tk()
forget_window.title("FORGET PASSWORD")
forget_window.configure(bg="white")
forget_window.geometry('1040x540+50+50')
img=ImageTk.PhotoImage(Image.open('image/forget.png'))
img_label=Label(forget_window,image=img,bd=0)
img_label.image=img
img_label.place(x=0,y=0)
img1=ImageTk.PhotoImage(Image.open("image/button.png"))
img_button=Button(forget_window,image=img1,bg="white",bd=0,activebackground="White
",command=des1)
img_button.image=img1
img_button.place(x=5,y=10)
forget_window.resizable(0,0)
style=ttk.Style()
style.theme_use("clam")
style.configure("TCombobox",fieldbackground="gray90",background="gray90",foreground
="firebrick4")

l=Label(forget_window,text="Forgot
Password",font=('Times',30),bd=0,bg='white',fg='firebrick4')
l.place(x=580,y=30)
LabelFrame(forget_window,width=340,height=4,bg='firebrick4').place(x=550,y=75)

l1=Label(forget_window,text="Username\t:
",font=('Times',18),bd=0,bg='white',fg='firebrick4')
l1.place(x=490,y=130)

e1=Entry(forget_window,font=('Times',16),width=28,bd=1,bg='gray90',fg='firebrick4')
e1.place(x=700,y=130)
e1.focus()

e2=Entry(forget_window,font=('Times',16),width=28,bd=1,bg='gray90',fg='firebrick4')
e2.place(x=700,y=190)

l2=Label(forget_window,text="Email\t\t: ",font=('Times',18),bd=0,bg='white',fg='firebrick4')
l2.place(x=490,y=190)
l3=Label(forget_window,text="Password\t\t:
",font=('Times',18),bd=0,bg='white',fg='firebrick4')
l3.place(x=490,y=250)

e3=Entry(forget_window,font=('Times',16),width=28,bd=1,bg='gray90',fg='firebrick4')
e3.place(x=700,y=250)

l4=Label(forget_window,text="Confirm Password\t:
",font=('Times',18),bd=0,bg='white',fg='firebrick4')
l4.place(x=490,y=315)

e4=Entry(forget_window,font=('Times',16),width=25,bd=1,bg='gray90',fg='firebrick4')
e4.place(x=700,y=315)

openeye=PhotoImage(file="eye_close.png")
eyeButton=Button(forget_window,image=openeye,bd=0,bg="white",activebackground="wh
ite",
cursor='hand2',command=show)
eyeButton.place(x=977,y=314)

hide()

l5=Label(forget_window,text="Identity\t\t:
",font=('Times',18),bd=0,bg='white',fg='firebrick4')
l5.place(x=490,y=380)

e5=ttk.Combobox(forget_window,font=("Times",16),values=["admin","customer"],width=26
)
e5.place(x=700,y=380)

b1=Button(forget_window,text='Reset',bd=0,bg='red2',fg='white',width=19,
font=('Times',20),cursor='hand2',
activeforeground='white',activebackground='red2',command=forcheck)
b1.place(x=575,y=450)

forget_window.mainloop()

#sign up page
def signup():
def des2():
signup_window.destroy()
login()
def regicheck():
l=["admin","customer"]
f=False
if e1.get()=='' or e2.get()=='' or e3.get()=='' or e4.get()=='' or e5.get()=='':
messagebox.showerror("showerror","All fields are required.....")
for i in range(len(e1.get())):
if e1.get()[i].isalpha() or e1.get()[i].isspace():
f=True
else:
f=False
break
if f==False:
messagebox.showerror("showerror","Invalid name input!")
elif e5.get().lower() not in l:
messagebox.showerror("showerror","Invalid identity.....")
else:
d2=d1.cursor()
d2.execute("SELECT * FROM c_register")
data=d2.fetchall()
if '@'and'.' in e2.get():
t=True
for i in data:
t=True
if e3.get() in i:
t=False
if t==True:
today = datetime.today()
query="Insert into c_register
values('{}','{}','{}','{}','{}','{}')".format(e1.get(),e2.get(),e3.get(),e4.get(),e5.get(),today)
d1.execute(query)
messagebox.showinfo("showinfo","Sign Up successfull.....")
d1.commit()
des2()
else:
messagebox.showerror("showerror","Username alread exist!")
else:
messagebox.showerror("showerror","Invalid mail format!")
def hide():
e4.config(show=('*'))
openeye.config(file="eye_close.png")
eyeButton.config(command=show)

def show():
openeye.config(file="eye_open.png")
e4.config(show=(''))
eyeButton.config(command=hide)

login_window.destroy()
global signup_window
signup_window=Tk()
signup_window.title("SIGN UP")
signup_window.geometry('1020x480+50+50')
signup_window.configure(bg="white")
img=ImageTk.PhotoImage(Image.open("image/signup.png"))
img_label=Label(signup_window,image=img,bd=0)
img_label.image=img
img_label.place(x=0,y=80)
signup_window.resizable(0,0)
style=ttk.Style()
style.theme_use("clam")
style.configure("TCombobox",fieldbackground="gray90",background="gray90",foreground
="firebrick4")

l=Label(signup_window,text='Register',bd=0,bg='white',fg='firebrick4',font=('Times',40))
l.place(x=620,y=30)
LabelFrame(signup_window,width=200,height=4,bg='firebrick4').place(x=618,y=90)

l1=Label(signup_window,text="Fullname :
",font=('Times',18),bd=0,bg='white',fg='firebrick4')
l1.place(x=490,y=120)
l2=Label(signup_window,text="Email :
",font=('Times',18),bd=0,bg='white',fg='firebrick4')
l2.place(x=490,y=160)
l3=Label(signup_window,text="Username :
",font=('Times',18),bd=0,bg='white',fg='firebrick4')
l3.place(x=490,y=200)
l4=Label(signup_window,text="Password :
",font=('Times',18),bd=0,bg='white',fg='firebrick4')
l4.place(x=490,y=240)
l5=Label(signup_window,text="Identity :
",font=('Times',18),bd=0,bg='white',fg='firebrick4')
l5.place(x=490,y=280)
e1=Entry(signup_window,font=('Times',16),width=28,bd=1,bg='gray90',fg='firebrick4')
e1.place(x=630,y=120)
e1.focus()

e2=Entry(signup_window,font=('Times',16),width=28,bd=1,bg='gray90',fg='firebrick4')
e2.place(x=630,y=160)

e3=Entry(signup_window,font=('Times',16),width=28,bd=1,bg='gray90',fg='firebrick4')
e3.place(x=630,y=200)

e4=Entry(signup_window,font=('Times',16),width=25,bd=1,bg='gray90',fg='firebrick4')
e4.place(x=630,y=240)

openeye=PhotoImage(file="eye_close.png")
eyeButton=Button(signup_window,image=openeye,bd=0,bg="white",activebackground="w
hite",
cursor='hand2',command=show)
eyeButton.place(x=908,y=239)

hide()

e5.place(x=630,y=280)

b1=Button(signup_window,text='Register',bd=0,bg='firebrick4',fg='white',
width=20,font=('Times',24),cursor='hand2',activeforeground='white',
activebackground='firebrick4',command=regicheck)
b1.place(x=535,y=340)
l1=Label(signup_window,text="Already have an account ?
",bg='white',fg='VioletRed',font=('Times',15))
l1.place(x=565,y=406)

b3=Button(signup_window,text='Login',bd=0,bg='white',fg='red2',font=('Times',15),
activeforeground='red2',activebackground='white',cursor='hand2',command=des2)
b3.place(x=780,y=405)

signup_window.mainloop()

#login page
def login():
def sett():
global pz
d2=d1.cursor()
d2.execute("Select * from c_register")
data=d2.fetchall()
for i in data:
if ep.get()in i:
pz=i
def logcheck():
m=False
d2=d1.cursor()
query="select * from c_register"
d2.execute(query)
data=d2.fetchall()
for i in data:
if ep.get()=='' or e2.get()=='' or e3.get()=='':
messagebox.showerror("showerror","All fields are required.....")
elif ep.get() in i and e2.get() in i and e3.get() in i:
yu=i
if e3.get()=="admin":
m=True
ro=Toplevel()
ro.title("Admin Password")
ro.geometry("450x150+60+60")
ro.config(bg="gray70")
def eh():
e.config(show=('*'))
eye.config(file="eye_close.png")
eyeb.config(command=es)

def es():
eye.config(file="eye_open.png")
e.config(show=(''))
eyeb.config(command=eh)
def admin_check():
while True:
if e.get()=="admin123":
messagebox.showinfo("showinfo","Login successfull.....")
m=True
login_window.destroy()
mainframe(yu[0],yu[1],yu[4])
break
else:
messagebox.showerror("showerror","Wrong Admin Password")
break
e=Entry(ro,width=17,font=('Times',16),bd=3)
e.place(x=180,y=10)
e.focus()
el=Label(ro,text="Admin Password :",font=('Times',16),bg="gray70")
el.place(x=10,y=10)
eb=Button(ro,text="Enter",width=17,bd=2,font=('Times',16),command=admin_ch
eck)
eb.place(x=90,y=70)
eye=PhotoImage(file="eye_close.png")
eyeb=Button(ro,image=eye,bd=0,bg="white",activebackground="white",
cursor='hand2',command=es)
eyeb.place(x=380,y=12)
eh()
ro.mainloop

elif e3.get()=="customer":
messagebox.showinfo("showinfo","Login successfull.....")
m=True
login_window.destroy()
mainframe(yu[0],yu[1],yu[4])
break
if m==False:
messagebox.showerror("showerror","Wrong Username or Password or Identity")

def hide():
e2.config(show=('*'))
openeye.config(file="eye_close.png")
eyeButton.config(command=show)

def show():
openeye.config(file="eye_open.png")
e2.config(show=(''))
eyeButton.config(command=hide)
global login_window
login_window=Tk()
login_window.title("LOGIN")
login_window.configure(bg="white")
login_window.geometry('1040x560+50+50')
imgx=ImageTk.PhotoImage(Image.open("image/login.png"))
img_label=Label(image=imgx,bd=0)
img_label.image=imgx
img_label.place(x=10,y=10)
login_window.resizable(0,0)
style=ttk.Style()
style.theme_use("clam")
style.configure("TCombobox",fieldbackground="gray90",background="gray90",foreground
="firebrick4")

l=Label(login_window,text="Login",font=('Times',40),bd=0,bg='white',fg='firebrick4')
l.place(x=650,y=30)
LabelFrame(login_window,width=200,height=4,bg='firebrick4').place(x=618,y=90)

l1=Label(login_window,text="Username :
",font=('Times',18),bd=0,bg='white',fg='firebrick4')
l1.place(x=490,y=145)

ep=Entry(login_window,font=('Times',16),width=28,bd=1,bg='gray90',fg='firebrick4')
ep.place(x=630,y=145)
ep.focus()
e2=Entry(login_window,font=('Times',16),width=25,bd=1,bg='gray90',fg='firebrick4')
e2.place(x=630,y=210)

l2=Label(login_window,text="Password :
",font=('Times',18),bd=0,bg='white',fg='firebrick4')
l2.place(x=490,y=210)

openeye=PhotoImage(file="eye_close.png")
eyeButton=Button(login_window,image=openeye,bd=0,bg="white",activebackground
="white",
cursor='hand2',command=show)
eyeButton.place(x=907,y=209)

hide()

l3=Label(login_window,text="Identity :
",font=('Times',18),bd=0,bg='white',fg='firebrick4')
l3.place(x=490,y=275)

e3=ttk.Combobox(login_window,font=("Times",16),values=["admin","customer"],width=26)
e3.place(x=630,y=270)

b1=Button(login_window,text='Login',cursor='hand2',bd=0,bg='firebrick4',
fg='white',font=('Times',24),width=20,activeforeground='white',
activebackground='firebrick4',command=logcheck)
b1.place(x=534,y=350)

b2=Button(login_window,text='Forgot password ?',bd=0,bg='white',fg='red2',


font=('Times',13),activeforeground='red2',activebackground='white',
cursor='hand2',command=forget)
b2.place(x=800,y=300)
l4=Label(login_window,text="Don't have account ?
",bg='white',fg='VioletRed',font=('Times',15))
l4.place(x=555,y=455)

l5=Label(login_window,text="-"*60,bg='white',fg='VioletRed',font=('Times',15))
l5.place(x=500,y=430)

b3=Button(login_window,text='Create account',bd=0,bg='white',
fg='red2',font=('Times',15),
activeforeground='red2',activebackground='white',
cursor='hand2',command=signup)
b3.place(x=725,y=453)

login_window.mainloop()
login()
OUTPUTS
# LOGIN PAGE

#REGISTER PAGE
#FORGOT PASSWORD

#ADMIN PASSWORD
#LOGIN SUCCESS

#HOME PAGE
#PROFILE PAGE

#CONTACT INFO
#RESERVATION PAGE

#PAYMENT METHOD
#UNRESERVE PAGE

#RESERVION SUCCESSFUL
#PRINT RECIEPT

#PAYMENT INFORMATION
#RESERVATION DETAILS

#CHECK IN
#CHECKOUT

#CHECKOUT SUCCESSFUL
#LOGOUT PAGE

CONCLUSION
This projecton Hotel Management Systemhelpedusto knowand learn
about various libraries in python with their working and how they are
appliedinto making various application/programs,etc.Wealso learned
about the python connectivity and tkinter.Further it cleared our
concepts and logic ofpython programming language . This project
helped us to understand and developthe knowledge of programming
which will help us greatlyin future.It hasalso enhanced our debugging
skills. This project is very helpful for us an helpin high universities
as it can manage the data and takeinstructionsfrom the user very
easily.
BIBLIOGRAPHY
 Google.com
 Youtube.com
 Python.org

You might also like