You are on page 1of 42

INFORMATICS PRACTICES

PROJECT FILE
(SESSION 2016 – 2017)

AIRLINE RESERVATION
SYSTEM

SUBMITTED TO:Mrs. Vandana Thakur
PROJECT BY:Sarthak Gupta

Page 2
















About the project ………………………………………..….. 5
Acknowledgements ……………………………………..…. 6
System requirements……………………………………..… 7
Introduction………………………………………………..…… 8
Flowchart…………………………………………….…….…… 10
Design and coding……….…………………………………. 15
Main form…………………….……………………………..… 16
User login…………………..……………………………..…… 18
Signup form…………………………………………………... 20
Booking form……………………………………………….… 24
Seat selection form……..…………………………….…… 29
Payment form………………..………………………….…… 32
Reservation form……………………………………….…… 34
Admin login form……………………………………………. 37
Validation form…………..………………………………….. 39
Bibliography………………..…………………………………..42

Page 3

Page 4

The project has been coded and designed in NetBeans™ IDE 8. It is a lot much time saving as such systems responds to users quick enough making things much easier. but this project is an initiative to ignore any chance of error as well as save time and promote the simplicity of online works today.com Page 5 . The system keeps the check on user inputs and every other detail he/she gives thereby suppressing chances of irrelevancy as well. The main objective of this project is to reduce the time wasted in standing in lines and booking tickets as well as reduce the chances that are made in the manual works done at the booking ports .The GUI application is based upon the simple and basic idea of how online flight ticket booking system works .0. This is a user friendly GUI and can be used to book a flight ranging any distance in less than a while.2 and many photo editors have also been used such as Adobe Photoshop CS-6 and many more suiting the situation and backgrounds have been downloaded from www. Shutterstock.

without whom I would not have been able to complete the project. Vandana . from initial advice and contacts in the early stages conceptual inception and through ongoing advice and encouragement to this day. Page 6 . At last but not the least . for her continuous support for the project . who inspired me and encouraged me to go my own way .I world like to express my greatest gratitude to the people who have helped and supported me throughout my project . I wish to thank my parents for their individual support and interest. Mrs. a special thanks of mine goes to my friends who helped me in completing the project through their thoughts and made this project easy and accurate. I would also like to thanks my friends who appreciated me for my work and motivated me and finally to God who made all things possible. I am grateful to my teacher .

8 GHZ Memory : 512 MB Disk Space: 275 MB Macintosh OS X 10.6 Intel: Processor : Dual-Core Intel(32 or 64-bit) Memory : 1 GB Disk Space: 300Mb of free disk space Page 7 .Minimum Hardware Requirements Microsoft Windows XP/Vista Sp1/ Windows 7 Professional: Processor: 600MHZ Intel Pentium IV or equivalent Memory: 512 MB Disk Space : 300 MB of free Ubuntu 9.10: Processor: 600 MHZ Intel Pentium IV or equivalent Memory : 512 MB Disk Space: 250MB of free disk space Solaris OS v ersion 11 Express (x86/x64 Platform Edition) Processor: AMD Opteron 1200 series 1.

Many people are travelling with airplanes. is the option for the user to set up specific requirements for the travel such as . will be to have an easy to use Interface which makes it easier for less computer experienced users to use as well. to mention a few. airline companies hold for a user to book a travel himself. To much reservations for such travels. either on means of daily to and from work or on some vacation . A functionality which these websites lacks out on. minimal travel time and distance . Based on the methods provided by Object Oriented Programming the report will Another aspect of the present a result to such problems. The functionalities given to users can be judged through this Figure : Page 8 .

a rich picture has been made and described. Page 9 .Whereas the Administrator has functionalities as shown: To form the overview of what the system should interact with.

Page 10 .

START Accept YES If choice = login choice No If choice = signup OPEN USER LOGIN FORM No A OPEN ADMIN LOGIN FORM No Accept Information (If correct) If choice =admin OPEN Signup form No Accept login details No Accept login details (If correct) Stores Information OPEN Validation form Store Data Page 11 .

