Project v2
Project v2
UNDERTAKING
We declare that the work presented in this project titles “HOTEL
MANAGEMENT SYSTEM”, is submitted to Mr Dibakar Das PGT
Computer Science, Central Model School Barrackpore for the award of the
CBSE – AISSE class XII Certificate. We have not plagiarized or submitted
the same work for the award of any other examination. In case this
undertaking is found incorrect, we accept that our Certificates may be
unconditionally withdrawn.
January 2025
Place – Central Model School Barrackpore
2
ACKNOWLEDGEMENT
3
CERTIFICATE
This is to Certify that the Computer Science Board Project on the Topic
“HOTEL MANAGEMENT” is submitted by the group of “Meghraj, Roni,
Sagnik, Sudhansu, Ujan” under the guidance and supervision of Mr Dibakar
Das.
4
5
6
INTROUCTION
Meghraj, Roni & Ujan has been assigned the work of coding and
programming, Sudhansu has been assigned the work of analysing the
Overall mistakes while Sagnik crafted the overall presentation and the
conclusion work
We are glad that this work has been assigned to us, As Students of Class
XII we have performed all that we have learnt from CBSE
PROGRAMMING. Hence, we know that this programming would be
further done bigger platform.
We are also thankful to our groupmates for cooperating with each other
while performing this task we have polished the skills of group activity.
7
PROCESS
FIRSTLY, we have done the planning in a paper work regarding what have
to do on the ass
8
9
igned 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 out project on the foot paths of our subject teacher.
THEN, we started our coding, coding took 1 and half months for
completion.
10
SOURCE CODE
import mysql.connector
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)
cid = input("Enter Customer Identification Number : ")
name = input("Enter Customer Name : ")
address = input("Enter Customer Address : ")
age = input("Enter Customer Age : ")
nationality = input("Enter Customer Country : ")
phoneno = input("Enter Customer Contact Number : ")
email = input("Enter Customer Email : ")
13
sql = "INSERT INTO C_Details VALUES(%s, %s, %s, %s, %s, %s,
%s)"
values = (cid, name, address, age, nationality, phoneno, email)
cursor.execute(sql, values)
myConnection.commit()
print("\nNew Customer Entered In The System Successfully !")
cursor.close()
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)
myConnection.commit()
print("\nCHECK-IN AND CHECK-OUT ENTRY MADE
SUCCESSFULLY !")
14
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 Rs. ")
roomchoice = int(input("Enter Your Option : "))
roomno = int(input("Enter Customer Room No : "))
noofdays = int(input("Enter No. Of Days : "))
if roomchoice == 1:
roomrent = noofdays * 10000
print("\nUltra Royal Room Rent : ", roomrent)
elif roomchoice == 2:
roomrent = noofdays * 5000
print("\nRoyal Room Rent : ", roomrent)
elif roomchoice == 3:
roomrent = noofdays * 3500
15
print("\nElite Royal Room Rent : ", roomrent)
elif roomchoice == 4:
roomrent = noofdays * 2500
print("\nBudget Room Rent : ", roomrent)
else:
print("Sorry, May Be You Are Giving Me Wrong Input, Please
Try Again !!!")
return
sql = "INSERT INTO ROOM_RENT VALUES(%s, %s, %s, %s,
%s)"
values = (cid, roomchoice, noofdays, roomno, roomrent)
cursor.execute(sql, values)
myConnection.commit()
print("Thank You, Your Room Has Been Booked For : ", noofdays,
"Days")
print("Your Total Room Rent is : Rs. ", roomrent)
cursor.close()
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
def restaurant():
global cid
customer = searchCustomer()
if customer:
global restaurentbill
if myConnection:
cursor = myConnection.cursor()
createTable = """CREATE TABLE IF NOT EXISTS
RESTAURANT(CID VARCHAR(20), CUISINE VARCHAR(30),
QUANTITY VARCHAR(30), BILL VARCHAR(30))"""
cursor.execute(createTable)
16
print("1. Vegetarian Combo -----> 300 Rs.")
print("2. Non-Vegetarian Combo -----> 500 Rs.")
print("3. Vegetarian & Non-Vegetarian Combo -----> 750 Rs.")
choice_dish = int(input("Enter Your Cuisine : "))
quantity = int(input("Enter Quantity : "))
if choice_dish == 1:
print("\nSO YOU HAVE ORDERED: Vegetarian Combo")
restaurentbill = quantity * 300
elif choice_dish == 2:
print("\nSO YOU HAVE ORDERED: Non-Vegetarian Combo")
restaurentbill = quantity * 500
elif choice_dish == 3:
print("\nSO YOU HAVE ORDERED: Vegetarian & Non-
Vegetarian Combo")
restaurentbill = quantity * 750
else:
print("Sorry, May Be You Are Giving Me Wrong Input, Please
Try Again !!!")
return
sql = "INSERT INTO RESTAURANT VALUES(%s, %s, %s, %s)"
values = (cid, choice_dish, quantity, restaurentbill)
cursor.execute(sql, values)
myConnection.commit()
print("Your Total Bill Amount Is : Rs. ", restaurentbill)
print("\n\n**** WE HOPE YOU WILL ENJOY YOUR MEAL
***\n\n")
cursor.close()
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
def gaming():
17
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("""
1. Table Tennis -----> 150 Rs./HR
2. Bowling -----> 100 Rs./HR
3. Snooker -----> 250 Rs./HR
4. VR World Gaming -----> 400 Rs./HR
5. Video Games -----> 300 Rs./HR
6. Swimming Pool Games -----> 350 Rs./HR
7. Exit
""")
game = int(input("Enter What Game You Want To Play : "))
hour = int(input("Enter No Of Hours You Want To Play : "))
print("\n\n#################################################")
if game == 1:
print("YOU HAVE SELECTED TO PLAY : Table Tennis")
gamingbill = hour * 150
elif game == 2:
print("YOU HAVE SELECTED TO PLAY : Bowling")
gamingbill = hour * 100
elif game == 3:
print("YOU HAVE SELECTED TO PLAY : Snooker")
18
gamingbill = hour * 250
elif game == 4:
print("YOU HAVE SELECTED TO PLAY : VR World
Gaming")
gamingbill = hour * 400
elif game == 5:
print("YOU HAVE SELECTED TO PLAY : Video Games")
gamingbill = hour * 300
elif game == 6:
print("YOU HAVE SELECTED TO PLAY : Swimming Pool
Games")
gamingbill = hour * 350
else:
print("Sorry, May Be You Are Giving Me Wrong Input, Please
Try Again !!!")
return
sql = "INSERT INTO GAMING VALUES(%s, %s, %s, %s)"
values = (cid, game, hour, gamingbill)
cursor.execute(sql, values)
myConnection.commit()
print("Your Total Gaming Bill Is : Rs. ", gamingbill)
print("FOR : ", hour, " HOURS", "\n *** WE HOPE YOU WILL
ENJOY YOUR GAME ***")
print("\n\n#################################################")
cursor.close()
else:
print("ERROR ESTABLISHING MYSQL CONNECTION !")
def fashion():
global cid
19
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.
""")
dress = int(input("Enter your Choice wear: "))
quantity = int(input("How many you want to buy: "))
if dress == 1:
print("\nShirts")
fashionbill = quantity * 1500
elif dress == 2:
print("\nT-Shirts")
fashionbill = quantity * 300
elif dress == 3:
print("\nPants")
20
fashionbill = quantity * 2000
elif dress == 4:
print("\nJeans")
fashionbill = quantity * 4000
elif dress == 5:
print("\nTassel top")
fashionbill = quantity * 500
elif dress == 6:
print("\nGown")
fashionbill = quantity * 3000
elif dress == 7:
print("\nWestern dress")
fashionbill = quantity * 3000
elif dress == 8:
print("\nSkirts")
fashionbill = quantity * 400
elif dress == 9:
print("\nTrousers")
fashionbill = quantity * 200
elif dress == 10:
print("\nInnerWear")
fashionbill = quantity * 30
else:
print("Sorry, May Be You Are Giving Me Wrong Input, Please
Try Again !!!")
return
sql = "INSERT INTO FASHION VALUES(%s, %s, %s, %s)"
values = (cid, dress, quantity, fashionbill)
cursor.execute(sql, values)
myConnection.commit()
21
print("\n\n#################################################")
print("\nYOU SELECT ITEM NO : ", dress, "\nYOUR
QUANTITY IS : ", quantity, " ITEMS", "\nTHANK YOU FOR
SHOPPING VISIT AGAIN!!!")
print("\nYour Total Bill Is : ", fashionbill)
print("\n\n#################################################")
cursor.close()
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
def totalAmount():
global cid
customer = searchCustomer()
if customer:
global grandTotal
global roomrent
global restaurentbill
global fashionbill
global gamingbill
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 : ")
22
grandTotal = roomrent + restaurentbill + fashionbill + gamingbill
values = (cid, name, roomrent, restaurentbill, gamingbill,
fashionbill, grandTotal)
cursor.execute(sql, values)
myConnection.commit()
cursor.close()
print("\n **** CROWN PLAZA MIAMI **** CUSTOMER
BILLING ****")
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)
23
else:
print("Record Not Found Try Again !")
cursor.close()
else:
print("\nSomething 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("\nSomething Went Wrong, Please Try Again !")
print("""
**************CENTRAL MODEL SCHOOL BARRACKPORE
**********************
***************HOTEL MANAGEMENT SYSTEM
*************************
*****************CROWN PLAZA MIAMI
***************************** """)
24
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()
elif choice == 3:
roomRent()
elif choice == 4:
restaurant()
elif choice == 5:
gaming()
elif choice == 6:
fashion()
elif choice == 7:
25
searchCustomer()
elif choice == 8:
totalAmount()
elif choice == 9:
searchOldBill()
elif choice == 10:
break
else:
print("Sorry, May Be You Are Giving Me Wrong Input, Please Try
Again !!!")
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
# END OF PROJECT
26
CODE PREVIEW
DATABASE
MAIN SCREEN
27
OLD BILL
FASHION BILL
28
GAMING BILL
RESTAURENT BILL
29
ROOM BILL
CUTOMER DETAILS
30
CUSTOMER BOOKING RECORD
DETAILS OF CUSTOMER
31
USER AUTHENTICATION
TABLE STRUCTURES
33
TOTAL RECORD
BACKEND DATA
34
EXIT
35