You are on page 1of 34

PROJECT REPORT OF

JAVA
Topic: GUI: Movie Ticket Booking System

Submitted by: Name: Puneet Mehta Roll No: RK1R02B38 Reg. No. : 11003856 Course Code: CSE310T

Submitted to:
Mr. Sandeep Singh

Course Name: Modern Programming tools and Techniques -1

ACKNOWLEDGEMENT
I take opportunity to express my gratitude towards my teacher Sandeep Sir who has helped me throughout this project named GUI: Movie Ticket Booking System. He has guided me and helped me clearing out all my problems and doubt regarding my topic. I am indebted towards my seniors and friends who have assisted me and proved a helping hand in every aspect of this project. They have helped me in studying about this topic and hence preparing this project. I am thankful to all of them who have helped me in this project. The success of this project the outcome of the enormous contribution of various people involved directly or indirectly with project work. It is a pleasure to express our sincere thanks to them all

Puneet Mehta

Index
1. Introduction 2. Project overview and summary 2.1 2.2 2.3 Purpose of Project Scope of Project Overview of Project

3. System Specification 3.1 3.2 Hardware Requirements Software Requirements

4. System Analysis 4.1 4.2 Existing System Proposed System

5. Project Modules 5.1 5.2 5.3 Buying ticket Administrative Staff My Modules

6. Coding part with screen shots

7. Conclusion 8. Bibliography

1 . INTRODUCTION
This project is aimed at developing a ticket reservation system for Cinema Halls. The Ticket Reservation System is an Internet based application that can be accesses throughout the Net and can be accessed by anyone who has a net connection. This application will automate the reservation of tickets and Enquiries about availability of the tickets. This application includes email confirmation for the tickets. This is one of the important features of our system. By examining the existing system on the internet, we found that there is no such function available at this moment, so we try to include it in our system. To protect the benefit of the cinema, we will not give the money back to the customer, instead the customer has to visit cinema hall for further process. So, the customer can get the money from the cinema hall. Hence both the customer and the cinema can sort out further matter

Functional components of the project:


Following is a list of functionalities of the system. More functionality that you find appropriate can be added to this list. And, in places where the description of functionality is not adequate, you can make appropriate assumptions and proceed. The Cinema hall has a web site and any user of internet can access this. The cinema hall is a multiplex which has 2 or more screens. Each screen has 3 different types of seats/classes viz Platinum, Gold & Silver depending on the rate of the class/seat. Only 100% of the seats are available for online reservation.

1. A person should be able to

Choose city where he/she want to see the Movie.

Choose the film which he/she wish to book tickets.

Query the films on show for one weeks (Only one weeks advance reservation is available) should be there.

Able to choose the seats which are available for a certain class.

Can select seats from different classes as well for same show and screen also.

Give details about the credit card or debit card through which he is doing payment.

Able collect tickets at the counter presenting the unique id send to him/her through email.

2. A mail should be send to the concerned person about the confirmation of the ticket to the specified email address. 3. The system should automatically show the fare for the corresponding shows and amount of money needs to be pay for selected seats.

2. Project Overview and Summary


2.1 Purpose of Project :
The main purpose of our ticket booking system is to provide another way for the customer to buy cinema ticket. It is an automatic system. After inserting the data to

database, staff needs not to do with the order receive through the system. In fact, there is similar system on the internet, but there is no refund method found in the existing system The goals of our system are: 1. To provide a anytime anyplace service for the customer 2. To promote the film on the internet 3. To increase the profit 4. To obtain statistic information from the booking record

2.2 Scope of Project :


2.2.1 General Requirements (functional): 1. The web page (e.g. the time table page) will be generated automatically according to the data in database. 2. A way in which the cinema hall admin (staff) can login to the system to perform different operation. 3. A way in which the customer can modify its own data(booked seats before payment). 4. A way in which the customer can commit order by just clicking the seat (which is shown on the screen) and insert some card data. 5. A way in which the customer can check the ticket record (seat numbers)selected by him/her at the time of payment. 6. A way in which the staff can use the system to add data(e.g. film description) to the database. 7. The system can verify the data before transaction. 8. The system can generate the time table automatically as the time table is set by the staff.(operating mode for the staff to insert data). 11. The system can generate some statistic information according booking and ticket selling record for the cinema hall per Movie based.

