You are on page 1of 31

Project On Movie Ticketing System

Title: Online Movie Ticketing System

Objectives:
Through this project we present a comprehensive solution for movie ticket booking system
.This system is specifically designed for theatre owners to sell tickets online.
Therefore, the main objective of our project is to develop an enhanced, automated, accurate,
user-friendly and less maintained way of ticketing system.

Usefulness:
This project is aimed to provide the customers facility to book tickets for cinema halls online,
through which they can book tickets anytime, anywhere.
This project is basically made for providing the customers anytime and anywhere service for
booking the seat in the cinema hall and to gather information about the movies online. The
user can easily be able to know about the movies released and then make the choice.
The project can speedup, digitalize the whole ticketing system.Through this project we can do:
 Provide anytime anyplace service for the customer.
 Provide effective solutions for easily availability of movie tickets.
 Provide simpler way to choose our seat and area for movie show.
 To minimize the number of staff at the ticket box.
 And so on.

Tools:

 WAMP server
 PHP
 HTML

Procedure:
At first we have design our E-R diagram for our project .The E-R diagram is given below:

There are following table & attributes :


1. Customer: c_name,c_id,password,e-mail_id,phone_no
2. Movie : m_name,release_date,director,actors,m_id
3. Booking: booking_date,ticket_no, c_id
4. Show: st_time,end_time,show_id ,language
5. Tickets:show_id,show_date,seat_no,price ,tid,hall_no,ticket_no,admin_id
6. Admin : admin_id,password
7. Discount: offer_id,m_id,price
8. Theatre : tid,t_name,location
9. Seats: seat_id, no_of_seats

Database Command for Movie Ticketing System


mysql> create database movie_cine;

mysql> use movie_cine


Database changed

mysql> create table seats(


-> id varchar(30),
-> name varchar(30),
-> seat_no varchar(30),
-> primary key(seat_no));

mysql> create table theatre(


->t_id varchar(20),
->t_name varchar(30),
->location varchar(30),
->seat_no varchar(30),
->foreign key(seat_no) references seats(seat_no),
->admin_id varchar(30),
->foreign key(admin_id) references admin(admin_id));

mysql> create table customer(


-> c_id varchar(30),
-> primary key(c_id),
-> c_name varchar(40),
-> password varchar(30),
-> email_id varchar(40),
-> phone varchar(20));

mysql> create table booking(


-> booking_date varchar(30),
-> ticket_no varchar(30),
-> primary key(ticket_no),
-> cid varchar(30),
-> foreign key(cid) references customer(c_id));

mysql> create table Movie(


-> movie_name varchar(40),
-> release_date varchar(15),
-> director varchar(30),
-> actors varchar(40),
-> movie_id varchar(25),
-> primary key(movie_id));

mysql>create table showth(


->st_time varchar(30),
->end_time varchar(30),
->show_id varchar(30),
->primary key(show_id),
->lang varchar(30),
->movie_id varchar(30),
->foreign key(movie_id) references Movie(movie_id));

mysql> create table admin(


-> admin_id varchar(30),
-> password varchar(30),
-> primary key(admin_id));

mysql> create table discount(


-> offer_id varchar(30),
-> name varchar(30),
-> price varchar(30),
-> primary key(offer_id));
mysql>create table ticket(
->admin_id varchar(30),
->show_id varchar(30),
->show_date varchar(30),
->seat_no varchar(30),
->price varchar(30),
->t_id varchar(30),
->ticket_no varchar(30),
->primary key(ticket_no),
->tid varchar(30),
->foreign key(tid) references theatre(tid),
->ticket_no varchar(30),
->foreign key(ticket_no) references booking(ticket_no),
->admin_id varchar(30),
->foreign key(admin_id) references admin(admin_id),
->show_id varchar(30),
->foreign key(show_id) references showth(show_id));

mysql> insert into seats values("328","Rahul","M20");


mysql> insert into seats values("330","Emon","M21");
mysql> insert into seats values("340","Faisal","M22");

mysql> select * from seats;

+------+--------+---------+
| id | name | seat_no |
+------+--------+---------+
| 328 | Rahul | M20 |
| 330 | Emon | M21 |
| 340 | Faisal | M22 |
+------+--------+---------+
mysql> insert into admin values("24","xxxx");
mysql> insert into admin values("27","yyyy");
mysql> select * from admin;
+----------+----------+
| admin_id | password |
+----------+----------+
| 24 | xxxx |
| 27 | yyyy |
+----------+----------+
mysql> insert into discount values("A20","Rahul","100");
mysql> insert into discount values("A30","Emon","200");
mysql> insert into discount values("A50","Faisal","300");
mysql> select * from discount;
+----------+--------+-------+
| offer_id | name | price |
+----------+--------+-------+
| A20 | Rahul | 100 |
| A30 | Emon | 200 |
| A50 | Faisal | 300 |
+----------+--------+-------+

