MOVIETICKETBOOKING
MOVIETICKETBOOKING
I.P. EXTENSION
COMPUTER SCIENCE
PROJECT
TEAM MEMBERS:
YASH GAUR 12-A
VEER 12-A
SOURCE CODE
conn=sc.connect(host="localhost",user="root",password="mgm",database="ip12")
mycursor=conn.cursor()
query="insert into Theater values({},'{}','{}',{},{},{},{},{},{},{},
{})".format(Tid,Tname,Tfilim,Tnofront,Tnomiddle,Tnoback,Tnobalcony,Tpricefro
nt,Tpricemiddle,Tpriceback,Tpricebalcony)
mycursor.execute(query)
conn.commit()
conn.close()
print("SUCCESSFULLY ADD THEATER DEATILS")
conn=sc.connect(host="localhost",user="root",password="mgm",database="ip12")
mycursor=conn.cursor()
query="update Theater set
Tfilim='{}',Tfrontno={},Tmiddleno={},Tbackno={},Tbalconyno={},Tpricefront=
{},Tpricemiddle={},Tpriceback={},Tpricebalcony={} where
Tid={}".format(ufilim,unofront,unomiddle,unoback,unobalcony,upricefront,uprice
middle,upriceback,upricebalcony,Tid)
mycursor.execute(query)
conn.commit()
conn.close()
print("SUCCESSFULLY UPDATE THEATER DEATILS")
conn=sc.connect(host="localhost",user="root",password="mgm",database="ip12")
mycursor=conn.cursor()
query="delete from Theater where Tid={}".format(Tid)
mycursor.execute(query)
conn.commit()
conn.close()
print("SUCCESSFULLY REMOVE THEATER DEATILS")
conn=sc.connect(host="localhost",user="root",password="mgm",database="ip12")
mycursor=conn.cursor()
query="select * from Theater where Tid={}".format(Tid)
mycursor.execute(query)
myrecord=mycursor.fetchall()
for x in myrecord:
print(x)
conn.close()
#DEfinition for TicketBooking() section
def TicketBooking():
print("\n\n\n\n")
print("*********************")
print("WELCOME TO BOOK MY SHOW")
print("1. Ticket Booking")
print("2. Ticket Cancellation")
print("3. Search Booking details")
print("4. Go Home page")
op=int(input("Enter your option"))
if op==1:
Tbooking()
elif op==2:
Tcancel()
elif op==3:
SearchBooking()
elif op==4:
Homepage()
else:
print("Invalid option")
conn=sc.connect(host="localhost",user="root",password="mgm",database="ip12")
mycursor=conn.cursor()
query="select * from Theater where Tid={}".format(tid)
mycursor.execute(query)
myrecord=mycursor.fetchall()
conn.close()
fare=0
for x in myrecord:
if typeticket=="Front":
fare=x[7]
elif typeticket=="Middle":
fare=x[8]
elif typeticket=="Back":
fare=x[9]
elif typeticket=="Balcony":
fare=x[10]
query1="insert into ticketbooking values({},{},'{}',
{})".format(bid,tid,typeticket,fare)
conn=sc.connect(host="localhost",user="root",password="mgm",database="ip12")
mycursor=conn.cursor()
mycursor.execute(query1)
conn.commit()
print("Successfully Booking done")
conn.close()
conn=sc.connect(host="localhost",user="root",password="mgm",database="ip12")
mycursor=conn.cursor()
bidcan=int(input("Enter id of the ticket booking to be searching: "))
query1="select * from ticketbooking where bid={}".format(bidcan)
mycursor.execute(query1)
myrecord=mycursor.fetchall()
print("Bookingid\tTheaterId\tTypeofseat\tprice\n")
for x in myrecord:
print(x[0],"\t",x[1],"\t",x[2],"\t",x[3],"\n")
conn.close()
Home page
Registration Section
Ticket Booking
Ticket Cancellation
Search Booking
Search
Report
This project was completed on time and is found working effectively under all
circumstances that may arise in real environment. The program objective specifies
on the requirement is believed to be met. Using the facilities and functionalities of
python and mysql , the program has been developed in neat manner.
This program is simple and user friendly. The speed and accuracy are maintained
in proper way. Testing of the program has given good result.
The program is done with an insight into necessary modifications that is required
in the future.