Python project
Python project
A PROJECT REPORT
ON
Submitted by
NIHARIKA.S 208MSB7045
PROF. K.RAVI
DEPARTMENT OF COMPUTER APPLICATION
2023-24
RNS FIRST GRADE COLLEGE
NAAC ACCREDITED WITH “A‟ GRADE
CERTIFICATE
This is to certify that Arunganesh (Register No. 208MSB7006) has successfully completed the
project titled “ ONLINE MOVIE TICKET BOOKING SYSTEM” at RNS First Grade College
under my supervision and guidance in the fulfilment of requirements of VI semester, Bachelor
of Computer Application of Bangalore University, Bangalore
.
1)...........................
2)...........................
ACKNOWLEDGEMENT
I express my sincere thanks to our beloved Principal, Dr. Sudheer Pai K L, for
providing us all the facilities for laboratory and library.
I express my gratitude to our Vice Principal Prof. Shilpa Sarnad for her
continuous support and assistance during the course of my project.
I express my grateful thanks to all the staff members, Department of BCA for
their valuable assistance, encouragement and co-operation during this wonderful
learning experience.
CHAPTER – 1 INTRODUCTION
1.1 Aim
1.2 Existing system
1.3 Proposed System
1.4 Objective
1.5 Modules
4.1 Definition
4.2 Function Requirements
4.3 Non-Function Requirements
CHAPTER – 5 SYSTEM DESIGN
5.1 Definition
5.2 Conceptual Design
5.3 Logical Design
5.4 Physical Design
5.5 E R Diagram
5.6 Methodology
CHAPTER – 6 SCREENSHOTS
CHAPTER – 7 CODING
8.1 Testing
8.2 Unit Testing
8.3 Validation Testing
8.4 Performance Testing
CHAPTER – 10 CONCLUSIONS
BIBLIOGRAPHY
ONLINE MOVIE TICKET BOOKING SYSTEM
INTRODUCTION
CHAPTER 1
INTRODUCTION
1.1AIM
In order to solve the drawbacks of the previous system stated in 1.1, the existing
system will need to evolve. We aim to improve the existing system to enhance
user experience, The aim of an online movie ticket booking system is to provide
a convenient and efficient platform for users to book movie tickets over the
internet. The system aims to simplify the ticket booking process by eliminating
the need for physical ticket counters and allowing users to book tickets from the
comfort of their homes or on the go. By being available online, the system aims
information and book tickets anytime and anywhere with an internet connection.
In the existing system User Registration and Authentication can create accounts,
log in, and authenticate themselves to access the system's features. Movie and
Theatre Information: The system stores information about movies, including their
titles, genres, descriptions, release dates, and associated theatres. Theatre details
such as name, location, seating capacity, and show timings are also stored.
Showtime and Seat Selection: Users can select a movie, choose a specific
showtime, and select their preferred seats in the theatre. The system should handle
seat availability, seat maps, and reservations .Booking and Payment Processing:
Once the movie, showtime, and seats are selected, users can proceed to the
booking and payment process. The system should securely process online
payments, verify transactions, and generate booking confirmations.
1.4. OBJECTIVES
• The project is totally built at administrative end and thus only the
administrator is guaranteed the access.
1.5 MODULES
The proposed project will have its main page and will be mainly divided
into admin and customers modules as.
The seat and booking module in an online movie ticket booking system is
responsible for managing seat availability, seat selection, and the booking
process.
5. Payment form
6. Login form
7. Users form
8. Exit
SYSTEM ANALYSIS
CHAPTER 2
SYSTEM ANALYSIS
The existing system is clearly understood. The next step is to conduct the
feasibility study, which is a high-level capsule version of the entire system
analysis and design process. The objective is to determine whether the
proposed system is feasible. The three tests of feasibility nave been coming
out:
1. Technical feasibility
2. Economic feasibility
3. Operational feasibility
In technical feasibility study, one has to test whether the proposed system
can be developed using existing technology or not. It is planned to
implement the proposed system using Windows 2000 Professional, JSP and
Apache Tomcat Web Server.
As part of this, the costs and benefits associated with the proposed system
are to be compared and the project is economically feasible only if benefits
outweigh costs. The Organization has already its own satellite link, and a
host of SUN FIRE 6800 servers.
So, it need not invest newly for the internet connection and also the
organization initiated to use Open Source in project development, hence
there is 0 additional cost incurred for the tools that will be used.
This test of feasibility checks if the system works with least difficulties
when it is developed and installed. The technical staffs have sufficient
knowledge of the tools being used and the users need just to know how to
access and run the programs in the Apache Web Server. Hence it is
concluded that the system is operationally feasible.
Software requirement
Hardware Requirement
SOFTWARE COMPONENTS
CHAPTER 3
SOFTWARE COMPONENTS
TECHNOLOGY USED
intelligence, and more. It is known for its easy-to-read syntax and code
readability, making it a popular choice for beginners. Python also has a large
platform language, which means that code written on one platform (such as
can get started quickly with a basic Flask application by installing the
Flask package and writing a few lines of code. Routing and View
dynamic HTML pages. You can create templates with placeholders for
application itself, rather than being a separate service that the application
communicates with. This makes it a popular choice for mobile apps, web
SOFTWARE REQUIREMENT
SPECIFICATION
CHAPTER 4
4.1 DEFINITION
A software requirements specification (SRS) is a description of a software
system to be developed. It lays out functional and non-functional
requirements, and may include a set of use cases that describe user
interactions that the software must provide.
It serves as a product validation check. The SRS also serves as the parent
document for testing and validation strategies that will be applied to the
requirements for verification.
USER REGISTRATION
• User Registration
USER LOGOUT
PERFORMANCE REQUIREMENTS
• The load time for the user interface screen shall take no longer than
two seconds.
SAFETY REQUIREMENTS
SECURITY REQUIREMENTS
• After entering the password and user id the user can access his
profile.
• Sharing of details.
RELIABILTY
MAINTAINABILITY
• It is easy to maintain.
PORTIBILITY
The Study Tweaks Forum and Python with Django web framework
shall run in any platform with web browser support.
SYSTEM DESIGN
CHAPTER 5
SYSTEM DESIGN
5.1 DEFINITION
The major steps in the design phase are input design, output design, and
dealing with coding issues. The very first step is design of Input and output
screen to the client requirements. Next comes the various issues that should
be dealt with while coding and the code should be such that it should be
compatible with the real time environment and should be generic in nature.
• Conceptual Design
• Logical Design
• Physical Design
Logical Design derives business objects and their related services directly
from these usage scenarios. The logical view of the solution provides a basis
for evaluating different physical options. It also formalizes the solution for
the project team.
The idea of the application is that the system first emerges in logical design.
Its boundaries are business objects and it contains the system definition.
Logical design specifies the interfaces between the system and external
entities, such as users and other systems. Within a system there may be a
number of subsystems, and these boundaries are also specified.
• Input/output Specifications
• File Specification
• Processing Specifications
The idea of the application is that the system first emerges in logical design.
Its boundaries and business objects contain the system definition. Logical
design specifies the interfaces between the system and external entities,
such as users and other systems. Within a system there may be a number of
subsystems, and these boundaries are also specified.
• Input/output Specifications
• File Specifications
• Processing Specification
DATA FLOW
PROCESS:
Procedures or devices that use or transform data.
DATA SOURCE:
INSURANCE
USER ADMIN
MANAGEMENT
SYSTEM
Login
1) ENTITY
Entities are represented by rectangles. An entity is an object or concept
about which you want 00 to store information.
2) ATTRIBUTE
Attributes are represented by ovals. A key attribute is the unique,
distinguishing Characteristic of the entity. For example, an customer's
social security number might be the customer's key attribute.
3) RELATIONSHIP
Relationship is represented by diamond shapes, show how two entities share
information.
customer
4) MULTIVATED ATTRIBUTES
A multivalued attribute can have more than one value. For example, an
customer entity can have multiple skill values.
Attribute
5) DERIVED ATTRIBUTES
ER DIAGRAM
5.7 Methodology
SCREENSHOTS
CHAPTER 6
SCREENSHOTS
CODING
CODING:
def t_movie():
global f
f = f+1
print("1,movie 1 ")
print("2,movie 2 ")
print("3,movie 3")
print("4,back")
if movie == 4:
center()
theater()
return 0
if f == 1:
theater()
def theater():
print("1,SCREEN 1")
print("2,SCREEN 2")
print("3,SCREEN 3")
timing(a)
def timing(a):
time1 = {
"1": "10.00-1.00",
"2": "1.10-4.10",
"3": "4.20-7.20",
"4": "7.30-10.30"
time2 = {
"1": "10.15-1.15",
"2": "1.25-4.25",
"3": "4.35-7.35",
"4": "7.45-10.45"
time3 = {
"1": "10.30-1.30",
"2": "1.40-4.40",
"3": "4.50-7.50",
"4": "8.00-10.45"
if a == 1:
print(time1)
x = time1[t]
elif a == 2:
print(time2)
x = time2[t]
elif a == 3:
print(time3)
x = time3[t]
return 0
def movie(theater):
if theater == 1:
t_movie()
elif theater == 2:
t_movie()
elif theater == 3:
t_movie()
elif theater == 4:
city()
else:
print("wrong choice")
def center():
print("1,Inox")
print("2,Icon")
print("3,pvp")
print("4,back")
movie(a)
return 0
def city():
print("1,city 1")
print("2,city 2 ")
print("3,city 3 ")
if place == 1:
center()
elif place == 2:
center()
elif place == 3:
center()
else:
print("wrong choice")
import mysql.connector,sys
import datetime
from mysql.connector import Error
from flask import Flask, request, jsonify,
render_template
from random import randint
app = Flask(_name_)
@app.route('/')
def renderLoginPage():
return render_template('login.html')
try:
if username == 'cashier' and password ==
'cashier123':
return render_template('manager.html')
else:
return render_template('loginfail.html')
except Exception as e:
print(e)
return render_template('loginfail.html')
if res == []:
return '<h4>No Movies Showing</h4>'
else:
return render_template('movies.html',movies =
res)
list = []
for i in res:
list.append( (i[0], int(i[0]/100), i[0]%100 if
i[0]%100 != 0 else '00' ) )
@app.route('/getAvailableSeats', methods =
['POST'])
def getSeating():
showID = request.form['showID']
totalGold = 0
totalStandard = 0
for i in res:
if i[0] == 'gold':
totalGold = i[1]
if i[0] == 'standard':
totalStandard = i[1]
goldSeats = []
standardSeats = []
standardSeats.append([i,''])
for i in res:
if i[0] > 1000:
goldSeats[ i[0] % 1000 - 1 ][1] = 'disabled'
else:
standardSeats[ i[0] - 1 ][1] = 'disabled'
if res == []:
return '<h5>Prices Have Not Been Assigned To
This Show, Please Try Again Later!</h5>'
price = int(res[0][0])
if seatClass == 'gold':
price = price * 1.5
if seatClass == 'gold':
seatNo = int(seatNo) + 1000
ticketNo = 0
res = None
if res == []:
return '<h5>Ticket Has Been Booked
Successfully!</h5>\
<h6>Ticket Number: '+str(ticketNo)+'</h6>'
res = runQuery("SELECT
show_id,movie_name,type,time FROM shows
NATURAL JOIN movies WHERE Date =
'"+date+"'")
if res == []:
return '<h4>No Shows Showing</h4>'
else:
shows = []
for i in res:
x = i[3] % 100
if i[3] % 100 == 0:
x = '00'
shows.append([ i[0], i[1], i[2], int(i[3] /
100), x ])
@app.route('/getBookedWithShowID', methods =
['POST'])
def getBookedTickets():
showID = request.form['showID']
if res == []:
return '<h5>No Bookings!!</h5>'
tickets = []
for i in res:
@app.route('/fetchMovieInsertForm', methods =
['GET'])
def getMovieForm():
return render_template('movieform.html')
for i in res:
if i[1] == movieName and i[2] == int(movieLen)
and i[3] == movieLang \
and i[4].strftime('%Y/%m/%d') ==
startShowing and i[5].strftime('%Y/%m/%d') ==
endShowing:
return '<h5>The Same Movie Already
Exists</h5>'
movieID = 0
res = None
",'"+movieLang+"','"+startShowing+"','"+endSh
owing+"')")
if res == []:
print("Was able to add movie")
subTypes = types.split(' ')
if res == []:
return '<h5>Movie Added
Successfully!</h5>\
<h6>Movie ID: '+str(movieID)+'</h6>'
else:
print(res)
else:
print(res)
res = runQuery("SELECT
movie_id,movie_name,length,language FROM
movies WHERE show_start <= '"+showDate+\
"' and show_end >= '"+showDate+"'")
if res == []:
return '<h5>No Movies Available for Showing
On Selected Date</h5>'
movies = []
for i in res:
subTypes = runQuery("SELECT * FROM types
WHERE movie_id = "+str(i[0]) )
t = subTypes[0][1]
if subTypes[0][2] != 'NUL':
t = t + ' ' + subTypes[0][2]
if subTypes[0][3] != 'NUL':
t = t + ' ' + subTypes[0][3]
movies.append( (i[0],i[1],t,i[2],i[3]) )
@app.route('/getHallsAvailable', methods =
['POST'])
def getHalls():
movieID = request.form['movieID']
showDate = request.form['showDate']
showTime = request.form['showTime']
movieLen = res[0][0]
showTime = int(showTime)
unavailableHalls = set()
for i in res:
y = x + i[1]
unavailableHalls =
unavailableHalls.union({i[0]})
availableHalls = set()
for i in res:
availableHalls = availableHalls.union({i[0]})
availableHalls =
availableHalls.difference(unavailableHalls)
if availableHalls == set():
showID = 0
res = None
",'"+movieType+"',"+showTime+",'"+showDate
+"',"+'NULL'+")")
print(res)
if res == []:
return '<h5>Show Scheduled
Successfully</h5>\
<h6>Show ID: '+str(showID)+'</h6>'
else:
print(res)
return '<h5>Something Went Wrong!!</h5>'
sortedDays =
['Sunday','Monday','Tuesday','Wednesday','Thursday
','Friday','Saturday']
if res == []:
return '<h5>Price Updated Successfully</h5>\
<h6>Standard: $ '+newPrice+'</h6>\
<h6>Gold: $ '+str( int(int(newPrice) * 1.5)
)+'</h6>'
else:
print(res)
return '<h5>Something Went Wrong!!</h5>'
def runQuery(query):
try:
db = mysql.connector.connect(
host='localhost',
database='dbtheatre',
user='root',
password='')
if db.is_connected():
print("Connected to MySQL, running
query: ", query)
cursor = db.cursor(buffered = True)
cursor.execute(query)
db.commit()
res = None
try:
res = cursor.fetchall()
except Exception as e:
print("Query returned nothing, ", e)
return []
return res
except Exception as e:
print(e)
return e
finally:
db.close()
if _name_ == "_main_":
app.run(host='0.0.0.0')
class Movie:
def _init_(self, title, showtimes, available_seats):
self.title = title
self.showtimes = showtimes
self.available_seats = available_seats
def display_showtimes(self):
print("Showtimes for", self.title)
class Theater:
def _init_(self, name, movies):
self.name = name
self.movies = movies
def display_movies(self):
print("Movies available at", self.name)
for movie in self.movies:
print(movie.title)
if movie.title == movie_title:
for show in movie.showtimes:
if show == showtime:
if movie.available_seats >=
num_tickets:
movie.available_seats -=
num_tickets
print("Tickets booked
successfully!")
return
else:
print("Insufficient seats
available.")
return
print("Showtime not found.")
return
print("Movie not found.")
def main():
# Create movies
movie1 = Movie("Movie 1", ["10:00 AM", "2:00
PM", "6:00 PM"], 100)
# Book tickets
movie_title = input("Enter the movie title: ")
showtime = input("Enter the showtime: ")
num_tickets = int(input("Enter the number of
tickets: "))
theater.book_ticket(movie_title, showtime,
num_tickets)
if _name_ == "_main_":
main()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-
width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible"
content="ie=edge" />
<link rel="stylesheet" href="style.css" />
<title>Movie Seat Booking</title>
</head>
<body>
<div class="movie-container">
<label>Pick a movie:</label>
<select id="movie">
<option value="10">Avengers: Endgame
($10)</option>
<option value="12">Joker ($12)</option>
<option value="8">Toy Story 4 ($8)</option>
<option value="9">The Lion King ($9)</option>
</select>
</div>
<ul class="showcase">
<li>
<div class="seat"></div>
<small>N/A</small>
</li>
<li>
<div class="seat selected"></div>
<small>Selected</small>
</li>
<li>
<div class="seat occupied"></div>
<small>Occupied</small>
</li>
</ul>
<div class="container">
<div class="screen"></div>
<div class="row">
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
</div>
<div class="row">
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
<div class="seat occupied"></div>
<div class="seat occupied"></div>
</div>
<div class="row">
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
<div class="seat occupied"></div>
<div class="seat occupied"></div>
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
</div>
<div class="row">
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
<div class="seat"></div>
<div class="seat occupied"></div>
<div class="seat occupied"></div>
<div class="seat occupied"></div>
<div class="seat"></div>
</div>
</div>
<p class="text">
You have selected <span id="count">0</span> seats
for a price of $<span
id="total"
>0</span
>
</p>
<script src="script.js"></script>
</body>
</html>
2. script.js
populateUI();
localStorage.setItem('selectedSeats',
JSON.stringify(seatsIndex));
count.innerText = selectedSeatsCount;
total.innerText = selectedSeatsCount * ticketPrice;
setMovieData(movieSelect.selectedIndex,
movieSelect.value);
}
const selectedMovieIndex =
localStorage.getItem('selectedMovieIndex');
updateSelectedCount();
}
});
3. style.css
@import
url('https://fonts.googleapis.com/css?family=Lato&displa
y=swap');
*{
box-sizing: border-box;
}
body {
background-color: #242333;
color: #fff;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
font-family: 'Lato', sans-serif;
margin: 0;
}
.movie-container {
margin: 20px 0;
}
.movie-container select {
background-color: #fff;
border: 0;
border-radius: 5px;
font-size: 14px;
margin-left: 10px;
padding: 5px 15px 5px 15px;
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
}
.container {
perspective: 1000px;
margin-bottom: 30px;
}
.seat {
background-color: #444451;
height: 12px;
width: 15px;
margin: 3px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.seat.selected {
background-color: #6feaf6;
}
.seat.occupied {
background-color: #fff;
}
.seat:nth-of-type(2) {
margin-right: 18px;
}
.seat:nth-last-of-type(2) {
margin-left: 18px;
}
.seat:not(.occupied):hover {
cursor: pointer;
transform: scale(1.2);
}
.showcase .seat:not(.occupied):hover {
cursor: default;
transform: scale(1);
}
.showcase {
background: rgba(0, 0, 0, 0.1);
padding: 5px 10px;
border-radius: 5px;
color: #777;
list-style-type: none;
display: flex;
justify-content: space-between;
}
.showcase li {
display: flex;
align-items: center;
justify-content: center;
margin: 0 10px;
}
.showcase li small {
margin-left: 2px;
}
.row {
display: flex;
}
.screen {
background-color: #fff;
height: 70px;
width: 100%;
margin: 15px 0;
transform: rotateX(-45deg);
box-shadow: 0 3px 10px rgba(255, 255, 255, 0.7); }
CHAPTER 8
8.1 TESTING
Instead of testing the system as a whole, Unit testing focuses on the modules that
make up the system. Each module is taken up individually and tested for
correctness in coding and logic. Unit testing is a crucial aspect of ensuring the
reliability and correctness of an online movie ticket booking system. It involves
FUTURE ENHANCEMENT
CHAPTER 9
FUTURE ENHANCEMENT
• User Profiles: Implement a user profile system where users can create accounts, store
their preferences, and view their booking history. This can provide a personalized
experience and make it easier for users to manage their bookings .
• Social Media Integration: Enable users to share their movie bookings on social media
platforms. This can help promote your platform and allow users to invite their friends
to join them for a movie.
• Ratings and Reviews: Allow users to rate and review movies they have watched.
Implement a rating system and provide a space for users to share their thoughts and
opinions about the movies. This can help other users make informed decisions when
choosing movies.
CONCLUSION
CONCLUSION
I would like to admit that there was a lot of effort involved in developing the
software/report ready. The completion time for the report was as long as that of
the program.
I thank everyone who helped and guided in developing software. I am very much
obliged to my parents and blessings of god and my beloved lectures.
5. Provides high security to the system and hence unauthorized users can be
prevented.
7. Ease of operation.
BIBLIOGRAPHY
BIBLIOGRAPHY
REFERANCE BOOK
1. A byte of python.
2. Programming Python
4. Software Engineering.
WEBSITE
• http://www.w3school.com
• http://www.codeacademy.com
• http://github.com
• www.slideshare.net
• www.enggroom.com
• www.Projectsgeek.com