0% found this document useful (0 votes)
22 views107 pages

Python project

Movie tikets book my show

Uploaded by

minakshisahu8456
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
22 views107 pages

Python project

Movie tikets book my show

Uploaded by

minakshisahu8456
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 107

BANGALORE UNIVERSITY

A PROJECT REPORT

ON

“ONLINE MOVIE TICKET BOOKING SYSTEM”

Submitted in Practical fulfilment for the award of the degree

BACHELOR OF COMPUTER APPLICATION

Submitted by

NIHARIKA.S 208MSB7045

UNDER THE GUIDANCE OF

PROF. K.RAVI
DEPARTMENT OF COMPUTER APPLICATION

RNS FIRST GRADE COLLEGE


NAAC ACCREDITED WITH “A‟ GRADE

Channasandra, Bengaluru- 560098

2023-24
RNS FIRST GRADE COLLEGE
NAAC ACCREDITED WITH “A‟ GRADE

Channasandra, Bangalore 560098

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
.

Signature of the Guide:

Head of the Department Principal

Signature of the Examiners: -

1)...........................

2)...........................
ACKNOWLEDGEMENT

I express my deep sense of gratitude to my guide Dr KAVITHA R G


Department of BCA for providing valuable suggestions and guidance during the
development, designing and implementation of the project, without which it
would not have been possible to complete the project.

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 wish to reciprocate in full measure the kindness shown by Dr. Mohan S H,


Head of the Department who inspired us with his valuable suggestions in
successfully completing the project work.

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.

Finally, I would like to express my sincere thanks to my parents and my friends


for the useful tips and moral support.
TABLE OF CONTENTS

CHAPTER – 1 INTRODUCTION

1.1 Aim
1.2 Existing system
1.3 Proposed System
1.4 Objective
1.5 Modules

CHAPTER – 2 SYSTEM ANALYS

2.1 Feasibility Study


2.1.1 Technical Feasibility
2.1.2 Economical Feasibility
2.1.3 Operational Feasibility
2.2 Software and Hardware Components

CHAPTER – 3 SOFTWARE COMPONENTS

3.1 Introduction to Python


3.2 Introduction to Flask framework
3.3 Introduction to SQLite

CHAPTER – 4 SOFTWARE REQUIREMENTS

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

6.1 Main login Form


6.2 Manager Form
6.3 Movie detail Form
6.4 Cashier Form
6.5 Movie insert detail Form
6.6 Movie pricing Form
6.7 Movie select Form
6.8 Date select Form
6.9 Booking confirm Form

CHAPTER – 7 CODING

CHAPTER – 8 SYSTEM TESTING

8.1 Testing
8.2 Unit Testing
8.3 Validation Testing
8.4 Performance Testing

CHAPTER - 9 FUTURE ENHANCEMENT

CHAPTER – 10 CONCLUSIONS

BIBLIOGRAPHY
ONLINE MOVIE TICKET BOOKING SYSTEM

INTRODUCTION

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


1
ONLINE MOVIE TICKET BOOKING SYSTEM

CHAPTER 1

INTRODUCTION

A simple project based on Online Movie Ticket Booking System which


uses Python Language with Flask Web Framework. It has a number of features
that will allow users to book movie tickets and add movie details. This system as
well as the python application’s concept is all clear. It’s the same as real-life
scenarios and well-implemented on it. In particular, this Movie Ticket Booking
System project in Python focuses mainly on keeping track of movie booking
details. To be more precise, the system helps to keep track of theatre movies with
respect to their depth information. Also, the system displays all pricing lists
according to day and type. In addition, the system allows viewing booking details
and more. Evidently, this project contains a manager panel with a cashier panel.
In an overview of this web application, the manager has full control over the
system. He/she can manage movies, schedule movies, alter ticket prices, and list
booking details. Moreover, a manager only has access to manage/set up movies.
In general, the system allows inserting movies with their various details. Speaking
of movie details refers to its title, language, format, total length, and hall id. Also,
the user needs to schedule each movie in order to make it available for the public
users. Here, the user has to select a date and time in order to schedule a movie
with respect to format and hall id. In fact, each movie should have its own unique
show timing and day in order to schedule a show. Both of these features play the
main role in maintaining the proper flow of the system. On one hand, this movie
ticket booking application in python also allows the manager to list out all the
booking details. addition to it, the manager won’t be able to view any booking
details prior to the current date

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


2
ONLINE MOVIE TICKET BOOKING SYSTEM

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

to be accessible to a wide range of users, allowing them to access movie

information and book tickets anytime and anywhere with an internet connection.

1.2 EXISTING SYSTEM

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:

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


3
ONLINE MOVIE TICKET BOOKING SYSTEM

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.3 PROPOSED SYSTEM

The development of the Insurance Management System in Django


serves as a the existing insurance system has a long process to obtain
life insurance. It also contains a long chain of intermediaries. We aim
to improve the existing system to enhance user experience, connect the
policyholders directly to the insurer to avoid the involvement of
middlemen. Provide sophisticated ways to store and handle data
without any loss of data. We have devised a code that uses SQL-
connectivity to ensure swift accessibility to insurers. We have
implemented optimal methods to secure the data from being stolen. The
agents of the company can only access their clients’ data. The Agent at
any time can view the required information whether it is policies, or
customers at the click of a mouse and instance of a second. If planned
in an organized manner the customers can be provided an online
terminal where they can access the information at their own hands with
out the basic intervention manually and to provide a convenient and
efficient way for users to book movie tickets from the comfort of their
own homes. It allows users to browse through a selection of movies,
view showtimes, select seats, and make reservations online.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