mysql> insert into theatre values("A","Albert","5th floor right");


mysql> insert into theatre values("M","Margerate","5th floor left");
mysql> insert into theatre values("W","William","6th floor right");

mysql> select * from theatre;

+------+-----------+-----------------+
| t_id | t_name | location |
+------+-----------+-----------------+
| A | Albert | 5th floor right |
| M | Margerate | 5th floor left |
| W | William | 6th floor right |
+------+-----------+-----------------+

mysql> insert into ticket


values("24","Harry11","20/10/2019","M20","400","M","2010M2001");
mysql> insert into ticket
values("27","Harry11","21/10/2019","M22","400","M","2110M2076");

mysql> select * from ticket;

+----------+---------+------------+---------+-------+------+-----------+
| admin_id | show_id | show_date | seat_no | price | t_id | ticket_no |
+----------+---------+------------+---------+-------+------+-----------+
| 24 | Harry11 | 20/10/2019 | M20 | 400 | M | 2010M2001 |
| 27 | Harry11 | 21/10/2019 | M22 | 400 | M | 2110M2076 |
+----------+---------+------------+---------+-------+------+-----------+

mysql> insert into showth values("5pm","7:30 pm","Harry11","English");


mysql> insert into showth values("2pm","4:30 pm","Harry11","English");
mysql> insert into showth values("8pm","10:30 pm","Endgame","English");

mysql> select * from showth;

+---------+----------+---------+---------+
| st_time | end_time | show_id | lang |
+---------+----------+---------+---------+
| 5pm | 7:30 pm | Harry11 | English |
| 8pm | 10:30 pm | Endgame | English |
| 2pm | 4:30 pm | Harry11 | English |
+---------+----------+---------+---------+
mysql> insert into customer
values("102030","Emon","xxxxxxxx","emonju330@gmail.com","017790xxxx");

mysql> insert into customer


values("2030030","Shaikh","XXXyyyyX","shaikhju330@gmail.com","016790xxxx")
;

