Professional Documents
Culture Documents
HMS Complete Synopsis
HMS Complete Synopsis
On
For
Mrs.Sheetal Bachhav
______________ ________________
Sign of Internal Examiner Sign of External Examiner
_________________
Signature of Principal Seal of the school
Declaration
Introduction
PROPOSED SYSTEM:
Python code:
import mysql.connector as sql
conn=sql.connect(host='localhost',user='root',password='123',
database='HMS')
if conn:
print("successfully connected")
c1= conn.cursor()
def display():
print(" ")
print("RATES OF LODGING PER DAY:")
print(" ")
print("ULTRA ROYAL=5000")
print("ELITE=2500")
print("BUDGET=1500")
print(" ")
print("RATES OF RESTAURANT:")
print(" ")
print("ROTI=5")
print("RICE=70")
print("MIX VEG=100")
print("Biryani=200")
print("DESERT=50")
print("MINERAL WATER=20")
print("NOTE:2.O% TAX WILL BE APPLIED ON
TOTAL COST")
print(" ")
print(109*'~')
print(" ")
def createtable():
c1=conn.cursor()
c1.execute("create table if not exists employee(emp_id
varchar(25) primary key,emp_name varchar(25) not
null,emp_age int not null,Mob_no char(25),emp_designation
varchar(25),emp_salary float)")
print("table created")
print(" ")
print(109*'~')
print(" ")
def addemp():
c1=conn.cursor()
n=int(input("ENTER HOW MANY EMPLOYEE TO BE
INSERTED:"))
for i in range(n):
emp_id=input(str("ENTER EMPLOYEE ID:"))
emp_name=input("ENTER FULL NAME OF
EMPLOYEE NAME:")
emp_age=int(input("ENTER EMPLOYEE AGE:"))
Mob_no=input("ENTER EMPLOYEE'S MOB_NO:")
emp_des=input("ENTER EMPLOYEE
DESIGNATION:")
emp_sal=float(input("ENTER EMPLOYEE
SALARY:"))
sql="insert into employee values(%s,%s,%s,%s,%s,
%s)"
value=(emp_id,emp_name,emp_age,Mob_no,emp_des,emp_
sal)
c1.execute(sql,value)
print("SUCCESSFULLY INSERTED")
conn.commit()
c1.close()
print(" ")
print(109*'~')
print(" ")
def createcust():
c1=conn.cursor()
c1.execute("create table if not exists customer(cust_id
varchar(25) primary key,cust_name varchar(25),cust_age
char(3),cust_mob_no char(10),roomtype varchar(25),price
float)")
print("table created")
print(" ")
print(109*'~')
print(" ")
def addcust():
c1=conn.cursor()
n=int(input("ENTER HOW MANY CUSTOMER TO BE
INSERTED:"))
for i in range(n):
cust_id=input(str("ENTER CUSTOMER ID:"))
cust_name=input("ENTER FULL NAME OF
CUSTOMER NAME:")
cust_age=int(input("ENTER CUSTOMER'S AGE:"))
cust_mob_no=input("ENTER CONTACT NUMBER
OF CUSTOMER:")
roomtype=input("ENTER ROOM TYPE:")
price=float(input("ENTER ROOM PRICE:"))
sql="insert into customer values(%s,%s,%s,%s,%s,%s)"
value=(cust_id,cust_name,cust_age,cust_mob_no,roomtype,p
rice)
c1.execute(sql,value)
print("SUCCESSFULLY ENTERED")
conn.commit()
c1.close()
print(" ")
print(109*'~')
print(" ")
def updateemployee():
c1=conn.cursor()
identity=input(str("ENTER EMPLOYEE ID TO BE
UPDATED: "))
emp_name=input("ENTER EMPLOYEE NAME: ")
emp_age=int(input("ENTER EMPLOYEE AGE:"))
Mob_no=input("ENTER EMPLOYEE'S MOB_NO: ")
emp_des=input("ENTER EMPLOYEE
DESIGNATION:")
emp_sal=float(input("ENTER EMPLOYEE SALARY:"))
sql="update employee set
emp_name='{}',emp_age='{}',Mob_no='{}',emp_designation
='{}',emp_salary='{}' where
emp_id={}".format(emp_name,emp_age,Mob_no,emp_des,e
mp_sal,identity)
print(sql)
c1.execute(sql)
conn.commit()
print("updated")
c1.close()
print(" ")
print(109*'~')
print(" ")
def updatecustomer():
c1=conn.cursor()
cust_identity=input(str("ENTER CUSTOMER ID TO BE
UPDATED: "))
cust_name=input("ENTER CUSTOMER NAME: ")
cust_age=int(input("ENTER CUSTOMER AGE:"))
cust_mob_no=input("ENTER CUSTOMER'S MOB_NO:
")
roomtype=input("ENTER ROOM TYPE
DESIGNATION:")
price=float(input("ENTER CUSTOMER SALARY:"))
sql="update customer set
cust_name='{}',cust_age='{}',cust_mob_no='{}',roomtype='{
}',price='{}' where
cust_id={}".format(cust_name,cust_age,cust_mob_no,roomt
ype,price,cust_identity)
print(sql)
c1.execute(sql)
conn.commit()
print("updated")
c1.close()
print(" ")
print(109*'~')
print(" ")
def Display_all_Employee_Details():
c1.execute('select * from employee')
data=c1.fetchall()
for i in data:
print(i)
print(" ")
print(109*'~')
print(" ")
def Display_all_Customer_Details():
c1.execute('select * from customer')
cust_data=c1.fetchall()
for i in cust_data:
print(i)
print(" ")
print(109*'~')
print(" ")
def searchcust():
c1=conn.cursor()
exp=input("ENTER CUSTOMER NAME TO BE
SEARCHED: ")
sql="select * from customer where cust_name='"+(exp)
+"'"
c1.execute(sql)
result=c1.fetchall()
for i in result:
print(i)
print(" ")
print(109*'~')
print(" ")
def searchemp():
c1=conn.cursor()
exp=input("ENTER EMPLOYEE NAME TO BE
SEARCHED: ")
sql="select * from employee where emp_name='"+(exp)
+"'"
c1.execute(sql)
result=c1.fetchall()
for i in result:
print(i)
print(" ")
print(109*'~')
print(" ")
def deleteemp():
c1=conn.cursor()
print("ENTER EMPLOYEE NAME TO BE DELETED")
exp=input("ENTER NAME:")
c1.execute("delete from employee where emp_name='"+
(exp)+"'")
print("RECORD DELETED")
conn.commit()
c1.close()
print(" ")
print(109*'~')
print(" ")
def totalbill():
while True:
print("************HOTEL
CRISP***************")
print("1.RESTAURANT & LODGING BILL")
print("2.EXIT")
choice=int(input("ENTER YOUR CHOICE: "))
if choice==1:
tax=2
rate={"roti":5,"rice":70,"mix_veg":100,"Biryani":200,"desert
":50,"mineral_water":20,"ULTRA_ROYAL":5000,"ELITE":
2500,"BUDGET":1500}
print("RESTAURANT & LODGING BILL")
print("ULTRA_ROYAL , ELITE , BUDGET")
rooms=input("ROOM BOOKED: ")
if rooms=="ULTRA_ROYAL":
NOR=int(input("Number of Ultra royal rooms
booked: "))
NOD=int(input("Number of days: "))
cost1=((rate["ULTRA_ROYAL"]*NOR)*NOD)*tax
elif rooms=="ELITE":
NOR=int(input("Number of Ultra royal rooms
booked: "))
NOD=int(input("Number of days: "))
cost1=((rate["ELITE"]*NOR)*NOD)*tax
elif rooms=="BUDGET":
NOR=int(input("Number of Ultra royal rooms
booked: "))
NOD=int(input("Number of days: "))
cost1=((rate["BUDGET"]*NOR)*NOD)*tax
print("ENTER QUANTITY OF FOLLOWING
ITEMS")
roti=int(input("roti:"))
rice=int(input("rice:"))
mixveg=int(input("mixveg:"))
Biryani=int(input("Biryani:"))
desert=int(input("desert:"))
mineralw=int(input("mineral water:"))
cost2=roti*rate["roti"]+rice*rate["rice"]
+mixveg*rate["mix_veg"]+Biryani*rate["Biryani"]
+desert*rate["desert"]+mineralw*rate["mineral_water"]
bill=cost1+(cost2*tax)
print("PLEASE PAY : Rs.",bill)
elif choice==2:
break
else :
print("Invalid Choice")
print(" ")
print(109*'~')
print(" ")
print("
#################################################
#################################################
######")
print("
*************************************************
*************************************************
******")
print(" HOTEL MANAGEMENT
SYSTEM ")
print(" HOTEL CRISP")
print(" #DESIGNED AND MAINTANED BY:")
print(" 1.ANKUR BHANDARE XII-A ROLL-NO:04")
print(" 2.ARYAN LOKHANDE XII-A ROLL-NO:06")
print("
*************************************************
*************************************************
*****")
print("
#################################################
#################################################
#####")
while True:
choice=int(input("ENTER YOUR CHOICE: "))
if choice==1:
display()
elif choice==2:
createtable()
elif choice==3:
addemp()
elif choice==4:
createcust()
elif choice==5:
addcust()
elif choice==6:
updateemployee()
elif choice==7:
updatecustomer()
elif choice==8:
Display_all_Employee_Details()
elif choice==9:
Display_all_Customer_Details()
elif choice==10:
searchcust()
elif choice==11:
searchemp()
elif choice==12:
deleteemp()
elif choice==13:
totalbill()
elif choice==14:
break
else:
print("invalid option")
Output
HARDWARE AND SOFTWARE
REQUIREMENTS
Hardware
Professional
866 Mhz
Colour )
Software
I. Windows
II. Python
III. Mysql
Bibliography
Google
Wikipedia
Computer Science by Sumita Arora
Botskool