4
ONLINE MOVIE TICKET BOOKING SYSTEM

1.4. OBJECTIVES

• The main objective of the Online Movie Ticket Booking System is to


manage the details of Movie, Ticket, Customer, Show Timing.

• Convenience and Accessibility: The system should provide a convenient


and accessible platform for users to browse movies, check showtimes, and
book tickets from any location with internet access.

• The project is totally built at administrative end and thus only the
administrator is guaranteed the access.

• Real-Time Seat Availability: The system should display real-time seat


availability for each showtime, allowing users to select their preferred
seats.

• Movie and Theatre Information: The system should provide


comprehensive and up-to-date information about movies, including titles,
genres, descriptions, cast, trailers, and associated theatres with their
locations and amenities.

• User-Friendly Interface: The system should have an intuitive and user-


friendly interface that makes it easy for users to navigate, search for
movies, select showtimes, and book tickets. Granting Security To People.
Easy of Use. It's a web-based programmer

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


5
ONLINE MOVIE TICKET BOOKING SYSTEM

1.5 MODULES

The proposed project will have its main page and will be mainly divided
into admin and customers modules as.

1. Movie management form

It encompasses various functionalities and features that help in effectively

managing insurance policies, claims, customers, and related processes.

2. Seat management form

This feature allows users to create, view, update, and manage


insurance policies. It includes functionalities like policy creation
forms, policy listing, policy details view, and the ability to handle
policy endorsements, cancellations, or renewals

3. Customer management form

The customer management feature enables the storage and retrieval


of customer information. It includes functionalities such as customer
registration, profile management .

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


6
ONLINE MOVIE TICKET BOOKING SYSTEM

4. Seat and booking form

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

The payment module in an online movie ticket booking system is responsible


for handling the payment process securely and efficiently.

6. Login form

The login module plays a crucial role in authenticating users and


providing access to the system's functionalities.

7. Users form

It provides functionalities for user registration, authentication,


authorization, and profile management.

8. Exit

It exits the system.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


7
ONLINE MOVIE TICKET BOOKING SYSTEM

SYSTEM ANALYSIS

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


8
ONLINE MOVIE TICKET BOOKING SYSTEM

CHAPTER 2

SYSTEM ANALYSIS

2.1. FEASIBILITY STUDY

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

2.1.1 TECHNICAL 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.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


9
ONLINE MOVIE TICKET BOOKING SYSTEM

The Organization already possesses the Windows 2000 Professional


Operating System. It is evident that the necessary hardware and software
are available for the development and implementation of the proposed
system. Hence the solution is technically feasible.

2.1.2 ECONOMICAL FEASIBILITY

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.

2.1.3 OPERATIONL FEASIBILITY

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.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


10
ONLINE MOVIE TICKET BOOKING SYSTEM

2.2 SOFTWARE AND HARDWARE REQUIREMENTS

Software requirement

• Operating system: Windows 11

• Front-End Tool: Python with flask web framework

• Back End Tool: SQLite

• Programmer Tool: Python with flask web framework

Hardware Requirement

• Processor: Intel(R) Core (TM) i5-10210U

• CPU @ 1.60GHz 2.11 GHz

• RAM: 8.00 GB Hard Disk: 1 TB

• System type 64-bit operating system

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


11
ONLINE MOVIE TICKET BOOKING SYSTEM

SOFTWARE COMPONENTS

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


12
ONLINE MOVIE TICKET BOOKING SYSTEM

CHAPTER 3

SOFTWARE COMPONENTS

TECHNOLOGY USED

SQLite server is installed or required for the current system.

3.1 INTRODUCTION TO PYTHON

Python is a high-level, interpreted programming language that is widely

used for web development, scientific computing, data analysis, artificial

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

and active community, which means there is a wealth of resources and

libraries available for users to take advantage of. Additionally, it is a cross-

platform language, which means that code written on one platform (such as

Windows) can run on another platform (such as Mac or Linux) without

modification. If you're new to programming, or want to start learning a new

programming language, Python is a great choice.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


13
ONLINE MOVIE TICKET BOOKING SYSTEM

3.2 INTRODUCTION TO FLASK FRAMEWORK

Python with the Flask web framework is a powerful combination for

developing web applications. Flask is a lightweight and flexible

framework that allows you to quickly build web applications using

Python. It provides a simple and elegant way to handle routing, request

handling, and template rendering. Easy to Get Started: Flask is

designed to be beginner-friendly and has a minimalistic approach. You

can get started quickly with a basic Flask application by installing the

Flask package and writing a few lines of code. Routing and View

Functions: Flask uses a decorator-based approach for defining routes.

You can use the @app.route decorator to map URLs to specific

functions, known as view functions. View functions handle incoming

requests and return responses. Template Rendering: Flask integrates

with Jinja2, a popular templating engine, allowing you to generate

dynamic HTML pages. You can create templates with placeholders for

dynamic data and render them using Flask's template rendering

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


14
ONLINE MOVIE TICKET BOOKING SYSTEM

capabilities. URL Building: Flask provides URL building utilities to

generate URLs dynamically within your application.

3.3 INTRODUCTION TO SQLite

SQLite3 is a software library that provides a relational database

management system. It is written in the C programming language and is a

self-contained, server less, zero-configuration, and transactional SQL