A OPEN BOOKING SYSTEM FORM ACCEPT FLIGHT DETAILS If choice = Domestic If choice = International VIEW FLIGHTS DETAILS ACCORDINGLY DESIRED VIEW FLIGHTS DETAILS ACCORDINGLY DESIRED ACCEPT FLIGHT ACCEPT FLIGHT OPEN SEAT SELECTION FORM B Page 12 .

OPEN PAYMENT WINDOW C Page 13 .B Accept passengers Accept class If choice = First If choice = Economy Select seat from Economy class seat list Select seat from First class seat list.

C ACCEPT CHOICE If choice = VisaCard If choice = Paypal OPEN FINAL DETAILS RESERVE FLIGHT STOP Page 14 If choice = MasterCard .

Payment Selection Form 7. Admin Login Form 9. Main Form 2. Flights Booking Form Seat Booking Form 6. 5. Flights Validation Form Page 15 . Reservation Form 8. Flight tracking Form 10. Signup Form 4.There are 10 forms in total :- 1. Login Form 3.

Page 16 . NOTE :. It is not meant for normal users.FORM SUMMARY :The above form is the main window of the application which provides every user with three choices. The person can login into the system by registering himself by clicking “SIGNUP” and then LOGIN anytime from anywhere he/she desires.The idea of “ADMIN” is to refer to the regular validation of the flights and other required information that needs to be kept fresh that can be done by administrators .

