CONTENTS
[Link] Topics page
1 Introduction 1
2 Hardware and Software Required 2
3 About hotel 3
4 Python Codes 10
5 My sql Database 23
6 Output 27
7 References 32
INTRODUCTION
The Hotel Management System (HMS) is a comprehensive
software solution designed to streamline and optimize the
operations of hotels and hospitality establishments. This
integrated system combines various modules to efficiently
manage different aspects of hotel functions, from
reservation and guest services to billing and inventory
management.
The reservation module of the HMS enables seamless
booking processes, allowing guests to make reservations
online or through the front desk. It maintains a centralized
database ofroom availability, ensuring accurateand up-to-
date information. The system also facilitates quick check-
ins and check-outs, enhancing the overall guestexperience.
Efficient guest services are a hallmark of the HMS, which
includes features such as room service management,
housekeeping, and personalized guest preferences. This
ensures a high level of customer satisfaction and loyalty.
Additionally, the system automates routine tasks, freeingup
stafftofocusonprovidingexceptionalservice.
HARDWARE AND
SOFTWAREREQUIRED
HARDWARE
1. PC
2. MOBILE PHONE
SOFTWARE
1. PYTHON (latestversion)
2. MYSQL
3. PYTHON-MYSQLCONNECTOR
HOTEL
A hotel is a commercial establishment that provides lodging,
accommodation,andotherservicestotravelersortourists.
Hotelstypicallyofferarangeofroomsorsuiteswithvarying levels of
amenities andservices. Theseestablishments canvary widely insize
andstyle,from small boutique hotels to large luxury resorts.
Keyfeaturesofhotelsinclude:
1. Accommodation:Hotelsprovideroomsorsuitesforgueststostayo
vernightorforanextendedperiod.
2. Services:In addition to lodging, hotels often offer various
services such as room service, housekeeping, concierge, and
facilities like restaurants, gyms, swimming pools, conference
rooms, and more.
3. Classification:Hotelsareoftenclassifiedbasedonfactors like their
size, amenities, and overall quality. Common
classificationsincludebudget/economyhotels,mid-rangehotels,
and luxury hotels.
4. Booking:Guests typically make reservations to secure their
accommodations in advance. This can be done through various
means, including online booking platforms, travel agencies, or
directly with the hotel.
5. HospitalityIndustry:Hotelsareanintegralpartofthe hospitality
industry, which encompasses businesses that provideservices
totravelersandcustomers seekingleisure and comfort.
Overall, hotels play a crucial role in the travel and tourismindustry,
offering a temporary home away from home for
individualsandgroupsseekingaccommodationduringtheirtravel
Financial management is another key component,
encompassing billing, invoicing, and reporting. The HMS
generates detailed financial reports, helping hotel owners
and managers make informed decisions to maximize
profitability. It also integrates with point-of-sale systems,
managing various revenue streams such as restaurants,
bars, and spa services.
Inventory management is crucial for maintaining optimal
stock levels in areas like housekeeping supplies and food
and beverage items. The HMS tracks inventory, automates
reordering processes, and minimizes wastage, contributing
to cost efficiency.
Security features, including user access controls and data
encryption, safeguard sensitive information and ensure
compliance with privacy regulations. The system also aids
in marketing efforts through guest relationship
management (CRM) tools, allowing hotels to personalize
promotions and loyalty programs.
In conclusion, the Hotel Management System is an
indispensable tool for modern hotels, enhancing
operational efficiency, improving guest satisfaction, and
ultimately contributing to the success of hospitality
businesses.
Key features of a Hotel Management System typically
include:
1. Reservation Management: Allows the hotel staff to
efficiently handle room bookings, cancellations,
and modifications. It helps in managing room
availability, rates, and guest preferences.
2. Front DeskOperations:Enablesthefront deskstaff to
check-in/check-out guests, generate room keys, and
manage guest information. It may also include
features like guest folio creation and invoice
generation.
3. Billing and Invoicing: Handles the financialaspects
of guest stays, including room charges, additional
services, and taxes. It generates invoices and
receipts for guest.
[Link]:Tracksandmanages hotel
inventory, including housekeeping supplies ,linens,
and other materials. This helps in maintaining
optimal stock levels and preventing shortages.
5. Housekeeping Management: Streamlines
housekeeping tasks such as room cleaning
schedules, maintenance requests, and inventory
restocking. It ensures rooms are preparedefficiently
for incoming guests.
[Link] and Analytics: Provides detailed reports
and analytics on various aspects of hoteloperations,
allowing management to makeinformed decisions.
Reports may cover occupancy rates, revenue, and
guest demographics.
7. PointofSale(POS):Managesthehotel'svarious
Revenue-generatingoutletssuchasrestaurants,
bars,spa, andother services. It helpsin tracking
sales, inventory, and generating bills.
[Link] Relationship Management (CRM): Helps in
building and maintaining relationships with guests
by managing guest profiles, preferences, and
[Link] topersonalized servicesand
improved guest satisfaction.
[Link]:Ensuresthesecurityof
guestdataandpropertybyimplementingaccesscontrol
[Link] features like
key card access and surveillance.
10. ChannelManagement:Managesthedistributionof
room inventory across various online booking
channels to optimize occupancy rates and maximize
revenue.
11. Implementing a Hotel Management
Systemnotonly enhances operational efficiency but
also contributes to a better overall guest experience.
The system can be tailored to meet the specific
needs of different types and sizes of hospitality
establishments, including hotels, resorts, motels,
and bed-and-breakfasts.
PYTHON
CODES
[Link]
fromtabulateimporttabulate
import random
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
#alldetailsforadmin
#toshowemployeedetails
def emp_details():
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
q="select*fromemployees"[Link]
ecute(q)
r=[Link]()
columns=[i[0]fori [Link]]
print(tabulate(r,headers=columns,tablefmt="fancy_grid"))
#toshowcustomerdetails
Defcustomdet():
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
x="select*frombooking"
[Link](x)
r=[Link]()
columns=[i[0][Link]]
print(tabulate(r,headers=columns,tablefmt="fancy_grid"))
[Link]()
#toshowroomdetails(allrooms,vacantrooms,bookedrooms)
def room_details():
whileTrue:
print("**********ROOMDETAILS**********")
print("[Link] Rooms")print("[Link]")
print("[Link]")
print("FOREXITENTERANYNO.: ")
ch=int(input("Enteryourchoice:"))if
ch==1:
show_rooms()
elif ch==2:
room_vacant()
elif ch==3:
rooms_booked()
else:
print("INVALIDINPUT")
break
#toshowallrooms
defshowrooms():
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
[Link]("selectroom_type,prices,count(*)fromroomsgroupbyroom_type,prices;") r =
[Link]()
columns=[i[0][Link]]
print(tabulate(r,headers=columns,tablefmt="fancy_grid"))
#toshowroomvacant
defroom_vacant():
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
av="Available"
z="select*fromroomswhereStatus='{}'".format(av)[Link](z)
r=[Link]()
columns=[i[0][Link]]
print(tabulate(r,headers=columns,tablefmt="fancy_grid"))
#toshowbookedroomsdef
rooms_booked():
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
bk="Booked"x="select*fromroomswhereStatus='{}'".for
mat(bk) [Link](x)
r=[Link]()
columns=[i[0][Link]]
print(tabulate(r,headers=columns,tablefmt="fancy_grid"))
#toshowrestaurantdetailsdef
restaurant_details():
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
z="select*fromorders"y
.execute(z)
r=[Link]()
columns=[i[0][Link]]
print(tabulate(r,headers=columns,tablefmt="fancy_grid"))
#toshowallfeedback
def fedback():
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
x="select*fromfdback"
[Link](x)
x=[Link]()
columns=[i[0][Link]]
print(tabulate(x,headers=columns,tablefmt="fancy_grid"))
#restaurant
defrestaurant():
#VIEWMENU
defmenu():
a=[Link](host="localhost",user="root",password="admin",database="hotel_su
nset")
y=[Link]()
b="select*frommenu".format()
[Link](b)
menu=[Link]()
columns=[i[0][Link]]
print(tabulate(menu,headers=columns,tablefmt="fancy_grid"))if
len(menu)>0:
print("Available")
[Link]()
yn=int(input("Dououwanttoorderanitem?type(1foryes/2forbacktomainpage):"))ifyn
==1:
b_order()
elifyn==2:
print("THANKYOU")
print("YOUHAVEBEENREDIRECTEDTOMAINPAGE")
customer_slot()
#BOOKINGORDER
def b_order():
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
Id=int(input("ENTER DISH NO.: "))
Quantity=int(input("ENTERQUANTITY:"))
Name=input("ENTER YOUR NAME: ")
Mobile_No=int(input("Entermobilrno."))
Address=input("Enter Address:")
f=("select*frommenuwhereDish_ID={}").format(Id)
[Link](f)
x=[Link]()
itn=x[0][1]
ip=x[0][3]
tp=ip*Quantity
ins="insert into orders(ID,Name,Quantity,Item_Price,Total_Price,Mobile_No,Adress)values({},'{}',{},{},{},
{},'{}')".format(Id, itn,Quantity,ip,tp,Mobile_No,Address)
[Link](ins)
print("THANKS FOR THE ORDER","\n\n","YOUR ORDER HAS BEEN ORDERED
SUCCESSFULLY","\n\n")
print("YOUHAVEBEENREDIRECTEDTOTHEMAINPAGE")
[Link]()
#VIEWORDER
def vorders():
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
m=int(input("Enteryournumber:"))
n="select*fromorderswhereMobile_No={}".format(m)
print("\n","YOUR RECENT ORDERS","\n")
[Link](n)
o=[Link]()
columns=[i[0][Link]]
print(tabulate(o,headers=columns,tablefmt="fancy_grid"))
for i in o:
p="select*frommenu,orderswhereMobile_No={}andmenu.Dish_ID=[Link]".format(m)
[Link](p)
q=[Link]()
[Link]()
#cancelorder
defcorder():
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
x=int(input("enteryournumber:"))
s="deletefrom orders where Mobile_No={}".format(x)
[Link](s) print("\n\
n","YOURORDERHASBEENCANCELLED")
print("YOUHAVEBEENREDIRECTEDTOTHEMAINPAGE","\n\n")
[Link]()
#feedback
deffdback():
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
fdn=input("Enter your name:")
print("Writesomethingaboutus...")
fdi=input()
x="insertintofdbackvalues('{}','{}')".format(fdn,fdi)
[Link](x)
print("\n\n")
print("THANKYOUFORYOURFEEDBACK")
print("\n")
print("YOUHAVEBEENREDIRECTEDTOTHEMAINPAGE")
[Link]()
#welcome
defstart1():
while True:
print("\n")
print("[Link]
MENU")print("[Link]
DERS") print("3. CANCEL
ORDER")print("4.
FEEDBACK")
print("[Link]")
ch1=int(input("enteryourchoice:"))if
ch1==1:
menu()
elifch1==2:
vorders()e
lif ch1==3:
corder()
elifch1==4:
fdback()
elifch1==5:
break
else:
print("\n","INVALIDCHOICE","\n","TRYAGAIN.","\n")
start1()
#bookingroomssection
#Createthetableifnot exists
create_table = "CREATE TABLE IF NOT EXISTS booking (Booking_ID int(10) PRIMARY
KEY,Room_Type varchar(20) not null,Guest_Name VARCHAR(255),Phone_number varchar(15) not null,
Room_Number int(5) not null, Check_In_Date DATE, Check_Out_Date DATE)"
[Link](create_table)
def booking_id():
[Link](10000,99999)
#to book room
defbook_room(guest_name,ph_no,ro_no,check_in_date,check_out_date,td1,pr):
try:
a=[Link](host="localhost",user="root",password="admin",
database="hotel_sunset")
y=[Link]()
b_id=booking_id()
#Fetchavailablerooms
c="SELECT*FROMroomsWHEREStatus='Available'androom_no={}".format(ro_no) [Link](c)
d=[Link]()
ifnotd:
print("Noavailablerooms.")
return None
e=d[0]
#Updateroomstatusto'booked'
update_query="UPDATEroomsSETStatus='Booked'WHEREroom_no={}".format(ro_no)
[Link](update_query)
#Insertbookingrecord
ins = "INSERT INTO booking (Booking_ID, Room_Type, Guest_Name, Phone_number,
Room_Number, Check_In_Date, Check_Out_Date, Total_Days, Price)VALUES ({},'{}', '{}',{},{}, '{}','{}',
{},'{}')".format(b_id,e[1],guest_name,ph_no,ro_no,check_in_date,check_out_date,td1,pr) [Link](ins)
print("Roombookedsuccessfully!RoomNumber:",ro_no)
returnb_id
except:
print("Error")
finally:
[Link]()
#to book delux room
defbook_delux_room():
a=[Link](host="localhost",user="root",password="admin",
database="hotel_sunset")
y=[Link]()
try:
z=[Link](101,111)
ro_no = z
g_name = input("Enter guest name: ")
ph_no=input("Enteryourphonenumber:")
in_date=input("Entercheck-indate(YYYY-MM-DD):")
out_date=input("Entercheck-outdate(YYYY-MM-DD):")
total_days_query="SELECTDATEDIFF('{}','{}')".format(out_date,in_date)
[Link](total_days_query)
td1=[Link]()[0]
pr = 15000 * td1
booking_id=book_room(g_name,ph_no,ro_no,in_date,out_date,td1,pr)#
Display booking history for the specific Booking_ID
ifbooking_idisnotNone:
q="SELECT*FROMbookingWHEREBooking_ID={}".format(booking_id)
[Link](q)
print("\nBookingHistoryforBooking_ID{}:".format(booking_id)) x
= [Link]()
columns=[i[0][Link]]
print(tabulate(x,headers=columns,tablefmt="fancy_grid")) except
:
print("Error")
#to book double room
defbook_double_room():
a=[Link](host="localhost",user="root",password="admin",
database="hotel_sunset")
y=[Link]()
try:
z=[Link](201,211)
ro_no = z
g_name = input("Enter guest name: ")
ph_no=input("Enteryourphonenumber:")
in_date=input("Entercheck-indate(YYYY-MM-DD):")
out_date=input("Entercheck-outdate(YYYY-MM-DD):")
total_days_query="SELECTDATEDIFF('{}','{}')".format(out_date,in_date)
[Link](total_days_query)
td1=[Link]()[0]
pr = 25000 * td1
booking_id=book_room(g_name,ph_no,ro_no,in_date,out_date,td1,pr)#
Display booking history for the specific Booking_ID
ifbooking_idisnotNone:
q="SELECT*FROMbookingWHEREBooking_ID={}".format(booking_id)
[Link](q)
print("\nBookingHistoryforBooking_ID{}:".format(booking_id)) x
= [Link]()
columns=[i[0][Link]]
print(tabulate(x,headers=columns,tablefmt="fancy_grid"))
except:
print("Error")
#to book king
roomdefbook_king_ro
om():
a = [Link](host="localhost", user="root", password="admin",
database="hotel_sunset")
y=[Link]()
try:
z=[Link](301,311)
ro_no = z
g_name = input("Enter guest name: ")
ph_no=input("Enteryourphonenumber:")
in_date=input("Entercheck-indate(YYYY-MM-DD):")
out_date=input("Entercheck-outdate(YYYY-MM-DD):")
total_days_query="SELECTDATEDIFF('{}','{}')".format(out_date,in_date)
[Link](total_days_query)
td1=[Link]()[0]
pr = 40000 * td1
booking_id=book_room(g_name,ph_no,ro_no,in_date,out_date,td1,pr)
#DisplaybookinghistoryforthespecificBooking_IDif
booking_id is not None:
q="SELECT*FROMbookingWHEREBooking_ID={}".format(booking_id)
[Link](q)
print("\nBookingHistoryforBooking_ID{}:".format(booking_id)) x
= [Link]()
columns=[i[0][Link]]
print(tabulate(x,headers=columns,tablefmt="fancy_grid"))
except:
print("Error")
#to book balcony rooms
defbook_balcony_room():
a=[Link](host="localhost",user="root",password="admin",
database="hotel_sunset")
y =[Link]()
try:
z=[Link](401,411)
ro_no = z
g_name = input("Enter guest name: ")
ph_no=input("Enteryourphonenumber:")
in_date=input("Entercheck-indate(YYYY-MM-DD):")
out_date=input("Entercheck-outdate(YYYY-MM-DD):")
total_days_query="SELECTDATEDIFF('{}','{}')".format(out_date,in_date)
[Link](total_days_query)
td1=[Link]()[0]
pr = 45000 * td1
booking_id=book_room(g_name,ph_no,ro_no,in_date,out_date,td1,pr)#
DisplaybookinghistoryforthespecificBooking_ID
ifbooking_idisnot None:
q="SELECT*FROMbookingWHEREBooking_ID={}".format(booking_id)
[Link](q)
print("\nBookingHistoryforBooking_ID{}:".format(booking_id)) x
= [Link]()
columns=[i[0][Link]]
print(tabulate(x,headers=columns,tablefmt="fancy_grid"))
except:
print("Error")
#tobookcavanaroom
def book_cavana():
a = [Link](host="localhost", user="root", password="admin",
database="hotel_sunset")
y=[Link]()
try:
z=[Link](501,506)
ro_no = z
g_name = input("Enter guest name: ")
ph_no=input("Enteryourphonenumber:")
in_date=input("Entercheck-indate(YYYY-MM-DD):")
out_date=input("Entercheck-outdate(YYYY-MM-DD):")
total_days_query="SELECTDATEDIFF('{}','{}')".format(out_date,in_date)
[Link](total_days_query)
td1=[Link]()[0]
pr = 90000 * td1
booking_id=book_room(g_name,ph_no,ro_no,in_date,out_date,td1,pr)#
Display booking history for the specific Booking_ID
ifbooking_idisnotNone:
q="SELECT*FROMbookingWHERE
Booking_ID={}".format(booking_id)
[Link](q)
print("\nBookingHistoryforBooking_ID{}:".format(booking_id)) x
= [Link]()
columns=[i[0][Link]]
print(tabulate(x,headers=columns,tablefmt="fancy_grid"))
except:
print("Error")
#user choice
defbookings():
try:
a = [Link](host="localhost", user="root", password="admin",
database="hotel_sunset")
y=[Link]()
z="select*frombook_rooms"[Link]
e(z)
x=[Link]()
columns=[i[0][Link]]
print(tabulate(x,headers=columns,tablefmt="fancy_grid"))
roomchoice = int(input("Enter Your Option : "))
ifroomchoice==1:
book_delux_room()
elifroomchoice==2:
book_double_room()
elif roomchoice == 3:
book_king_room()
elifroomchoice==4:
book_balcony_room()
elif roomchoice == 5:
book_cavana()
else:
print("Sorry,MayBeYouAreGivingMeWrongInput,PleaseTryAgain!!!")except:
print("Error")
finally:
[Link]()
[Link]()
#gamingsection
def gaming():
print("[Link]------->15000Rs./HR")
print("[Link]------>10000Rs./HR")
print("[Link]------>25000Rs./HR")
print("[Link]-------->40000Rs./HR")
print("[Link]------->35000Rs./HR")
print("[Link]-------->50000Rs./HR")
print("[Link]")
game=int(input("Enter What Game YouWant To Play : "))
hour=int(input("EnterNoOfHoursYouWantToPlay:")) if
game==1:
print("YOUHAVESELECTEDTOPLAY:TableTennis")
gamingbill = hour * 15000
price=print("Totalprice=",gamingbill,"Rs.") elif
game==2:
print("YOUHAVESELECTEDTOPLAY:Bowling")
gamingbill=hour* 10000
price=print("Totalprice=",gamingbill,"Rs.")
elifgame==3:
print("YOUHAVESELECTEDTOPLAY:Snooker")
gamingbill=hour* 25000
price=print("Totalprice=",gamingbill,"Rs.")elif
game==4:
print("YOUHAVESELECTEDTOPLAY:VRWorldGaming")gamingbill=
hour * 40000
price=print("Totalprice=",gamingbill,"Rs.")elif
game==5:
print("YOUHAVESELECTEDTOPLAY:VideoGames")
gamingbill = hour * 35000
price=print("Totalprice=",gamingbill,"Rs.") elif
game ==6:
print("YOUHAVESELECTEDTOPLAY:SwimmingPoolGames")
gamingbill = hour *50000
price=print("Totalprice=",gamingbill,"Rs.")
else:
print("Sorry,MayBeYouAreGivingMeWrongInput,PleaseTryAgain!!!")
#feedbacktobeaskedbyuserdef
feedback():
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
fdn=input("Enter your name:")
print("Writesomethingaboutus...")
fdi=input()
x="insertintofdbackvalues('{}','{}')".format(fdn,fdi)
[Link](x)
print("\n\n")
print("THANKYOUFORYOURFEEDBACK")
print("\n")
print("YOUHAVEBEENREDIRECTEDTOTHEMAINPAGE")
[Link]()
#foradmin
defadmin_slot():
while True:
print("*********WELCOMEADMIN*********")
print("[Link] Details")
print("[Link] Details")
print("[Link] Details")
print("[Link]")
print("[Link] Details")
print("[Link]")
a=int(input("enteryourchoice"))
if a==1:
emp_details()
elif a==2:
customdet()
elif a==3:
room_details()
elifa==4:
fedback()
elif a==5:
restaurant_details()
elif a==6:
break
else:
print("\n\n","INVALIDCHOICE","\n","TRYAGAIN")
#forcustomer
defcustomer_slot():
while True:
print("*************NAMASTE*************")
print("[Link]")
print("[Link]")
print("[Link]")
print("[Link]")
print("[Link]")
a=int(input("enteryourchoice"))if
a==1:
restaurant()
elif a==2:
bookings()
elif a==3:
gaming()
elif a==4:
feedback()
elif a==5:
break
else:
print("\n\n","INVALIDCHOICE")
#firstinterface
while True:
print("*********WELCOMETOHOTELSUNSET*********")
print("[Link]")
print("[Link]")
print("[Link]")
a=int(input("whoareyou"))
if a==1:
defadmin_login(a,username,password):
a=[Link](host="localhost",user="root",password="admin",database="hotel_sunset")
y=[Link]()
try:
#Checkiftheprovidedusernameandpasswordmatchanadminrecord
query="SELECT*FROMusersWHEREusername=%sANDpassword=
%s"[Link](query, (username, password))
admin_result=[Link]()
if admin_result:
print("[Link],Admin!")
else:
print("[Link].")
exceptExceptionase:
print(f"Error:{e}")
[Link]()
admin_username=input("EnterAdminUsername:")
admin_password=input("EnterAdminPassword:")
admin_login(a, admin_username, admin_password)
admin_slot()
elif a==2:
customer_slot()
elifa==3:
break
MYSQL
DATABASE
Alltablesused:-
Describingalltables:-
1. Booking:
2. Employees:
3. Feedback:
4. Menu:
5. Orders:
6. Rooms:
7. Room Details
8. Users:
OUTPUTS
Firstinterfacewithadminlogin:
Customerlogin:
From restaurant view menu
:
Orderan item:
Vieworder:
Canceling anorder:
Feedbackofrestaurant:
Bookaroom:
Gaming:
Feedbackforhotel:
Viewingemployeedetails:
Viewingcustomerdetails:
Viewingroomdetails:
Showingvacantrooms:
Showingbookedrooms:
Viewingfeedbacksfrombothhotelandrestaurant:
Viewingrestaurantdetails:
REFERENCES
Class12 CS PreetiArorabook
Class11 CS preetiArorabook
My sql
Python IDLE