database engine. SQLite3 is widely used in various applications as an

embedded database management system, meaning it is integrated into the

application itself, rather than being a separate service that the application

communicates with. This makes it a popular choice for mobile apps, web

browsers, and other applications that need a lightweight and easy-to-use

database management system.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


15
ONLINE MOVIE TICKET BOOKING SYSTEM

SOFTWARE REQUIREMENT
SPECIFICATION

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


16
ONLINE MOVIE TICKET BOOKING SYSTEM

CHAPTER 4

SOFTWARE REQUIREMENT SPECIFICATION

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.

SRS are typically developed during the first stages of "Requirements


Development '' which is the initial product of the development phase in
which information is gathered about what requirements are needed--and
not. This information-gathering stage can include onsite visits,
questionnaires, surveys, interviews, and perhaps a return-on-investment
(ROI) analysis or needs analysis of the customer or client's current business
environment. The actual specification, then, is written after the
requirements have been gathered and analysed

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


17
ONLINE MOVIE TICKET BOOKING SYSTEM

Software requirements specification establishes the basis for an agreement


between customers and contractors or suppliers (in market-driven projects,
these roles may be played by the marketing and development divisions) on
what the software product is to do as well as what it is not expected to do.
Software requirements specification permits a rigorous assessment of
requirements before design can begin and reduces later redesign. It should
also provide a realistic basis for estimating product costs, risks, and
schedules. Used appropriately, software requirements specifications can
help prevent software project failure.

The software requirements specification document enlists enough and


necessary requirements that are required for the project development. To
derive the requirements, the developer needs to have a clear and thorough
understanding of the products to be developed or being developed. This is
achieved and refined with detailed and continuous communications with the
project team and customer till the completion of the software.

4.2 FUNCTIONAL REQUIREMENTS

The International Institute of Business Analysis (IIBA) defines functional


requirements as product capabilities, or things that a product must do for Its
users. „Functional requirement defines how software behaves to meet user
needs

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


18
ONLINE MOVIE TICKET BOOKING SYSTEM

USER REGISTRATION

• This is a user registration form.

• User Registration

USER LOGOUT

• The system provides the facility to logout from the site.

• Logout from the system.

4.3 NON FUNCTIONAL REQUIREMENTS

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


19
ONLINE MOVIE TICKET BOOKING SYSTEM

The IIBA defines non-functional requirements as "the quality attributes,


design and Implementation constraints, and external Interfaces which a
product must nave.
A non-functional requirement is a statement of how a system must behave;
it is a constraint upon the system behaviour.

Non-functional requirements specify all the remaining requirements not


covered by the functional requirements.

Non-functional requirements place restrictions on the product being


developed, the development process, and specify external constraints that
the product must meet.

PERFORMANCE REQUIREMENTS

• The system needs to be reliable

• The load time for the user interface screen shall take no longer than
two seconds.

SAFETY REQUIREMENTS

• The details need to be maintained properly.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


20
ONLINE MOVIE TICKET BOOKING SYSTEM

• Users must be authenticated.

• The database must be kept backed up.

SECURITY REQUIREMENTS

• After entering the password and user id the user can access his
profile.

• The details of the user must be safe and secure.

• Sharing of details.

RELIABILTY

• Response time should be minimum

• The software will be available only to authorized users.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


21
ONLINE MOVIE TICKET BOOKING SYSTEM

MAINTAINABILITY

• The software is developed in Python with flask web framework,


SQLite.

• 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.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


22
ONLINE MOVIE TICKET BOOKING SYSTEM

SYSTEM DESIGN

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


23
ONLINE MOVIE TICKET BOOKING SYSTEM

CHAPTER 5

SYSTEM DESIGN

System design is a modelling process. It is a solution, how to approach


creating a new system.

5.1 DEFINITION

It can be defined as a transition from users view to programmer s or database


person s view. The design phase mainly depends on the detailed
specification in the feasibility study. The system design phase acts as a
bridge between the required specification and the implementation phase.

From a project management point of view software design is conducted in


two steps. Preliminary design is concerned with the transformation of
requirements into data and software architecture. Detailed design focuses
on refinement to the architectural representation that leads to detailed data
structure and algorithmic representation for software.

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.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


24
ONLINE MOVIE TICKET BOOKING SYSTEM

System design is a process through which requirements are translated into


a representation of software. Initially the representation depicts a holistic
view of software. System design serves as the foundation for all software
engineering and software maintenance steps that follow.

We look the design process from three distinct perspectives ;

• Conceptual Design

• Logical Design

• Physical Design

5.2 CONCEPTUAL DESIGN

Conceptual Design is the process of acquiring and evaluating, documenting


and then validating what the user envisions to be the business relation. It
identifies the user and business requirements of the application and leads to
a business solution as seen by the user. All applications are built to solve
business problems, and it is important to pay close attention to the principle
that the business needs to drive application development. At any point in
the design process, the current state of the design should be directly
traceable to a business problem and requirements.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


25
ONLINE MOVIE TICKET BOOKING SYSTEM

To achieve this conceptual design is driven by developing usage scenarios.


These scenarios are a direct representation of the user's view of the solution
to a specific business problem. A conceptual view places the emphasis on
solving a business problem and deriving a solution that corresponds to the
needs and requirements of the users. It is based on deriving the behaviour
of the solution with a primary emphasis on the user. Beginning with an
emphasis on the activities of the business rather than aspects of software
development, underscores the fact that systems exist to serve the business