2.2.2 Interface Enhancements:


Our web-based system needs about more than 30 interfaces to handle all the functions. Staff:

One of the main purpose of our system is to reduce the number of staff in the ticket box. So, most of the job is done by the system automatically. Staff only need to insert new film data and due with the refund part. Customer:

To make the system more user-friendly, customer need not to enter lots of data. An order will be commit step by step with guideline (request about 7 steps for an order).

2.3 Overview of Project :


Our Ticket Reservation for Cinema Halls is a web-based system. The customers can buy ticket online and cancel the seat at a suitable time (2 days before the show to 1hour before the show)by visiting the cinema hall. To enhance the refund function, all the customers have to present the unique id provided at the time of booking seats online. Staff can use the system to insert and delete data (e.g. film description, time table) which will update the webpage (webpage are dynamic page, changing according to the data in database). Also, staff can check the statistic information from the system. 2.3.1 Features :
Lists all Times and Theaters

The website lists all of the major theaters, the movies that are showing and the movie times, along with the information of available seats.
Movie Synopsis

The online movie ticket site provides a short summary of each movie plot to help you decide if you want to see that movie.
Trailers

The online movie ticket site has short movie clips that you can view to get an idea of the plot and genre of the movie.

Consumer Review

The movie ticket service offers consumer movie reviews posted and generated by different critics and media.
Limit Search by Area

You can limit the movie search by theater location.


Limit Search by Theater

You can limit your search by a specific theater.


Limit Search by Movie

You can search for a certain movie on the online movie ticket website.

Limit Search by Date

You can search for movies according to the date they are showing.
Message Board/Forum

The website provides an area for clients to post comments or questions for other consumers to view.
Upcoming Movie

The service posts a list of movies that will be in the theaters soon.

3. SYSTEM SPECIFICATIONS

3.1 Hardware Requirements: Pentium-IV (Processor) or more. 256 MB Ram 512 KB Cache Memory

Hard disk 10 GB Microsoft Compatible 101 or more Key Board.

3.2 Software Requirements: Operating System : Windows XP and latest

Programming language: JAVA-1.7 Scripting: Front-End: Back-End: Web Server: JAVASCRIPTING JSP,HTML Oracle (10g) Apache Tomcat.

4. SYSTEM ANALYSIS

4.1 Existing System

In the existing system, the Customer has to visit cinema hall for booking seats. Further they do not even have the information about the Movie which is in the cinema hall, it's show time and different rates of the ticket. Even the customer may not be able to get information about different cinema hall available in the city. So, if he wish to see a Movie on a particular day he has to first roam around the city to find out where it is being shown at the specific time.

Further cinema hall owner has to hire large number of staff at the counter for selling tickets. Enquiries about movie, etc. Hence this system is much tedious and not much user friendly as per the need of current scenario.

4.2 Proposed System


In order to overcome the existing problem we are making this system as online where every information about any cinema hall, movie, theater and rates can get online which helps the customer to get better facilities at his own computer or laptop. FUNCTIONALITIES OF THIS SYSTEM A person should be able to

Choose city where he/she want to see the Movie. Choose the film which he/she wish to book tickets. Query the films on show for one weeks (Only one weeks advance reservation is available) should be there.

Able to choose the seats which are available for a certain class. Can select seats from different classes as well for same show and screen also. Give details about the credit card or debit card through which he is doing payment. Able collect tickets at the counter presenting the unique id send to him/her through email.

5.PROJECT MODULE

Since the Administrative Staff and the user are the main target group of our software, we will only concern about some important functions for the Administrative Staff and the user. The user can start the buy ticket process after checking the movie detail.

