(Dharmik) Hotel Management
(Dharmik) Hotel Management
Management
would like to At first thank & acknowledge our principal Mrs. BEENA
completion of this project and then would like to express our sincere
his vital support, guidance and encouragement – without which this project
GUJARAT PUBLIC SCHOOL for letting us use the school computer laboratory .
INDEX
3. Python Coding.
5. References.
To perform this task the students were divided into the group of two
students named as Dharmik, Krish.
We are so glad that this work have been assigned to us, yet we
haven’t done this work before .Sunil Vanjani our subject
teacher have also helped us a lot to complete this project. We
feel so blessed that we have learnt all this work with the help of
our sir, we are also thankful to our respected principal Beena
Prasad for providing us various facilities to complete this
project.
PYTHON CODING
#***************Gujarat Public School**********************
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 ():
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 !")
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' )
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !") myConnection.close()
cursor=myConnection.cursor(
else:
print("\nERROR ESTABLISHING MYSQL CONNECTION !")
def bookingRecord():
global cid customer=searchCustomer() if customer:
if myConnection:
cursor=myConnection.cursor()
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")
cursor.close() else:
def roomRent():
global cid customer=searchCustomer() if customer:
cursor=myConnection.cursor()
cursor.execute(createTable)
print ("\n ##### We have The Following Rooms For You #####") print (" 1. Ultra Royal ----> 10000
Rs.")
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
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)
cursor.execute("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 Restaurent():
global cid customer=searchCustomer() if customer:
cursor=myConnection.cursor(
print("Sorry ,May Be You Are Giving Me Wrong Input, Please Try Again !!! ")
return
sql= "INSERT INTO RESTAURENT VALUES(%s,%s,%s,%s)"
values= (cid,choice_dish,quantity,restaurentbill) cursor.execute(sql,values)
cursor.execute("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():
global cid customer=searchCustomer() if customer:
cursor=myConnection.cursor()
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
else:
print("ERROR ESTABLISHING MYSQL CONNECTION !")
def Fashion():
global cid customer=searchCustomer() if customer:
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
2. T-Shirts
3. Pants
4. Jeans
5. Tassel top 6. Gown
-----> 1500 Rs. -----> 300 Rs. -----> 2000 Rs. -----> 4000 Rs.
print("\nShirts")
print("\nT-Shirts")
print("\nPants")
print("\nJeans")
print("\nTassel top")
print("\nGown")
print("\nWestern dress")
print("\nTrousers")
print("\nInnerWear")
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)
cursor.execute("COMMIT")
print("\n\n#################################################")
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()
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:
else:
print("\nSomthing Went Wrong ,Please Try Again !")
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)
else:
print("\nSomthing Went Wrong ,Please Try Again !")
print("""
**************KENDRIYA VIDYALAYA PALAMPUR **********************
***************HOTEL MANAGEMENT SYSTEM *************************
*****************CROWN PLAZA MIAMI ***************************** #******* Designed
and Maintained By: *************************** #******* SAHISTHA - CLASS XII A - ROLL NO -
20[ 2019-2020 ]****
#******* PALLAVI - CLASS XII A - ROLL NO - 14 [ 2019-2020 ]****
#******* SABNAM - CLASS XII A - ROLL NO - 19 [ 2019-2020 ]****
""")
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 """)
bookingRecord()
break else:
print("Sorry ,May Be You Are Giving Me Wrong Input, Please Try Again !!! ") else:
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
MYSQL DATABASE AND TABLES USED IN THIS PROJECT
DATABASE
TABLE STRUCTURE 1 AND 2
TABLE STRUCTURE 7
BACKEND DATA GENERATED THROUGH
SOFTWARE
Made by:
Dharmik Patel & Krish chhatrala
Class: xii-c
Gujarat public school