Sashu Hotel Management Final
Sashu Hotel Management Final
New Delhi.
Submitted by student
SASHWANTH.S
In the academic year2024-2025
Place: BUJANGANOOR
Date:
ACKNOWLEDGEMENT
“HOTEL MANAGEMENT”
1.Customer Check-in:
When a customer arrives at the hotel, the system checks if a room is available. If available, the
customer’s information (name, address, phone number, etc.) is recorded, and the room is booked. The
check-in process ensures that the room is marked as occupied so that other customers cannot book it.
2.Customer Check-out:
During check-out, the system calculates the bill for the customer based on the number of days they
stayed and any extra services they availed of. The room is then marked as available again, and the
customer’s details are stored for future reference or reports.
3.Room Management:
The system manages room availability in real time. You can view available and booked rooms,
ensuring smooth and efficient room allocation.
4.Service Management:
Additional services like food, laundry, restaurant, gaming or room service can be added to the
customer’s account. Each service has a cost, which is added to the total bill when the customer
checks out.
5.Billing System:
The billing module calculates the total amount to be paid by the customer. This includes both room
charges (based on the number of days stayed) and any additional service charges
By integrating these functionalities, the Hotel Management System addresses common challenges
faced in medical retail, such as manual billing errors and inefficient customer management. The use
of MySQL ensures robust data handling and easy retrieval, while the Python interface provides a
user-friendly experience. This project not only enhances operational efficiency but also contributes to
improved customer satisfaction in hotel booking and lodging services.
SOURCE CODE
import mysql.connector
from tabulate import tabulate
import random
a=mysql.connector.connect(host="localhost",user="root",password="admin",databa
se="hotel_sunset")
y=a.cursor()
a=mysql.connector.connect(host="localhost",user="root",password="admin",databa
se="hotel_sunset")
y=a.cursor()
q="select * from employees"
y.execute(q)
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_sunset")
y = a.cursor()
b = "select * from menu"
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 you 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()
# BOOKING ORDER
def b_order():
a = mysql.connector.connect(host="localhost", user="root", password="admin",
database="hotel_sunset")
y = a.cursor()
Id = int(input("ENTER DISH NO.: "))
Quantity = int(input("ENTER QUANTITY: "))
Name = input("ENTER YOUR NAME: ")
Mobile_No = int(input("Enter mobile 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
# Insert order
def insert_order(Id, itn, Quantity, ip, tp, Mobile_No, Address):
a = mysql.connector.connect(host="localhost", user="root", password="admin",
database="hotel_sunset")
y = a.cursor()
ins = "insert into orders(ID, Name, Quantity, Item_Price, Total_Price,
Mobile_No, Address) values({}, '{}', {}, {}, {}, {}, '{}')".format(Id, itn, Quantity,
ip, tp, Mobile_No, Address)
y.execute(ins)
print("THANKS FOR THE ORDER\n\nYOUR ORDER HAS BEEN
ORDERED SUCCESSFULLY\n\n")
print("YOU HAVE BEEN REDIRECTED TO THE MAIN PAGE")
a.commit()
# View orders
def vorders():
a = mysql.connector.connect(host="localhost", user="root", password="admin",
database="hotel_sunset")
y = a.cursor()
m = int(input("Enter your number: "))
n = "select * from orders where Mobile_No={}".format(m)
print("\nYOUR RECENT ORDERS\n")
y.execute(n)
o = y.fetchall()
columns = [i[0] for i in y.description]
print(tabulate(o, headers=columns, tablefmt="fancy_grid"))
for i in o:
p = "select * from menu, orders where Mobile_No={} and
menu.Dish_ID=orders.ID".format(m)
y.execute(p)
q = y.fetchall()
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\nYOUR 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\nTHANK YOU FOR YOUR FEEDBACK\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")
import mysql.connector
import random
from tabulate import tabulate
def book_balcony_room():
a = mysql.connector.connect(host="localhost", user="root", password="admin",
database="hotel_sunset")
y = a.cursor()
try:
z = random.randint(401, 411)
ro_no = z
g_name = input("Enter guest name: ")
ph_no = input("Enter your phone number: ")
#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 ,Maybe You Are Giving Me Wrong Input, Please Try Again !!! ")
#feedback to be asked by user
def feedback():
a=mysql.connector.connect(host="localhost",user="root",password="admin",databa
se="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()
# for admin
def admin_slot():
while True:
print("*********WELCOME ADMIN*********")
print("1.Employees Details")
print("2.Customer Details")
print("3.Room Details")
print("4.Feedback")
print("5.Restaurant Details")
print("6.Exit")
a = int(input("enter your choice"))
if a == 1:
emp_details()
elif a == 2:
customdet()
elif a == 3:
room_details()
elif a == 4:
fedback()
elif a == 5:
restaurant_details()
elif a == 6:
break
else:
print("\n\n", "INVALID CHOICE", "\n", "TRY AGAIN")
# for customer
def customer_slot():
while True:
print("*************NAMASTE*************")
print("1.RESTAURANT")
print("2.BOOK ROOMS")
print("3.GAMING")
print("4.FEEDBACK")
print("5.EXIT")
a = int(input("enter your choice"))
if a == 1:
restaurant()
elif a == 2:
bookings()
elif a == 3:
gaming()
elif a == 4:
feedback()
elif a == 5:
break
else:
print("\n\n", "INVALID CHOICE")
# first interface
while True:
print("*********WELCOME TO HOTEL SUNSET*********")
print("1.admin")
print("2.customer")
print("3.exit")
a = int(input("who are you"))
if a == 1:
def admin_login(a, username, password):
a = mysql.connector.connect(host="localhost", user="root",
password="admin", database="hotel_sunset")
y = a.cursor()
try:
# Check if the provided username and password match an admin record
query = "SELECT * FROM users WHERE username = %s AND
password = %s"
y.execute(query, (username, password))
admin_result = y.fetchone()
if admin_result:
print("Login successful. Welcome, Admin!")
else:
print("Invalid username or password. Please try again.")
except Exception as e:
print(f"Error: {e}")
a.close()
admin_username = input("Enter Admin Username: ")
admin_password = input("Enter Admin Password: ")
admin_login(a, admin_username, admin_password)
admin_slot()
elif a == 2:
customer_slot()
elif a == 3:
break
MYSQL DATABASES
3. Feedback:
4. Menu:
5. Orders:
6. Rooms:
7. Room Details:
8. Users:
OUTPUT
• Customer login:
• From restaurant view menu:
• Order an item:
• View order:
• Canceling an order:
• Feedback of restaurant:
• Gaming:
• Book a room:
BIBLIOGRAPHY:
To develop this project many references were used:
1. Computer Science with Python by Sumitha Arora, Dhanpat
Rai Publications.
2. https://www.google.com
3. www.pypi.org
4. MySQL
5. www.youtube.com