5.3 LOGICAL 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.

Logical System Design consists of the following steps:

• Input/output Specifications

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


26
ONLINE MOVIE TICKET BOOKING SYSTEM

• File Specification

• Processing Specifications

5.4 PHYSICAL DESIGN

The purpose of Physical Design is to translate the logical design into a


solution that can be implemented effectively, according to performance,
administration and development process requirements. This physical view
should correctly implement the desired system behaviour while meeting the
constraints imposed by the technology.

In Physical Design, the perspective shifts from an abstraction of system


behaviour to an Implementation of the behaviour.

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.

Logical System Design consists of the following steps:

• Input/output Specifications

• File Specifications

• Processing Specification

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


27
ONLINE MOVIE TICKET BOOKING SYSTEM

The aim of physical design is to specify how to build portioned applications


from software components. The interaction of these components through
defined Interfaces results in the desired behaviour of the system as a whole.
Physical design consists of the following steps:

1. Design the physical media

• Specify Input/output media.

• Design the database and specify backup procedures.

• Design physical information flows through the system.


2. Plan the system implementation

• Prepare a conversion schedule target date.

• Determine training procedure, courses and timetable.

3. Device a test and implementation plan.

4. Specify any new Hardware/Software usage.

5. Update benefits, costs, and conversion date and system constraint.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


28
ONLINE MOVIE TICKET BOOKING SYSTEM

5.5 DATA FLOW DIAGRAM

DATA FLOW

• A data flow diagram shows the logical flows of data through a


transaction processing system of an organization.

• They are primarily used in the systems development process as a tool


for analysing an existing system

PROCESS:
Procedures or devices that use or transform data.

SOURCE OR DESTINATION OF DATA

• Source or destination of data, which may be people, organization or


other entities, interact with the system but are outside its boundary.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


29
ONLINE MOVIE TICKET BOOKING SYSTEM

DATA SOURCE:

• A Data Source referenced by a process in the system.

INSURANCE
USER ADMIN
MANAGEMENT
SYSTEM

Login

ZERO LEVEL DFD – Online movie ticket booking Management


System

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


30
ONLINE MOVIE TICKET BOOKING SYSTEM

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


31
ONLINE MOVIE TICKET BOOKING SYSTEM

5.6 E-R DIAGRAM

ER-modelling is a data modelling technique used in software engineering


to produce a conceptual data model of an information system. Diagrams
created using this ER-modelling technique are called Entity-Relationship
Diagrams, or ER diagrams or ERDs. An entity relationship diagram (ERD)
shows the relationships of entity sets stored in a database. An entity in this
context is a component of data. In other words, ER diagrams illustrate the
logical structure of databases. Entities-relationship analysis uses three
major abstractions to describe data.

1) ENTITY
Entities are represented by rectangles. An entity is an object or concept
about which you want 00 to store information.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


32
ONLINE MOVIE TICKET BOOKING SYSTEM

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.

In some cases, entities can be self-linked. For example, customer can


supervise other employees.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


33
ONLINE MOVIE TICKET BOOKING SYSTEM

customer

4) MULTIVATED ATTRIBUTES
A multivalued attribute can have more than one value. For example, an
customer entity can have multiple skill values.

Attribute

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


34
ONLINE MOVIE TICKET BOOKING SYSTEM

5) DERIVED ATTRIBUTES

A derived attribute is based on another attribute. For example, an customer's


monthly salary is based on the customer’s annual salary.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


35
ONLINE MOVIE TICKET BOOKING SYSTEM

ER DIAGRAM

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


36
ONLINE MOVIE TICKET BOOKING SYSTEM

5.7 Methodology

A structured approach that uses procedures, techniques, tools and


documentation help to support and make possible the process of design is
called Design methodology.

A design methodology encapsulates various phases, each containing some


stages which guide the designer in the techniques suitable at each stage of
the project. A design methodology also helps the designer to plan, manage,
control, and evaluate database development and managing projects.
Furthermore, it is a planned approach for analysing and model a group of
requirements for a database in a standardized and ordered manner.

In this design methodology, the process of constructing a model of the data


is used in an enterprise, independent of all physical considerations. The
conceptual database design phase starts with the formation of a conceptual
data model of the enterprise that is entirely independent of implementation
details such as the target DBMS, use of application programs, programming
languages used, hardware platform, performance issues, or any other
physical deliberations.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


37
ONLINE MOVIE TICKET BOOKING SYSTEM

SCREENSHOTS

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


38
ONLINE MOVIE TICKET BOOKING SYSTEM

CHAPTER 6

SCREENSHOTS

6.1 MAIN LOGIN FORM

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


39
ONLINE MOVIE TICKET BOOKING SYSTEM

6.2 MANAGER FORM

6.3 MOVIE DETAIL FORM

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


40
ONLINE MOVIE TICKET BOOKING SYSTEM

6.4 CASHIER FORM

6.5 MOVIE INSERT FORM

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


41
ONLINE MOVIE TICKET BOOKING SYSTEM

6.6 MOVIE PRICING FORM

6.7 MOVIE SELECT FORM

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


42
ONLINE MOVIE TICKET BOOKING SYSTEM

6.8 DATE SELECT FORM

6.9 BOOKING CONFIRM FORM

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


43
ONLINE MOVIE TICKET BOOKING SYSTEM

CODING

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


44
ONLINE MOVIE TICKET BOOKING SYSTEM

CODING:

#this t_movie function is used to select movie name

