Computer Board Project
Computer Board Project
Computer Board Project
INDEX
SL.NO. TOPIC
1. CERTIFICATE
2. ACKNOWLEDGEMENT
3. INTRODUCTION TO PROJECT
4. CODING
5. OUTPUTS
6. BIBLIOGRAPHY
INTRODUCTION
import mysql.connector
db=mysql.connector.connect(host='localhost',user='root',password='deepak')
mycursor=db.cursor()
mycursor.execute('create database if not exists HOTEL_MANAGEMENT')
db=mysql.connector.connect(host='localhost',user='root',password='deepak',database=
'HOTEL_MANAGEMENT')
mycursor=db.cursor()
print("\nDESCRIPTION:")
print("The Taj Mahal Palace, Mumbai makes a wonderful starting point from which to\
discover the charms that bring people from around the globe flocking to Mumbai city,\
India’s commercial and entertainment capital. Around the corner from the hotel is Colaba\
Causeway - a vibrant stretch filled with roadside stores, jewellery shops, pubs and\
restaurants that whisks guests back in time to old Bombay. Take a tour of and learn about\
the rich history and architecture of this vibrant city, accompanied by Government of India\
appointed and trained tourism officials.Walk past Gothic buildings and through narrow\
streets.Visit historic locations such as Wellington Fountain, Regal Cinema, Indian Merchant\
Building, Asiatic Library, CSMVS Museum, Jehangir Art Gallery, Elphinstone College and\
other prominent buildings in varying styles of architecture, each symbolic of a particular\
period of Bombay’s social and commercial history.\n")
print("BOOKING:")
print("Excursions, Guided tours, Private parties")
mycursor.close()
db.close()
Function, hotel fare calculator
**********************************
def hotelfare():
while True :
print("\n")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("1.Booking for Room")
print("2.Show Customer Record")
print("3.Search Customer Record")
print("4.Delete Customer Record")
print("5.Update Customer Record")
print("6.Return to Main Menu")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
if (b=='1'):
z='y'
while (z=='y'):
inputdata()
z=input("\nDo you want to continue..(y/n):")
if (z=='n'):
return hotelfare()
else :
print("Invalid Input!!")
z=input("\nDo you want to continue..(y/n):")
elif (b=='2'):
z='y'
while z=='y':
display()
z=input("\nDo you want to continue..(y/n):")
If (z=='n'):
return hotelfare()
else :
print("Invalid Input!!")
z=input("\nDo you want to continue..(y/n):")
elif (b=='3'):
z='y'
while (z=='y'):
search()
z=input("\nDo you want to continue..(y/n):")
if (z=='n'):
return hotelfare()
else :
print("Invalid Input!!")
z=input("\nDo you want to continue..(y/n):")
elif (b=='4'):
z='y'
while (z=='y'):
delete()
if (z=='n'):
return hotelfare()
else :
print("Invalid Input!!")
z=input("\nDo you want to continue..(y/n):")
elif (b=='5'):
z='y'
while (z=='y'):
update()
z=input("\nDo you want to continue..(y/n):")
if (z=='n'):
return hotelfare()
else :
print("Invalid Input!!")
z=input("\nDo you want to continue..(y/n):")
elif (b=='6'):
break
else:
print("Invalid Input......")
Inserting data
******************
import mysql.connector
import random
def inputdata():
r=0
l=0
p=0
s=0
db=mysql.connector.connect(host='localhost',user='root',password='deepak',database=
'HOTEL_MANAGEMENT')
mycursor=db.cursor() Ccode=input("\
nEnter Customer Code:")
Cname=input("Enter Customer Name:")
Cadd=input("Enter Customer Address:")
Cindate=input("Enter Customer Check in Date:")
Coutdate=input("Enter Customer Check out Date:")
Cid_type=input("Enter your Identity card name:")
Cid_no=input("Enter your Identity number:")
Ccontact_no=input("Enter you Contact number:")
CNationality=input("Enter your nationality:")
print("\n")
Choose Room for rent
***********************
while (1):
if (x==1):
elif (x==2):
elif (x==4):
elif (x==5):
elif (x==6) :
break
else:
print ("\n")
SubTotal_bill=s+r+l+p
Add_charges=1800
Room_rent=s
Game_bill=p
Food_bill=r
Laundry_bill=l
GrandTotal_bill=SubTotal_bill+Add_charges print("\
nYou have to pay Rs",GrandTotal_bill)
data1=(Ccode,Cid_type,Cid_no,Cname,Ccontact_no,Cadd,Cindate,Coutdate,CNationality)
data2=(Ccode,Cname,Cadd,Cindate,Coutdate,Room_no,Room_rent,Food_bill,Laundry_bill,
Game_bill,SubTotal_bill,Add_charges,GrandTotal_bill)
mycursor.execute(cotm,data1)
mycursor.execute(rec,data2)
db.commit()
mycursor.close() print("\
nRecord Inserted...................")
db.close()
Show Details of Customer
****************************
def display():
print("\n")
print("1.Display all records")
print("2.Display through code number")
d=input("\nEnter your choice:")
if (d=='1'):
db=mysql.connector.connect(host='localhost',user='root',password='deepak',
database= 'HOTEL_MANAGEMENT')
mycursor=db.cursor()
qry=("select h.Ccode,h.Cname,h.Cadd,h.Cindate,h.Coutdate,h.Room_no,\
c.CNationality, c.Ccontact_no,c.Cid_type,c.Cid_no from hoteldata h, customer c\
where h.Ccode=c.Ccode")
mycursor.execute(qry)
for(Ccode,Cname,Cadd,Cindate,Coutdate,Room_no,CNationality, Ccontact_no,
Cid_type,Cid_no) in mycursor:
print ("\n")
print ("Customer details.......")
print ("Customer code:",Ccode)
print ("Customer name:",Cname)
print ("Customer Id type:",Cid_type)
print ("Customer Id Number:",Cid_no)
print ("Customer address:",Cadd)
print ("customer Nationality:",CNationality)
print ("Check in date:",Cindate)
print ("Check out date",Coutdate)
print ("Room number:",Room_no)
print ("Customer Contact number:",Ccontact_no)
print (" ")
mycursor.close()
print("\nIt's All record")
db.close()
elif (d=='2'):
db=mysql.connector.connect(host='localhost',user='root',password='deepak',
database='HOTEL_MANAGEMENT')
mycursor=db.cursor() Ccode=input("\
nEnter code of customer:")
qry=("select h.Ccode,h.Cname,h.Cadd,h.Cindate,h.Coutdate,h.Room_no,\
c.CNationality,c.Ccontact_no,c.Cid_type,c.Cid_no from hoteldata h, customer c\
where h.Ccode=c.Ccode and h.Ccode=%s")
rec_code=(Ccode,)
mycursor.execute(qry,rec_code)
rec_count=0
for(Ccode,Cname,Cadd,Cindate,Coutdate,Room_no,CNationality,Ccontact_no,
Cid_type,Cid_no) in mycursor:
rec_count+=1
print ('\nRecord Found......')
print ("Customer details.......")
print ("Customer code:",Ccode)
print ("Customer name:",Cname)
print ("Customer Id type:",Cid_type)
print ("Customer Id Number:",Cid_no)
print ("Customer address:",Cadd)
print ("customer Nationality:",CNationality)
print ("Check in date:",Cindate)
print ("Check out date",Coutdate)
print ("Room number:",Room_no)
print ("Customer Contact number:",Ccontact_no)
if (rec_count==0):
print("\nRecord not found!!")
db.commit()
mycursor.close()
db.close()
else :
print("Invalid Input!!")
Search Customer
*******************
def search():
db=mysql.connector.connect(host='localhost',user='root',password='deepak',database=
'HOTEL_MANAGEMENT')
mycursor=db.cursor()
Ccode=input("\nEnter Customer Code to be Searched in Hotel:")
qry=("select * from hoteldata where Ccode=%s")
rec_srch=(Ccode,)
mycursor.execute(qry,rec_srch)
rec_count=0
for(Ccode,Cname,Cadd,Cindate,Coutdate,Room_no,Room_rent,Food_bill,Laudry_bill,
Game_bill,SubTotal_bill,Add_charges,GrandTotal_bill) in mycursor:
rec_count+=1
print ('\nRecord Found')
print ("Customer details......")
print ("Customer code:",Ccode)
print ("Customer name:",Cname)
print ("Customer address:",Cadd)
print ("Check in date:",Cindate)
print ("Check out date",Coutdate)
print ("Room number:",Room_no)
print ("Room rent is:",Room_rent)
print ("Food bill is:",Food_bill)
print ("Laundary bill is:",Laudry_bill)
print ("Game bill is:",Game_bill)
print ("Sub total bill is:",SubTotal_bill)
print ("Additional Service Charges is:",Add_charges)
print ("Grand Total bill is:",GrandTotal_bill)
if (rec_count==0):
print("\nRecord not found!!")
db.commit()
mycursor.close()
db.close()
print("\n\t\t\t\t\t\t\t\t ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░")
print("֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎\ ֎֎֎֎֎֎֎֎░░ WELCOME TO
THE TAJ PALACE ░░֎֎֎֎֎֎֎֎֎\
֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎֎")
print("\t\t\t\t\t\t\t\t ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░")
while True:
print("\n")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("1.Speciality of your Hotel")
print("2.Customer Management")
print("3.Booking for Private Party")
print("4.EXIT")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
b=input("\nEnter your choice:")
if (b=='1'):
speciality()
elif (b=='2'):
hotelfarecal()
elif (b=='3'):
party()
elif (b=='4'):
quit()
else:
print("Wrong Choice")
OUTPUT
Main screen of Hotel Management
Specialty of Hotel
Customer Management
python.org
tutorialsPoint.com
LearnPython.org