Class 12 Project-Hotel Management System
Class 12 Project-Hotel Management System
Class 12 Project-Hotel Management System
MARY’S SCHOOL
(CHILKANA ROAD, SAHARANPUR)
SubJECT COMPUTER SCIENCE
PYTHON (083)
PrOJECT FILE
CLASS-XII
SESSION 2022-23
A PROJECT REPORT
ON
HoTEL MANAGEMENT
SYSTEM
SUBMITTED BY SUBMITTED TO
NAME: MR. ABDUL HAMID
CLASS-12TH [ ] (PGT COMP. SC)
Certificate
This is to certify that (NAME OF STUDENT)of
class XII (SCIENCE/COMMERCE) of St. Mary’s
School has done her project on HOTEL
MANAGEMENT SYSTEM under my supervision.
She has taken interest and has shown at most
sincerity in completion of this project.
I certify this project up to my expectation & as
per guidelines issued by CBSE.
Acknowledgement
It is with pleasure that I acknowledge my sincere gratitude
to our teacher, Mr. Abdul Hamid who taught and
undertook the responsibility of teaching the subject
computer science. I have been greatly benefited from his
classes.
Our sincere thanks goes to our principal Mrs. Sushma Bajaj
who has been a source of encouragement and support and
without her inspiration, this project would not have been
successful.
Finally, I would like to express my sincere appreciation for
all the other students of my batch, their friendship & the
fine time we all shared together.
Last but not least, I would like to thank all those who had
helped directly or indirectly towards the completion of this
project.
Name:
Class:
Contents
1. Introduction of the Project.
2. System Requirements of the Project.
3. Python Coding.
4. Output of the Project.
5. References.
PROCESS
Firstly, we have done the planning in a paper work regarding what have
to do on the assigned project HOTEL MANAGEMENT SYSTEM.
Secondly, we discussed our planning with our subject teacher and then he
provided us the right path to perform the work.
Next, we started our project on foot paths of our subject teacher.
Then, we started our coding, coding took around 2 and half months for
completion.
Next, we analyzed the mistakes done and then we corrected them.
Then, we prepared the project format as shown above.
THANKS TO ALL OF WORTHY TEACHERS AND PRINCIPAL AND MY DEAR
GROUP MATES ALSO A GREAT THANKS TO ST. MARY’S SCHOOL FOR
PROVIDING US THIS GOLDEN OPPORTUNITY.
Manual system
Manual system means a system which does it’s work itself not
by help of any technology in which paper work has some
special place.
All conventional methods are in instead of new technologies.
And now as everybody knows that computer graphs at its
extent mean the more you can use computer system the more
you can make your work easier.
And if in the case system is not computerized then it has to face
a lot of problem because every task gets complex and time
consumable.
Costly
Difficulty in searching the records
Maintenance problem
Time consuming
Tedious
PROPOSED SYSTEM
Proposed system is a system which is computerized in every
manner. Computerized system is not just adding machines but
they are capable of doing much complex, tedious and
cumbersome tasks.
Processing of data by hand id satisfactory only when the
amount of data to be processes is small and also the manual
processing is slow, monotonous & often subject to error.
Above explanation is clearly telling us that existing system
contain a lot of deficiencies which can be remove by only by
following proposed system.
Now-a-days, computer graph is at its extent. Computerization
contain a lot of benefits so that everyone chasing and following
computerized items. Now, question arises what kind of help
this project or computerized system can give to remove all
disadvantages of this existing system.
About
The project, Hotel Management System is a web-based
application that allows the hotel manager to handle all hotel
activities online. Interactive GUI and the ability to manage
various hotel bookings and rooms make this system very
flexible and convenient. The hotel manager is a very busy
person and does not have the time to sit and manage the entire
activities manually on paper. This application gives him the
power and flexibility to manage the entire system from a single
online system. Hotel management project provides room
booking, staff management and other necessary hotel
management features. The system allows the manager to post
available rooms in the system. Customers can view and book
room online. Admin has the power of entire approving or
disapproving the customer’s booking request. Other hotel
services can also be viewed by the customers and can book
them too. The system is hence useful for both customers and
managers to portable manage the hotel activities.
Advantages
Sometimes it happens that the rooms get booked soon
when one visits the place therefore user can make advance
booking using this system.
It saves user time in searching an exact cost of rooms for
request number of days.
The system is useful as it calculates an exact cost of rooms
for requested number of days.
It saves organization resources and expenses.
This system is effective and saves time and cost of users.
Disk space: 1 GB
Note:- MySQL Connector Python requires python to be in the system’s PATH. Installation
fails if it doesn’t find python.
On Windows, if Python doesn’t exist in the system’s PATH, please manually add the
directory containing python.exe yourself.
HARDWARE :
Processer : Pentium ® G2030 @ 3.70GHz
Processer speed : 533 MHz
RAM : 2 GB or more
Hard Disk : 2.00 GB
Software :
Working environment
What is python ?
Python is a popular programming language. It was created by Guido Van
Rossum, and released in 1991.
It is used for:
What is MySQL?
MySQL is an open-source relational database management syatem (RDBMS). It
is the most popular database system used with PHP. MySQL is developed
distributed, and supported by Oracle Corporation.
Python Coding
import mysql.connector
# GLOBAL VARIABLES DECLARATION
myConnnection =""
cursor=""
userName=""
password =""
roomrent =0
restaurentbill=0
gamingbill=0
fashionbill=0
totalAmount=0
cid=""
#MODULE TO CHECK MYSQL CONNECTIVITY
def MYSQLconnectionCheck ():
global myConnection
global userName
global password
userName = input("\n ENTER MYSQL SERVER'S USERNAME : ")
password = input("\n ENTER MYSQL SERVER'S PASSWORD : ")
myConnection=mysql.connector.connect(host="localhost",user=userName,passwd=password
, auth_plugin='mysql_native_password' )
if myConnection:
print("\n CONGRATULATIONS ! YOUR MYSQL CONNECTION HAS BEEN ESTABLISHED !")
cursor=myConnection.cursor()
cursor.execute("CREATE DATABASE IF NOT EXISTS HMS")
cursor.execute("COMMIT")
cursor.close()
return myConnection
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION CHECK USERNAME AND
PASSWORD !")
#MODULE TO ESTABLISHED MYSQL CONNECTION
def MYSQLconnection ()
global userName
global password
global myConnection
global cid
myConnection=mysql.connector.connect(host="localhost",user=userName,passwd=password
, database="HMS" , auth_plugin='mysql_native_password' )
if myConnection:
return myConnection
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
myConnection.close()
def userEntry():
global cid
if myConnection:
cursor=myConnection.cursor(
createTable ="""CREATE TABLE IF NOT EXISTS C_DETAILS(CID VARCHAR(20),C_NAME
VARCHAR(30),C_ADDRESS VARCHAR(30),C_AGE VARCHAR(30),
C_COUNTRY VARCHAR(30) ,P_NO VARCHAR(30),C_EMAIL VARCHAR(30))”””
cursor.execute(createTable)
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
def bookingRecord():
global cid
customer=searchCustomer()
if customer:
if myConnection:
cursor=myConnection.cursor()
createTable ="CREATE TABLE IF NOT EXISTS BOOKING_RECORD(CID
VARCHAR(20),CHECK_IN DATE ,CHECK_OUT DATE)"
cursor.execute(createTable)
checkin=input("\n Enter Customer CheckIN Date [ YYYY-MM-DD ] : ")
checkout=input("\n Enter Customer CheckOUT Date [ YYYY-MM-DD ] : ")
sql= "INSERT INTO BOOKING_RECORD VALUES(%s,%s,%s)"
values= (cid,checkin,checkout)
cursor.execute(sql,values)
cursor.execute("COMMIT")
print("\nCHECK-IN AND CHECK-OUT ENTRY MADED SUCCESSFULLY !")
cursor.close()
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
def roomRent():
global cid
customer=searchCustomer()
if customer:
global roomrent
if myConnection:
cursor=myConnection.cursor()
createTable ="""CREATE TABLE IF NOT EXISTS ROOM_RENT(CID
VARCHAR(20),ROOM_CHOICE INT,NO_OF_DAYS INT,ROOMNO INT ,ROOMRENT INT)”””
cursor.execute(createTable)
print ("\n ##### We have The Following Rooms For You #####")
print (" 1. Ultra Royal ----> 10000 Rs.")
print (" 2. Royal ----> 5000 Rs. ")
print (" 3. Elite ----> 3500 Rs. ")
print (" 4. Budget ----> 2500 USD ")
roomchoice =int(input("Enter Your Option : "))
roomno=int(input("Enter Customer Room No : "))
noofdays=int(input("Enter No. Of Days : "))
print("\nCHECK-IN AND CHECK-OUT ENTRY MADED SUCCESSFULLY !")
cursor.close()
if roomchoice==1:
elif roomchoice==2:
elif roomchoice==3:
elif roomchoice==4:
else:
else:
def Restaurent():
global cid
customer=searchCustomer()
if customer:
global restaurentbill
if myConnection:
cursor=myConnection.cursor(
createTable ="""CREATE TABLE IF NOT EXISTS RESTAURENT(CID VARCHAR(20),CUISINE
VARCHAR(30),QUANTITY VARCHAR(30),BILL VARCHAR(30))
"""
cursor.execute(createTable)
if choice_dish==1:
elif choice_dish==3:
else:
else:
def Gaming():
global cid
customer=searchCustomer()
if customer:
global gamingbill
if myConnection:
cursor=myConnection.cursor()
createTable ="""CREATE TABLE IF NOT EXISTS GAMING(CID VARCHAR(20),GAMES
VARCHAR(30),HOURS VARCHAR(30),GAMING_BILL VARCHAR(30))
""" cursor.execute(createTable)
print("""
return
def Fashion():
global cid
customer=searchCustomer()
if customer:
global fashionbill
if myConnection:
cursor=myConnection.cursor()
createTable ="""CREATE TABLE IF NOT EXISTS FASHION(CID VARCHAR(20),DRESS
VARCHAR(30),AMOUNT VARCHAR(30),BILL VARCHAR(30))”””
cursor.execute(createTable)
print("""
1. Shirts -----> 1500 Rs.
2. T-Shirts -----> 300 Rs.
3. Pants -----> 2000 Rs.
4. Jeans -----> 4000 Rs.
5. Tassel top -----> 500 Rs.
6. Gown -----> 3000 Rs.
7. Western dress -----> 3000 Rs.
8. Skirts -----> 400 Rs.
9. Trousers -----> 200 Rs.
10. InnerWear -----> 30 Rs.
""")
if myConnection:
cursor=myConnection.cursor()
createTable ="""CREATE TABLE IF NOT EXISTS TOTAL(CID VARCHAR(20),C_NAME
VARCHAR(30),ROOMRENT INT ,RESTAURENTBILL INT ,GAMINGBILL
INT,FASHIONBILL INT,TOTALAMOUNT INT)"""
cursor.execute(createTable)
sql= "INSERT INTO TOTAL VALUES(%s,%s,%s,%s,%s,%s,%s)"
name = input("Enter Customer Name : ")
grandTotal=roomrent + restaurentbill + fashionbill + gamingbill
values= (cid,name,roomrent,restaurentbill , gamingbill,fashionbill,grandTotal)
cursor.execute(sql,values)
cursor.execute("COMMIT")
cursor.close()
print("\n **** CROWN PLAZA MIAMI **** CUSTOMER BIILING ****")
print("\n CUSTOMER NAME : " ,name)
print("\nROOM RENT : Rs. ",roomrent)
print("\nRESTAURENT BILL : Rs. ",restaurentbill)
print("\nFASHION BILL : Rs. ",fashionbill)
print("\nGAMING BILL : Rs. ",gamingbill)
print("___________________________________________________")
print("\nTOTAL AMOUNT : Rs. ",grandTotal)
cursor.close()
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
def searchOldBill():
global cid
customer=searchCustomer()
if customer:
if myConnection:
cursor=myConnection.cursor()
sql="SELECT * FROM TOTAL WHERE CID= %s"
cursor.execute(sql,(cid,))
data=cursor.fetchall()
if data:
print(data)
else:
print("Record Not Found Try Again !")
cursor.close()
else:
print("\nSomthing Went Wrong ,Please Try Again !")
def searchCustomer():
global cid
if myConnection:
cursor=myConnection.cursor()
cid=input("ENTER CUSTOMER ID : ")
sql="SELECT * FROM C_DETAILS WHERE CID= %s"
cursor.execute(sql,(cid,))
data=cursor.fetchall()
if data:
print(data)
return True
else:
print("Record Not Found Try Again !")
return False
cursor.close()
else:
print("\nSomthing Went Wrong ,Please Try Again !")
myConnection = MYSQLconnectionCheck ()
if myConnection:
MYSQLconnection ()
while(True):
print("""
1--->Enter Customer Details
2--->Booking Record
3--->Calculate Room Rent
4--->Calculate Restaurant Bill
5--->Calculate Gaming Bill
6--->Calculate Fashion store Bill
7--->Display Customer Details
8--->GENERATE TOTAL BILL AMOUNT
9--->GENERATE OLD BILL
10--->EXIT """)
choice = int(input("Enter Your Choice"))
if choice == 1:
userEntry()
elif choice ==2:
bookingRecord()
MAIN SCREEN
USER AUTHENTICATION
CUSTOMER DETAILS
CUSTOMER BOOKING RECORDS
ROOM RENT
RESTAURENT BILL
GAMING BILL
FASHION STORE BILL
DETAILS OF THE CUSTOMER
TOTAL BILL
OLD BILL
EXIT