def t_movie():

global f

f = f+1

print("which movie do you want to watch?")

print("1,movie 1 ")

print("2,movie 2 ")

print("3,movie 3")

print("4,back")

movie = int(input("choose your movie: "))

if movie == 4:

# in this it goes to center function and

# from center it goes to movie function

# and it comes back here and then go to theater

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


45
ONLINE MOVIE TICKET BOOKING SYSTEM

center()

theater()

return 0

if f == 1:

theater()

# this theater function used to select screen

def theater():

print("which screen do you want to watch movie: ")

print("1,SCREEN 1")

print("2,SCREEN 2")

print("3,SCREEN 3")

a = int(input("choose your screen: "))

ticket = int(input("number of ticket do you want?: "))

timing(a)

# this timing function used to select timing for movie

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


46
ONLINE MOVIE TICKET BOOKING SYSTEM

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"

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


47
ONLINE MOVIE TICKET BOOKING SYSTEM

if a == 1:

print("choose your time:")

print(time1)

t = input("select your time:")

x = time1[t]

print("successful!, enjoy movie at "+x)

elif a == 2:

print("choose your time:")

print(time2)

t = input("select your time:")

x = time2[t]

print("successful!, enjoy movie at "+x)

elif a == 3:

print("choose your time:")

print(time3)

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


48
ONLINE MOVIE TICKET BOOKING SYSTEM

t = input("select your time:")

x = time3[t]

print("successful!, enjoy movie at "+x)

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")

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


49
ONLINE MOVIE TICKET BOOKING SYSTEM

def center():

print("which theater do you wish to see movie? ")

print("1,Inox")

print("2,Icon")

print("3,pvp")

print("4,back")

a = int(input("choose your option: "))

movie(a)

return 0

# this function is used to select city

def city():

print("hi welcome to movie ticket booking: ")

print("where you want to watch movie?:")

print("1,city 1")

print("2,city 2 ")

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


50
ONLINE MOVIE TICKET BOOKING SYSTEM

print("3,city 3 ")

place = int(input("choose your option: "))

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

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


51
ONLINE MOVIE TICKET BOOKING SYSTEM

app = Flask(_name_)

@app.route('/')
def renderLoginPage():
return render_template('login.html')

@app.route('/login', methods = ['POST'])


def verifyAndRenderRespective():
username = request.form['username']
password = request.form['password']

try:
if username == 'cashier' and password ==
'cashier123':

res = runQuery('call delete_old()')


return render_template('cashier.html')

elif username == 'manager' and password ==


'Password@123':

res = runQuery('call delete_old()')

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


52
ONLINE MOVIE TICKET BOOKING SYSTEM

return render_template('manager.html')

else:
return render_template('loginfail.html')
except Exception as e:
print(e)
return render_template('loginfail.html')

# Routes for cashier


@app.route('/getMoviesShowingOnDate', methods
= ['POST'])
def moviesOnDate():
date = request.form['date']

