0% found this document useful (0 votes)
73 views93 pages

Info Project2

The document describes the front end and back end of an airline reservation system. The front end is the user interface that receives user requests and passes them to the back end. The front end uses Java IDE. The back end handles database access through servers and processes user requests, then returns results to the front end. The back end uses MySQL. It also introduces the airline reservation system project, which allows travelers to book flights online.

Uploaded by

Zany Jubuns
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views93 pages

Info Project2

The document describes the front end and back end of an airline reservation system. The front end is the user interface that receives user requests and passes them to the back end. The front end uses Java IDE. The back end handles database access through servers and processes user requests, then returns results to the front end. The back end uses MySQL. It also introduces the airline reservation system project, which allows travelers to book flights online.

Uploaded by

Zany Jubuns
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 93

DOCUMENTATION

FRONT END:
The Front End is the user interface that the user sees and this end is
responsible for interacting with the user. The Front End is responsible
for receiving users queries, requests etc, and passing it over to the
Back End. The Front End basically includes graphical user interface and
the input form through which the user interacts with the system.

The Front End that we are using is JAVA IDE.

BACK END:
The Back End manages the interface with which the user interacts, the
Back End handles all the database access through one or more servers.
A server is a special computer that is responsible for serving requests
made to it. That is the part of the program that does the real processing
work or gets it done from a server. After processing the users requests
in queries, the server returns the result to the Back End which is
interpreted and passed on to the Front End.

The Back End that we are using is MYSQL.

Page | 1
INTRODUCTION

Airline Reservation Systems were first introduced in the late 1950s.


The modern airline reservation is comprehensive suite of products to
provide a system that assists with a variety of airline management tasks
and service customer needs from time to initial reservation through
completion of the flight.

The World Wide Web has become tremendously popular over the last
years, and currently most of the airlines have made provision for online
reservation of their flights. My project intends to serve these purposes.

The object of this project is to create an airline reservation system


where a traveler can request all booking information as per their
journey dates. They can get information regarding cost according to
their trip type, cabin class etc all at the same time and place. The
traveler can book tickets online and can also check their specific
bookings made. This system would help the airline to better serve its
customers by catering to their needs.

Page | 2
MY SQL DATABASE
AND TABLES

Page | 3
DATABASE NAME: AirReservation

TABLE NAME: Airline_Reservation

TABLE NAME: Users

Page | 4
JAVA FRAMES AND
SOURCE CODE

Page | 5
WELCOME SCREEN

CONTROL TYPE CONTROL NAME


Command Button Continue btnContinue
Command Button Exit btnExit

Source Code:
import javax.swing.JOptionPane;

