ProjectReport - Hotel Management System
ProjectReport - Hotel Management System
A Project on
Hotel management
Under
Computer Science
Subject code: 083
SUBMITTED BY:
Samarth Roy
Vansh Thakkar
TARUN YADAV
Subject Incharge (Computer Science)
CERTIFICATE
report or a similar report on the topic has not been submitted for
any other examination and doesnot form a part of any other course
…………………………… …………………………
Signature of the student Signature of the teacher
(Samarth Roy) (Tarun Yadav)
…………………………… ……………………………..
Signature of the Principal Signature of the
(P.P Jose) (External Examiner)
CERTIFICATE
This report or a similar report on the topic has not been submitted
for any other examination and doesnot form a part of any other
…………………………… …………………………
Signature of the student Signature of the teacher
(Vansh Thakkar) (Tarun Yadav)
…………………………… ……………………………..
Signature of the Principal Signature of the
(P.P Jose) (External Examiner)
ACKNOWLEDGEMENT
Apart from the efforts of me, the success of any project depends largely on the
encouragement and guidelines of many others. I take this opportunity to express my
gratitude to the people who have been instrumental in the successful completion of this
project.
I express deep sense of gratitude to almighty God for giving me strength for the
successful completion of the project.
I express my deep sense of gratitude to the luminary The Principal, Hills’ High
School who has been continuously motivating and extending their helping hand to us.
I express my sincere thanks to the academician The Vice Principal, Hills’ High
School , for constant encouragement and the guidance provided during this project
My sincere thanks to Mr. Tarun Yadav , Master In-charge, A guide, Mentor all the
above a friend, who critically reviewed my project and helped in solving each and every
problem, occurred during implementation of the project
The guidance and support received from all the members who contributed and who
are contributing to this project, was vital for the success of the project. I am grateful for
their constant support and help.
TABLE OF CONTENTS [ T O C ]
01 INTRODUCTION 1
03 PROPOSED SYSTEM 3
06 SOURCE CODE 7
08 OUTPUT 51
09 TESTING 56
BIBLIOGRAPHY
11 58
0
PROJECT ON hotel management
INTRODUCTION
Hotel management software is a technology that allows hotel operators and owners
to streamline their administrative tasks while also increasing their bookings in both
the short and long term
This is a project, named Hotel Management System . This project is
created by using :
1. Python Programming Language, and
2. SQL(Structured Query Language)
In this project there are 1000+ lines of python code and 70+ lines of
SQL Script, in which I used simple python programming.
Libraries Required :
➢ MySQL Connector Python
➢ Datetime
1
OBJECTIVES OF THE PROJECT
The objective of this project is to let the students apply the programming
knowledge into a real- world situation/problem and exposed the students how
2
PROPOSED SYSTEM
Today one cannot afford to rely on the fallible human beings of be really wants to stand
against today’s merciless competition where not to wise saying “to err is human”.no
longer valid, it’s outdated to rationalize your mistake. So, to keep pace with time, to
bring about the best result without malfunctioning and greater efficiency so to replace
the unending heaps of flies with a much sophisticated hard disk of the computer .One
has to use the data management software. Software has been an ascent in
atomization various organizations . Many software products working are now in
markets, which have helped in making the organizations work easier and efficiently.
Data management initially had to maintain a lot of ledgers and a lot of paper work has
to be done but now software product on this organization has made their work faster
and easier. Now only this software has to be loaded on the computer and work can be
done. This prevents a lot of time and money. The work becomes fully automated and
any information regarding the organization can be obtained by clicking the button.
Moreover, now it’s an age of computers of and automating such an organization gives
the better look.
3
SYSTEM DEVELOPMENT LIFE CYCLE (SDLC)
4
DESIGN PHASE
5
Everything requiring user input or approval is documented and reviewed by the
user. Once these documents have been approved by the Agency CIO and
Business Sponsor, the final System Design Document is created to serve as
the Critical/Detailed Design for the system.
This document receives a rigorous review by Agency technical and functional
representatives to ensure that it satisfies the business requirements.
Concurrent with the development of the system design, the Agency Project
Manager begins development of the Implementation Plan, Operations and
Maintenance Manual, and the Training Plan.
DEVELOPMENT PHASE
6
SOURCE CODE
# Project Name : Hotel Management System
Also make sure you have imported the sql script, named
"The_Taj_Hotel.sql", or
Run the "Creating Table for running HMS file.py" file first
Change the password from every 'conn' variable and enter your
own password.
"""
# Importing Libraries:
import mysql.connector
# Global variables:
hotel_name =''
addr =''
7
phone=''
email =''
gst=42
st =13
def hotelDetails():
global hotel_name
global addr
global phone
global email
global gst
global st
conn = mysql.connector.connect(
host='localhost', database='The_Taj_Hotel',
user='root', password='1234')
cursor = conn.cursor()
cursor.execute(sql)
records = cursor.fetchmany(6)
if record[1]=='Hotel_Name':
hotel_name = record[2]
if record[1] == 'Address':
addr = record[2]
if record[1] == 'Phone':
phone = record[2]
if record[1] == 'Email':
8
email = record[2]
if record[1] == 'GST':
gst = record[2]
if record[1] == 'ST':
st = record[2]
print("\n\n")
greet()
def change_hotelDetails():
conn = mysql.connector.connect(
user='root', password='1234')
cursor = conn.cursor()
clear()
print('-'*75)
print('1.Hotel Name')
print('2.Hotel Address')
9
print('3.Phone Number(s)')
print('4.Email ID')
if choice == 7:
main_menu()
else :
print("\n\n\tInvalid input")
wait = input('\n\n\n\
main_menu()
cursor.execute(sql)
conn.commit()
conn.close()
greet()
def room_exist(room_no):
conn = mysql.connector.connect(
10
user='root', password='1234')
cursor = conn.cursor()
cursor.execute(sql)
record = cursor.fetchone()
return record
def customer_exist(cust_no):
conn = mysql.connector.connect(
user='root', password='1234')
cursor = conn.cursor()
cursor.execute(sql)
record = cursor.fetchone()
return record
def add_room():
conn = mysql.connector.connect(
user='root', password='1234')
cursor = conn.cursor()
clear()
11
print('-'*75)
1. AC
2. Non-AC
3. DELUX
4. Super Delux
5. Queen Delight
6. Kings Special
if room_type_choice == 1:
room_type = 'AC'
if room_type_choice == 2:
room_type = 'Non-AC'
if room_type_choice == 3:
room_type = 'Delux'
if room_type_choice == 4:
if room_type_choice == 5:
if room_type_choice == 6:
12
if room_type_choice == 7:
print("Invalid Input.....")
1. Single
2. Double
3. Triple
if room_bed_choice == 1:
if room_bed_choice == 2:
if room_bed_choice == 3:
print("Invalid Input.....")
1. AC : ₹3499/night
2. Non-AC : ₹1499/night
3. Delux : ₹4799/night
13
\t\tNOTE: Rent changes as per bed there is addition of
Rs.1000 per bed(type)''')
if room_type == 'AC':
room_rent_selection = 1
room_rent_selection = 2
room_rent_selection = 3
room_rent_selection = 4
room_rent_selection = 5
room_rent_selection = 6
room_rent_selection = 7
else :
pass
# 1. AC Room rent
if room_rent_selection == 1:
room_rent = 3499
14
if room_rent_selection == 2:
room_rent = 1499
if room_rent_selection == 3:
room_rent = 4799
if room_rent_selection == 4:
room_rent = 5499
if room_rent_selection == 5:
room_rent = 6999
15
room_rent = 6999 + 1000
if room_rent_selection == 6:
room_rent = 8499
if room_rent_selection == 7:
room_rent = 10499
print("Invalid Input.....")
add_room()
print('\nFor ----->')
room_rent = str(room_rent)
16
sql = 'insert into rooms(RoomNo, room_type,\
('+room_no+',"'+ room_type.upper()+'",\
'+room_rent+',"'+room_bed.upper()+'","Free");'
cursor.execute(sql)
conn.commit()
conn.close()
greet()
def modify_room():
conn = mysql.connector.connect(
user='root', password='1234')
cursor = conn.cursor()
clear()
print('-'*75)
while True:
check = room_exist(room_no)
if check == None:
17
2. Return to main menu
if choice == 1:
elif choice == 2:
main_menu()
elif choice == 3:
greet()
break
else:
print("Invalid Input!")
print("Exiting..........")
greet()
break
print('''
Room Type : {}
Room Bedding : {}
Room Rent : {}
check[3],check[2],check[4]))
print()
print('1.Room Type')
18
print('2.Room Rent')
print('3.Room Bed')
field_name = ''
AC
Non-AC
Delux
Super Delux
Queen Delight
King Special
field_name = 'Room_Type'
AC ₹3499/night
Non-AC ₹1499/night
Delux ₹4799/night
field_name = 'rent'
Single Bed
19
Double Bed
field_name = 'bed_type'
Free
Occupied''')
field_name = 'Room_Status'
if value.isdigit():
else:
cursor.execute(sql)
conn.commit()
greet()
break
def add_customer():
conn = mysql.connector.connect(
20
user='root', password='1234')
cursor = conn.cursor()
clear()
print('-'*75)
(CustomerName,address,Contact_No,email,id_proof,id_number\
,males,females,children) values \
("'+name+'","' + address.upper()+'","'+phone+'",\
"'+email.upper()+'","'+id_proof.upper()+'","'+id_proof_no.uppe
r()+'",\
'+males+','+females+','+children+');'
cursor.execute(sql1)
cursor.execute(sql2)
data = cursor.fetchone()
21
print('\n\n\nCustomer Added successfully ...............')
conn.commit()
conn.close()
greet()
def modify_customer():
conn = mysql.connector.connect(
user='root', password='1234')
cursor = conn.cursor()
clear()
print('-'*75)
22
while True:
check = customer_exist(cust_no)
if check == None:
if choice == 1:
elif choice == 2:
main_menu()
elif choice == 3:
break
else:
print("Invalid Input!")
print("Exiting..........")
break
print('''
Name : {}
Address : {}
Phone No. : {}
Email : {}
23
ID Proof : {}
ID Proof No. : {}
No. of males : {}
No. of females : {}
No. of children : {}
'''.format(check[1],check[2],check[3],
check[4],check[5],check[6],check[7],check[8],check[9]))
print()
print('1.Name')
print('2.Address')
print('3.Phone No')
print('4.Email ID')
print('5.ID Proof')
print('7.Males')
print('8.Females')
print('9.Childeren')
field_name = ''
if choice == 1:
field_name = 'CustomerName'
if choice == 2:
field_name = 'Address'
if choice == 3:
field_name = 'Contact_No'
24
if choice == 4:
field_name = 'email'
if choice == 5:
field_name = 'id_proof'
if choice == 6:
field_name = 'ID_Number'
if choice == 7:
field_name = 'males'
if choice == 8:
field_name = 'females'
if choice == 9:
field_name = 'children'
if value.isdigit():
else:
cursor.execute(sql)
conn.commit()
greet()
wait = input(
break
25
# 9. Function to book room
def room_booking():
conn = mysql.connector.connect(
cursor = conn.cursor()
clear()
print("*"*20)
while True:
cursor.execute(query1)
data = cursor.fetchone()
cursor.execute(query2)
record = cursor.fetchone()
if record == None:
rmno = 0
pass
else:
room_no = data[0]
roomtype = data[1]
26
roomrent = data[2]
roombed = data[3]
cursor.execute(query2)
data2 = cursor.fetchone()
cName = data2[1]
if customer_exist(cust_no) != None :
if rmno == room_no:
DateOfBooking =
datetime.strptime(input('Enter date of occupancy (yyyy-mm-dd)
:> '), '%Y-%m-%d')
pass
else :
else:
27
sql1 = 'update rooms \
CustomerID = {} \
where Roomno =
{};'.format(cust_no,room_no)
(roomno,customerid,DateOfBooking,advance,customername) \
cursor.execute(sql1)
cursor.execute(sql2)
conn.commit()
conn.close()
break
else :
else :
28
print("NOTE: This room (", room_no,") is not
available for booking")
def bill_generation():
global gst
global st
conn = mysql.connector.connect(
user='root', password='1234')
cursor = conn.cursor()
print(35*'*')
while True:
cursor.execute(query1)
data = cursor.fetchall()
checkRoomExist = room_exist(room_no)
if checkRoomExist == None:
29
print("\nNOTE: This room doesn't exist in our
database,Room no.", room_no)
break
else :
pass
if data == []:
3. Return back
:> '''))
if choice == 1:
elif choice == 2:
main_menu()
pass
elif choice == 3:
break
else:
print("Invalid Input!")
print("Exiting..........")
break
30
else:
if dolv != None :
:> '''))
if choice == 1:
elif choice == 2:
main_menu()
pass
elif choice == 3:
break
else:
print("Invalid Input!")
print("Exiting..........")
break
31
FROM customers\
cursor.execute(query2)
data = cursor.fetchone()
\t-----------------------------------------
Room No. : {}
Room Name : {}
Room Bedding : {}
Customer ID : {}
Customer Name : {}
Customer Address : {}
clear()
print('-'*75)
dol = date.today()
total_days = (dol-doo).days
amount = total_days*rent
gst_amount = amount*int(gst)/100
st_amount = amount*int(st)/100
32
if dol == doo:
charge = 1500
charge = 1200
charge = 1000
charge = 800
charge = 550
charge = 275
charge = 150
else:
pass
print('Advance :',advance,'\nGST : {}
'.format(gst,gst_amount), '\nService Tax :
{}'.format(st,st_amount))
33
sql1 = 'update rooms set room_status ="free" \
values('+str(book_id)+','+str(payable_amount)+',"'+str(dol)+'"
,'+str(gst)+','+str(st)+','+str(roomno)+');'
cursor.execute(sql1)
cursor.execute(sql2)
cursor.execute(sql3)
conn.commit()
conn.close()
break
def search_rooms():
conn = mysql.connector.connect(
user='root', password='1234')
cursor = conn.cursor()
check = room_exist(room_no)
34
sql ='select * from rooms where roomno ='+room_no +';'
cursor.execute(sql)
record = cursor.fetchone()
clear()
print('-'*75)
conn.close()
else :
def search_customer():
while True:
conn = mysql.connector.connect(
user='root', password='1234')
cursor = conn.cursor()
clear()
print('-'*75)
35
print('1.by Customer ID')
print('6.by ID Proof')
field_name =''
if choice ==1:
field_name = 'CustomerID'
if choice ==2:
field_name = 'CustomerName'
if choice ==3:
field_name = 'address'
if choice ==4:
field_name = 'Contact_No'
if choice ==5:
field_name = 'email'
if choice ==6:
field_name = 'id_proof'
if choice ==7:
field_name = 'id_number'
if choice ==8:
break
36
if field_name =='CustomerID':
else:
cursor.execute(sql)
records = cursor.fetchall()
if records == []:
print('*' * 45)
break
else :
pass
clear()
print('*'*80)
print('''
Customer ID : {}
Customer Name : {}
Address : {}
Contact No. : {}
Email : {}
ID Proof : {}
37
record[0], record[1], record[2], record[3],
record[4], record[5], record[6]))
conn.close()
greet()
break
def search_booking():
while True:
conn = mysql.connector.connect(
user='root', password='1234')
cursor = conn.cursor()
sql = 'select
book_id,r.roomno,c.Customername,DateOfBooking,advance from
bookings b, customers c, rooms r where b.roomno = r.roomno AND
b.customerid = '+cust_no+' and DateOfLeaving is NULL;'
cursor.execute(sql)
records = cursor.fetchall()
clear()
print('*'*50)
if records == []:
38
1. Want to enter another room no
:> '''))
if choice == 1:
elif choice == 2:
main_menu()
pass
elif choice == 3:
break
else:
print("Invalid Input!")
break
else:
print('''\tCustomer ID :\t{}
conn.close()
greet()
break
39
# 14. Function to search bills
def search_bills():
while True:
conn = mysql.connector.connect(
user='root', password='1234')
cursor = conn.cursor()
cursor.execute(sql)
record = cursor.fetchone()
clear()
print('*'*140)
# checking record
if record == None:
40
greet()
break
else :
pass
conn.close()
break
41
# 15. Function to select what you want to search
def search_menu():
while True:
clear()
print('-'*75)
print("\n1.Room Status")
print('\n2.Booking Status')
print('\n3.Customer Details')
print('\n4.Bills')
print('\n\n')
if choice == 1:
search_rooms()
if choice == 2:
search_booking()
if choice == 3:
search_customer()
if choice == 4:
search_bills()
if choice == 5:
greet()
break
def report_room_status():
conn = mysql.connector.connect(
42
host='localhost', database = 'The_Taj_Hotel',
user='root', password='1234')
cursor = conn.cursor()
cursor.execute(sql)
records = cursor.fetchall()
clear()
print('-'*75)
conn.close()
greet()
def report_booking_status():
conn = mysql.connector.connect(
user='root', password='1234')
cursor = conn.cursor()
43
'''
cursor.execute(sql)
records = cursor.fetchall()
clear()
print('-'*75)
conn.close()
greet()
def report_menu():
while True:
clear()
print('Report Menu')
print('*'*35)
print("\n1.Room Status")
print('\n2.Booking Status')
print('\n3.Bill Collections')
44
print('\n\n')
if choice == 1:
report_room_status()
if choice == 2:
report_booking_status()
if choice == 3:
reportCollection()
if choice == 4:
break
def reportCollection():
conn = mysql.connector.connect(
user='root', password='1234')
cursor = conn.cursor()
clear()
print('*'*45)
if choice == 1:
print("\nTotal Collection")
45
print('-'*35)
cursor.execute(sql)
data = cursor.fetchone()
if choice == 2:
print('-'*35)
cursor.execute(sql1)
records = cursor.fetchall()
count = cursor.rowcount
dateofleaving = record[0]
advance = record[1]
collection = advance
46
WHERE bl.book_id = bk.book_id and customerid
={};".format(custNo)
cursor.execute(sql2)
data = cursor.fetchone()
cursor.execute(sql3)
records = cursor.fetchall()
bill = record[1]
bill = 0
cursor.execute(sql3)
records = cursor.fetchall()
bill += record[1]
collection = bill
47
print("Collection from Customer No.", custNo, ":>
Rs. ",collection)
break
if count == 0 :
if choice == 3:
report_menu()
greet()
def main_menu():
while True:
clear()
print(' H O T E L M A N A G E M E N T S Y S T E M ')
print('-'*75)
print('\n\n')
48
choice = int(input('Enter your choice ...: '))
add_room()
add_customer()
modify_room()
modify_customer()
room_booking()
bill_generation()
search_menu()
report_menu()
hotelDetails()
change_hotelDetails()
if choice ==11:
greet()
break
def clear():
for _ in range(30):
49
print()
# __main__
if __name__ == "__main__":
hotelDetails()
main_menu()
# END OF PROGRAM
50
OUTPUT
51
Adding new room
52
53
• Room booking:
54
• Bill generation:
• Closing appilication:
55
TESTING
56
HARDWARE AND SOFTWARE REQUIREMENTS
SOFTWARE REQUIREMENTS:
I. Windows OS
II. Python
III. Mysql
57
BIBLIOGRAPHY
***
58