Computer Science PROJECT
Computer Science PROJECT
BALURGHAT
…………………………………
……………………………………
Signature of Principal
……………………………………
Acknowledgement
I would like to express deep gratitude to my project guide
Mr. DIPANKAR ROY for guiding me immensely through
the
course of the project. He always evinced keen interest in
my
project. His constructive advice & constant motivation have
been responsible for the successful completion of this
project.
At last but not the least, I would like to thank all those
who
have helped directly or indirectly towards the completion of
this project.
HARDWARE AND
SOFTWARE
REQUIRED
HARDWARE
1.PC
2.MOBILE PHONE
SOFTWARE
1. PYTON(Latest Version)
2. MYSQL
3. PYTHON-MYSQL CONNECTOR
CONTENTS
Sl.N
o. Topics
1. About Hotel
2. Introduction
3. Python Codes
4. MySQL Database
5. Output
6. References
Hotel
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 suits with varying levels of
amenities and services. These establishments can vary widely in size
and style, from small boutique hotels to large luxury resorts.
Key features of hotels include:
1. Accommodation: Hotels provide rooms or suites for guests to stay
overnight or for an extended period.
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: Hotels are often classified based on factors like their
size, amenities, and overall quality. Common classifications include
budget/economy hotels, mid-range hotels, 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. Hospitality Industry: Hotels are an integral part of the hospitality
industry, which encompasses businesses that provide services to
travellers and customers seeking leisure and comfort.
Overall, hotels play a crucial role in the travel and tourism industry,
offering a temporary home away from home for individuals and
groups seeking accommodation during their travels.
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.
#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".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 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]
p=ip*Quantity
ins="insert into orders
(ID,Name,Quantity,Item_Price,Total_Price,Mobile_No,Adres
s) 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()
#VIEW ORDER
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("\n","YOUR 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\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()
print("Write something about us...")
fdi=input()
x="insert into fdback values('{}','{}')".format(fdn,fdi)
y.execute(x)
print("\n\n")
print("THANK YOU 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()
#booking rooms section
# Create the table if not 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)"
y.execute(create_table)
Acknowledgement
I would like to express deep gratitude to my project guide
Mr. DIPANKAR ROY for guiding me immensely through the
course of the project. He always evinced keen interest in
my
project. His constructive advice & constant motivation have
been responsible for the successful completion of this
project.
At last but not the least, I would like to thank all those
who
have helped directly or indirectly towards the completion of
this project.
OPEN PYCHARM: IMPORT MYSQL.CONNECTOR
CUR =CON.CURSOR
Q=”show tables”
Cur.execute(Q)
For i in cur:
print(i)