public class Welcome extends javax.swing.JFrame {

public Welcome() { initComponents(); }

Page | 6
private void btnContinueActionPerformed(java.awt.event.ActionEvent
evt) {

this.setVisible(false);

new Login().setVisible(true);

private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {

int x=JOptionPane.showConfirmDialog(null,"Are you sure you want to exit


the application?");

if (x==JOptionPane.YES_OPTION)

System.exit(0);

public static void main(String args[]) {

try {

for (javax.swing.UIManager.LookAndFeelInfo info :


javax.swing.UIManager.getInstalledLookAndFeels()) {

if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break; } }

} catch (ClassNotFoundException ex) {


java.util.logging.Logger.getLogger(Welcome.class.getName()).log(java.util.lo
gging.Level.SEVERE, null, ex);

Page | 7
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Welcome.class.getName()).log(java.util.lo
gging.Level.SEVERE, null, ex);

} catch (IllegalAccessException ex) {


java.util.logging.Logger.getLogger(Welcome.class.getName()).log(java.util.lo
gging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {


java.util.logging.Logger.getLogger(Welcome.class.getName()).log(java.util.lo
gging.Level.SEVERE, null, ex); }

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Welcome().setVisible(true); } });

private javax.swing.JButton btnContinue;

private javax.swing.JButton btnExit;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JLabel jLabel4;

private javax.swing.JLabel jLabel5;

private javax.swing.JLabel jLabel6;

Page | 8
LOGIN SCREEN

CONTROL TYPE CONTROL NAME


Text Field Username TFUsern
Password Field Password PFPass
Command Button Login btnLogin
Command Button Register btnRegister

Source Code:
import java.sql.*;

import javax.swing.JOptionPane;

Page | 9
public class Login extends javax.swing.JFrame {

Connection con;

Statement stmt;

ResultSet rs;

public Login() {

initComponents();

try {

Class.forName("java.sql.Driver");

String user = "root";

String pass = "user";

String DB_URL = "jdbc:mysql://localhost:3306/airreservation";

con=DriverManager.getConnection(DB_URL,user,pass);

stmt = con.createStatement(); }

catch(Exception e) {

JOptionPane.showMessageDialog(this,e.getMessage()); }

private void btnLoginActionPerformed(java.awt.event.ActionEvent evt) {

String usern,pass,sql;

usern=TFUsern.getText();

pass=PFPass.getText();

Page | 10
try{

sql="Select * from users where username='"+usern+"'and


password='"+pass+"';";

rs=stmt.executeQuery(sql);

JOptionPane.showMessageDialog(null,"Login successful!");

new Main_menu().setVisible(true);

this.setVisible(false);

JOptionPane.showMessageDialog(null,"Welcome to Middle East Airline


Reservation System!"); }

catch(Exception e) {

JOptionPane.showMessageDialog(this,e.getMessage()); }

private void btnRegisterActionPerformed(java.awt.event.ActionEvent evt){

new Registration().setVisible(true);

this.setVisible(false);

public static void main(String args[]) {

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Login().setVisible(true); } });

Page | 11
private javax.swing.JPasswordField PFPass;

private javax.swing.JTextField TFUsern;

private javax.swing.JButton btnLogin;

private javax.swing.JButton btnRegister;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JLabel jLabel4;

private javax.swing.JLabel jLabel5;

private javax.swing.JPanel jPanel1;

Page | 12
REGISTERATION SCREEN

CONTROL TYPE CONTROL NAME


Text Field First Name TFFirstName
Text Field Surname TFSurname
Text Field Age TFAge
Text Field Phone Number TFPhoneNo
Text Field Email ID TFEmailID
Text Field Username TFUsername
Password Field Password PFPassword
Password Field Confirm Password PFConPassword
Radio Button Male RBM
Radio Button Female RBF
Page | 13
CONTROL TYPE CONTROL NAME
Combo Box Phone Number CBCC
Check Box I agree to Terms and Conditions. CBTaC
Command Button View Terms and Conditions btnViewToS
Command Button Register btnRegister
Command Button <<Back btnBack
buttonGroup Gender BG1

Source Code:
import java.sql.*;

import javax.swing.JOptionPane;

public class Registration extends javax.swing.JFrame {

Connection con;

Statement stmt;

ResultSet rs;

public Registration() {

initComponents();

try {

Class.forName("java.sql.Driver");

String user = "root";

String pass = "user";

String DB_URL = "jdbc:mysql://localhost:3306/airreservation";

con=DriverManager.getConnection(DB_URL,user,pass);
Page | 14
stmt = con.createStatement(); }

catch(Exception e)

{ JOptionPane.showMessageDialog(this,e.getMessage());}

private void btnBackActionPerformed(java.awt.event.ActionEvent evt) {

new Login().setVisible(true);

this.setVisible(false);

private void btnViewToSActionPerformed(java.awt.event.ActionEvent


evt){

new Terms_and_conditions().setVisible(true);

private void btnRegisterActionPerformed(java.awt.event.ActionEvent evt){

String firstn,surn,gender=null,phonen,eid,username,pass,confirmpass,sql;

int age;

firstn=TFFirstName.getText();

surn=TFSurname.getText();

phonen=TFPhoneNo.getText();

eid=TFEmailID.getText();

username=TFUsername.getText();

pass=(PFPassword.getText());

Page | 15
confirmpass=(PFConPassword.getText());

age=Integer.parseInt(TFAge.getText());

if (RBM.isSelected()==true)

gender="Male";

else if (RBF.isSelected()==true)

gender="Female";

if (!pass.equals(confirmpass))

JOptionPane.showMessageDialog(null,"The confirmation password does not


match. Please make sure you have entered it correctly.");

if ((age<18||!CBTaC.isSelected()&&(age<18&&!CBTaC.isSelected())))

JOptionPane.showMessageDialog(null,"Registration unsuccessful.\nPlease
make sure you agree with the Terms & Conditions and are 18 or above years
old.");

if (age>=18&&CBTaC.isSelected()&&(pass.equals(confirmpass)))

{JOptionPane.showMessageDialog(null,"Registration successful!\nYou will


now be redirected to the login screen.");

new Login().setVisible(true);

this.setVisible(false);}

try{

sql="insert into users


values('"+firstn+"','"+surn+"',"+age+",'"+gender+"','"+phonen+"','"+eid+"','"+
username+"','"+pass+"','"+confirmpass+"');";

int rs=stmt.executeUpdate(sql);}
Page | 16
catch(Exception e)

{ JOptionPane.showMessageDialog(this,e.getMessage());

private void CBCCActionPerformed(java.awt.event.ActionEvent evt) {

String ctc=(String)CBCC.getSelectedItem();

if ("Kuwait".equals(ctc))

TFPhoneNo.setText("965+ ");

if ("Bahrain".equals(ctc))

TFPhoneNo.setText("973+ ");

if ("Egypt".equals(ctc))

TFPhoneNo.setText("20+ ");

if ("Iran".equals(ctc))

TFPhoneNo.setText("98+ ");

if ("Iraq".equals(ctc))

TFPhoneNo.setText("964+ ");

if ("Israel".equals(ctc))

TFPhoneNo.setText("972+ ");

if ("Jordan".equals(ctc))

TFPhoneNo.setText("962+ ");

if ("Lebanon".equals(ctc))

TFPhoneNo.setText("961+ ");
Page | 17
if ("Oman".equals(ctc))

TFPhoneNo.setText("968+ ");

if ("Qatar".equals(ctc))

TFPhoneNo.setText("974+ ");

if ("Saudi Arabia".equals(ctc))

TFPhoneNo.setText("966+ ");

if ("Syria".equals(ctc))

TFPhoneNo.setText("963+ ");

if ("Turkey".equals(ctc))

TFPhoneNo.setText("90+ ");

if ("United Arab Emirates".equals(ctc))

TFPhoneNo.setText("971+ ");

if ("Yemen".equals(ctc))

TFPhoneNo.setText("967+ ");

if ("Cyprus".equals(ctc))

TFPhoneNo.setText("357+ ");

public static void main(String args[]) {

try {

for (javax.swing.UIManager.LookAndFeelInfo info :


javax.swing.UIManager.getInstalledLookAndFeels()) {

Page | 18
if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break; } }

} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.
logging.Level.SEVERE, null, ex);

} catch (InstantiationException ex) {


java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.
logging.Level.SEVERE, null, ex);

} catch (IllegalAccessException ex) {


java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.
logging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {


java.util.logging.Logger.getLogger(Registration.class.getName()).log(java.util.
logging.Level.SEVERE, null, ex); }

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Registration().setVisible(true); } });

private javax.swing.JComboBox<String> CBCC;

private javax.swing.JCheckBox CBTaC;

private javax.swing.JPasswordField PFConPassword;

private javax.swing.JPasswordField PFPassword;

Page | 19
private javax.swing.JRadioButton RBF;

private javax.swing.JRadioButton RBM;

private javax.swing.JTextField TFAge;

private javax.swing.JTextField TFEmailID;

private javax.swing.JTextField TFFirstName;

private javax.swing.JTextField TFPhoneNo;

private javax.swing.JTextField TFSurname;

private javax.swing.JTextField TFUsername;

private javax.swing.JButton btnBack;

private javax.swing.JButton btnRegister;

private javax.swing.JButton btnViewToS;

private javax.swing.ButtonGroup BG1;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel10;

private javax.swing.JLabel jLabel11;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JLabel jLabel4;

private javax.swing.JLabel jLabel5;

private javax.swing.JLabel jLabel6;

private javax.swing.JLabel jLabel7;


Page | 20
private javax.swing.JLabel jLabel8;

private javax.swing.JLabel jLabel9;

private javax.swing.JPanel jPanel1;

Page | 21
MAIN MENU SCREEN

CONTROL TYPE CONTROL NAME


Command Button Reservation Form btnResvForm
Command Button Update Reservation btnResvUpdate
Command Button Search Reservations btnResvSearch
Command Button Fare Enquiry btnFareEn
Command Button Cancel Reservations btnResvCancel
Command Button Logout btnLogout
Command Button Exit btnExit

Source Code:
import javax.swing.JOptionPane;

public class Main_menu extends javax.swing.JFrame {


Page | 22
public Main_menu() {

initComponents(); }

private void btnResvFormActionPerformed(java.awt.event.ActionEvent


evt) {

new Reservation_form().setVisible(true);

this.setVisible(false);

private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {

this.setVisible(false);

new Exit().setVisible(true);

private void btnLogoutActionPerformed(java.awt.event.ActionEvent evt) {

int x=JOptionPane.showConfirmDialog(null,"Are you sure you want


logout?");

if (x==JOptionPane.YES_OPTION)

new Login().setVisible(true);

this.setVisible(false);

Page | 23
private void btnResvUpdateActionPerformed(java.awt.event.ActionEvent
evt) {

new Update_reservation().setVisible(true);

this.setVisible(false);

private void btnResvCancelActionPerformed(java.awt.event.ActionEvent


evt) {

new Cancel_reservations().setVisible(true);

this.setVisible(false);

private void btnResvSearchActionPerformed(java.awt.event.ActionEvent


evt) {

new Search_reservations().setVisible(true);

this.setVisible(false);

private void btnFareEnActionPerformed(java.awt.event.ActionEvent evt) {

new Fare_enquiry().setVisible(true);

this.setVisible(false);

Page | 24
public static void main(String args[]) {

try {

for (javax.swing.UIManager.LookAndFeelInfo info :


javax.swing.UIManager.getInstalledLookAndFeels()) {

if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break; } }

} catch (ClassNotFoundException ex) {


java.util.logging.Logger.getLogger(Main_menu.class.getName()).log(java.util
.logging.Level.SEVERE, null, ex);

} catch (InstantiationException ex) {


java.util.logging.Logger.getLogger(Main_menu.class.getName()).log(java.util
.logging.Level.SEVERE, null, ex);

} catch (IllegalAccessException ex) {


java.util.logging.Logger.getLogger(Main_menu.class.getName()).log(java.util
.logging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {


java.util.logging.Logger.getLogger(Main_menu.class.getName()).log(java.util
.logging.Level.SEVERE, null, ex); }

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Main_menu().setVisible(true); } });

Page | 25
private javax.swing.JButton btnExit;

private javax.swing.JButton btnFareEn;

private javax.swing.JButton btnLogout;

private javax.swing.JButton btnResvCancel;

private javax.swing.JButton btnResvForm;

private javax.swing.JButton btnResvSearch;

private javax.swing.JButton btnResvUpdate;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JPanel jPanel1;

Page | 26
RESERVATION FORM SCREEN

CONTROL TYPE CONTROL NAME


Text Field Passport ID TFPassID
Text Field Passport Name TFPassName
Text Field Departure Date TFDepDate
Text Field Return Date TFRetDate
Text Field Adult(s) TFAD
Text Field Child/Children TFCH
Text Field Infant(s) TFIN
Text Field Total Fare TFTotF
Combo Box Origin CBOri
Combo Box Destination CBDest
Page | 27
CONTROL TYPE CONTROL NAME
Radio Button One-Way RBOneW
Radio Button Round-Trip RBRoT
Radio Button First Class RBFC
Radio Button Business Class RBBC
Radio Button Premium Class RBPEC
Radio Button Economy Class RBEC
Command Button Book Ticket btnBookT
Command Button <<Back btnBack
Command Button Clear btnClear
buttonGroup Trip Type BG2
buttonGroup Cabin Class BG1

Source Code:
import java.sql.*;

import javax.swing.JOptionPane;

public class Reservation_form extends javax.swing.JFrame {

Connection con;

Statement stmt;

ResultSet rs;

double tf,fad,fch,fin;

String cc,tt,sql;

public Reservation_form() {

initComponents();

Page | 28
try {

Class.forName("java.sql.Driver");

String user = "root";

String pass = "user";

String DB_URL = "jdbc:mysql://localhost:3306/airreservation";

con=DriverManager.getConnection(DB_URL,user,pass);

stmt = con.createStatement(); }

catch(Exception e) {

JOptionPane.showMessageDialog(this,e.getMessage()); }

private void btnBackActionPerformed(java.awt.event.ActionEvent evt) {

this.setVisible(false);

new Main_menu().setVisible(true);

private void btnBookTActionPerformed(java.awt.event.ActionEvent evt) {

String pname,ori,dest,dpdate,retdate,curr=null;

int pid,ad,ch,in,rs;

pid=Integer.parseInt(TFPassID.getText());

ad=Integer.parseInt(TFAD.getText());

ch=Integer.parseInt(TFCH.getText());

in=Integer.parseInt(TFIN.getText());
Page | 29
pname=TFPassName.getText();

dpdate=TFDepDate.getText();

retdate=TFRetDate.getText();

ori=(String)CBOri.getSelectedItem();

dest=(String)CBDest.getSelectedItem();

if(("Bahrain".equals(ori)&&dest.equals("Kuwait"))||("Kuwait".equals(ori)&&
dest.equals("Bahrain")));

{ fad= 120*ad;

fch+= 90*ch;

fin+= 65*in; }

if(("Bahrain".equals(ori)&&dest.equals("Lebanon"))||("Lebanon".equals(ori)
&&dest.equals("Bahrain")));

{ fad= 120*ad;

fch+= 90*ch;

fin+= 65*in; }

if(("Kuwait".equals(ori)&&dest.equals("Lebanon"))||("Lebanon".equals(ori)
&&dest.equals("Kuwait")));

{ fad= 120*ad;

fch+= 90*ch;

fin+= 65*in; }

Page | 30
if(("Kuwait".equals(ori)&&dest.equals("Bahrain"))||("Bahrain".equals(ori)&
&dest.equals("Kuwait")));

{ fad= 120*ad;

fch+= 90*ch;

fin+= 65*in; }

if(("Lebanon".equals(ori)&&dest.equals("Bahrain"))||("Bahrain".equals(ori)
&&dest.equals("Bahrain")));

{ fad= 120*ad;

fch+= 90*ch;

fin+= 65*in; }

if(("Lebanon".equals(ori)&&dest.equals("Kuwait"))||("Kuwait".equals(ori)&
&dest.equals("Lebanon")));

{ fad= 120*ad;

fch+= 90*ch;

fin+= 65*in; }

if (("Select Origin".equals(ori)&&"Select Destination".equals(dest)))

JOptionPane.showMessageDialog(null,"Please select your origin &


destination.");

else if ("Select Destination".equals(dest))

JOptionPane.showMessageDialog(null,"Please select your destination.");

else if("Select Origin".equals(ori))

JOptionPane.showMessageDialog(null,"Please select your origin.");

Page | 31
else if (dest.equals(ori))

JOptionPane.showMessageDialog(null,"Invalid origin and/or destination.");

if (TFPassName.getText().trim().equals(""))

if
(TFDepDate.getText().trim().equals("")&&TFRetDate.getText().trim().equals(
""))

JOptionPane.showMessageDialog(null,"Please enter your departure &


return date.");

else if (TFDepDate.getText().trim().equals(""))

JOptionPane.showMessageDialog(null,"Please enter your departure date.");

else if (TFRetDate.getText().trim().equals(""))

JOptionPane.showMessageDialog(null,"Please enter your return date.");

if (!RBOneW.isSelected()&&!RBRoT.isSelected())

JOptionPane.showMessageDialog(null,"Please select your preferred trip


type.");

if
(!RBFC.isSelected()&&!RBBC.isSelected()&&!RBPEC.isSelected()&&!RBEC.isS
elected())

JOptionPane.showMessageDialog(null,"Please select your preferred cabin


class.");

if (RBFC.isSelected())

{ cc="First Class";

fad+=80;

Page | 32
fch+=65;

fin+=45; }

else if (RBBC.isSelected())

{ cc="Business Class";

fad+=70;

fch+=55;

fin+=35; }

else if (RBPEC.isSelected())

{ cc="Premium Economy Class";

fad+=50;

fch+=35;

fin+=15; }

else if (RBEC.isSelected())

cc="Economy Class";

if (RBOneW.isSelected())

{ tt="One-Way";

tf=fad+fch+fin; }

else if(RBRoT.isSelected())

{ tt="Round-Trip";

tf=fad+fch+fin*2; }

Page | 33
if("Kuwait".equals(ori))

curr= " KWD";

if("Bahrain".equals(ori))

curr= " BHD";

if("Lebanon".equals(ori))

curr= " LBP";

if (!dest.equals(ori)&&!"Select Origin".equals(ori)&&!"Select
Destination".equals(dest)&&(!TFPassName.getText().trim().equals(""))&&((!
TFDepDate.getText().trim().equals(""))||((RBRoT.isSelected()&&!TFRetDate.
getText().trim().equals(""))))&&(RBOneW.isSelected()||RBRoT.isSelected())
&&(RBFC.isSelected()||RBBC.isSelected()||RBPEC.isSelected()||RBEC.isSele
cted())&&(!TFAD.getText().trim().equals("")||!TFAD.getText().equals("0")))

TFTotF.setText(""+tf+curr);

try{

if (!dest.equals(ori)&&!"Select Origin".equals(ori)&&!"Select
Destination".equals(dest)&&(!TFPassName.getText().trim().equals(""))&&((!
TFDepDate.getText().trim().equals(""))||((RBRoT.isSelected()&&!TFRetDate.
getText().trim().equals(""))))&&(RBOneW.isSelected()||RBRoT.isSelected())
&&(RBFC.isSelected()||RBBC.isSelected()||RBPEC.isSelected()||RBEC.isSele
cted())&&(!TFAD.getText().trim().equals("")||!TFAD.getText().equals("0")))

sql="insert into airline_reservation


values("+pid+",'"+pname+"','"+ori+"','"+dest+"','"+dpdate+"','"+retdate+"',"+
ad+","+ch+","+in+",'"+cc+"','"+tt+"',"+tf+",'"+curr+"');";

rs= stmt.executeUpdate(sql);

Page | 34
JOptionPane.showMessageDialog(null,"Congratulations!\nYour reservation
has been booked sucessfully!\nYour total fare is "+tf+""+curr+" only."); }

catch(Exception e) {

JOptionPane.showMessageDialog(this,e.getMessage()); }

private void btnClearActionPerformed(java.awt.event.ActionEvent evt) {

TFPassID.setText("");

TFPassName.setText("");

TFDepDate.setText("");

TFRetDate.setText("");

TFAD.setText("");

TFCH.setText("");

TFIN.setText("");

TFTotF.setText("");

BG1.clearSelection();

BG2.clearSelection();

CBOri.setSelectedIndex(0);

CBDest.setSelectedIndex(0);

Page | 35
private void RBOneWActionPerformed(java.awt.event.ActionEvent evt) {

if (RBOneW.isSelected()==true)

TFRetDate.setEnabled(false);

TFRetDate.setText("0001-01-01");

private void RBRoTActionPerformed(java.awt.event.ActionEvent evt) {

if (RBRoT.isSelected()==true)

TFRetDate.setEnabled(true);

TFRetDate.setText("");

private void RBFCActionPerformed(java.awt.event.ActionEvent evt) {

if (RBFC.isSelected()&&TFCH.getText().trim().equals(""))

TFCH.setText("0");

if (TFIN.getText().trim().equals(""))

TFIN.setText("0");

private void RBBCActionPerformed(java.awt.event.ActionEvent evt) {

if (RBBC.isSelected()&&TFCH.getText().trim().equals(""))

TFCH.setText("0");

Page | 36
if (TFIN.getText().trim().equals(""))

TFIN.setText("0");

private void RBPECActionPerformed(java.awt.event.ActionEvent evt) {

if (RBPEC.isSelected()&&TFCH.getText().trim().equals(""))

TFCH.setText("0");

if (TFIN.getText().trim().equals(""))

TFIN.setText("0");

private void RBECActionPerformed(java.awt.event.ActionEvent evt) {

if (RBEC.isSelected()&&TFCH.getText().trim().equals(""))

TFCH.setText("0");

if (TFIN.getText().trim().equals(""))

TFIN.setText("0");

public static void main(String args[]) {

try {

for (javax.swing.UIManager.LookAndFeelInfo info :


javax.swing.UIManager.getInstalledLookAndFeels()) {

if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

Page | 37
break; } }

} catch (ClassNotFoundException ex) {


java.util.logging.Logger.getLogger(Reservation_form.class.getName()).log(ja
va.util.logging.Level.SEVERE, null, ex);

} catch (InstantiationException ex) {


java.util.logging.Logger.getLogger(Reservation_form.class.getName()).log(ja
va.util.logging.Level.SEVERE, null, ex);

} catch (IllegalAccessException ex) {


java.util.logging.Logger.getLogger(Reservation_form.class.getName()).log(ja
va.util.logging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {


java.util.logging.Logger.getLogger(Reservation_form.class.getName()).log(ja
va.util.logging.Level.SEVERE, null, ex); }

java.awt.EventQueue.invokeLater(new Runnable() {

@Override

public void run() {

new Reservation_form().setVisible(true); } });

private javax.swing.ButtonGroup BG1;

private javax.swing.ButtonGroup BG2;

private javax.swing.JComboBox<String> CBDest;

private javax.swing.JComboBox<String> CBOri;

private javax.swing.JRadioButton RBBC;

Page | 38
private javax.swing.JRadioButton RBEC;

private javax.swing.JRadioButton RBFC;

private javax.swing.JRadioButton RBOneW;

private javax.swing.JRadioButton RBPEC;

private javax.swing.JRadioButton RBRoT;

private javax.swing.JTextField TFAD;

private javax.swing.JTextField TFCH;

private javax.swing.JTextField TFDepDate;

private javax.swing.JTextField TFIN;

private javax.swing.JTextField TFPassID;

private javax.swing.JTextField TFPassName;

private javax.swing.JTextField TFRetDate;

private javax.swing.JTextField TFTotF;

private javax.swing.JButton btnBack;

private javax.swing.JButton btnBookT;

private javax.swing.JButton btnClear;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel10;

private javax.swing.JLabel jLabel14;

private javax.swing.JLabel jLabel15;

private javax.swing.JLabel jLabel16;


Page | 39
private javax.swing.JLabel jLabel17;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JLabel jLabel4;

private javax.swing.JLabel jLabel5;

private javax.swing.JLabel jLabel6;

private javax.swing.JLabel jLabel7;

private javax.swing.JLabel jLabel8;

private javax.swing.JLabel jLabel9;

private javax.swing.JPanel jPanel1;

private javax.swing.JPanel jPanel2;

private javax.swing.JPanel jPanel3;

private javax.swing.JPanel jPanel4;

Page | 40
UPDATE RESERVATION SCREEN

CONTROL TYPE CONTROL NAME


Text Field Enter Passport ID TFPassID
Text Field Passport Name TFPassName
Text Field Origin TFOri
Text Field Destination TFDest
Text Field Departure Date TFDepDate
Text Field Return Date TFRetDate
Text Field No. of Adult(s) TFAD
Text Field No. of Child/Children TFCH
Text Field No. of Infant(s) TFIN
Text Field Cabin Class TFCC
Text Field Trip Type TFTT
Page | 41
CONTROL TYPE CONTROL NAME
Text Field Total Fare TFTotF
Command Button Load btnLoad
Command Button Back btnBack
Command Button Update btnUpdate
Command Button Clear TFClear

Source Code:
import java.sql.*;

import javax.swing.JOptionPane;

public class Update_reservation extends javax.swing.JFrame {

Connection con;

Statement stmt;

ResultSet rs;

String na,ori,dest,depdate,retdate,cc,tt,sql,curr=null;

double tf,fad,fch,fin,totf;

int id,ad,ch,in,noa,noc,noi;

public Update_reservation() {

initComponents();

try {

Class.forName("java.sql.Driver");

Page | 42
String user = "root";

String pass = "user";

String DB_URL = "jdbc:mysql://localhost:3306/airreservation";

con=DriverManager.getConnection(DB_URL,user,pass);

stmt = con.createStatement(); }

catch(Exception e) {

JOptionPane.showMessageDialog(this,e.getMessage()); }

private void btnBackActionPerformed(java.awt.event.ActionEvent evt) {

this.setVisible(false);

new Main_menu().setVisible(true);

private void TFClearActionPerformed(java.awt.event.ActionEvent evt) {

TFPassID.setText("");

TFPassName.setText("");

TFDest.setText("");

TFOri.setText("");

TFDepDate.setText("");

TFRetDate.setText("");

TFAD.setText("");

TFCH.setText("");
Page | 43
TFIN.setText("");

TFCC.setText("");

TFTT.setText("");

TFTotF.setText("");

private void btnLoadActionPerformed(java.awt.event.ActionEvent evt) {

id=Integer.parseInt(TFPassID.getText());

sql="Select * from airline_reservation where passport_id="+id+";";

try{

rs=stmt.executeQuery(sql);

if(rs.next()) {

na=rs.getString(2);

ori=rs.getString(3);

dest=rs.getString(4);

depdate=rs.getString(5);

retdate=rs.getString(6);

noa=rs.getInt(7);

noc=rs.getInt(8);

noi=rs.getInt(9);

cc=rs.getString(10);

tt=rs.getString(11);
Page | 44
totf=rs.getDouble(12);

TFPassName.setText(""+na);

TFDest.setText(dest);

TFOri.setText(ori);

TFDepDate.setText(depdate);

TFRetDate.setText(retdate);

TFAD.setText(""+noa);

TFCH.setText(""+noc);

TFIN.setText(""+noi);

TFCC.setText(cc);

TFTT.setText(tt);

TFTotF.setText(""+totf); }

} catch (Exception e) {

JOptionPane.showMessageDialog(this,e.getMessage()); }

private void btnUpdateActionPerformed(java.awt.event.ActionEvent evt) {

int rs;

id=Integer.parseInt(TFPassID.getText());

ad=Integer.parseInt(TFAD.getText());

ch=Integer.parseInt(TFCH.getText());

in=Integer.parseInt(TFIN.getText());
Page | 45
tf=Double.parseDouble(TFTotF.getText());

na=TFPassName.getText();

ori=TFOri.getText();

dest=TFDest.getText();

depdate=TFDepDate.getText();

retdate=TFRetDate.getText();

cc=TFCC.getText();

tt=TFTT.getText();

if(("Bahrain".equals(ori)&&dest.equals("Kuwait"))||("Kuwait".equals(ori)&&
dest.equals("Bahrain")));

{ fad= 120*ad;

fch+= 90*ch;

fin+= 65*in; }

if(("Bahrain".equals(ori)&&dest.equals("Lebanon"))||("Lebanon".equals(ori)
&&dest.equals("Bahrain")));

{ fad= 120*ad;

fch+= 90*ch;

fin+= 65*in; }

if(("Kuwait".equals(ori)&&dest.equals("Lebanon"))||("Lebanon".equals(ori)
&&dest.equals("Kuwait")));

{ fad= 120*ad;

fch+= 90*ch;
Page | 46
fin+= 65*in; }

if(("Kuwait".equals(ori)&&dest.equals("Bahrain"))||("Bahrain".equals(ori)&
&dest.equals("Kuwait")));

{ fad= 120*ad;

fch+= 90*ch;

fin+= 65*in; }

if(("Lebanon".equals(ori)&&dest.equals("Bahrain"))||("Bahrain".equals(ori)
&&dest.equals("Bahrain")));

{ fad= 120*ad;

fch+= 90*ch;

fin+= 65*in; }

if(("Lebanon".equals(ori)&&dest.equals("Kuwait"))||("Kuwait".equals(ori)&
&dest.equals("Lebanon")));

switch (cc) {

case "first class":

case "First Class":

fad+=80;

fch+=65;

fin+=45;

break;

case "businness class":

case "Businness Class":


Page | 47
fad+=70;

fch+=55;

fin+=35;

break;

case "premium economy class":

case "Premium Economy Class":

fad+=50;

fch+=35;

fin+=15;

break; }

if("Kuwait".equals(ori)||"kuwait".equals(ori))

curr= " KWD";

if("Bahrain".equals(ori)||"bahrain".equals(ori))

curr= " BHD";

if("Lebanon".equals(ori)||"egypt".equals(ori))

curr= " LBP";

if (tt.equals("one way")||tt.equals("One-Way")||tt.equals("One Way"))

tf=fad+fch+fin;

else if (tt.equals("round trip")||tt.equals("Round-Trip")||tt.equals("Round


Trip"))

tf=fad+fch+fin*2;

Page | 48
TFTotF.setText(""+tf+curr);

try {

sql="Update airline_reservation set


passport_name='"+na+"',origin='"+ori+"',destination='"+dest+"',departure_d
ate='"+depdate+"',return_date='"+retdate+"',no_of_adults="+ad+",no_of_c
hildren="+ch+",no_of_infants="+in+",cabin_class='"+cc+"',trip_type='"+tt+"',
fare="+tf+" where passport_id="+id+";";

rs=stmt.executeUpdate(sql);

JOptionPane.showMessageDialog(null,"Your reservation has been updated


successfully!"); }

catch (Exception e) {

JOptionPane.showMessageDialog(this,e.getMessage()); }

public static void main(String args[]) {

try {

for (javax.swing.UIManager.LookAndFeelInfo info :


javax.swing.UIManager.getInstalledLookAndFeels()) {

if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break; } }

} catch (ClassNotFoundException ex) {


java.util.logging.Logger.getLogger(Update_reservation.class.getName()).log(j
ava.util.logging.Level.SEVERE, null, ex);

Page | 49
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Update_reservation.class.getName()).log(j
ava.util.logging.Level.SEVERE, null, ex);

} catch (IllegalAccessException ex) {


java.util.logging.Logger.getLogger(Update_reservation.class.getName()).log(j
ava.util.logging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {


java.util.logging.Logger.getLogger(Update_reservation.class.getName()).log(j
ava.util.logging.Level.SEVERE, null, ex); }

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Update_reservation().setVisible(true); } });

private javax.swing.JTextField TFAD;

private javax.swing.JTextField TFCC;

private javax.swing.JTextField TFCH;

private javax.swing.JButton TFClear;

private javax.swing.JTextField TFDepDate;

private javax.swing.JTextField TFDest;

private javax.swing.JTextField TFIN;

private javax.swing.JTextField TFOri;

private javax.swing.JTextField TFPassID;

private javax.swing.JTextField TFPassName;


Page | 50
private javax.swing.JTextField TFRetDate;

private javax.swing.JTextField TFTT;

private javax.swing.JTextField TFTotF;

private javax.swing.JButton btnBack;

private javax.swing.JButton btnLoad;

private javax.swing.JButton btnUpdate;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel10;

private javax.swing.JLabel jLabel11;

private javax.swing.JLabel jLabel12;

private javax.swing.JLabel jLabel13;

private javax.swing.JLabel jLabel14;

private javax.swing.JLabel jLabel15;

private javax.swing.JLabel jLabel16;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JLabel jLabel4;

private javax.swing.JLabel jLabel5;

private javax.swing.JLabel jLabel6;

private javax.swing.JLabel jLabel7;

private javax.swing.JLabel jLabel8;


Page | 51
private javax.swing.JLabel jLabel9;

private javax.swing.JPanel jPanel1;

Page | 52
SEARCH RESERVATIONS SCREEN

CONTROL TYPE CONTROL NAME


Text Field Passport ID TFPassID
Command Button Search btnSearch
Command Button Clear btnClear
Command Button <<Back btnBack
Table ResvTable

Source Code:
import java.sql.*;

import javax.swing.JOptionPane;

import javax.swing.table.DefaultTableModel;

public class Search_reservations extends javax.swing.JFrame {

Connection con;

Statement stmt;

Page | 53
ResultSet rs;

public Search_reservations() {

initComponents();

try {

Class.forName("java.sql.Driver");

String user = "root";

String pass = "user";

String DB_URL = "jdbc:mysql://localhost:3306/airreservation";

con=DriverManager.getConnection(DB_URL,user,pass);

stmt=con.createStatement(); }

catch(Exception e) {

JOptionPane.showMessageDialog(this,e.getMessage()); }

private void btnBackActionPerformed(java.awt.event.ActionEvent evt) {

this.setVisible(false);

new Main_menu().setVisible(true);

private void btnClearActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel model=(DefaultTableModel)ResvTable.getModel();

model.setRowCount(0);

}
Page | 54
private void btnSearchActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel dtm = (DefaultTableModel)ResvTable.getModel();

String na,org,dest,depdate,retdate,cc,tt,sql;

int id,noa,noc,noi,count;

double totf;

id=Integer.parseInt(TFPassID.getText());

sql="Select * from airline_reservation where passport_id="+id+"";

try {

rs=stmt.executeQuery(sql);

while(rs.next())

{ na=rs.getString(2);

org=rs.getString(3);

dest=rs.getString(4);

depdate=rs.getString(5);

retdate=rs.getString(6);

noa=rs.getInt(7);

noc=rs.getInt(8);

noi=rs.getInt(9);

cc=rs.getString(10);

tt=rs.getString(11);

totf=rs.getDouble(12);
Page | 55
Object arr[]={na,org,dest,depdate,retdate,noa,noc,noi,cc,tt,totf};

dtm.addRow((Object[]) arr); }

count= ResvTable.getModel().getRowCount();

if (count==0)

JOptionPane.showMessageDialog(null,"Reservation does not exist. Please


check if your entered passport ID is correct & try again."); }

catch(Exception e) {

JOptionPane.showMessageDialog(this,e.getMessage()); }

try {

for(javax.swing.UIManager.LookAndFeelInfoinfo:javax.swing.UIManager.getI
nstalledLookAndFeels()) {

if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break; } }

} catch(ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Search_reservations.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);

} catch (InstantiationException ex) {


java.util.logging.Logger.getLogger(Search_reservations.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);

Page | 56
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Search_reservations.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {


java.util.logging.Logger.getLogger(Search_reservations.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex); }

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Search_reservations().setVisible(true); } });

private javax.swing.JTable ResvTable;

private javax.swing.JTextField TFPassID;

private javax.swing.JButton btnBack;

private javax.swing.JButton btnClear;

private javax.swing.JButton btnSearch;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JLabel jLabel5;

private javax.swing.JPanel jPanel1;

private javax.swing.JScrollPane jScrollPane1;

Page | 57
FARE ENQUIRY SCREEN

CONTROL TYPE CONTROL NAME


Text Field Enter Passport ID TFPassID
Text Field Passport Name TFPassName
Text Field Origin TFOri
Text Field Destination TFDest
Text Field Departure Date TFDepDate
Text Field Return Date TFRetDate
Text Field Total Fare TFTotF
Command Button Search btnSearch
Command Button <<Back btnBack
Command Button Clear btnClear

Page | 58
Source Code:
import java.sql.*;

import javax.swing.JOptionPane;

public class Fare_enquiry extends javax.swing.JFrame {

Connection con;

Statement stmt;

ResultSet rs;

public Fare_enquiry() {

initComponents();

try {

Class.forName("java.sql.Driver");

String user = "root";

String pass = "user";

String DB_URL = "jdbc:mysql://localhost:3306/airreservation";

con=DriverManager.getConnection(DB_URL,user,pass);

stmt = con.createStatement(); }

catch(Exception e) {

JOptionPane.showMessageDialog(this,e.getMessage()); }

Page | 59
private void btnBackActionPerformed(java.awt.event.ActionEvent evt) {

this.setVisible(false);

new Main_menu().setVisible(true);

private void btnSearchActionPerformed(java.awt.event.ActionEvent evt) {

String na,dest,depdate,retdate,sql,curr,ori;

double totf;

int id=Integer.parseInt(TFPassID.getText());

sql="Select * from airline_reservation where passport_id="+id+";";

try {

rs=stmt.executeQuery(sql);

if(rs.next()) {

na=rs.getString(2);

ori=rs.getString(3);

dest=rs.getString(4);

depdate=rs.getString(5);

retdate=rs.getString(6);

curr=rs.getString(13);

totf=rs.getDouble(12);

TFPassName.setText(na);
Page | 60
TFOri.setText(ori);

TFDest.setText(dest);

TFDepDate.setText(depdate);

TFRetDate.setText(retdate);

TFTotF.setText(""+totf+curr); } }

catch(Exception e) {

JOptionPane.showMessageDialog(this,e.getMessage()); }

private void btnClearActionPerformed(java.awt.event.ActionEvent evt) {

TFPassID.setText("");

TFPassName.setText("");

TFOri.setText("");

TFDest.setText("");

TFDepDate.setText("");

TFRetDate.setText("");

TFTotF.setText("");

public static void main(String args[]) {

try {

for (javax.swing.UIManager.LookAndFeelInfo info :


javax.swing.UIManager.getInstalledLookAndFeels()) {

Page | 61
if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break; } }

} catch (ClassNotFoundException ex) {


java.util.logging.Logger.getLogger(Fare_enquiry.class.getName()).log(java.uti
l.logging.Level.SEVERE, null, ex);

} catch (InstantiationException ex) {


java.util.logging.Logger.getLogger(Fare_enquiry.class.getName()).log(java.uti
l.logging.Level.SEVERE, null, ex);

} catch (IllegalAccessException ex) {


java.util.logging.Logger.getLogger(Fare_enquiry.class.getName()).log(java.uti
l.logging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {


java.util.logging.Logger.getLogger(Fare_enquiry.class.getName()).log(java.uti
l.logging.Level.SEVERE, null, ex); }

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Fare_enquiry().setVisible(true);} });

private javax.swing.JTextField TFDepDate;

private javax.swing.JTextField TFDest;

private javax.swing.JTextField TFOri;

private javax.swing.JTextField TFPassID;

Page | 62
private javax.swing.JTextField TFPassName;

private javax.swing.JTextField TFRetDate;

private javax.swing.JTextField TFTotF;

private javax.swing.JButton btnBack;

private javax.swing.JButton btnClear;

private javax.swing.JButton btnSearch;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JLabel jLabel4;

private javax.swing.JLabel jLabel5;

private javax.swing.JLabel jLabel6;

private javax.swing.JLabel jLabel7;

private javax.swing.JLabel jLabel8;

private javax.swing.JLabel jLabel9;

private javax.swing.JPanel jPanel1;

private javax.swing.JPanel jPanel2;

Page | 63
CANCEL RESERVATION SCREEN

CONTROL TYPE CONTROL NAME


Text Field Passport ID TFPassID
Command Button Search btnSearch
Command Button Cancel Reservation btnCancelResv
Command Button <<Back btnBack
Table ResvTable

Source Code:
import java.sql.*;

import javax.swing.JOptionPane;

import javax.swing.table.DefaultTableModel;

public class Cancel_reservations extends javax.swing.JFrame {

Connection con;

Statement stmt;

Page | 64
ResultSet rs;

public Cancel_reservations() {

initComponents();

try {

Class.forName("java.sql.Driver");

String user = "root";

String pass = "user";

String DB_URL = "jdbc:mysql://localhost:3306/airreservation";

con=DriverManager.getConnection(DB_URL,user,pass);

stmt = con.createStatement(); }

catch(Exception e) {

JOptionPane.showMessageDialog(this,e.getMessage()); }

private void btnBackActionPerformed(java.awt.event.ActionEvent evt) {

this.setVisible(false);

new Main_menu().setVisible(true);

private void btnCancelResvActionPerformed(java.awt.event.ActionEvent


evt) {

DefaultTableModel model=(DefaultTableModel)ResvTable.getModel();

int id=Integer.parseInt(TFPassID.getText());

Page | 65
String sql="Delete from airline_reservation where passport_id="+id+";";

try {

int x=JOptionPane.showConfirmDialog(null,"Are you sure you want to cancel


your reservation?");

if(x==JOptionPane.YES_OPTION) {

stmt.executeUpdate(sql);

do {

((DefaultTableModel)
ResvTable.getModel()).removeRow(ResvTable.getSelectedRows()[0]); }

while (ResvTable.getSelectedRowCount() > 0);

JOptionPane.showMessageDialog(null,"Reservation cancelled
successfully!"); }

else if(x==JOptionPane.NO_OPTION); }

catch (Exception e) {

JOptionPane.showMessageDialog(this,e.getMessage()); }

private void btnSearchActionPerformed(java.awt.event.ActionEvent evt) {

DefaultTableModel dtm = (DefaultTableModel)ResvTable.getModel();

String na,org,dest,depdate,retdate,cc,tt,sql;

int noa,noc,noi,id,count;

double totf;

id=Integer.parseInt(TFPassID.getText());
Page | 66
sql="Select * from airline_reservation where passport_id="+id+";";

try {

rs=stmt.executeQuery(sql);

while(rs.next())

{ na=rs.getString(2);

org=rs.getString(3);

dest=rs.getString(4);

depdate=rs.getString(5);

retdate=rs.getString(6);

noa=rs.getInt(7);

noc=rs.getInt(8);

noi=rs.getInt(9);

cc=rs.getString(10);

tt=rs.getString(11);

totf=rs.getDouble(12);

Object arr[]={na,org,dest,depdate,retdate,noa,noc,noi,cc,tt,totf};

dtm.addRow((Object[]) arr); }

count= ResvTable.getModel().getRowCount();

JOptionPane.showMessageDialog(null,"Reservation does not exist. Please


check if your entered passport ID is correct & try again."); }

catch(Exception e) {

Page | 67
JOptionPane.showMessageDialog(this,e.getMessage()); }

public static void main(String args[]) {

try {

for (javax.swing.UIManager.LookAndFeelInfo info :


javax.swing.UIManager.getInstalledLookAndFeels()) {

if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break; } }

} catch (ClassNotFoundException ex) {


java.util.logging.Logger.getLogger(Search_reservations.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);

} catch (InstantiationException ex) {


java.util.logging.Logger.getLogger(Search_reservations.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);

} catch (IllegalAccessException ex) {


java.util.logging.Logger.getLogger(Search_reservations.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {


java.util.logging.Logger.getLogger(Search_reservations.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex); }

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Search_reservations().setVisible(true); } });


Page | 68
}

private javax.swing.JTable ResvTable;

private javax.swing.JTextField TFPassID;

private javax.swing.JButton btnBack;

private javax.swing.JButton btnCancelResv;

private javax.swing.JButton btnSearch;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JLabel jLabel5;

private javax.swing.JPanel jPanel1;

private javax.swing.JScrollPane jScrollPane1;

Page | 69
EXIT SCREEN

CONTROL TYPE CONTROL NAME


Command Button Yes btnYes
Command Button No btnNo

Source Code:
import javax.swing.JOptionPane;

public class Exit extends javax.swing.JFrame {

public Exit() {

initComponents(); }

private void btnYesActionPerformed(java.awt.event.ActionEvent evt) {

JOptionPane.showMessageDialog(null,"Thank you for using Middle East


Airline Reservation System!\nHope to see you again!");

System.exit(0);

}
Page | 70
private void btnNoActionPerformed(java.awt.event.ActionEvent evt) {

new Main_menu().setVisible(true);

this.setVisible(false);

public static void main(String args[]) {

try {

for (javax.swing.UIManager.LookAndFeelInfo info :


javax.swing.UIManager.getInstalledLookAndFeels()) {

if ("Nimbus".equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break; } }

} catch (ClassNotFoundException ex) {


java.util.logging.Logger.getLogger(Exit.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);

} catch (InstantiationException ex) {


java.util.logging.Logger.getLogger(Exit.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);

} catch (IllegalAccessException ex) {


java.util.logging.Logger.getLogger(Exit.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {


java.util.logging.Logger.getLogger(Exit.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex); }

Page | 71
java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new Exit().setVisible(true); } });

private javax.swing.JButton btnYes;

private javax.swing.JButton btnNo;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JPanel jPanel1;

Page | 72
OUTPUTS

Page | 73
STARTUP SCREEN:

ON CLICKING CONTINUE:

Page | 74
ON CLICKING REGISTER:

ON CLICKING VIEW TERMS AND CONDITIONS:

Page | 75
ON CLICKING <<BACK:

ON CLICKING REGISTER:

Page | 76
ON CLICKING OK:

ON CLICKING LOGIN:

Page | 77
ON CLICKING OK:

Page | 78
ON CLICKING RESERVATION FORM:

Page | 79
ON CLICKING BOOK TICKET:

Page | 80
ON CLICKING CLEAR:

ON CLICKING <<BACK:

Page | 81
ON CLICKING UPDATE RESERVATION:

ON CLICKING LOAD:

Page | 82
ON CLICKING UPDATE:

Page | 83
ON CLICKING CLEAR:

ON CLICKING <<BACK:

Page | 84
ON CLICKING SEARCH RESERVATIONS:

ON CLICKING SEARCH:

ON CLICKING CLEAR:

Page | 85
ON CLICKING <<BACK:

ON CLICKING FARE ENQUIRY:

Page | 86
ON CLICKING SEARCH:

ON CLICKING CLEAR:

Page | 87
ON CLICKING <<BACK:

ON CLICKING CANCEL RESERVATIONS:

Page | 88
ON CLICKING SEARCH:

ON CLICKING CANCEL RESERVATION:

Page | 89
ON CLICKING YES:

ON CLICKING <<BACK:

Page | 90
ON CLICKING LOGOUT:

Page | 91
OR ON CLICKING EXIT:

ON CLICKING YES:

Page | 92
BIBLIOGRAPHY

https://en.wikipedia.org/wiki/Airline_reservations_system
https://stackoverflow.com
https://images.google.com/
Informatics Practices Readers XI & XII (NCRT) By Sumita
Arora
AISCCE Practical Project For Informatics Practices (2016-
2017)

Page | 93

You might also like