CS Project 2024 25
CS Project 2024 25
2024-2025
Topic: hotel management system
Submitted by;
PAVITHRAN.M
Kavin.P
Mukesh aravind.S
Contents
S.NO
Topics
1 Abstract
2 Python Codes
3 MySQL Database
4 Output
5 References
Abstract
A hotel is a commercial establishment that provides
lodging, accommodation, and other services to travellers
or tourists. Hotels typically offer a range of rooms or suites
with varying levels of amenities and services. These
establishments can vary widely in size and style, from
small boutique hotels to large luxury resorts.
y=a.cursor()
x="select * from booking"
y.execute(x) r =
y.fetchall()
columns = [i[0] for i in y.description]
print(tabulate(r, headers=columns, tablefmt="fancy_grid"))
a.commit()
else:
print("INVALID INPUT")
break
#to show all rooms
def showrooms():
a=mysql.connector.connect(host="localhost",user="root",password="admin",database="hotel_sunset")
y=a.cursor()
y.execute("select room_type,prices,count(*) from rooms group by room_type,prices;")
r = y.fetchall()
columns = [i[0] for i in y.description]
print(tabulate(r, headers=columns, tablefmt="fancy_grid"))
#restaurant def
restaurant():
#VIEW MENU
def menu():
a=mysql.connector.connect(host="localhost",user="root",password="admin",database="hotel_su nset")
y=a.cursor()
b="select * from menu".format()
y.execute(b) menu=y.fetchall()
columns = [i[0] for i in y.description]
print(tabulate(menu, headers=columns, tablefmt="fancy_grid"))
if len(menu)>0:
print("Available")
a.commit()
yn=int(input("Do uou want to order an item ?type(1 for yes/2 for back to main
page):")) if yn ==1: b_order() elif yn==2:
print("THANK YOU")
print("YOU HAVE BEEN REDIRECTED TO MAIN PAGE")
customer_slot()
y=a.cursor()
Id=int(input("ENTER DISH NO.: "))
Quantity=int(input("ENTER QUANTITY: "))
Name=input("ENTER YOUR NAME: ")
Mobile_No=int(input("Enter mobilr no."))
Address=input("Enter Address:")
f=("select * from menu where
Dish_ID={}").format(Id) y.execute(f)
x=y.fetchall() 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) y.execute(ins)
print("THANKS FOR THE ORDER","\n\n","YOUR ORDER HAS BEEN
ORDERED SUCCESSFULLY","\n\n")
print("YOU HAVE BEEN REDIRECTED TO THE MAIN PAGE")
a.commit()
#cancel order
def corder():
a=mysql.connector.connect(host="localhost",user="root",password="admin",database="hotel_sunset")
y=a.cursor()
x=int(input("enter your number:"))
s="delete from orders where Mobile_No={}".format(x)
y.execute(s)
print("\n\n","YOUR ORDER HAS BEEN CANCELLED")
print("YOU HAVE BEEN REDIRECTED TO THE MAIN PAGE","\n\n")
a.commit()
#feedback
def fdback():
a=mysql.connector.connect(host="localhost",user="root",password="admin",database="hotel_sunset")
y=a.cursor()
fdn=input("Enter your name:")
print("Write something about us...")
fdi=input()
x="insert into fdback values('{}','{}')".format(fdn,fdi)
y.execute(x) print("\n\n")
print("THANKYOU FOR YOUR FEEDBACK")
print("\n")
print("YOU HAVE BEEN REDIRECTED TO THE MAIN PAGE")
a.commit()
#welcome def
start1():
while True:
print("\n")
print("1. VIEW MENU")
print("2. VIEW YOUR ORDERS")
print("3. CANCEL ORDER")
print("4. FEEDBACK")
print("5. EXIT")
ch1=int(input(" enter your choice:"))
if ch1==1: menu() elif
ch1==2: vorders() elif
ch1==3: corder( ) elif
ch1==4: fdback() elif
ch1==5: break
else:
print("\n","INVALID CHOICE"," \n" ,"TRY AGAIN."," \n")
start1()
except :
print("Error")
Booking_ID = {}".format(booking_id)
y.execute(q)
print("\nBooking History for Booking_ID {}: ".format(booking_id))
x = y.fetchall()
columns = [i[0] for i in y.description]
print(tabulate(x, headers=columns, tablefmt="fancy_grid"))
except :
print("Error")
#user choice
def bookings():
try:
a = mysql.connector.connect(host="localhost", user="root", password="admin",
database="hotel_sunset")
y = a.cursor()
z="select * from
book_rooms" y.execute(z)
x = y.fetchall()
columns = [i[0] for i in y.description]
print(tabulate(x, headers=columns, tablefmt="fancy_grid"))
roomchoice = int(input("Enter Your Option : ")) if
roomchoice == 1:
book_delux_room()
elif roomchoice == 2:
book_double_room() elif
roomchoice == 3:
book_king_room() elif
roomchoice == 4:
book_balcony_room()
elif roomchoice == 5:
book_cavana()
else:
print("Sorry, May Be You Are Giving Me Wrong Input, Please Try Again !!! ")
except:
print("Error")
finally:
y.close()
a.close()
#gaming section
def gaming():
print("1. Table Tennis -----> 15000 Rs./HR")
print("2. Bowling -----> 10000 Rs./HR") print("3.
Snooker -----> 25000Rs./HR") print("4. VR World
Gaming -----> 40000 Rs./HR") print("5. Video Games
-----> 35000 Rs./HR") print("6. Swimming Pool
Games -----> 50000Rs./HR") print("7. Exit")
game=int(input("Enter What Game You Want To Play : "))
hour=int(input("Enter No Of Hours You Want To Play : "))
if game==1:
print("YOU HAVE SELECTED TO PLAY : Table Tennis")
gamingbill = hour * 15000
price=print("Total price = ",gamingbill,"Rs.")
elif game==2:
print("YOU HAVE SELECTED TO PLAY : Bowling")
gamingbill = hour * 10000
price=print("Total price = ",gamingbill,"Rs.")
elif game==3:
print("YOU HAVE SELECTED TO PLAY : Snooker")
gamingbill = hour * 25000 price=print("Total price =
",gamingbill,"Rs.") elif game==4:
print("YOU HAVE SELECTED TO PLAY : VR World Gaming")
gamingbill = hour * 40000 price=print("Total price =
",gamingbill,"Rs.") elif game==5:
print("YOU HAVE SELECTED TO PLAY :Video Games")
gamingbill = hour * 35000
price=print("Total price = ",gamingbill,"Rs.")
elif game ==6:
print("YOU HAVE SELECTED TO PLAY : Swimming Pool Games")
gamingbill = hour *50000 price=print("Total price =
",gamingbill,"Rs.") else:
print("Sorry ,May Be You Are Giving Me Wrong Input, Please Try Again !!! ")
else:
print("\n\n","INVALID CHOICE")
a=mysql.connector.connect(host="localhost",user="root",password="admin",database="hotel_sunset")
y=a.cursor() try:
2. Employees:
3. Feedback:
4. Menu:
5. Orders:
6. Rooms:
7. Room Details:
8. Users:
OUTPUTS
First interface with admin login:
Customer login:
View order:
Canceling an order:
Feedback of restaurant:
Book a room:
Gaming: