Maxfort School Rohini: Project On Movie Ticket Booking

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

MAXFORT SCHOOL ROHINI

ACADEMIC YEAR: 2021-22


PROJECT ON MOVIE TICKET BOOKING

ROLL NO :

NAME : TANMAY VIJAY

CLASS : XII

SUBJECT : COMPUTER SCIENCE

SUB CODE : 083

1
CERTIFICATE

This is to certify that Tanmay Vijay, student of class XII-A ,


Maxfort School, Rohini has successfully completed the
Project Work entitled “MOVIE TICKET BOOKING” in the
subject Computer Science (083) for the purpose of Practical
Examination in Class XII.

Ms Pinky Gupta
(PGT Comp Sc)

Examiner:

Name: _______________________

Signature:

2
ACKNOWLEDGEMENT

The success of any project is all about team-work which


involves participation, encouragement and guidelines of many
others. I take this opportunity to express my gratitude to our
dynamic principal Dr Ratna Chakravarty for her constant
encouragement and guidance provided during this project.

My sincere thanks to my teacher Ms Pinky Gupta, who guided


me in solving problems encountered and critically reviewed
my project to make it a success.

I would also thank my partner in this project Pratham Bansal,


without whose support and help this project couldn’t have
completed on time.

I also express my heartfelt gratitude to my parents for


constant encouragement while carrying out this project.

3
TABLE OF CONTENTS [ T O C ]

PAGE
SNo DESCRIPTION
NO

01 INTRODUCTION 05

02 OBJECTIVES OF THE PROJECT 06

03 EXISTING SYSTEM 07

04 PROPOSED SYSTEM 07

DESCRIPTION OF INPUT/OUTPUT
05 08
REQUIREMENTS

06 FLOW CHART 09

07 SOURCE CODE 10

08 OUTPUT 12

09 FUTURE SCOPE 15

10 CONCLUSION 15

HARDWARE AND SOFTWARE


11 16
REQUIREMENTS

12 BIBLIOGRAPHY 16

4
INTRODUCTION
● This project is aimed at developing a ticket reservation
system for Cinema Halls. The Ticket Reservation
System is an Internet based application that can be
accessed throughout the internet and can be accessed by
anyone having internet connection.

● The system uses “Python” at the front end and database


software “Mysql” at the back end.

● This system will automate the reservation and payment


of tickets. This uses phone number and password for the
confirmation of tickets.

● It is one of the important features of our system. To


protect the benefit of the cinema, there is no policy of
cancellation of tickets instead the customer has to visit
cinema hall for further purposes. So, the customer can
get refund from the cinema hall.

● Hence both the customer and the cinema can sort out
further matter.

5
OBJECTIVE

❖The main objective of this project is to automate the


system of movie tickets booking. After inserting the data
into the database the staff needs not to do anything.
Customer can directly book tickets through internet and
that information will be stored simultaneously into the
database which can be accessed by the staff of the
cinema.

❖This system will also allow the customers to book seats


of different category (Silver, Gold, Platinum). Different
offers can also be applied before the payment is made.
However, every offer can be applied only once.Customer
can also give their feedback to about the system and to
improve customer satisfaction.Data generated will be
stored in the database.

❖This system will provide a anytime anyplace service for


the customer and will also help cinema increase its profit
at the same time. This will also promote the film on the
internet.

6
EXISTING SYSTEM
The existing system of offline booking have following
problems-
▪ More man power
▪ Time consuming

PROPOSED SYSTEM
● It works on the basic principle of the linking python  and a
database .
● At first , the command will be given in python software
afterwards the command will be sent to the database.
● There in the database the command will fetch the
demanded data and it will pass it to the python software.
● Then the required output will be shown the python
software.
● After succesful booking, data generated will be stored in
the database.

7
Hardware / Software Used

● Hardware – RAM - 4 GB or More , CPU – Intel i3 or


Above / AMD Ryzen 3 or above

● Software – Windows 7 or above Operating System ,


Python 3.x , MySQL

The following libraries have been added in the Python