mysql> insert into movie values("Avengers:Infinity War","17 January


2019","Marvel team","Tony Stark,Hulk,Dr.Strange","Av24189274");

mysql> insert into movie values("Harrry Potter: Half blood","17 January


2005","J.K Rowlin","Ema Watson & Harry","Harry potter1892748");

mysql> use movie_ticketing;


Database changed
mysql> select * from customer;
+---------+--------+----------+-----------------------+------------+
| c_id | c_name | password | email_id | phone |
+---------+--------+----------+-----------------------+------------+
| 102030 | Emon | XXXXXXX | emonju330@gmail.com | 017790xxxx |
| 2030030 | Shaikh | XXXyyyyX | shaikhju330@gmail.com | 016790xxxx |
+---------+--------+----------+-----------------------+------------+

mysql> select * from movie;


+---------------------------+-----------------+-------------+----------------------------+---------------------+
| movie_name | release_date | director | actors | movie_id |
+---------------------------+-----------------+-------------+----------------------------+---------------------+
| Avengers:Infinity War | 17 January 2019 | Marvel team | Tony Stark,Hulk,Dr.Strange | Av24189274 |
| Harrry Potter: Half blood | 17 January 2005 | J.K Rowlin | Ema Watson & Harry | Harry potter1892748 |
+---------------------------+-----------------+-------------+----------------------------+---------------------+

PHP :
Movie:

<html>

<head>

<title>MOVIE NAME</title>

<style >

body {background-color:8CB9EE;}

</style>

</head>

<body >

<form action="" method="post">

<table align="center">

<tr>

<td> Enter movie name: </td>

<td> <input name="m_name" type="text"> </td>

</tr>

<tr>

<td> Enter release date: </td>

<td> <input name="rls_date" type="text"> </td>

</tr>

<tr>

<td> Enter director name: </td>

<td> <input name="director" type="text"> </td>


</tr>

<tr>

<td> Enter Actor name: </td>

<td> <input name="actor" type="text"> </td>

</tr>

<tr>

<td> Enter Movie Id: </td>

<td> <input name="m_id" type="text"> </td>

</tr>

<tr>

<td> <input name="x" type="submit" value="SAVE">

<input name="y" type="submit" value="DISPLAY">

</td>

</tr>

</table>

</form>

<?php

$con=mysqli_connect("localhost","root","","pr_movie");

$a=mysqli_real_escape_string($con,$_REQUEST['m_name']);

$b=mysqli_real_escape_string($con,$_REQUEST['rls_date']);
$c=mysqli_real_escape_string($con,$_REQUEST['director']);

$d=mysqli_real_escape_string($con,$_REQUEST['actor']);

$e=mysqli_real_escape_string($con,$_REQUEST['m_id']);

$q="insert into movie values('$a','$b','$c','$d','$e')";

$disp="select * from movie";

if(isset($_POST['x']))

$result=mysqli_query($con,$q);

if(isset($_POST['y']))

$result=mysqli_query($con,$disp);

echo '<table height=180 width=500 border=10 align="center" bgcolor=#F26A38>';

echo '<tr><th>movie_name</th><th>release_date</th><th>director</th><th>actors</th><th>movie_id</th></tr>';

while($row=mysqli_fetch_array($result))

echo'<tr bgcolor="white" align="center">';

echo '<td>'.$row[0].'</td>';

echo '<td>'.$row[1].'</td>';

echo '<td>'.$row[2].'</td>';
echo '<td>'.$row[3].'</td>';

echo '<td>'.$row[4].'</td>';

echo'</tr>';

echo '</table>';

mysqli_close($con);

?>

</body>

</html>

Showth:

<html>

<head>

<title>Show Details</title>

<style >

body {background-color:8CB9EE;}

</style>

</head>

<body >
<form action="" method="post">

<table align="center">

<tr>

<td> Enter Show Time: </td>

<td> <input name="st_time" type="text"> </td>

</tr>

<tr>

<td> Enter Ending Time: </td>

<td> <input name="end_time" type="text"> </td>

</tr>

<tr>

<td> Enter SHow ID: </td>

<td> <input name="show_id" type="text"> </td>

</tr>

<tr>

<td> Enter Language: </td>

<td> <input name="lang" type="text"> </td>

</tr>

<tr>

<td> Enter Movie Id: </td>

<td> <input name="m_id" type="text"> </td>

</tr>

<tr>

<td> Enter Deleting Value : </td>

<td> <input name="dlt" type="text"> </td>


</tr>

<tr>

<td> <input name="x" type="submit" value="SAVE">

<input name="y" type="submit" value="DISPLAY">

<input name="z" type="submit" value="Inner Join">

</td>

</tr>

</table>

</form>

<?php

$con=mysqli_connect("localhost","root","","pr_movie");

$a=mysqli_real_escape_string($con,$_REQUEST['st_time']);

$b=mysqli_real_escape_string($con,$_REQUEST['end_time']);

$c=mysqli_real_escape_string($con,$_REQUEST['show_id']);

$d=mysqli_real_escape_string($con,$_REQUEST['lang']);

$e=mysqli_real_escape_string($con,$_REQUEST['m_id']);

$n=mysqli_real_escape_string($con,$_REQUEST['dlt']);

$q="insert into showth values('$a','$b','$c','$d','$e')";

$disp="select * from showth";


#$d ="delete from showth where m_id='$n'";

#$up="UPDATE `members` SET `contact_number` = '0759 253 542' WHERE `membership_number` = 1";

#$f="SELECT * FROM `movies` CROSS JOIN `members`";

if(isset($_POST['x']))

$result=mysqli_query($con,$q);

if(isset($_POST['s']))

$result=mysqli_query($con,$n);

if(isset($_POST['y']))

$result=mysqli_query($con,$disp);

echo '<table height=180 width=500 border=10 align="center" bgcolor=#F26A38>';

echo '<tr><th>show_time</th><th>end_time</th><th>show_id</th><th>lang</th><th>m_id</th></tr>';

while($row=mysqli_fetch_array($result))

echo'<tr bgcolor="white" align="center">';

echo '<td>'.$row[0].'</td>';

echo '<td>'.$row[1].'</td>';

echo '<td>'.$row[2].'</td>';

echo '<td>'.$row[3].'</td>';

echo '<td>'.$row[4].'</td>';
echo'</tr>';

echo '</table>';

$disp2="select movie.m_name,movie.director,movie.rls_date,showth.lang,showth.st_time from movie inner join showth on movie.m_id=showth.m_id";

if(isset($_POST['z']))

$result=mysqli_query($con,$disp2);

echo '<table height=180 width=500 border=10 align="center" bgcolor=#F26A38>';

echo '<tr><th>m_name</th><th>director</th><th>rls_date</th><th>lang</th><th>st_time</th></tr>';

while($row=mysqli_fetch_array($result))

echo'<tr bgcolor="white" align="center">';

echo '<td>'.$row[0].'</td>';

echo '<td>'.$row[1].'</td>';

echo '<td>'.$row[2].'</td>';

echo '<td>'.$row[3].'</td>';

echo '<td>'.$row[4].'</td>';

echo'</tr>';

echo '</table>';
echo '</table>';

$disp3="update showth set showth.lang='bangla' where m_id='Ph3M3' ";

if(isset($_POST['u']))

$result=mysqli_query($con,$disp3);

echo '<table height=180 width=500 border=10 align="center" bgcolor=#F26A38>';

echo '<tr><th>show_time</th><th>end_time</th><th>show_id</th><th>lang</th><th>m_id</th></tr>';

while($row=mysqli_fetch_array($result))

echo'<tr bgcolor="white" align="center">';

echo '<td>'.$row[0].'</td>';

echo '<td>'.$row[1].'</td>';

echo '<td>'.$row[2].'</td>';

echo '<td>'.$row[3].'</td>';

echo '<td>'.$row[4].'</td>';

echo'</tr>';

echo '</table>';

mysqli_close($con);

?>
</body>

</html>

Ticket:

<html>

<head>

<title>Tickets</title>

<style >

body {background-color:8CB9EE;}

</style>

</head>

<body >

<form action="" method="post">

<table align="center">

<tr>

<td> Enter Ticket no: </td>

<td> <input name="ticket_no" type="text"> </td>

</tr>

<tr>

<td> Enter Location: </td>

<td> <input name="location" type="text"> </td>

</tr>

<tr>
<td> Enter Ticket Id: </td>

<td> <input name="t_id" type="text"> </td>

</tr>

<tr>

<td> Enter Ticket Price: </td>

<td> <input name="ticket_price" type="text"> </td>

</tr>

<tr>

<td> Enter Seat no: </td>

<td> <input name="seat_no" type="text"> </td>

</tr>

<tr>

<td> Enter Show Time: </td>

<td> <input name="st_time" type="text"> </td>

</tr>

<tr>

<td> Enter Show Date: </td>

<td> <input name="show_date" type="text"> </td>

</tr>

<tr>

<td> Enter c_id: </td>

<td> <input name="c_id" type="text"> </td>

</tr>

<tr>

<td> <input name="x" type="submit" value="SAVE">


<input name="y" type="submit" value="DISPLAY">

<input name="z" type="submit" value="DISPLAY">

<input name="w" type="submit" value="DISPLAY">

<input name="x" type="submit" value="DISPLAY">

</td>

</tr>

</table>

</form>

<?php

$con=mysqli_connect("localhost","root","","pr_movie");

$a=mysqli_real_escape_string($con,$_REQUEST['m_name']);

$b=mysqli_real_escape_string($con,$_REQUEST['rls_date']);

$c=mysqli_real_escape_string($con,$_REQUEST['director']);

$d=mysqli_real_escape_string($con,$_REQUEST['actor']);

$e=mysqli_real_escape_string($con,$_REQUEST['m_id']);

$q="insert into movie values('$a','$b','$c','$d','$e')";

$disp="select * from movie";


if(isset($_POST['x']))

$result=mysqli_query($con,$q);

if(isset($_POST['y']))

$result=mysqli_query($con,$disp);

echo '<table height=180 width=500 border=10 align="center" bgcolor=#F26A38>';

echo '<tr><th>movie_name</th><th>release_date</th><th>director</th><th>actors</th><th>movie_id</th></tr>';

while($row=mysqli_fetch_array($result))

echo'<tr bgcolor="white" align="center">';

echo '<td>'.$row[0].'</td>';

echo '<td>'.$row[1].'</td>';

echo '<td>'.$row[2].'</td>';

echo '<td>'.$row[3].'</td>';

echo '<td>'.$row[4].'</td>';

echo'</tr>';

echo '</table>';

mysqli_close($con);
?>

</body>

</html>

Admin:

<html>

<body background="DBMS wallpaper.jpg">

<form action="" method="post">

<table align="center">

<tr>

<td> Enter Admin Id: </td>

<td> <input name="admin_id" type="text"> </td>

</tr>

<tr>

<td> Enter Admin Password: </td>

<td> <input name="password" type="text"> </td>

</tr>

<tr>

<td> <input name="x" type="submit" value="SAVE">

<input name="y" type="submit" value="DISPLAY">

<a href="http://localhost/home.php" class="btn-info">HOME</a> </td></td>

</tr>
</table>

</form>

<?php

$con=mysqli_connect("localhost","root","","movie_cine");

$a=mysqli_real_escape_string($con, $_REQUEST['admin_id']);

$b=mysqli_real_escape_string($con, $_REQUEST['password']);

$q="insert into admin values('$a','$b')";

$disp="select * from admin";

if(isset($_POST['x']))

$result=mysqli_query($con,$q);

if(isset($_POST['y']))

$result=mysqli_query($con,$disp);

echo '<table height=180 width=360 border=10 align="center">';

echo '<tr><th>admin_id</th><th>password</th></tr>';
while($row=mysqli_fetch_array($result))

echo'<tr bgcolor="white">';

echo '<td>'.$row[0].'</td>';

echo '<td>'.$row[1].'</td>';

echo'</tr>';

echo '</table>';

mysqli_close($con);

?>

</body>

</html>

Customer:

<html>

<body background="DBMS wallpaper.jpg">

<form action="" method="post">

<table align="center">

<tr>
<td> Enter customer Id: </td>

<td> <input name="c_id" type="text"> </td>

</tr>

<tr>

<td> Enter customer Name: </td>

<td> <input name="c_name" type="text"> </td>

</tr>

<tr>

<td> Enter customer password: </td>

<td> <input name="password" type="text"> </td>

</tr>

<tr>

<td> Enter customer E-mail: </td>

<td> <input name="email_id" type="text"> </td>

</tr>

<tr>

<td> Enter customer Phone No: </td>

<td> <input name="phone" type="text"> </td>

</tr>

<tr>

<td> <input name="x" type="submit" value="SAVE">

<input name="y" type="submit" value="DISPLAY">

<a href="http://localhost/home.php" class="btn-info">HOME</a> </td></td>

</tr>
</table>

</form>

<?php

$con=mysqli_connect("localhost","root","","movie_cine");

$a=mysqli_real_escape_string($con, $_REQUEST['c_id']);

$b=mysqli_real_escape_string($con, $_REQUEST['c_name']);

$c=mysqli_real_escape_string($con, $_REQUEST['password']);

$d=mysqli_real_escape_string($con, $_REQUEST['email_id']);

$e=mysqli_real_escape_string($con, $_REQUEST['phone']);

$q="insert into customer values('$a','$b','$c','$d','$e')";

$disp="select * from customer";

if(isset($_POST['x']))

$result=mysqli_query($con,$q);

if(isset($_POST['y']))

$result=mysqli_query($con,$disp);
echo '<table height=180 width=360 border=10 align="center">';

echo '<tr><th>c_id</th><th>c_name</th><th>password</th><th>email_id</th><th>phone</th></tr>';

while($row=mysqli_fetch_array($result))

echo'<tr bgcolor="white">';

echo '<td>'.$row[0].'</td>';

echo '<td>'.$row[1].'</td>';

echo '<td>'.$row[2].'</td>';

echo '<td>'.$row[3].'</td>';

echo '<td>'.$row[4].'</td>';

echo'</tr>';

echo '</table>';

mysqli_close($con);

?>

</body>

</html>

Theatre:
<html>

<body>

<form action="" method="post">

<table align="center">

<tr>

<td> Enter ticket ID: </td>

<td> <input name="t_id" type="text"> </td>

</tr>

<tr>

<td> Enter ticket Name: </td>

<td> <input name="t_name" type="text"> </td>

</tr>

<tr>

<td> Enter Location: </td>

<td> <input name="location" type="text"> </td>

</tr>

<tr>

<td> <input name="x" type="submit" value="SAVE">

<input name="y" type="submit" value="DISPLAY"> </td>

</tr>

</table>

</form>
<?php

$a=$_POST['t_id'];

$b=$_POST['t_name'];

$c=$_POST['location'];

$con=mysql_connect('localhost','root','');

mysql_select_db('movie_cine');

$q="insert into theatre values('$a','$b','$c')";

$disp="select * from theatre";

if(isset($_POST['x']))

$result=mysql_query($q);

if(isset($_POST['y']))

$result=mysql_query($disp);

echo '<table border=10 align="center">';

echo '<tr><th>t_id</th><th>t_name</th><th>location</th></tr>';

while($row=mysql_fetch_array($result))

{
echo'<tr>';

echo '<td>'.$row[0].'</td>';

echo '<td>'.$row[1].'</td>';

echo '<td>'.$row[2].'</td>';

echo'</tr>';

echo '</table>';

mysql_close($con);

?>

</body>

</html>
Inner join:
Conclusion:

This is a website based database, which will let a company to easily maintain interaction

with customer. And will also help company business be more customize and reliable.

You might also like