null. dispose().event. } FLIGHT_DETAILS.log(Level. ex).ActionEvent evt) { new NewJFrame().awt.setVisible(true). if ((d != null) && (d.setVisible(true). dispose().event.executeQuery("select * from reserved where uni = '"+d+"'").showInputDialog(this.setVisible(true). } catch (SQLException ex) { Logger.class.getLogger(mai.ActionEvent evt) { new AIR_RESERVATION_SYSTEM(). rs2 = st1.length() > 0)) { Try { new FLIGHT_DETAILS().awt.resultSetToTableModel(rs2)).awt. } private void jRadioButton2ActionPerformed(java.setModel(DbUtils. } Page 17 .event. } private void jButton1ActionPerformed(java.ActionEvent evt) { String d = JOptionPane. dispose().getName())."ENTER UNIQUE CODE").SEVERE.private void jRadioButton1ActionPerformed(java.jTable2.

the user is prompted to enter his/her „username‟ and „password‟ which on being correct prompts the user to further window which is the Booking Form. Page 18 .FORM SUMMARY :This is the window that opens when the user clicks on “login” button .

createStatement().createStatement(). while(rs1.exit(0). mob=rs1.private void jButton1ActionPerformed(java. ResultSet rs = stmt. while(rs.next()){ name = rs1.forName("com.awt. if ((user.exit(0).setVisible(true).mysql. } private void jButton3ActionPerformed(java.Driver"). String user=jTextField1. try { Class. } new MANAGING_SOFTWARE()."").executeQuery(sql).getString("email").getString("name"). Statement stmt = (Statement) con."root".getConnection("jdbc:mysql://localhost:3306/mysql". String pwd= new String (jPasswordField1.getText().ActionEvent evt) { System. e.equals(uname)) && (pwd.next()) { String uname=rs.getMessage()).jdbc. String password=rs. Connection con= (Connection) DriverManager.ActionEvent evt) { int c = 0. rs1=stmt1.event.} } catch (Exception e){ JOptionPane. } Page 19 .getString("mobile").String sql=" Select * from skyline_users".awt. dispose().executeQuery("select * from skyline_users where email='"+user+"' ").equals(password))) { c=1. Statement stmt1 = (Statement) con.event.getString("password"). } } if(c==0) {System.showMessageDialog(this.getPassword()).

This form accepts all essential information from the user and stores them in the database thereby registering the user in the system. Page 20 .Form Summary:This is the form/window which opens when the user clicks on the SIGNUP window on the main form.

isEmpty()||password.} if (c==1) { JOptionPane.parseInt(jTextField8."INVALID DATE").getText()).parseInt(jTextField9. String password = jPasswordField1.getText().isEmpty()||mobile.getText().isEmpty()||email.showMessageDialog(this.length()!=4) { c=1. } else if(m==2) { if(y%4==0 && d<=0||d>29) c=1.awt.ActionEvent evt) { String name = jTextField1. if(Integer.private void jButton1ActionPerformed(java.getText()). } else if(y%4!=0 && d<=0||d>28) c=1. String email = jTextField2. int d = Integer. int m = Integer. String cor = jTextField5. int c = 0 . String date = jTextField7.event.isEmpty()||cor.getText().getText() +"/"+jTextField9.isEmpty()) Page 21 .} if(m>12) {c=1.getText()). int y = Integer.parseInt(jTextField7.getText()).getText().getText().toString(y). } else if(m==4||m==6||m==9||m==11) { if(d<=0||d>30) c=1. String mn = jTextField3. String mobile = (jTextField4. if(m==1||m==3||m==5||m==7||m==8||m==10||m==12) { if(d<=0||d>31) c=1. } else if(name.getText() +"/"+jTextField8.getText().

DriverManager"). Statement st = (Statement) con. } Page 22 .setVisible(true).ActionEvent evt) { try { new mai(). } dispose(). String query="INSERT INTO skyline_users VALUES ('"+name+"'.sql.log(Level.'"+cor+"'.showMessageDialog(this.getMessage()). } catch (SQLException ex) { Logger.SEVERE. } else if(mobile.'"+mobile+"'.'"+email+"'. } catch (Exception e) { JOptionPane. } } } private void jButton2ActionPerformed(java. ex).isSelected()!= true) { JOptionPane.forName("java.'"+mn+"'). Connection con = (Connection) DriverManager.event.showMessageDialog(this.showMessageDialog (this. stmt. } else { try { Class.getLogger(NewJFrame.createStatement(). null."Information incomplete").executeUpdate(query).createStatement().'"+date+"'. "root".")."").showMessageDialog(this. e."."wrong mobile no.class.awt."Please agree to our terms and conditions ").{ JOptionPane.'"+password+"'.length()!=10) { JOptionPane. Statement stmt = (Statement) con.getName()).getConnection("jdbc:mysql://localhost:3306/mysql". } else if(jCheckBox1.

After signing up the information gets stored in database Figure-1 Figure-2 Page 23 .

Form Summary:This form on the click of „next‟ accepts the regions the person wants to travel between and further after sorting suitable flights view all the flights in a table under “VIEW FLIGHT DETAILS “ tab as can be seen in the preview above. Page 24 .

SEVERE.getText().resultSetToTableModel(rs))."Please select the type(INTERNATIONAL OR DOMSESTIC)!!").setText((String) jComboBox3.end from flights where start='"+s1+"' and end='"+s2+"' "). } else { JOptionPane. try { rs =st. } jTabbedPane1.getSelectedItem()).getName()). } else if(jRadioButton2. jTextField10.event.departure.setText((String) jComboBox2.getSelectedItem()).isSelected()==true){ if(jRadioButton1.private void jButton7ActionPerformed(java.getText().terminal.ActionEvent evt) { if(jRadioButton1.isSelected()==true) { jTextField9.class.isSelected()==true || jRadioButton2. } } private void jButton2ActionPerformed(java.area.setModel(DbUtils. } catch (SQLException ex) { Logger.setText("INTERNATIONAL").setText("DOMESTIC"). null. jTextField10. } Page 25 . } catch (SQLException ex) { } jTable1.getSelectedItem()).showMessageDialog(this. jTextField5. s1 = jTextField9.price.getSelectedItem()).ActionEvent evt) { try { new mai().setSelectedIndex(1).event.executeQuery("select date.isSelected()==true) { jTextField9.setText((String) jComboBox1.setVisible(true).getLogger(MANAGING_SOFTWARE. s2 = jTextField10.log(Level.airliner.start.awt.setText((String) jComboBox4. } dispose(). jTextField5.awt. ex).

selecting the origin and end of the journey.Form Summary:This form represented above receives command from the previous “selection” that the user did i. The action promotes the database to be searched through and thereby displaying all the flights following the tour. Page 26 .The above window is just the continuation of the previous form which are sub-contained in the same form but under different tabs just like web-browser style.e. The user can easily select the flight by simply clicking on the flight suiting him/her. NOTE:.

private void jTable1MouseClicked(java.SEVERE.event. dispose(). String p = (String) jTable1.jTextField4.getValueAt(row.getValueAt(row. ex).setSelectedIndex(0). String s8 = (String) jTable1.MouseEvent evt) { int n = 0.jTextField3. int row = jTable1.log(Level.3) .jTextField2. s2 = jTextField10.awt.getModel().getModel(). String s9 = (String) jTable1.substring(2)). } catch (SQLException ex) { Logger.setText(s). String s0 = (String) jTable1. further. further.getValueAt(row.getValueAt(row.setText(s9).jTextField1.getLogger(MANAGING_SOFTWARE.awt.jTextField5.getText().getText(). } } } private void jButton3ActionPerformed(java. if(row>=0) { try { s1 = jTextField9.setVisible(true).setText(p.1) . } Page 27 .setText(s8). new further(). further.0) .2) . further.getModel().4) .ActionEvent evt) { jTabbedPane1.getName()). further.getModel().class.getSelectedRow().getModel().getValueAt(row.setText(s0). String s = (String) jTable1.event. null.

Page 28 .(a few of them).Flights stored in database. Note : The above pictures are of MySQL database software which works at back –end.

FORM SUMMARY:This form accepts number of passengers from user and prompts him to the payment portal. Page 29 .

name).parseInt(s)+s1. } int t = Integer.getText()).setText(AIR_RESERVATION_SYSTEM."PLEASE SELECT MORE SEATS")."PLEASE DONT SELECT EXTRA SEATS").jTextField3.setVisible(true). }} if(jRadioButton2.length. int z1 = Integer.l3.getText(). int s1=0.setText(AIR_RESERVATION_SYSTEM. class1.parseInt(j6. } else if(l<n) { JOptionPane.showMessageDialog(this.jTextField1. class1.event.setText("ECONOMY").j<=n-1.length().getSelectedIndices().toString(t+s1)).getElementAt(j).getSelectedValues()). class1.jTextField4.parseInt(jTextField5.private void jButton2ActionPerformed(java. class1.ActionEvent evt) { z = j6. s1 = Integer. String s= i.j++) { String i = (String)l3.parseInt(j6.getModel(). dispose().getText()) * z1. for(int j=0. if(l>n) { JOptionPane. class1.awt. if(jRadioButton1.getText()).setText(Integer. } else{ new class1().showMessageDialog(this.substring(20).mob). if(z>0){ n = Integer.setListData(l1.isSelected()==true) { l = l1.jTextField5.isSelected()==true) { Page 30 .

"PLEASE ENTER NUMBER OF PASSENGERS").jTextField4.setText(AIR_RESERVATION_SYSTEM. int s1=0.jTextField1. if(l>n) { JOptionPane. class1. dispose().parseInt(s)+s1.getModel()."SELECT CLASS").mob).jTextField5.setListData(l2. } Page 31 .j++) { String i = (String)l3. } else if(l<n) { JOptionPane."PLEASE SELECT MORE SEATS"). s1 = Integer.showMessageDialog(this. } } if(jRadioButton1.isSelected()==false && jRadioButton2.setText(Integer.setVisible(true).setText("FIRST").getElementAt(j). for(int j=0.setText(AIR_RESERVATION_SYSTEM. class1.isSelected()==false ) { JOptionPane.jTextField3.showMessageDialog(this.l = l2. class1.l3.name). } } else { JOptionPane. String s= i.length.getSelectedValues()). } int t = Integer. } else{ new class1(). class1.toString(t+s1)).getText())*z1. class1.getSelectedIndices()."PLEASE DONT SELECT EXTRA SEATS").showMessageDialog(this.substring(20).parseInt(jTextField5.showMessageDialog(this.j<=n-1.

Note:The image might look tilted in the figure above. Page 32 . „VisaCard‟. „Paypal‟. ‟MasterCard‟.e.FORM SUMMARY :This form receives the essential information from the previous inputs and results and asks for the payment through the three ways possible shown i. It is just because of effects used while editing .

String seat = i.isSelected() == false) { JOptionPane."Please select a Payment method").getText()). Reservationdetails.isSelected()==false && jRadioButton2. seat2 = seat+".jTextField9.setText("PAYPAL"). Reservationdetails.event.jTextField4.setText(further.jTextField1.setVisible(true).jTextField3.private void jButton1ActionPerformed(java.getText()).setText("VISACARD").setText(re. 2)). Reservationdetails. } } Page 33 .j++) { String i = (String)l3.2).showMessageDialog(this.l.ActionEvent evt) { if(jRadioButton1. dispose().setText(ns).jTextField8.jTextField7.getModel().awt.m-5).substring(0. Reservationdetails.setText(jTextField4.getText()). } if(jRadioButton2. } int m = seat2.jTextField2. Reservationdetails.substring(1)+jTextField1. int res = (r.setText(further.isSelected()==true) { Reservationdetails.substring(0.jTextField8. int n1 = further. j<=(n1-1). String re=Integer.getText()).substring(0.length(). Random r = new Random(). Reservationdetails. } if(jRadioButton3.jTextField10.int f2=100000. } int f1=1.jTextField8.getText().isSelected() == false && jRadioButton3.toString(res).jTextField9.setText(MANAGING_SOFTWARE.jTextField5.setText(jTextField5.isSelected()==true) { Reservationdetails.getText()). Reservationdetails.jTextField10.jTextField9.isSelected()==true) {Reservationdetails. for(int j=0.jTextField6. Reservationdetails.jTextField2. if(jRadioButton1. Reservationdetails. } else{ new Reservationdetails(). String ns = seat2.getElementAt(j).setText("MASTERCARD").nextInt()* (f2-f1)+f1).setEditable(false).getText()).setText(MANAGING_SOFTWARE."+ seat2.

Page 34 .Form Summary :This form finally shows the details essential for reservation and after the user have confirmed these he/she presses reserve which stores the flight record in the database that Can be tracked later using the „UNIQUE CODE‟ provided.

getText().getText(). } dispose(). e.ActionEvent evt) { JOptionPane.createStatement().SEVERE."").getText(). String uni = jTextField9.showMessageDialog (this.".getText().setVisible(true).sql.getName()). String payment = jTextField8. } } private void jButton2ActionPerformed(java.'"+date+"'. String origin = jTextField6.showMessageDialog(this. String end = jTextField7.getLogger(Reservationdetails. ex). } catch (SQLException ex) { Logger.log(Level.'"+departure+"'. null.'"+seatnumber+"'.getConnection("jdbc:mysql://localhost:3306/mysql". "root". } Page 35 .getText(). String FLIGHT = further.getText().awt. String query="INSERT INTO reserved VALUES ('"+Name+"'. Statement stmt = (Statement) con.'"+contact+"'.event. } catch (Exception e) { JOptionPane.DriverManager"). String date = jTextField5. Class. String seatnumber = jTextField10.'"+payment+"'.ActionEvent evt) { try { new mai().forName("java. String contact = jTextField2.getMessage()).getText(). HAVE A NICE DAY !") try { String Name = jTextField1.'"+FLIGHT+"'. String departure = jTextField4.'"+uni+"').awt.event.jTextField1.class.getText().'"+origin+"'.private void jButton1ActionPerformed(java.'"+e nd+"'. Connection con = (Connection) DriverManager.getText().getText()."FLIGHT RESERVED .executeUpdate(query). stmt.

The Illustration is given below.DO TAKE A NOTE OF THIS The reservation form provides a UNIQUE CODE to every costumers who tries to reserve the flight and this unique code can help the customer to see the record of his flight easily by clicking on the CHECK FLIGHT STATUS on the main form which will retrieve the particular record from the database showing his/her flight details. Page 36 . In the above figure the textfield with unique code which has been copied The user enter his/her unique number and gets the flight record displayed accordingly.

This form asks the admin for the password the administration uses and hence it further opens a modifying window which can help to add .FORM SUMMARY:This form is administration based form which allow the administrators to modify the flight as well as seat details from wherever they desire thereby saving time . delete the flights from the record database. Page 37 .

String password=rs. dispose().equals(uname)) && (pwd.getText().executeQuery(sql).createStatement(). try { Class.event. Connection con= (Connection) DriverManager. ResultSet rs = stmt. String user=jTextField1."").mysql. Statement stmt1 = (Statement) con. } } if(c==1) { new addschedule().setVisible(true). while(rs.awt.next()) { String uname=rs.exit(0). String pwd= new String (jPasswordField1.equals(password))) { c=1.createStatement(). } if(c==0) { System.getString("PASSWORD")."root".showMessageDialog(this.ActionEvent evt) { int c=0.getString("USERNAME").getMessage()).jdbc.String sql=" Select * from admin ".getConnection("jdbc:mysql://localhost:3306/mysql". } } catch (Exception e) { JOptionPane. Statement stmt = (Statement) con.getPassword()).private void jButton1ActionPerformed(java. } } Page 38 . if ((user.Driver").forName("com. e.

FORM SUMMARY:This form can easily modify the flight schedule with the help of buttons INSERT. NOTE:Here ‘FN’ refers to the unique number that is assigned to every row and acting as a primary key which helps in reducing the bulky and complex coding to remove a row . DELETE which can add as well as delete a particular desired row from the database. Page 39 . However use of primary key makes removal easy.

getValueAt(r.ActionEvent evt) { int row = jTable1.1).getString("FN").2).'"+terminal+"'.'"+departure+"'. try { String query = "INSERT INTO flights VALUES ('"+date+"'.getValueAt(r. st1.event.resultSetToTableModel(rs2)).private void jButton1ActionPerformed(java.getValueAt(r.8).7). Page 40 . null. String date = (String) jTable1.class.'"+ FN+"').".next()) { String s = rs3.setModel(DbUtils. String Price = (String) jTable1.getSelectedRow(). } catch (SQLException ex) { Logger. ex).log(Level.getValueAt(r.executeUpdate(query).getName()).getValueAt(r.getValueAt(r. null. } jTable1. while(rs3. ex).'"+end+"'.'"+area+"'. String start = (String) jTable1.6). String airliner = (String) jTable1.getValueAt(r.'"+Price+"'.getName()).log(Level.executeQuery("Select * from flights"). String end = (String) jTable1.getLogger(addschedule. } } private void jButton2ActionPerformed(java.ActionEvent evt) { int r = jTable1. } catch (SQLException ex) { Logger.'"+airliner+"'.SEVERE.class. String terminal = (String) jTable1.awt.'"+start+"'. String query = " delete from flights where FN = '"+s+"' ".executeQuery("select * from flights LIMIT 1 OFFSET "+row+" "). String FN = (String) jTable1.getSelectedRow(). String departure = (String) jTable1.5).ActionEvent evt) { try { rs2 =st1.3).event.getValueAt(r.4).SEVERE.getLogger(addschedule.awt.event.awt. String area = (String) jTable1. if(row>=0) { try { rs3 =st1.0).getValueAt(r. } private void jButton3ActionPerformed(java.

}} catch(Exception e ){} } } If you observe the preview image and the above and below one you will observe that the row with primary key 101 has been removed and with 1001 has been added. Page 41 . Such is obtained by the action of delete and insert button.st2.executeUpdate(query).

youtube.org www.The sources that proved out to be very useful during the making of the project are listed below. www.NetBeans.wikipedia.org www.org www.com www. and many more. Page 42 .MySQl.com CBSE CLASS 11/12 Informatics Practices.Shutterstock.