5.1. Buying ticket


The buying ticket process is the most important function in our system. We will describe this process in detail. 1. Choose the movie ,time and venue
2. Check the status of select venue at certain time.(by system)

3. Choosing the seat position. 4. Enter data like ticket type and payment method if the user pay by credit card, credit card number need to be insert too.
5. Validation the data entered by the user.(e.g. credit card number) (by system) 6. Ask the user to confirm the transaction. (by system) 7. Show the transaction number to the user. (by system)

5.2 Administrative Staff


The system for the Administrative Staff part is not shown in the main page. Before the Administrative Staff to perform any operation, he/she must login to the system first. Once the Administrative Staff login to the system, the statistic information will be shown. And the

Administrative Staff can choose function by clicking the button on left hand side. The functions are: 1. Insert movie data. 2. Delete movie data. 3. Modify movie data. 4. Add new show to current showing movie.

5.3 My modules:

About us Contact Us Home Timings Total Seats

6.

Coding part with screen shots:


about us.
It gives the information about the

/* first code is for company*/

import javax.swing.*; import java.awt.*; import java.awt.event.*; class aboutus extends JFrame implements ActionListener { JLabel l1; JButton b1; Container con; aboutus() { con=getContentPane(); l1 = new JLabel("<html>INDIA'S LEADING CINEMA CHAIN...<br><br>We are a leading and premium Multiplex Cinema Exibhition Company.We pioneered the multiplex resolution in india by establishing cinema in 1997 and the largest 11-screen multiplex cinema in the country in 2004.Currently,our geographical diverse cinema circuit in India consists of 33 Cinemas with 142 screens spread over Delhi,Faridabad,Gurgaon,Ludhiana,Ghaziabad,Mumbai,Banglore,Hyderabad ,Chennai,Lucknow,Indore,Aurangabad,Baroda,Allahabad,Chhattigarh,Ahme dabad,Latur and Rajpur.<br><br>Taking India to the movies,the PVR brand has been successful in entertaining more than 16 million patrons in FY-2009-2010.We are the only film exibhition company in India to have an international film exibhition operator as a strategic investor.<br><br>We were incorporated in April 1995 pursuant to a joint venture agreement between Priya Exibhitors Private Limited and Village Roadshow Limited ,one of the Largest non-U.s cinema exibhition companies in the world with more than 1,000 screens under operations.Village Roadshow's international experience enabled us to begin our film exhibition business operations at PVR saket,the first Multiplex Cinema in India,using

international best practices.In November 2002,as a part of Village Roadshow's planned divestment of its investments in 18 countries ,it sold its entire shareholding in our Company to Priya Exihbitors Private Limited.<br><br>The Company operates a film distribution and production business through PVR Pictures ,a subsidiary of the company.PVR Ltd holds 60% shareholding in the subsidiary with the balance 40% stake held by JP Morgan Mauritius Holding Ltd and ICICI Venture in equal proportion (20% each).The movies co-produced by PVR Pictures include ''Taare Zameen Par'',''Jaane Tu Ya Jaane Na'',''Contract'' and ''Mere Khwabon Mein Jo Aaye''.Apart from the movies co-produced ,some of the other movies distributed by us include ''Ghajani'',''Golmaal Returns'',''Dasvidaniya'',''Sarkar Raj',''Bal Ganesh'',''Lions Of Punjab'',''Tum Mile'',''Aviator'',''Chicago'',''Hannibal Rising'',''Don'',''Twilight'' to name a few.<br><br>To ramp up our prescence across the retail entertainment landscape ,we have entered into a JV with Major Cineplex Group ,a leading Film exhibition and retail entertainment company based out of Thailand ,to bring lifestyle entertainment concepts to Indian consumers.The Joint Venture enjoined setting up of bowling alleys ,karaoke centers ,ices skating rinks and gaming zone across the country to enhance the out of home entertainment experience for Indian consumers , bluo ,India's Largest bowling alley was set up in Gurgaon in 2009.<br><br>Our long-term vision is to remain India's most premium and most preferred Retail Entertainment Company.To achieve this vision ,we continue to provide the highest exhibition standards at our cinemas besides incresing the number of cinemas under operation on a pan India basis.We further look forward to bringing allied retail entertainment concepts to complement and complete the entertainment experience for our consumers..</html>"); b1 = new JButton("BACK"); add(l1); add(b1); l1.setBounds(5,0,1300,500); b1.setBounds(0,0,75,25); con.setBackground(Color.black); l1.setForeground(Color.white); b1.addActionListener(this); setLayout(null); setLocation(15,15); setSize(1300,500); setVisible(true); }

public void actionPerformed(ActionEvent ae) { Object o= ae.getSource(); if(o==b1) { setVisible(false); new home(); } }

public static void main(String args[]) { new aboutus(); } }

/******************************end************************/

/*--------------------------------- contact us -----------------------------------*/

import javax.swing.*; import java.awt.*; import java.awt.event.*; class contact extends JFrame implements ActionListener { JLabel l1; JButton b1; ImageIcon im; Container c; Color col; contact() { c = getContentPane(); col = new Color(253,212,0);

im = new ImageIcon("cont.jpg"); l1 = new JLabel(im); b1 = new JButton("BACK"); add(l1); add(b1); b1.addActionListener(this); setLayout(null); l1.setBounds(0,25,650,350); b1.setBounds(0,0,70,25); c.setBackground(col); setLocation(100,100); setSize(600,350); setVisible(true); } public void actionPerformed(ActionEvent ae) { Object o = ae.getSource(); if(o==b1) { setVisible(false); new home(); } } public static void main(String args[]) { new contact(); }

/*------------------------------------end of contact part ---------------------*/ /* ----------------------------------- main part HOME -------------------------*/

import javax.swing.*; import java.awt.*; import java.awt.event.*; class home extends JFrame implements ActionListener { JLabel l2,k1,k2,k3,k4; JComboBox j1,j2,j3,j4,j5; JButton b1,b2,b3,b4,b5; ImageIcon i1,im,i2,i3,i4; Font f; Container con1; home() { super("Pvr cinemas"); f = new Font("Comic Sans MS",Font.BOLD,20); im = new ImageIcon("paa.gif"); i1=new ImageIcon("collage.png"); i2=new ImageIcon("cct.png"); i3=new ImageIcon("au.png"); i4=new ImageIcon("site map.png"); con1=getContentPane(); k1 k2 k3 k4 = = = = new new new new JLabel(i1); JLabel(i2); JLabel(i3); JLabel(i4);

l2 = new JLabel(im);

j1 j2 j3 j4 j5

= = = = =

new new new new new

JComboBox(); JComboBox(); JComboBox(); JComboBox(); JComboBox();

b1 = new JButton("Submit"); b2 = new JButton("Contact Us"); b3 = new JButton("About Us"); b4 = new JButton("Site Map"); b5 = new JButton("Logout"); j1.addItem("PVR Chandigarh"); j1.addItem("PVR Chennai"); j1.addItem("PVR Bangalore"); j2.addItem("Ready"); j2.addItem("Pyar Ka Punchnama"); j2.addItem("Kung Fu Panda 2"); j4.addItem("Double Dhamaal"); j4.addItem("Delhi Belly"); j4.addItem("Ready"); j4.addItem("Pyar Ka Punchnama"); j5.addItem("Double Dhamaal"); j5.addItem("Pyar Ka Punchnama"); j5.addItem("Delhi Belly"); j3.addItem("17 j3.addItem("18 j3.addItem("19 j3.addItem("20 j3.addItem("21 j3.addItem("22 j3.addItem("23 June"); June"); June"); June"); June"); June"); June");

setLayout(null);

add(j1); add(j2); add(j3); add(b1); add(j4); add(j5); add(k1); add(k2); add(k3); add(b2); add(b3); add(k4); add(b4); add(b5); add(l2);

b1.addActionListener(this); b2.addActionListener(this); b3.addActionListener(this); b4.addActionListener(this); j1.addActionListener(this); b5.addActionListener(this); j1.setBounds(600,350,140,20); j2.setBounds(780,350,140,20); j4.setBounds(780,350,140,20); j4.setVisible(false); j5.setBounds(780,350,140,20); j5.setVisible(false); j3.setBounds(950,350,140,20); b1.setBounds(750,500,110,20); b2.setBounds(1000,120,110,20); b3.setBounds(1150,120,110,20); l2.setBounds(500,60,253,160); b4.setBounds(840,120,110,20); b5.setBounds(900,500,110,20); k1.setBounds(30,200,491,364); k2.setBounds(1020,50,66,63); k3.setBounds(1165,50,66,62); k4.setBounds(880,50,62,68);

con1.setBackground(Color.black); setLocation(0,0); setSize(1300,750); setVisible(true); } public void actionPerformed(ActionEvent ae) { Object o = ae.getSource(); if(o==b5) { setVisible(false); new movingText(); } if(o==b4) { setVisible(false); new map1(); } if(o==b2) { setVisible(false);

new contact(); } if(o==b3) { setVisible(false); new aboutus(); } if(j1.getSelectedItem()=="PVR Chandigarh") { j4.setVisible(false); j5.setVisible(false); j2.setVisible(true); if(o==b1) {

setVisible(false); new timing((String)j1.getSelectedItem(), (String)j2.getSelectedItem(),(String)j3.getSelectedItem()); } } if(j1.getSelectedItem()=="PVR Chennai") { j2.setVisible(false); j5.setVisible(false); j4.setVisible(true); if(o==b1) { setVisible(false); new timing((String)j1.getSelectedItem(), (String)j4.getSelectedItem(),(String)j3.getSelectedItem()); } } if(j1.getSelectedItem()=="PVR Bangalore") { j2.setVisible(false); j4.setVisible(false); j5.setVisible(true); if(o==b1) { setVisible(false);

new timing((String)j1.getSelectedItem(), (String)j5.getSelectedItem(),(String)j3.getSelectedItem()); } }

} public static void main(String args[]) { new home(); } } /*-------------------------------end of main part ---------------*/

/* ----------------------------- timings -----------------------------------*/

import import import import

javax.swing.*; java.awt.*; java.awt.event.*; javax.swing.border.*;

class timing extends JFrame implements ActionListener { JLabel l1,l2,l3,l4,l5,l6,l7,l8; JButton b1,b8; JComboBox j1; String t; LineBorder line; ImageIcon im,im1; Container con; Font f1,f2; String s,s1,s2; timing(String cine,String movi,String day) { super("PVR Cinemas"); s=cine; s1=movi; s2=day; System.out.println(cine); System.out.println(movi); System.out.println(day); im = new ImageIcon("paa.gif"); con = getContentPane(); con.setBackground(Color.black); f1 f2 l1 l2 l3 l4 l5 = = = = = = = new new new new new new new Font("Comic Sans MS",Font.BOLD,15); Font("Comic Sans MS",Font.BOLD,20); JLabel(" "+cine); JLabel(" "+movi); JLabel(" "+day); JLabel("Show time"); JLabel("Movie Brief");

if(movi=="Ready") { im1 = new ImageIcon("r.jpg"); l8 = new JLabel(im1); l8.setBounds(150,280,374,336); l6 = new JLabel("<html>Name: READY<br><br> Genre: COMEDY<br><br> Censor: U/A <br><br> Duration: 2hrs 29mins<br><br> Actors: SALMAN KHAN, ASIN<br> Directors: ANEES BAZMEE<br><br> Description: Set amidst the appealing locales of Thailand, 'Ready' revolves a round Prem(Salman Khan), the sole heir to a sprawling empire owned by his father and uncles. Prem's father desires that he gets married and settle down, though Prem intends to enjoy h.</html>"); } if(movi=="Delhi Belly") {

im1 = new ImageIcon("db.jpg"); l8 = new JLabel(im1); l8.setBounds(150,280,374,336); l6 = new JLabel("<html>Name: Delhi Belly(Hinglish)<br> Genre: DRAMA<br><br> Censor: (A)<br><br> Duration: 1hr 50mins<br><br> Actors: Imran Khan, Kunal Roy Kapoor<br><br> Directors: Abinay Deo<br><br> Description: Tashi, Arun, Nitin - flat mates, buddies and partners in crime. Tashiis to get married in a month but still doesn't know if his fiancee is the one! Arun can't make up his mind who he wants to kill first his girlfriend (who has dumped him) or hi</html> "); } if(movi=="Double Dhamaal") { im1 = new ImageIcon("dd.jpg"); l8 = new JLabel(im1); l8.setBounds(150,280,374,336); l6 = new JLabel("<html>Name: Double Dhamaal<br><br> Genre: COMEDY<br><br> Censor: U/A<br><br> Duration: 2hrs 20mins<br><br> Actors: Sanjay Dutt, Arshad Warshi, Ritesh Deshmukh<br><br>Directors: Indra Kumar<br><br> Description: Double Dhamaal movie is the sequel of 2007 movie Dhamaal. Arshad Warsi would be playing a sikh named ghanta singh, Jaaved Jaaferi as his younger brother, while Ritesh Deshmukh will be playing triple role, first one being</html>"); } if(movi=="Kung Fu Panda 2") { im1 = new ImageIcon("kfp2.jpg"); l8 = new JLabel(im1); l8.setBounds(150,280,374,336); l6 = new JLabel("<html>Name: Kung Fu Panda 2<br><br> Genre: ANIMATION<br><br> Censor: (U)<br><br> Duration: 1hr 30mins<br><br> Directors: Jennifer Yuh<br><br> Description: Po joins force with a group of new kunf-fu masters to take on an old enemy with a deadly new weapon</html>"); } if(movi=="Pyar Ka Punchnama") { im1 = new ImageIcon("pkp.jpg"); l8 = new JLabel(im1); l8.setBounds(150,280,374,336); l6 = new JLabel("<html>Name: Pyar Ka Punchnama<br><br> Genre: COMEDY<br><br> Censor: U/A <br><br> Duration: 2hrs 30mins<br><br> Actors: Kartikeya Tiwari, Rayo BHakirta<br><br> Directors: Luv Ranjan<br><br> Description: Rajat, Chaudhary and Liquid are stuck in their boring jobs and crave for women to add some spice into their lives. The unfortunate Rjat soon finds one- Neha. It is all rosy and good till Rajat gives into a misunderstanding of Neha`s and moves into</html>"); }

l7 = new JLabel(im); b1= new JButton("Back"); j1 = new JComboBox(); j1.addItem("9am-12pm"); j1.addItem("1pm-3pm"); j1.addItem("3pm-6pm"); j1.addItem("6pm-9pm"); j1.addItem("9pm-12am"); b8= new JButton("Submit"); line = new LineBorder(Color.BLACK,1); l1.setBorder(line); l2.setBorder(line); l3.setBorder(line); l1.setFont(f2); l2.setFont(f2); l3.setFont(f2); l4.setFont(f2); l5.setFont(f2); l6.setFont(f1); l1.setForeground(Color.white); l2.setForeground(Color.white); l3.setForeground(Color.white); l4.setForeground(Color.white); l5.setForeground(Color.white); l6.setForeground(Color.white); l7.setForeground(Color.white); add(l1); add(l2); add(l3); add(l4); add(l5); add(l6); add(b1); add(j1); add(b8); add(l7); add(l8); t=(String)j1.getSelectedItem(); setLayout(null); l1.setBounds(100,200,200,30); l2.setBounds(350,200,200,30); l3.setBounds(600,200,140,30); l4.setBounds(1050,200,140,30);

l5.setBounds(650,250,140,30); l6.setBounds(650,260,450,400); l7.setBounds(500,60,253,160); b1.setBounds(50,50,110,20); j1.setBounds(1050,250,110,20); b8.setBounds(1050,50,110,20); b1.addActionListener(this); b8.addActionListener(this); setLocation(10,10); setSize(1300,710); setVisible(true); } public void actionPerformed(ActionEvent ae) { Object o = ae.getSource(); if(o==b8) { setVisible(false); new seat(s,s1,s2,t); } if(o==b1) { setVisible(false); new home(); } } /*public static void main(String args[]) { new timing(); } }*/

/* ---------------------------------end ---------------------------------------------*/ /*----------------------------------- total ----------------------------------------*/

import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.border.*; import java.sql.*; class total extends JFrame implements ActionListener { JLabel l1,l2,l3,l4,l5,l7,l8,l9; JTextField t1,t2,t3,t4,t5; JButton b1,b2,b3; ImageIcon e,f,g; Container con1; ResultSet rs; String s,s1,p,q,r; Connection con; PreparedStatement ps; total(int count,String a,String b,String c) { super("Total Amount"); p=a; q=b; r=c; s=Integer.toString(count); s1=Integer.toString(count*150);

e=new ImageIcon("3.jpg"); f=new ImageIcon("13.jpg"); g=new ImageIcon("14.jpg"); con1=getContentPane(); l1=new JLabel("Movie"); l2=new JLabel("Cinema"); l3=new JLabel("No.Of Seats"); l4=new JLabel("Day"); l5=new JLabel("Total"); l7=new JLabel(e); l8=new JLabel(f); l9=new JLabel(g); t1=new t2=new t3=new t4=new t5=new JTextField(20); JTextField(20); JTextField(20); JTextField(20); JTextField(20);

t1.setText(a); t2.setText(b); t3.setText(s); t4.setText(c); t5.setText(s1);

b1=new JButton("Cancel"); b2=new JButton("Proceed To be Payment"); b3=new JButton("back"); setLayout(null); add(l1); add(l2); add(l3); add(l4); add(l5); add(t1); add(t2); add(t3); add(t4); add(t5); add(l7); add(l8); add(l9); add(b1); add(b2); add(b3); l1.setBounds(250,40,120,20); t1.setBounds(355,40,140,20);

l2.setBounds(250,80,120,20); t2.setBounds(355,80,140,20); l3.setBounds(250,120,120,20); t3.setBounds(355,120,140,20); l4.setBounds(250,160,120,20); t4.setBounds(355,160,140,20); l5.setBounds(250,200,120,20); t5.setBounds(355,200,140,20); b1.setBounds(200,300,100,20); b2.setBounds(320,300,100,20); b3.setBounds(440,300,100,20); l7.setBounds(0,0,150,120); l8.setBounds(0,140,150,120); l9.setBounds(0,280,150,120); b2.addActionListener(this); b3.addActionListener(this); con1.setBackground(Color.black); setUndecorated(true); setLocation(400,100); setSize(550,400); setVisible(true); } public void actionPerformed(ActionEvent ae) { Object o = ae.getSource(); if(o==b2) { setVisible(false); new last(); }

if(o==b3) { setVisible(false); new seat(p,q,r); } }

/*--------------------------------------end --------------------------------------*/ /* --------------------------------------seat ----------------------------------------*/

import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.sql.*; class seat extends JFrame implements ActionListener { JLabel l1, l2,l3,l4,l5,l6; JButton b1,b2; JPanel p; JButton b[] = new JButton[100]; int select[] = new int[100]; int i,j,k,sl; ImageIcon im,im1,im2; Container con; Connection con1; PreparedStatement ps; ResultSet rs; String a,d,c,w; int count=0;

//int save=0; seat(String s,String s1,String s2,String t) { super("PVR Cinemas"); a=s; d=s1; c=s2; w=t; con = getContentPane(); con.setBackground(Color.black); im = new ImageIcon("white.png"); im1 = new ImageIcon("red.png"); im2 = new ImageIcon("green.png"); l1 l2 l3 l4 l5 l6 = = = = = = new new new new new new JLabel("Booked"); JLabel(im1); JLabel("Vacant"); JLabel(im); JLabel("Your current location"); JLabel(im2);

b1 = new JButton("Proceed to payment"); b2=new JButton("Back"); p = new JPanel(); p.setLayout(new GridLayout(10, 10)); p.setFont(new Font("SansSerif",Font.BOLD,20));

k=0; for(i = 0; i < 10; i++) { for(j = 0; j < 10; j++) { p.add(b[k]=new JButton(""+k,im)); k++; } } for(i=0;i<100;i++) { b[i].addActionListener(this); } add(l6); add(b1); add(b2); add(p);

add(l1); add(l3); add(l5); add(l2); add(l4); b1.addActionListener(this); b2.addActionListener(this); l1.setBounds(85,50,110,30); l2.setBounds(25,50,50,40); l3.setBounds(260,50,100,30); l4.setBounds(200,50,50,40); l5.setBounds(430,50,130,30); l6.setBounds(370,50,50,40); b1.setBounds(600,400,190,20); b2.setBounds(650,100,100,20); p.setBounds(50,150,500,400); setLayout(null); setLocation(100,100); setSize(850,650); setVisible(true); j=0; k=0; sl=0;

public void actionPerformed(ActionEvent ae) { Object o= ae.getSource(); if(o==b1) { System.out.println("total no of seats"+count); setVisible(false); new total(count,a,d,c); } if(o==b2) setVisible(false); new home(); } for(int x=0;x<100;x++) { if(o==b[x]) { String s = (String)ae.getActionCommand(); i=Integer.parseInt(s);

try { String seat_no=b[i].getText();

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con1=DriverManager.getConnection("Jdbc:Odbc:tracker","system","abc") ; ps=con1.prepareStatement("select * from seat where seat_no=? and dt=? and tim=? and movi=? "); ps.setString(1,b[i].getText()); ps.setString(2,c); ps.setString(3,w); ps.setString(4, d ); rs=ps.executeQuery(); b[i].setIcon(im1); if(rs.next()) { //b[i].setIcon(im1); System.out.println("can't be allocated ..."); JOptionPane.showMessageDialog(this," Already Booked", "sorry ",JOptionPane.ERROR_MESSAGE); } else { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con1=DriverManager.getConnection("Jdbc:Odbc:tracker","system","abc") ; ps=con1.prepareStatement("insert into seat values(?,?,?,?)"); ps.setString(1,seat_no); ps.setString(2,c); ps.setString(3,w); ps.setString(4,d); ps.executeUpdate(); System.out.println("Record Inserted Successfully ..."); //System.out.println("save"); b[i].setIcon(im2); //dispose(); count++; //save=save+count;

System.out.println(count); //new total(save); } }//end of try catch(Exception e) { System.out.println("Exception Caught :"+e); } }//end if }//ending for

/*public static void main(String args[]) { new seat(); }*/ }

/* -------------------------------------end------------------------------------------*/

7. CONCLUSION
The project was designed in such a way that future modifications can be done easily. The following conclusions can be deduced from the development of the project. Automation of the entire system improves the efficiency We can provides the communication between Customer and Cinema Hall. Can also create Registration for Customer so that Cinema Hall can contact them about exiting offers. Can also make Customer to Post their View on Website. The System has adequate scope for modification in future if it is necessary.

It is the best way to improve selling Tickets with less efforts. This is the best way for customer as well as Cinema Halls to Interact with each other without much efforts.

8. BIBILIOGRAPHY

1. Complete Reference for java 2. Headfirst JSP & Servlet 3. Struts2 in Action 4. Learn programming in java

by Simon Robinson

by Lakhanpal Publishers

REFRENCES:

www.w3schools.com www.coderanch.com www.apache.org www.javasoft.com