3.x installation –
mysql.connector ( for Python-MySQL connectivity )
Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38)
[MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more
information.

8
TABLE STRUCTURE USED
This table contains the data of all customers having an account at the
cinema.

This table contains the data of all the movies that have been stored in the
database by the cinema.

This table contains all the offers that can be applied at the time of payment.

This table stores the data of all customers who have booked tickets.

This table stores the showtimings at a particular day

9
FLOWCHART
Start

Input Phone No and


password to sign in

Input Audi No

Input No.of seats


and select seat category

Select Suitable offer


before payment

Tickets are send to


email and phone
after payment

Give feedback

10
SOURCE CODE
#CONNECTING MYSQL
import mysql.connector as mys
mycon=mys.connect(host='localhost',user='root',passwd='Astrophysicist0116@T',database='
MTB')
mycursor=mycon.cursor()
#WELCOME
print("==============================================================
==================")
print(" Welcome To ALPHAION CINEMA HALL Ticket Booking Service ")
print("==============================================================
==================")
print('\n')
#SIGN-IN/SIGN-UP
print("PLEASE SELECT ONE OF THE FOLLOWING OPTIONS")
print("1. Sign In")
print("2. Sign Up")
print("3. Continue Without Login")
print("4. Exit")
print('\n')
xy=int(input("Please enter your choice:"))
while xy==1 or xy==2 or xy==3 or xy==4:
if (xy==1):
#INPUT PHONE NO. AND PASSWORD
phn=input("enter Phone number:")
pasw=input("enter password:")
#FETCHING DATA FROM SQL TABLE
query1="select * from UPT where pasw='{pasw}' and
Phno={phn}".format(pasw=pasw,phn=phn)
mycursor.execute(query1)
data=mycursor.fetchone()
#CONFIRMING IF USER EXSISTS
if data!=None:
print("Hii",data[0])
email=data[0][3]
print("Which movie would you like to watch")
print('\n')
#FETCHING LIST OF MOVIES
query2="select * from MSA"
mycursor.execute(query2)
data2=mycursor.fetchall()
SNo=1
#PRINTING LIST OF MOVIES
for row in data2:
print(SNo)
print("Movie:",row[0])

11
print("Price:",row[1])
print("Audi:",row[2])
print('\n')
SNo=SNo+1
ans='n'
while(ans!='y'):
#ASKING MOVIE TO BE WATCHED
MovC=int(input("enter your choice(ENTER AUDI NO.):"))
#FETCHING DATA REGARDING MOVIE SELECTED
query3="select * from MSA where audino={MovC}".format(MovC=MovC)
mycursor.execute(query3)
data3=mycursor.fetchall()
print(data3)
print("Confirm movie",data3[0][0])
x=data3[0][1]
ans=input(":")
#SELECT MOVIE TIMINGS

print("SHOWTIMINGS")
queryX="select* from ST"
mycursor.execute(queryX)
dataX=mycursor.fetchall()

for row in dataX:


print(row)
anss="y"
while anss=="y":
STS=int(input("Select from above Showtimings"))
if STS<=7:
queryX2="select * from ST where Sno={STS}".format(STS=STS)
mycursor.execute(queryX2)
dataX2=mycursor.fetchall()
print("Show time Selected:",dataX2[0][1])
anss="n"
else:
print("Invalid, Re-enter")
ReSTS=input("Want to re enter")
#INPUT NO. OF SEATS , CATEGORIES
print("Categories:")
print("1.Platinium(Rs.",x+100,")")
print("2.Gold(Rs.",x+50,")")
print("3.Silver(Rs.",x,")")
EC=int(input("Enter Category:"))
Seat=input("Enter number of seats:")
#APPLY OFFERS
print("Apply Offers")
#FETCHING LIST OF OFFERS
query4="select * from Offer"

12
mycursor.execute(query4)
data4=mycursor.fetchall()
for row in data4:
print("SNo.:",row[0])
print("Offer:",row[1])
print("Discount:",row[2])
print('\n')
ans2='r'
while ans2=='r':
Off=int(input("Enter offer number:"))
query7="select * from Offer"
mycursor.execute(query7)
data10=mycursor.fetchall()
#CHECKING IF OFFER VALIDITY
l=0
for row in data10:
l=l+1
if(Off>l):
print("out of range")
ans2='r'
elif (Off==1):
query5="select * from BH where Phn={phn}".format(phn=phn)
mycursor.execute(query5)
data5=mycursor.fetchall()
print(data5)
if data5!=[]:
print("can't avail this offer")
ans2=input("Reapply((enter 'r':")

else:
print("Discount applied")
ans2='y'

else:
print("Discount applied")
ans2='y'

query6="select * from Offer where Sno={Off}".format(Off=Off)


mycursor.execute(query6)
data6=mycursor.fetchall()
discount=data6[0][2]
if EC==1:
TP=x+100
elif EC==2:
TP=x+50
else:
TP=(x)

13
Ticketprice=(int(TP))*(int(Seat))
#Totalcost=Ticketprice-Discount+taxes
Totalcost=(float(Ticketprice))*1.18-float(discount)
print("Amount Payable:Rs.",Totalcost)
payment=0
#PAYMENT
while payment!=Totalcost:
payment=float(input("enter amount to pay:"))
if payment!=Totalcost:
print("amount doesnot match")
print("try again")
nouse=input("press any letter to continue")
#PRINTING TICKET
print("Ticket!!!")

print("==============================================================
==================")
print("Movie:",data3[0][0])
print("Showtime:",dataX2[0][1])
print("Audi:",data3[0][2])
print("Seats:",Seat)
print('\n')
print("Amount:",Totalcost)
print("Discount:",discount)
print("Payment status:payed")

print("==============================================================
==================")
print("THANKS FOR BOOKING")
print("TICKET HAS BEEN SEND TO REGISTERED PHONE NO. AND
EMAIL ID")
feed=input("enter feedbacks if any")
#UPDATING DATA IN DATABASE FOR LATER USES
query10="insert into BH
values('{0}','{1}','{2}','{3}')".format(phn,pasw,email,data3[0][0])
mycursor.execute(query10)
mycon.commit()
xy=10

else:
#IF PHONE NO. OR PASW DIDN'T MATCHED,
print("no data found, choose again")
print("1. Sign In")
print("2. Sign Up")
print("3. Continue Without Login")
xy=int(input("Please enter your choice:"))

14
elif(xy==2):
h='t'
while h=='t':
#GETTING DETAILS TO SIGNING UP
name=input("Enter your Name:")
Phone=input("Enter your Number:")
Email=input("Enter your mail id:")
CP='q'
CoP='r'
while CP!=CoP:
#GETTING A VALID PASSWORD
CP=input("Create Password:")
while len(CP)<4:
print("password must be of atleast 4 letters")
CP=input("Create Password:")
CoP=input("Confirm Password:")
if CP!=CoP:
print("Password doesn't match, retry")
query11="select * from upt"
mycursor.execute(query11)
data12=mycursor.fetchall()
for row in data12:
if row==(name,CP,Phone,Email):
print("already exsist")
print("retry")
else:
#UPDATING GIVEN INFORMATION IN DATABASE
query9="insert into upt
values('{0}','{1}','{2}','{3}')".format(name,CP,Phone,Email)
mycursor.execute(query9)
mycon.commit()
h='y'
#GIVING OPTIONS TO SIGN IN
print("1. Sign In")
print("2. Sign Up")
print("3. Continue Without Login")
print("4. EXIT")
xy=int(input("Please enter your choice:"))
elif(xy==3):
#FETCHING AND PRINTING LIST OF MOVIES
query8="select * from MSA"
mycursor.execute(query8)
data11=mycursor.fetchall()
SNo=1
for row in data11:
print(SNo)
print("Movie:",row[0])
print("Price:",row[1])

15
print("Audi:",row[2])
print('\n')
SNo=SNo+1
print("TO PROCEED FURTHUR PLEASE SIGN IN OR SIGN UP")
print("1. Sign In")
print("2. Sign Up")
print("3. Continue Without Login")
print("4. EXIT")
xy=int(input("Please enter your choice:"))
else:
#EXITING PROGRAM
print("BYE")
xy=10

16
OUTPUT:
>>>
= RESTART:
C:\Users\ADMIN\AppData\Local\Programs\Python\Python39
\Tanmay Vijay MTB.py
============================================
====================================
Welcome To ALPHAION CINEMA HALL Ticket
Booking Service
============================================
====================================

PLEASE SELECT ONE OF THE FOLLOWING OPTIONS


1. Sign In
2. Sign Up
3. Continue Without Login
4. Exit

Please enter your choice:3


1
Movie: Spiderman:Nowayhome
Price: 300
Audi: 1

2
Movie: Eternals
Price: 250
Audi: 2

17
3
Movie: RRR(3D)
Price: 250
Audi: 3

4
Movie: 83
Price: 275
Audi: 4

5
Movie: Sooryavanshi
Price: 225
Audi: 5

TO PROCEED FURTHUR PLEASE SIGN IN OR SIGN UP


1. Sign In
2. Sign Up
3. Continue Without Login
4. EXIT
Please enter your choice:2
Enter your Name:Tanmay Vijay
Enter your Number:8700668475
Enter your mail id:[email protected]
Create Password:123
password must be of atleast 4 letters
Create Password:1245
18
Confirm Password:1234
Password doesn't match, retry
Create Password:1234
Confirm Password:1234
1. Sign In
2. Sign Up
3. Continue Without Login
4. EXIT
Please enter your choice:1
enter Phone number:8700668475
enter password:1234
Hii Tanmay Vijay
Which movie would you like to watch

1
Movie: Spiderman:Nowayhome
Price: 300
Audi: 1

2
Movie: Eternals
Price: 250
Audi: 2

3
Movie: RRR(3D)
Price: 250
Audi: 3

19
4
Movie: 83
Price: 275
Audi: 4

5
Movie: Sooryavanshi
Price: 225
Audi: 5

enter your choice(ENTER AUDI NO.):1


[('Spiderman:Nowayhome', 300, 1)]
Confirm movie Spiderman:Nowayhome
:y
SHOWTIMINGS
(1, datetime.datetime(2022, 2, 8, 14, 30))
(2, datetime.datetime(2022, 2, 8, 16, 30))
(3, datetime.datetime(2022, 2, 8, 18, 30))
(4, datetime.datetime(2022, 2, 8, 20, 30))
(5, datetime.datetime(2022, 2, 8, 22, 30))
Select from above Showtimings2
Show time Selected: 2022-02-08 16:30:00
Categories:
1.Platinium(Rs. 400 )
2.Gold(Rs. 350 )
3.Silver(Rs. 300 )
Enter Category:1
Enter number of seats:9
Apply Offers
20
SNo.: 1
Offer: FIRSTTIME
Discount: 150

SNo.: 2
Offer: NYEAR022
Discount: 100

SNo.: 3
Offer: XMAS22
Discount: 100

Enter offer number:1


[('8700668475', 'QWERTY', 'm', 'Spiderman:Nowayhome')]
can't avail this offer
Reapply((enter 'r':r
Enter offer number:2
Discount applied
Amount Payable:Rs. 4148.0
enter amount to pay:4148
press any letter to continue
Ticket!!!
============================================
====================================
Movie: Spiderman:Nowayhome
Showtime: 2022-02-08 16:30:00
Audi: 1
Seats: 9

21
Amount: 4148.0
Discount: 100
Payment status:payed
============================================
====================================
THANKS FOR BOOKING
TICKET HAS BEEN SEND TO REGISTERED PHONE NO.
AND EMAIL ID
enter feedbacks if any-
>>>

22
Future Scope
To develop this system further, it is suggested to add the
following features –

1. Cancellation of tickets 4 hours prior to show time.


2. Referral Discount and Frequent User benefits.
3. Online booking of snacks and beverages.

Conclusion
In this project we were able to successfully automate the
following–

1. Login credentials to start the software program


2. User chooses from options available in the menu
3. Sign up if customer don’t have an account
4. Booking of Movie tickets
5. Selection of Seats
6. Succesful payment post selection of seats
7. Delivery of tickets to customer phone and email
8. Taking feedback from the customer
9. Storing the data into the database.

23
BIBLIOGRAPHY

▪ NCERT Text Book of Computer Science , class XI


▪ NCERT Text Book of Computer Science , class XII
▪ https://docs.python.org/
▪ www.w3schools.org
▪ www.stackoverflow.com
▪ www.programiz.com

24

You might also like