Professional Documents
Culture Documents
INFORMATICS
PRACTICES
Kendriya Vidyalaya
INS Mandovi
INDEX
• About the project ………………………………………..….. 2
• Acknowledgements ……………………………………..….. 3
• Certificate………………………………………………………… 4
• System requirements……………………………………..… 5
• Introduction………………………………………………..…… 6
• Flowchart…………………………………………….…….……. 8
• Design and coding……….…………………………………...13
• Homepage form……………….……………………………...14
• Login form…………………..……………………………..…...16
• Signup form………………………………………………….....18
• Booking flights form…………………………………………22
• Flight details form…………………………………………….24
• Seat booking form……..…………………………….……...28
• Payment form………………..…………………………...…..34
• Reservation form……………………………………………..36
• Check Flight Status……………………………………….….39
• Admin login form……………………………………..….….41
• Records form…………..…………………………..…….……43
• Alter Records form…………………………………..………44
• Conclusion……………………………………………..……….48
• Bibliography………………..………………………..……….49
Page 1 of 50
ABOUT THE PROJECT
The GUI application is based upon the simple
and basic idea of how online flight ticket
booking system works . 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 , 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.
Page 2 of 50
ACKNOWLEDGEMENT
I would like to express my greatest gratitude to
the people who have helped and supported me
throughout my project . I am grateful to my teacher
, Mr Deep Prakash Chaudhary, for his 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.
Page 3 of 50
CERTIFICATE
Page 4 of 50
SYSTEM REQUIREMENTS
Minimum Hardware Requirements
Ubuntu 9.10:
Processor: 600 MHZ Intel Pentium IV or equivalent
Memory : 512 MB
Disk Space: 250MB of free disk space
Page 5 of 50
INTRODUCTION
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 lacks out
on, is the option for the user to set up specific
requirements for the travel such as , minimal travel
time and distance .
Page 6 of 50
Whereas the Administrator has functionalities as shown:
Page 7 of 50
FLOWCHARTS
Page 8 of 50
0
START
Accept
YES choice
No No No
Store Data
Page 9 of 50
A
OPEN BOOKING
SYSTEM FORM
ACCEPT
FLIGHT
DETAILS
If choice = If choice =
Domestic International
ACCEPT ACCEPT
FLIGHT FLIGHT
B
Page 10 of 50
C
ACCEPT
CHOICE
RESERVE FLIGHT
STOP
Page 11 of 50
C
ACCEPT
CHOICE
RESERVE FLIGHT
STOP
Page 12 of 50
DESIGN AND CODING
2. Login Form
3. Signup Form
7. Payment Form
8. Reservation Form
Page 13 of 50
Home Page
new Login().setVisible(true);
dispose();
}
FORM SUMMARY :-
Page 14 of 50
The person can login into the system by
Page 15 of 50
Login Form
Page 16 of 50
String name;
name = rs1.getString("fullname");
String mob;
mob = rs1.getString("mobile");
}
new BookFlights().setVisible(true);
dispose();
}
}
if(c==0)
{JOptionPane.showMessageDialog(null,"Username or Password is Incorrrect");}
}
catch (HeadlessException | ClassNotFoundException | SQLException e){
JOptionPane.showMessageDialog(this, e.getMessage());
}
}
FORM SUMMARY :-
Booking Form.
Page 17 of 50
SignUp Form
new HomePage().setVisible(true);
dispose();
String name=jTextField1.getText();
String email=jTextField2.getText();
String mobile=jTextField3.getText();
String date=jTextField6.getText()+"/"+jTextField5.getText()+"/"+jTextField4.getText();
String username=jTextField7.getText();
char[] pass=jPasswordField1.getPassword();
Page 18 of 50
String password=new String(pass);
int d = Integer.parseInt(jTextField4.getText());
int m = Integer.parseInt(jTextField5.getText());
int y = Integer.parseInt(jTextField6.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)
c=1;
c=1;
if(Integer.toString(y).length()!=4)
{ c=1;}
if(m>12)
{c=1;}
if (c==1)
JOptionPane.showMessageDialog(this,"INVALID DATE");
else
Page 19 of 50
if(name.isEmpty()||email.isEmpty()||mobile.isEmpty()||username.isEmpty())
JOptionPane.showMessageDialog(this,"Information incomplete");
else if(mobile.length()!=10)
else
try {
Class.forName("java.sql.DriverManager");
try {
con = (Connection)
DriverManager.getConnection("jdbc:mysql://localhost:3306/airline","root","rootabc");
try {
Page 20 of 50
Logger.getLogger(SignUp.class.getName()).log(Level.SEVERE, null, ex);
try {
try {
stmt.executeUpdate(query);
System.exit(0);
Form Summary:-
This is the form/window which opens when the user clicks on
the SIGNUP window on the main form. This form accepts all
Page 21 of 50
Book Flights Form
if(jRadioButton1.isSelected()==true || jRadioButton2.isSelected()==true){
if(jRadioButton1.isSelected()==true)
{
field1=(String) jComboBox1.getSelectedItem();
field2=(String) jComboBox2.getSelectedItem();
field3=("INTERNATIONAL");
}
else if(jRadioButton2.isSelected()==true)
{
field1=(String) jComboBox3.getSelectedItem();
field2=(String) jComboBox4.getSelectedItem();
field3=("DOMESTIC");
}
try {
Class.forName("java.sql.DriverManager");
Page 22 of 50
} catch (ClassNotFoundException ex) {
Logger.getLogger(BookFlights.class.getName()).log(Level.SEVERE, null, ex);
}
Connection con = null;
try {
con = (Connection)
DriverManager.getConnection("jdbc:mysql://localhost:3306/airline",
"root","rootabc");
} catch (SQLException ex) {
Logger.getLogger(BookFlights.class.getName()).log(Level.SEVERE, null, ex);
}
Statement stmt = null;
try {
stmt = (Statement) con.createStatement();
} catch (SQLException ex) {
Logger.getLogger(BookFlights.class.getName()).log(Level.SEVERE, null, ex);
}
try {
Statement st = (Statement) con.createStatement();
} catch (SQLException ex) {
Logger.getLogger(BookFlights.class.getName()).log(Level.SEVERE, null, ex);
}
String query="INSERT INTO temporary VALUES('"+field1+"','"+field2+"');";
try {
stmt.executeUpdate(query);
} catch (SQLException ex) {
Logger.getLogger(BookFlights.class.getName()).log(Level.SEVERE, null, ex);
}
String info[]=new String[1]; //creates an array to store variable values. You can increase the size
when needed
info[0]=field3; //put jTextField1's value in the array.
FlightDetails.main(info); // call Frame2. Here we create an object of a Frame2. We are passing info
as arguments to main function.
new Login().setVisible(true);
dispose();
Page 23 of 50
Form Summary:-
below.
Page 24 of 50
Flight Details Form
try {
stmt.executeUpdate(query);
try {
Page 25 of 50
stmt.execute(sql);
new SeatBooking().setVisible(true);
dispose();
try{
Class.forName("java.sql.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/airline","root","rootabc");
stmt =con.createStatement();
rs =stmt.executeQuery(query);
if (rs.next()){
String start=rs.getString("start");
String end=rs.getString("end");
jTextField3.setText(""+start);
jTextField2.setText(""+end);
else
String f2=jTextField2.getText();
String f3=jTextField3.getText();
try{
Class.forName("java.sql.Driver");
Page 26 of 50
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/airline","root","rootabc");
stmt =con.createStatement();
String query="select * from flights Where src='"+f3+"' and destination= '"+f2+"' ;" ;
rs =stmt.executeQuery(query);
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
new BookFlights().setVisible(true);
dispose();
Form Summary:-
“selection” that the user did i.e. selecting the origin and end of the
and thereby displaying all the flights following the tour. The user
can easily select the flight by simply clicking on the flight suiting
him/her.
Page 27 of 50
Seat Booking Form
dispose();
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
int n,l;
int z = jTextField4.getText().length();
int z1 = Integer.parseInt(jTextField4.getText());
n = Integer.parseInt(jTextField4.getText());
if(jRadioButton1.isSelected()==true)
{
l = l1.getSelectedIndices().length;
if(l>n)
Page 28 of 50
{
JOptionPane.showMessageDialog(this,"PLEASE DONT SELECT EXTRA SEATS");
}
else if(l<n)
{
JOptionPane.showMessageDialog(this,"PLEASE SELECT MORE SEATS");
}
}
if(jRadioButton2.isSelected()==true)
{
l = l2.getSelectedIndices().length;
if(l>n)
{
JOptionPane.showMessageDialog(this,"PLEASE DONT SELECT EXTRA SEATS");
}
else if(l<n)
{
JOptionPane.showMessageDialog(this,"PLEASE SELECT MORE SEATS");
}
}
if(jRadioButton1.isSelected()==false && jRadioButton2.isSelected()==false )
{
JOptionPane.showMessageDialog(this,"SELECT CLASS");
}
else
{
}
if(jRadioButton1.isSelected()==true){
Page 29 of 50
Object[] o=l1.getSelectedValues();
int price=Integer.parseInt(jTextField5.getText());
int tprice=z1*price;
System.out.println(""+Arrays.toString(o)+"\n"+tprice);
try{
Class.forName("java.sql.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/airline","root","rootabc");
stmt =con.createStatement();
stmt.executeUpdate(query);
}
}
else if(jRadioButton2.isSelected()==true){
Object[] p=l2.getSelectedValues();
int price=Integer.parseInt(jTextField5.getText());
int tprice=z1*price;
try{
Class.forName("java.sql.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/airline","root","rootabc");
stmt =con.createStatement();
stmt.executeUpdate(query);
Page 30 of 50
else{
JOptionPane.showMessageDialog(null,"Error in logic");
}
new PaymentForm().setVisible(true);
dispose();
try{
Class.forName("java.sql.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/airline","root","rootabc");
stmt =con.createStatement();
rs=stmt.executeQuery(query);
if (rs.next()){
f=rs.getString("fno");}
else{
}
String a=f;
rs =stmt.executeQuery(sql);
if (rs.next()){
String date=rs.getString("date");
String departure=rs.getString("departure");
String airline=rs.getString("airline");
String terminal=rs.getString("terminal");
String pric=rs.getString("price");
String price=pric.substring(3,pric.length());
Page 31 of 50
jTextField1.setText(""+date);
jTextField2.setText(""+departure);
jTextField6.setText(""+airline);
jTextField3.setText(""+terminal);
jTextField5.setText(""+price);
}else
}
}
Form Summary:-
Page 32 of 50
Payment Form
Page 33 of 50
}catch(ClassNotFoundException | SQLException e){
}
new ReservationForm().setVisible(true);
dispose();
}
Page 34 of 50
Reservation Form
Class.forName("java.sql.DriverManager");
con = (Connection)
DriverManager.getConnection("jdbc:mysql://localhost:3306/airline", "root","rootabc");
stmt = (Statement) con.createStatement();
String query="INSERT INTO reserved_records
VALUES('"+Name+"','"+contact+"','"+seatnumber+"','"+departure+"','"+date+"','"+origin+"','"+end
+"','"+payment+"','"+uni+"');";
stmt.executeUpdate(query);
String sql="delete from pay;";
Page 35 of 50
stmt.executeUpdate(sql);
String sqla="delete from seatbook;";
stmt.executeUpdate(sqla);
String sqlb="delete from temporary;";
stmt.executeUpdate(sqlb);
String sqlc="delete from temporary_a;";
stmt.executeUpdate(sqlc);
JOptionPane.showMessageDialog(null,"Reservation Successful");
}
catch (ClassNotFoundException | SQLException e)
{
JOptionPane.showMessageDialog (this, e.getMessage());
}
}
}
}catch(ClassNotFoundException | SQLException e){
}
try{
Class.forName("java.sql.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/airline","root","rootabc");
stmt =con.createStatement();
Page 36 of 50
String query="Select * from temporary ;";
rs =stmt.executeQuery(query);
if (rs.next()){
String start=rs.getString("start");
String end=rs.getString("end");
jTextField6.setText(""+start);
jTextField7.setText(""+end);
}
else
;
} catch (ClassNotFoundException | SQLException ex) {
Logger.getLogger(FlightDetails.class.getName()).log(Level.SEVERE, null, ex);
}
String f2=jTextField6.getText();
String f3=jTextField7.getText();
try{
Class.forName("java.sql.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/airline","root","rootabc");
stmt =con.createStatement();
String query="select * from flights Where src='"+f3+"' and destination= '"+f2+"' ;" ;
rs =stmt.executeQuery(query);
if (rs.next()){
String date=rs.getString("date");
String departure=rs.getString("departure");
String ucode=rs.getString("fno");
jTextField5.setText(""+date);
jTextField4.setText(""+departure);
jTextField9.setText(""+ucode);
}
else
;
}catch (ClassNotFoundException | SQLException ex) {
Logger.getLogger(FlightDetails.class.getName()).log(Level.SEVERE, null, ex);
}
try{
Class.forName("java.sql.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/airline","root","rootabc");
stmt =con.createStatement();
String query="Select * from seatbook;";
rs=stmt.executeQuery(query);
Page 37 of 50
if (rs.next()){
String list=rs.getString("jlist");
jTextField3.setText(""+list);
}
else{
}
}catch(ClassNotFoundException | SQLException e){
}
String a=jTextField9.getText();
String b=jTextField1.getText();
String b1=b.substring(3,b.length());
String c=jTextField2.getText();
String c1=c.substring(3,c.length()-3);
jTextField9.setText(""+a+b1+c1);
}
Page 38 of 50
CHECK FLIGHT STATUS
dispose();
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
fetch_Data();
jTable1.setVisible(true);
Page 39 of 50
private void formWindowActivated(java.awt.event.WindowEvent evt) {
jTable1.setVisible(false);
NOTE
Page 40 of 50
Admin Form
Page 41 of 50
{
c=1;
}
}
if(c==1)
{
new UpdateRecords().setVisible(true);
dispose();
}
if(c==0)
{
System.exit(0);
}
}
catch (ClassNotFoundException e)
{
JOptionPane.showMessageDialog(this, e.getMessage());
} catch (SQLException ex) {
Logger.getLogger(Admin.class.getName()).log(Level.SEVERE, null, ex);
}
}
FORM SUMMARY:-
wherever they desire thereby saving time . This form asks the
Page 42 of 50
Records Form
Page 43 of 50
Alter Records Form
Page 44 of 50
String area=rs.getString("area");
String begin =rs.getString("src");
String end=rs.getString("destination");
String fno=rs.getString("fno");
jTextField4.setText(""+date);
jTextField5.setText(""+departure);
jTextField6.setText(""+airline);
jTextField7.setText(""+terminal);
jTextField8.setText(""+price);
jTextField9.setText(""+area);
jTextField10.setText(""+begin);
jTextField11.setText(""+end);
}else
JOptionPane.showMessageDialog(null,"No such record found");
}
}
try{
stmt =con.createStatement();
String query = "UPDATE flights SET date= '"+date+"' where fno="+fno+";";
stmt.executeUpdate(query);
String querya = "UPDATE flights SET departure= '"+departure+"' where fno="+fno+";";
stmt.executeUpdate(querya);
String queryb = "UPDATE flights SET airline= '"+airline+"' where fno="+fno+";";
stmt.executeUpdate(queryb);
Page 45 of 50
String queryc = "UPDATE flights SET terminal= '"+terminal+"' where fno="+fno+";";
stmt.executeUpdate(queryc);
String queryd = "UPDATE flights SET price= '"+price+"' where fno="+fno+";";
stmt.executeUpdate(queryd);
String querye = "UPDATE flights SET area= '"+area+"' where fno="+fno+";";
stmt.executeUpdate(querye);
String queryf = "UPDATE flights SET src= '"+begin+"' where fno="+fno+";";
stmt.executeUpdate(queryf);
String queryg = "UPDATE flights SET destination= '"+end+"' where fno="+fno+";";
stmt.executeUpdate(queryg);
String queryh = "UPDATE flights SET fno= '"+fno+"' where fno="+fno+";";
stmt.executeUpdate(queryh);
JOptionPane.showMessageDialog(null,"Record Updated!");
}catch(SQLException e){
System.out.println(""+e);
}
}
}
}
}
try{
Class.forName("java.sql.Driver");
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/airline","root","rootabc");
stmt =con.createStatement();
if (rs.next()){
String date =jTextField4.getText();
String departure =jTextField5.getText();
Page 46 of 50
String airline =jTextField6.getText();
String terminal =jTextField7.getText();
String price =jTextField8.getText();
String area =jTextField9.getText();
String begin =jTextField10.getText();
String end =jTextField11.getText();
String fno =jTextField12.getText();
String query = "INSERT INTO flights
VALUES('"+date+"','"+departure+"','"+airline+"','"+terminal+"','"+price+"','"+area+"','"+begin+"','"
+end+"','"+fno+"');";
stmt.executeUpdate(query);
}else
JOptionPane.showMessageDialog(null,"No such entry possible");
}
}
FORM SUMMARY:-
This form can easily modify the flight schedule with the help of
Page 47 of 50
CONCLUSION
Airline Reservation System has been prepared to
reduce the manual work and with the help of this
project the users will be able to save their time.
Page 48 of 50
BIBLOGRAPHY
The sources that proved out to be very useful
www.wikipedia.org
www.NetBeans.org
www.MySQl.org
www.Shutterstock.com
www.youtube.com
Page 49 of 50
Page 50 of 50