

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


































We are also thankful to our groupmates for cooperating with each other while performing this task we have also polished the skills of group activity. 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 KENDRIYA VIDYALAYA SANGATHAN FOR PROVIDING US THIS GOLDEN OPPORTUNITY …………
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)
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 : ") 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) cursor.execute("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) cursor.execute("COMMIT")
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) 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: 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) 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 Cusine : "))
quantity=int(input("Enter Quantity : ")) if choice_dish==1: print("\nSO YOU HAVE ORDER: Vegetarian Combo ") restaurentbill = quantity * 300 elif choice_dish==2: print("\nSO YOU HAVE ORDER: Non-Vegetarian Combo ") restaurentbill = quantity * 500 elif choice_dish==3: print("\nSO YOU HAVE ORDER: 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 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: 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))
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) cursor.execute("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 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("""
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 !")