INFORMATICS PRACTICES PROJECT FILE (SESSION 2016 – 2017)
AIRLINE RESERVATION SYSTEM
SUBMITTED TO:Mrs. Vandana Thakur PROJECT BY:Sarthak Gu ta
Page 2
About the project ……………………………………… ……………………………………… .. ..….. ….. 5 5 …………………………………… ..…. …. 6 6 Acknowledgements …………………………………….. requirements…………………………………… … .. ..… … 7 System requirements………………………………… Introduction……………………………………………….. ..…… …… 8 Introduction……………………………………………… Flowchart…………………………………………….……..…… 10 Flowchart…………………………………………….…… coding……….…………………………………. ………………. 15 15 Design and coding……….………………… form…………………….……………………………..… 16 Main form…………………….……………………………..… 16 User login…………………..……………………………..…… 18 Signup up form…………………………………… form…………………………………………………... ……………... 20 Sign form……………………………………………….… 24 Booking form……………………………………………….… 24 Seat selection form……..…………………………….…… 29 form……..…………………………….…… 29 form………………..………………………….…… 32 Payment form………………..………………………….…… 32 form……………………………………….…… 34 Reservation form……………………………………….…… 34 37 Admin login form……………………………………………. 37 39 Validation form…………..………………………………….. 39 Bibliography………………..…………………………………..42 2 Bibliography………………..…………………………………..4
Page 3
Page 4
The GUI application is based upon the simple and basic idea of how online flight ticket booking system works . The main objective objec tive 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 , 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. It is a lot much time saving as such systems responds to users quick enough making things much easier. This is a user friendly GUI and can be used to book a flight ranging any distance in less than a while. The system keeps the check on user inputs and every other detail he/she gives thereby suppressing chances of irrelevancy as well.
The project has been coded and designed in NetBeans™ IDE 8.0.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.com
Page 5
I world like to express my greatest gratitude to the people who have helped and supported me throughout my project . I am grateful to my teacher , , for her continuous support for the project , from initial advice and contacts in the early stages conceptual inception and through ongoing advice and encouragement to this day.
I wish to thank my parents for their individual support and interest, who inspired me and encouraged enco uraged me to go my own way , without whom I would not have been able to complete the project.
At last but not the least , 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.
Page 6
Processor: 600MHZ Intel Pentium IV or equivalent Memory: 512 MB Disk Space : 300 MB of free
Processor: 600 MHZ Intel Pentium IV or equivalent Memory : 512 MB Disk Space: 250MB of free disk space
Processor: AMD Opteron 1200 series 1.8 GHZ Memory : 512 MB Disk Space: 275 MB
Processor : Dual-Core Intel(32 or 64-bit) Memory : 1 GB Disk Space: 300Mb of free disk space
Page 7
Many people are travelling with airplanes, either on means of daily to and from work or on some vacation , to mention a few. To much reservations for such travels, airline companies hold for a user to book a travel himself. A functionality which these websites web sites lacks out on, is the option for the user to set up specific requirements for the travel such as , minimal travel time and distance . Based on the methods provided by Object Oriented Programming the report will present a result result to such problems. Another aspect of the will be to have an easy to use Interface which makes it easier for less computer experienced users to use as well. The functionalities given g iven to users can be judged through this Figure :
Page 8
Whereas the Administrator has functionalities as shown:
To form the overview of what the system should interact with, a rich picture has been made and described.
Page 9
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
(If correct)
Stores Information
OPEN Validation form
Store Data
Page 11
A
OPEN BOOKING SYSTEM FORM
ACCEPT FLIGHT DETAILS
If choice =
If choice =
Domestic
International
VIEW FLIGHTS DETAILS
VIEW FLIGHTS DETAILS
ACCORDINGLY
ACCORDINGLY
DESIRED
DESIRED
ACCEPT
ACCEPT
FLIGHT
FLIGHT
OPEN SEAT SELECTION FORM
B Page 12
B
Accept passengers
Accept class
If choice =
If choice =
Economy
First
Select seat from Economy class seat list
Select seat from First class seat list.
OPEN PAYMENT WINDOW
C
Page 13
C
ACCEPT CHOICE
If choice =
If choice
If choice =
VisaCard
= Paypal
MasterCard
OPEN FINAL DETAILS
RESERVE FLIGHT
STOP
Page 14
Page 15
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. NOTE :- 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 . It is not meant for normal users.
Page 16
private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) { new AIR_RESERVATION_SYSTEM().setVisible(true); dispose();
}
private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) { new NewJFrame().setVisible(true); dispose();
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { String d = JOptionPane.showInputDialog(this,"ENTER UNIQUE CODE"); if ((d != null) && (d.length() > 0)) { Try { new FLIGHT_DETAILS().setVisible(true); dispose(); rs2 = st1.executeQuery("select * from reserved where uni = '"+d+"'"); } catch (SQLException ex) { Logger.getLogger(mai.class.getName()).log(Level.SE Logger.getLogger(mai.class.getName( )).log(Level.SEVERE, VERE, null, nu ll, ex); } FLIGHT_DETAILS.jTable2.setModel(DbUtils.resultSetToTableModel(rs2));
}
Page 17
This is the window that opens when the user clicks on “login” button . the user is prompted to enter his/her „username‟ and „password‟ which on being correct prompts the user to further window which w hich is the Booking Form.
Page 18
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { int c = 0;String sql=" Select * from skyline_users"; try { Class.forName("com.mysql.jdbc.Driver"); Connection con= (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql","root",""); Statement stmt = (Statement) con.createStatement(); Statement stmt1 = (Statement) con.createStatement(); ResultSet rs = stmt.executeQuery(sql); String user=jTextField1.ge u ser=jTextField1.getText(); tText(); String pwd= new String (jPasswordField1.getPassword()); while(rs.next()) { String uname=rs.getString("email"); String password=rs.getString("password"); if ((user.equals(uname)) && (pwd.equals(password))) { c=1; rs1=stmt1.executeQuery("select * from skyline_users where email='"+user+"' "); while(rs1.next()){ name = rs1.getString("name"); mob=rs1.getString("mobile"); } new MANAGING_SOFTWARE().setVisible(true); dispose(); } } if(c==0) {System.exit(0);} } catch (Exception e){ JOptionPane.showMessageDialog(this, e.getMessage());
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { System.exit(0);
}
Page 19
This is the form/window which opens when the user clicks on the SIGNUP window on the main form. This form accepts all essential information from the user and stores them in the database thereby registering the user in the system.
Page 20
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { String name = jTextField1. jTextField1.getText(); getText(); String email = jTextField2.getTe jTextField2.getText(); xt(); String password = jPasswordField1.getText(); String mobile = (jTextField4. (jTextField4.getText()); getText()); String cor = jTextField5. jTextField5.getText(); getText(); String mn = jTextField3.ge jTextField3.getText(); tText(); String date = jTextField7.getText() +"/"+jTextField8.getText() +"/"+jTextField8.getText() +"/"+jTextField9.getText(); int d = Integer.parseInt(jTextField7. Integer.parseInt(jTextField7.getText()); getText()); int m = Integer.parseInt(jTextField8 Integer.parseInt(jTextField8.getText()); .getText()); int y = Integer.parseInt(jTextFiel Integer.parseInt(jTextField9.getText()); d9.getText()); int c = 0 ; if(m==1||m==3||m==5||m==7||m==8||m==10||m==12) { if(d<=0||d>31) c=1; } else if(m==4||m==6||m==9||m==11) { if(d<=0||d>30) c=1; } else if(m==2) { if(y%4==0 && d<=0||d>29) c=1; } else if(y%4!=0 && d<=0||d>28) c=1; if(Integer.toString(y).length()!=4) { c=1;} if(m>12) {c=1;} if (c==1) { JOptionPane.showMessageDialog(this,"INVALID DATE"); } else if(name.isEmpty()||email.isEmpty()||password.isEmpty()||mobile.isEmpty()||cor.isEmpty())
Page 21
{ JOptionPane.showMessageDialog(this,"Information JOptionPane.showMessageDialog(this,"Informat ion incomplete"); } else if(mobile.length()!=10)
{ JOptionPane.showMessageDialog(this,"wrong mobile no."); } else if(jCheckBox1.isSelected()!= true) { JOptionPane.showMessageDialog(this,"Please agree to our terms and conditions "); } else { try { Class.forName("java.sql.DriverManager"); Connection con = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql", DriverManager.getConnection("jdbc:mysql://local host:3306/mysql", "root",""); Statement stmt = (Statement) con.createStatement(); Statement st = (Statement) con.createStatement(); String query="INSERT INTO skyline_users VALUES ('"+name+"','"+email+"','"+password+"','"+date+"','"+cor+"','"+mobile+"','"+mn+"');"; stmt.executeUpdate(query); } catch (Exception e) { JOptionPane.showMessageDialog (this, e.getMessage()); } }
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { try { new mai().setVisible(true); } catch (SQLException ex) { Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, Logger.getLogger(NewJFrame.class.getName()).log (Level.SEVERE, null, ex); } dispose();
}
Page 22
After signing up the information gets stored in database
Figure-1
Figure-2
Page 23
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
private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) { if(jRadioButton1.isSelected()==true || jRadioButton2.isS if(jRadioButton1.isSelected()==true jRadioButton2.isSelected()==true){ elected()==true){ if(jRadioButton1.isSelected()==true) { jTextField9.setText((String) jComboBox1.getSele jComboBox1.getSelectedItem()); ctedItem()); jTextField10.setText((String) jComboBox2.getS jComboBox2.getSelectedItem()); electedItem()); jTextField5.setText("INTERNATIONAL"); jTextField5.setText("IN TERNATIONAL"); } else if(jRadioButton2.isSele if(jRadioButton2.isSelected()==true) cted()==true) { jTextField9.setText((String) jComboBox3.getSele jComboBox3.getSelectedItem()); ctedItem()); jTextField10.setText((String) jComboBox4.getS jComboBox4.getSelectedItem()); electedItem()); jTextField5.setText("DOMESTIC"); jTextField5.setText("DOME STIC"); } jTabbedPane1.setSelectedIndex(1); jTabbedPane1.setSelectedIndex( 1); s1 = jTextField9.getText(); s2 = jTextField10.getText(); try { rs =st.executeQuery("select date,departure,airliner,terminal,price,area,start,end date,departure,airliner,terminal,price,area,start,end from flights where start='"+s1+"' and end='"+s2+"' "); } catch (SQLException ex) { } jTable1.setModel(DbUtils.resultSetToTableModel(rs)); jTable1.setModel(DbUtils. resultSetToTableModel(rs)); } else { JOptionPane.showMessageDialog(this,"P JOptionPane.showMes sageDialog(this,"Please lease select the type(INTERNATION t ype(INTERNATIONAL AL OR DOMSESTIC)!!"); }
} private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { try { new mai().setVisible(true); } catch (SQLException ex) { Logger.getLogger(MANAGING_SOFTWARE.class.getName()).log(Level.SEVERE, Logger.getLogger(MANAGING_SOFTWARE.class.getName()).lo g(Level.SEVERE, null, ex); } dispose();
}
Page 25
This form represented above receives command from the previous “selection” that the user did i.e. selecting the origin and end end of the journey. journey. The action action promotes the database to be searched through and thereby displaying displaying all the flights following following the tour. The user user can easily easily select the the flight by simply clicking on the flight suiting him/her. NOTE:- 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.
Page 26
private void jTable1MouseClicked(java.awt.event.MouseEvent evt) { int n = 0; int row = jTable1.getSelectedRow(); jT able1.getSelectedRow(); if(row>=0) { try { s1 = jTextField9.getText(); s2 = jTextField10.getText(); String s = (String) jTable1.getModel().getValueA jTa ble1.getModel().getValueAt(row,2) t(row,2) ; String s0 = (String) jTable1.getModel().getValueAt(row,0) ; String s9 = (String) jTable1.getModel().getValueAt(row,3) ; String s8 = (String) jTable1.getModel().getValueAt(row,1) ; String p = (String) (String) jTable1.getModel().getValueAt(row,4) jTable1.getModel().getValueAt(row,4) ; new further().setVisible(true); dispose(); further.jTextField1.setText(s); further.jTextField2.setText(s0); further.jTextField3.setText(s8); further.jTextField4.setText(s9); further.jTextField5.setText(p.substring(2));
} catch (SQLException ex) { Logger.getLogger(MANAGING Logger.getLogger (MANAGING_SOFTWARE.class.getN _SOFTWARE.class.getName()).log(Level.S ame()).log(Level.SEVERE, EVERE, null, ex); } }
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { jTabbedPane1.setSelectedIndex(0); jTabbedPane1.setSelectedI ndex(0);
}
Page 27
Note : The above pictures are of MySQL database software which works at back – end. end. Page 28
This form accepts number of passengers from user and prompts him to the payment portal.
Page 29
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { z = j6.getText().length(); int z1 = Integer.parseInt(j6.getText()); if(z>0){ n = Integer.parseInt(j6.get Integer.parseInt(j6.getText()); Text()); if(jRadioButton1.isSelected()==true) { l = l1.getSelectedIndices().length; if(l>n) { JOptionPane.showMessageDialog(this,"PLEASE DONT SELECT EXTRA SEATS"); } else if(l
Page 30
l = l2.getSelectedIndices().length; if(l>n) { JOptionPane.showMessageDialog(this,"PLEASE DONT SELECT EXTRA SEATS"); } else if(l
Page 31