res = runQuery("SELECT DISTINCT


movie_id,movie_name,type FROM movies
NATURAL JOIN shows WHERE Date =
'"+date+"'")

if res == []:
return '<h4>No Movies Showing</h4>'
else:

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


53
ONLINE MOVIE TICKET BOOKING SYSTEM

return render_template('movies.html',movies =
res)

@app.route('/getTimings', methods = ['POST'])


def timingsForMovie():
date = request.form['date']
movieID = request.form['movieID']
movieType = request.form['type']

res = runQuery("SELECT time FROM shows


WHERE Date='"+date+"' and movie_id =
"+movieID+" and type ='"+movieType+"'")

list = []

for i in res:
list.append( (i[0], int(i[0]/100), i[0]%100 if
i[0]%100 != 0 else '00' ) )

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


54
ONLINE MOVIE TICKET BOOKING SYSTEM

return render_template('timings.html',timings = list)

@app.route('/getShowID', methods = ['POST'])


def getShowID():
date = request.form['date']
movieID = request.form['movieID']
movieType = request.form['type']
time = request.form['time']

res = runQuery("SELECT show_id FROM shows


WHERE Date='"+date+"' and movie_id =
"+movieID+" and type ='"+movieType+"' and time
= "+time)
return jsonify({"showID" : res[0][0]})

@app.route('/getAvailableSeats', methods =
['POST'])
def getSeating():
showID = request.form['showID']

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


55
ONLINE MOVIE TICKET BOOKING SYSTEM

res = runQuery("SELECT class,no_of_seats FROM


shows NATURAL JOIN halls WHERE show_id =
"+showID)

totalGold = 0
totalStandard = 0

for i in res:
if i[0] == 'gold':
totalGold = i[1]
if i[0] == 'standard':
totalStandard = i[1]

res = runQuery("SELECT seat_no FROM


booked_tickets WHERE show_id = "+showID)

goldSeats = []
standardSeats = []

for i in range(1, totalGold + 1):


goldSeats.append([i,''])

for i in range(1, totalStandard + 1):

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


56
ONLINE MOVIE TICKET BOOKING SYSTEM

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'

return render_template('seating.html', goldSeats =


goldSeats, standardSeats = standardSeats)

@app.route('/getPrice', methods = ['POST'])


def getPriceForClass():
showID = request.form['showID']
seatClass = request.form['seatClass']

res = runQuery("INSERT INTO halls VALUES(-


1,'-1',-1)");

res = runQuery("DELETE FROM halls WHERE


hall_id = -1")

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


57
ONLINE MOVIE TICKET BOOKING SYSTEM

res = runQuery("SELECT price FROM shows


NATURAL JOIN price_listing WHERE show_id =
"+showID)

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

return '<h5>Ticket Price: $ '+str(price)+'</h5>\


<button onclick="confirmBooking()" class="btn-
warning">Confirm Booking</button>'

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


58
ONLINE MOVIE TICKET BOOKING SYSTEM

@app.route('/insertBooking', methods = ['POST'])


def createBooking():
showID = request.form['showID']
seatNo = request.form['seatNo']
seatClass = request.form['seatClass']

if seatClass == 'gold':
seatNo = int(seatNo) + 1000

ticketNo = 0
res = None

while res != []:


ticketNo = randint(0, 2147483646)
res = runQuery("SELECT ticket_no FROM
booked_tickets WHERE ticket_no =
"+str(ticketNo))

res = runQuery("INSERT INTO booked_tickets


VALUES("+str(ticketNo)+","+showID+","+str(seat
No)+")")

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


59
ONLINE MOVIE TICKET BOOKING SYSTEM

if res == []:
return '<h5>Ticket Has Been Booked
Successfully!</h5>\
<h6>Ticket Number: '+str(ticketNo)+'</h6>'

# Routes for manager


@app.route('/getShowsShowingOnDate', methods =
['POST'])
def getShowsOnDate():
date = request.form['date']

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

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


60
ONLINE MOVIE TICKET BOOKING SYSTEM

if i[3] % 100 == 0:
x = '00'
shows.append([ i[0], i[1], i[2], int(i[3] /
100), x ])

return render_template('shows.html', shows =


shows)

@app.route('/getBookedWithShowID', methods =
['POST'])
def getBookedTickets():
showID = request.form['showID']

res = runQuery("SELECT ticket_no,seat_no FROM


booked_tickets WHERE show_id = "+showID+"
order by seat_no")

if res == []:
return '<h5>No Bookings!!</h5>'

tickets = []
for i in res:

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


61
ONLINE MOVIE TICKET BOOKING SYSTEM

if i[1] > 1000:


tickets.append([i[0], i[1] - 1000, 'Gold'])
else:
tickets.append([i[0], i[1], 'Standard'])

return render_template('bookedtickets.html', tickets


= tickets)

@app.route('/fetchMovieInsertForm', methods =
['GET'])
def getMovieForm():
return render_template('movieform.html')

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


62
ONLINE MOVIE TICKET BOOKING SYSTEM

@app.route('/insertMovie', methods = ['POST'])


def insertMovie():
movieName = request.form['movieName']
movieLen = request.form['movieLen']
movieLang = request.form['movieLang']
types = request.form['types']
startShowing = request.form['startShowing']
endShowing = request.form['endShowing']

res = runQuery('SELECT * FROM movies')

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

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


63
ONLINE MOVIE TICKET BOOKING SYSTEM

res = None

while res != []:


movieID = randint(0, 2147483646)
res = runQuery("SELECT movie_id FROM
movies WHERE movie_id = "+str(movieID))

res = runQuery("INSERT INTO movies


VALUES("+str(movieID)+",'"+movieName+"',"+m
ovieLen+\

",'"+movieLang+"','"+startShowing+"','"+endSh
owing+"')")

if res == []:
print("Was able to add movie")
subTypes = types.split(' ')

while len(subTypes) < 3:


subTypes.append('NUL')

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


64
ONLINE MOVIE TICKET BOOKING SYSTEM

res = runQuery("INSERT INTO types


VALUES("+str(movieID)+",'"+subTypes[0]+"','"+s
ubTypes[1]+"','"+subTypes[2]+"')")

if res == []:
return '<h5>Movie Added
Successfully!</h5>\
<h6>Movie ID: '+str(movieID)+'</h6>'
else:
print(res)
else:
print(res)

return '<h5>Something Went Wrong</h5>'

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


65
ONLINE MOVIE TICKET BOOKING SYSTEM

@app.route('/getValidMovies', methods = ['POST'])


def validMovies():
showDate = request.form['showDate']

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]

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


66
ONLINE MOVIE TICKET BOOKING SYSTEM

if subTypes[0][3] != 'NUL':
t = t + ' ' + subTypes[0][3]

movies.append( (i[0],i[1],t,i[2],i[3]) )

return render_template('validmovies.html', movies =


movies)

@app.route('/getHallsAvailable', methods =
['POST'])
def getHalls():
movieID = request.form['movieID']
showDate = request.form['showDate']
showTime = request.form['showTime']

res = runQuery("SELECT length FROM movies


WHERE movie_id = "+movieID)

movieLen = res[0][0]

showTime = int(showTime)

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


67
ONLINE MOVIE TICKET BOOKING SYSTEM

showTime = int(showTime / 100)*60 + (showTime


% 100)

endTime = showTime + movieLen

res = runQuery("SELECT hall_id, length, time


FROM shows NATURAL JOIN movies WHERE
Date = '"+showDate+"'")

unavailableHalls = set()

for i in res:

x = int(i[2] / 100)*60 + (i[2] % 100)

y = x + i[1]

if x >= showTime and x <= endTime:


unavailableHalls =
unavailableHalls.union({i[0]})

if y >= showTime and y <= endTime:

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


68
ONLINE MOVIE TICKET BOOKING SYSTEM

unavailableHalls =
unavailableHalls.union({i[0]})

res = runQuery("SELECT DISTINCT hall_id


FROM halls")

availableHalls = set()

for i in res:

availableHalls = availableHalls.union({i[0]})

availableHalls =
availableHalls.difference(unavailableHalls)

if availableHalls == set():

return '<h5>No Halls Available On Given Date


And Time</h5>'

return render_template('availablehalls.html', halls =


availableHalls)

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


69
ONLINE MOVIE TICKET BOOKING SYSTEM

@app.route('/insertShow', methods = ['POST'])


def insertShow():
hallID = request.form['hallID']
movieID = request.form['movieID']
movieType = request.form['movieType']
showDate = request.form['showDate']
showTime = request.form['showTime']

showID = 0
res = None

while res != []:


showID = randint(0, 2147483646)
res = runQuery("SELECT show_id FROM
shows WHERE show_id = "+str(showID))

res = runQuery("INSERT INTO shows


VALUES("+str(showID)+","+movieID+","+hallID+
\

",'"+movieType+"',"+showTime+",'"+showDate
+"',"+'NULL'+")")

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


70
ONLINE MOVIE TICKET BOOKING SYSTEM

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>'

@app.route('/getPriceList', methods = ['GET'])


def priceList():
res = runQuery("SELECT * FROM price_listing
ORDER BY type")

sortedDays =
['Sunday','Monday','Tuesday','Wednesday','Thursday
','Friday','Saturday']

res = sorted( res, key = lambda x :


sortedDays.index(x[2]) )

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


71
ONLINE MOVIE TICKET BOOKING SYSTEM

return render_template('currentprices.html', prices =


res)

@app.route('/setNewPrice', methods = ['POST'])


def setPrice():
priceID = request.form['priceID']
newPrice = request.form['newPrice']

res = runQuery("UPDATE price_listing SET price =


"+str(newPrice)+" WHERE price_id =
"+str(priceID))

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>'

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


72
ONLINE MOVIE TICKET BOOKING SYSTEM

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:

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


73
ONLINE MOVIE TICKET BOOKING SYSTEM

print(e)
return e

finally:
db.close()

print("Couldn't connect to MySQL Database")


#Couldn't connect to MySQL
return None

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)

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


74
ONLINE MOVIE TICKET BOOKING SYSTEM

for showtime in self.showtimes:


print(showtime)

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)

def display_showtimes(self, movie_title):


for movie in self.movies:
if movie.title == movie_title:
movie.display_showtimes()
return
print("Movie not found.")

def book_ticket(self, movie_title, showtime,


num_tickets):
for movie in self.movies:

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


75
ONLINE MOVIE TICKET BOOKING SYSTEM

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)

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


76
ONLINE MOVIE TICKET BOOKING SYSTEM

movie2 = Movie("Movie 2", ["11:00 AM", "3:00


PM", "7:00 PM"], 80)

# Create theater and add movies


theater = Theater("ABC Theater", [movie1,
movie2])

# Display movies and showtimes


theater.display_movies()
movie_title = input("Enter the movie title: ")
theater.display_showtimes(movie_title)

# 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()

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


77
ONLINE MOVIE TICKET BOOKING SYSTEM

<!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">

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


78
ONLINE MOVIE TICKET BOOKING SYSTEM

<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>

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


79
ONLINE MOVIE TICKET BOOKING SYSTEM

<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>

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


80
ONLINE MOVIE TICKET BOOKING SYSTEM

<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

Let's create a JavaScript file named script.js and add the


following JavaScript code to it:

const container = document.querySelector('.container');

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


81
ONLINE MOVIE TICKET BOOKING SYSTEM

const seats = document.querySelectorAll('.row


.seat:not(.occupied)');
const count = document.getElementById('count');
const total = document.getElementById('total');
const movieSelect = document.getElementById('movie');

populateUI();

let ticketPrice = +movieSelect.value;

// Save selected movie index and price


function setMovieData(movieIndex, moviePrice) {
localStorage.setItem('selectedMovieIndex',
movieIndex);
localStorage.setItem('selectedMoviePrice', moviePrice);
}

// Update total and count


function updateSelectedCount() {
const selectedSeats = document.querySelectorAll('.row
.seat.selected');

const seatsIndex = [...selectedSeats].map(seat =>


[...seats].indexOf(seat));

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


82
ONLINE MOVIE TICKET BOOKING SYSTEM

localStorage.setItem('selectedSeats',
JSON.stringify(seatsIndex));

const selectedSeatsCount = selectedSeats.length;

count.innerText = selectedSeatsCount;
total.innerText = selectedSeatsCount * ticketPrice;

setMovieData(movieSelect.selectedIndex,
movieSelect.value);
}

// Get data from localstorage and populate UI


function populateUI() {
const selectedSeats =
JSON.parse(localStorage.getItem('selectedSeats'));

if (selectedSeats !== null && selectedSeats.length > 0) {


seats.forEach((seat, index) => {
if (selectedSeats.indexOf(index) > -1) {
seat.classList.add('selected');
}
});
}

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


83
ONLINE MOVIE TICKET BOOKING SYSTEM

const selectedMovieIndex =
localStorage.getItem('selectedMovieIndex');

if (selectedMovieIndex !== null) {


movieSelect.selectedIndex = selectedMovieIndex;
}
}

// Movie select event


movieSelect.addEventListener('change', e => {
ticketPrice = +e.target.value;
setMovieData(e.target.selectedIndex, e.target.value);
updateSelectedCount();
});

// Seat click event


container.addEventListener('click', e => {
if (
e.target.classList.contains('seat') &&
!e.target.classList.contains('occupied')
){
e.target.classList.toggle('selected');

updateSelectedCount();
}

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


84
ONLINE MOVIE TICKET BOOKING SYSTEM

});

// Initial count and total set


updateSelectedCount();

3. style.css

Let's create a CSS file named style.css and add the


following CSS code to it:

@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;

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


85
ONLINE MOVIE TICKET BOOKING SYSTEM

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 {

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


86
ONLINE MOVIE TICKET BOOKING SYSTEM

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 {

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


87
ONLINE MOVIE TICKET BOOKING SYSTEM

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;
}

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


88
ONLINE MOVIE TICKET BOOKING SYSTEM

.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); }

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


89
ONLINE MOVIE TICKET BOOKING SYSTEM

SYSTEM TESTING AND REPORT

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


90
ONLINE MOVIE TICKET BOOKING SYSTEM

CHAPTER 8

SYSTEM TESTING AND REPORT

8.1 TESTING

System testing involves unit testing, integration testing, white-box testing,


black-box testing. Strategies for integration of software components into a
functional product include the bottom-up strategy, the top-down strategy,
and the sandwich strategy. Careful planning and scheduling are required to
ensure that modules that will be available for integration into evolving
software products when needed are performed for the proposed system
before the system is ready for user acceptance testing.

8.1.1 UNIT 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

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


91
ONLINE MOVIE TICKET BOOKING SYSTEM

testing individual components or units of code in isolation to verify that they


function as intended.

8.1.2 VALIDATION TESTING

Validation testing can be defined as many, but a single definition is that


validation succeeds when the software functions in a manner that can be
reasonably expected by the customer. Validation refers to the process of
using the software in a live environment to find errors. During the course of
validation systems may occur and the software will be changed.

8.1.3 PERFORMANCE TESTING

In software engineering, performance testing is testing that is performed,


from one perspective, to determine how fast some aspect of a system
performs under a particular workload. It can also serve to validate and verify
other quality attributes of the system, such as scalability, reliability and
resource usage. Performance testing is a subset of Performance engineering,
an emerging computer science practice which strives to build performance
into the design and architecture of a system, prior to the onset of actual
coding effort.

Performance testing can serve different purposes. It can demonstrate that


the system meets Performance criteria. It can compare two systems to find
which performs better. Or it can measure what parts of the system or

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


92
ONLINE MOVIE TICKET BOOKING SYSTEM

workload cause the system to perform badly. In the diagnostic case,


software engineers use tools such as profilers to measure what parts of a
device or software contribute most to the poor performance or to establish
throughput levels (and thresholds) for maintaining acceptable response
time.

It is critical to the cost Performance of a new system; the performance test


efforts begin at the inception of the development project and extend through
to deployment. The later a performance defect is detected, the higher the
cost of remediation. This is true in the case of functional testing, but even
more so with performance testing, due to the end-to-end nature of its scope.

In performance testing, it is often crucial (and often difficult to arrange) for


the test conditions to be similar to the expected actual use. This is, however,
not entirely possible in actual practice. The reason is that production
systems have a random nature of the workload and while the test workloads
do their best to mimic what may happen in the production environment, it
is impossible to exactly replicate this workload variability - except in the
simplest system.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


93
ONLINE MOVIE TICKET BOOKING SYSTEM

FUTURE ENHANCEMENT

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


94
ONLINE MOVIE TICKET BOOKING SYSTEM

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 .

• Advanced Search and Filtering: Enhance the search functionality by implementing


advanced search and filtering options. Users can search for movies based on genre,
language, release date, cast, or other criteria.

• 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.

• Notifications: Implement a notification system to keep users informed about


upcoming movies, special offers, or changes in show timings. You can use email or
push notifications to notify users based on their preferences.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


95
INSURANCE MANAGEMENT SYSTEM

CONCLUSION

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


96
INSURANCE MANAGEMENT SYSTEM

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.

My project is only a humble venture to satisfy the needs in an Institution. Several


user-friendly coding has also been adopted. This package shall prove to be a
powerful package in satisfying all the requirements of the users.

The objective of software planning is to provide a framework that enables the


manager to make reasonable estimates made within a frame at the beginning of
the software project and should be updated regularly as the project progresses.

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.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


97
INSURANCE MANAGEMENT SYSTEM

Achievements Expected Through the Project

1. Compared to the existing system, it performs at a faster pace.

2. System gives better feedback.

3. Timely and accurate information is available.

4. The system provides greater processing speed consistency.

5. Provides high security to the system and hence unauthorized users can be
prevented.

6. Forms are very user friendly.

7. Ease of operation.

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


98
INSURANCE MANAGEMENT SYSTEM

BIBLIOGRAPHY

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


99
INSURANCE MANAGEMENT SYSTEM

BIBLIOGRAPHY

REFERANCE BOOK
1. A byte of python.

2. Programming Python

3. Flask Web Development: Developing Web Applications with Python

4. Software Engineering.

5. Database management system.

6. Test-Driven Development with Python

WEBSITE
• http://www.w3school.com

• http://www.codeacademy.com

• http://github.com

• www.slideshare.net

• www.enggroom.com

• www.Projectsgeek.com

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


100
INSURANCE MANAGEMENT SYSTEM

DEPARTMENT OF BACHELOR OF COMPUTER APPLICATION, RNSFGC


101

You might also like