Вы находитесь на странице: 1из 63

A

PROJECT REPORT
ON
AIRLINE MANGEMENT SYSTEM
UNDER THE PARTIAL FULFILMENT OF UNIVERSITY OF
MUMBAI REQUIREMENT FOR THE COURSE OF
TYBSC(COMPUTER SCIENCE)
-: SUBMITTED BY :-

MR. MUSTAFA MAZHAR RAMPURAWALA


-: GUIDED BY :-

Prof. Rajesh Yadav

DEPARTMENT OF COMPUTER SCIENCE


V.K.K MENON COLLEGE OF COMMERCE AND ECONOMICS
&
SHARAD SHANKAR DIGHE COLLEGE OF SCIENCE
BHANDUP (EAST), MUMBAI-400-042 UNIVERSITY
OF MUMBAI
2018-19

INDEX
Sr.no. Title Page No.

1
01 Acknowledgement 3
02 Overview
2.1 Abstract 4
2.2 Undertaking 5
2.3 Objective 6
2.4 Introduction 7

2.5 Requirement Specification 9

2.6 Feasibility Study 12

03 System Design
3.1 E-R Diagram 14

3.2 Class Diagram 15

3.3 Use Case Diagram 16

3.4 System Flow Chart 18

04 Code Implementation 19

05 Results
5.1 Tables 85

5.2 Screen Shots 86

06 Future Scope 93

07 Reference and Bibliography 94

2
ACKNOWLEDGEMENT

It gives great pleasure and pride as I presented my project on “AIRLINE


MANGEMENT SYSTEM”. This acknowledgement is a small effort to
express and our gratitude to all those who have shown me the path to bring out the

various colours of this project with their vast treasure of experience and knowledge.

I would like to express my sincere thanks to Prof. Mr. Rajesh Yadav, who helps me

throughout the project for providing me moral support, conductive work

environment and the much needed inspiration to conclude this project on time.

I also take this opportunity to thank Head of the Department Dr. Saloni Bhushan

and thanks to all of our professors of the Department of Computer Science of

V.K.Krishna Menon College for giving me an opportunity to study in the institute

and the most needed guidance throughout the duration of the course.

Prof. Mr. Rajesh Yadav has provided me with the guidance and necessary support

during each phase of the project. He was the Source of continuous encouragement

as each milestone was crossed.

Last but not the least, I would like to thank my friends and family for the support

and encouragement they given me during this course of work.

3
ABSTRACT

Blood Finder is an emergency time app where a user can search for the blood banks as

well as the registered blood donors around Mumbai. This application also provide an

opportunity for the user of this application to become a registered donor for this user have

to enroll for the donor request from the application itself. If the admin wish to make user

a registered donor, with some of the formalities with the organization it can be done.

Specialization of this application is that the user will not have to register on sign-in for

searching the blood banks and blood donors it can be just done by installing the

application to the mobile.

The purpose of making this application is to save the user’s time for searching blood of

needed blood group during the time of the emergency.

This is an android application developed in Java and XML with the connectivity of

SQLite database. This application will provide most of basic functionality required for an

emergency time application. All the details of Blood bank’s and Blood donor’s are stored

in the database i.e SQLite.

This application allowed the user to get all the information regarding blood bank’s and

blood donor’s such as Name, Number, Address, Blood Group, rather than searching it on

the different websites and wasting the precious time. This application is effective and user

friendly.

4
UNDERTAKING

This is to declare that the project entitled


“AIRLINE MANGEMENT SYSTEM ”
is an original work done by the undersigned, in partial fulfilment of the
requirement for the degree “ Bachelor of Science in
Computer Science ” at CS Department, V.K.Krishna Menon College.

All the analysis design and System developed have been accomplished by the

undersigned. Moreover, this project has not been submitted to any other College or

University.

Mr. Nikhil Pandurang Palkar

5
OBJECTIVE

 Blood is one of the main need for the human body to live on the earth

 BLOOD FINDER is the application to find the blood at the time of need by the

user

 The main objective of the project is to design and develop a user-friendly

emergency application.

 Easy to use and efficient application

 To develop a platform to search for blood without wasting the users precious time

 The user can search for the particular blood group in the application using the

search operation

 To save the user’s time there is no login or signup is required, User can directly

install the application and search for the desired need

 A user can also request to enroll for a blood donor to the admin of the application

 The search option is provided according to the blood group in the application itself,

The user does not have to enter any thing in the application manually

 Hospitals can also use this application to search the blood for the patient

 The databases for the blood banks and blood groups are been separated due to the

security purpose

6
INTRODUCTION

This project acts as an important role in saving life of human beings and which is

also its main aim. The project Android Blood finder application is developed so that

users can view the information about registered blood donors such as name,

address, contact along with their details of blood group.

The project also has a enroll page where in the user can Enroll i.e request the admin

to being a donor. Thus this application helps to select the right donor instantly using

the blood group.

The main aim of developing this application is to reduce the time to a great extent

that is spent in searching for the right donor and the availability of blood required.

Thus this application provides the required information in no time and also helps in

quicker decision making.

Advantages :-

• This system can be used to view all the donor details and accordingly select

the right donor.

• This system can also be used to view nearby blood banks in very quick time

• The android mobile user will be able make quick decision in selecting a

donor.

7
• Usage of this application will greatly reduce time in selecting the right donor.

• This application can be used by any common people.

• The application can prove very beneficial in to the clinics, hospitals as the

requirement is very high in such places.

REQUIREMENT SPECIFICATION

A Software Requirement Specification (SRS) is a description of a software system to be

developed . It lays out functional and non-functional requirements, and may include a set

of use cases that describe the user interactions that the software must provide.

8
SOFTWARE REQUIREMNTS :-

Front End :-JAVA Netbeans

Back End :- Mysql

Development Tool :- Android Development Toolkit (ADT)

HARDWARE REQUIREMENTS :-

Processor :- Intel i5/AMD

Hard Disk :- 5 GB

RAM :- 4 GB

ANDROID DEVICE

FUNCTIONAL REQUIREMENT :-

ADMIN :-

Login : The Admin can Login by providing Username & Password.

Management : The Admin Manages this 3 Information’s

1. Blood Bank’s in Mumbai :-

Admin can ADD, UPDATE, DELETE the Blood Bank’s Database as required.

2. Blood Donor’s :-

Admin can ADD, UPDATE, DELETE the Blood Donor’s Database as required.

3. Enroll Request’s for Donor’s :-

9
Admin can check for the Request of User’s to be a Donor & add them in the

Donor’s list.

Logout : The Admin can Logout using this Option & redirect to the Main Page of the

Application

USER :-

Search Blood Bank’s in Mumbai : The User can Search the Blood banks in Mumbai

& contact them or go there for the Requirement of the Blood to the User.

Search Donor’s : The User can Search for the Blood Donor’s nearest to it as of its

Requirements of Blood Group & contact the person for the blood donation.

Enroll to be a Donor : The User can enroll the request for being the donor to the

Admin.

NON-FUCTIONAL REQUIREMENT :-

Performance Requirements :

Performance is measured in terms of the output provided by the application. Requirement

specification plays an important part in the analysis of the system, which will fit into

10
required environment. It rests largely with the users of the system to give the requirement

specifications because they are the people who finally use the system. This is because the

requirements have to be known during the initial stage so that the system can be designed

according to those requirements. It is Very difficult to change the system once it has been

designed and on the other hand designing a system, which does not cater to the

requirements of the user, is of no use. The requirement Specification for any system can

be broadly stated as given below :

• The system should be interface with the user

• The system should be accurate

Reliability

• In this system reliability means the

Security

• The Database should be protected from hacking, virus etc.

Availability

• This application will be available always

FEASIBLITY STUDY

Feasibility study includes consideration of all the possible way to provide solution to the

given problem. The proposed solution should satisfy all the user requirements and should

11
be flexible enough so that future changes can be easily done based on the future

requirements.

OPERATIONAL FEASIBILTY

Operation of the proposed system depend on the it’s user. These various user type are

mentioned below:

1. Admin

2. User

Admin :-

 Admin can manage the Enrollment of the user.

 If the user preform an unusual or illegal kind of task then the admin may wish to

delete the account of that particular user.

 Admin can provide necessary information related to the application such as new

updates.

 Admin can add new Blood Banks in the Application while Updating the data

User :-

 User can Search for the Blood donor’s & blood banks on basis of its requirements

 User can Updates related to the application is provided by the admin to the user. 

User can Enroll the Request form to the Admin for being a Donor

12
TECHNICAL FEASIBLITY

 The blood finder application is created by using certain programming languages

like JAVA & XML, and SQLite as a database.

 JAVA is used for front-end and XML for data transfer.

 This system avoids manual work such as maintaining a hard copy of Blood

Donor’s list.

 This application keeps the data in a centralized way which is available to all the

user

ECONOMICAL FEASIBLITY

 As no papers required so it reduce cost.

 It would be beneficial because only one time development efforts required.

All people are aware of technologies so no special skills required to run the system

SYSTEM DESIGN

E-R DIAGRAM :-

13
CLASS DIAGRAM :-

14
15
USE CASE DIAGRAM :-

ADMIN

Search Blood Donor

Search Blood Bank

Enroll User
request for donor

USER

16
Enroll the user

Add Blood Bank

Delete Blood Bank

Edit Blood Bank

Delete Blood Donor


Add Blood Donor

Edit Blood Donor

17
SYSTEM FLOW CHART
Start

No
Is Admin Is User

No
Yes

Login

Yes
Admin Is Valid

Manage Search
Blood Bank Donor’s

Manage Search
Blood Donor Blood Banks

Manage User Enroll to be a


Enroll Request Donor

Logout

Exit

18
CODE :-
//Login.java

package airlines;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;

public class Login extends JFrame implements ActionListener{

TextField t1,t2;
Label l1,l2;
Button b2,b3,b4;
GridBagLayout gbl;
GridBagConstraints gbc;
Font f1,f2;

public Login(){
super("Login");

setBackground(Color.WHITE);
f1 = new Font("TimesRoman",Font.BOLD,20);
f2 = new Font("TimesRoman",Font.BOLD,15);

gbl=new GridBagLayout();
gbc=new GridBagConstraints();
setLayout(gbl);

l1 = new Label("Username");
l1.setFont(f1);

l2 = new Label("Password");
l2.setFont(f1);

19
t1 = new TextField(15);
t2 = new TextField(15);
t2.setEchoChar('*');

b2 = new Button("Reset");
b2.setFont(f2);

b3 = new Button("Submit");
b3.setFont(f2);

b4 = new Button("Close");
b4.setFont(f2);

gbc.gridx=0;
gbc.gridy=0;
gbl.setConstraints(l1,gbc);
add(l1);

gbc.gridx=2;
gbc.gridy=0;
gbl.setConstraints(t1,gbc);
add(t1);

gbc.gridx=0;
gbc.gridy=2;
gbl.setConstraints(l2,gbc);
add(l2);

gbc.gridx=2;
gbc.gridy=2;
gbl.setConstraints(t2,gbc);
add(t2);

20
gbc.gridx=0;
gbc.gridy=8;
gbl.setConstraints(b2,gbc);
add(b2);

gbc.gridx=2;
gbc.gridy=8;
gbl.setConstraints(b3,gbc);
add(b3);

gbc.gridx=4;
gbc.gridy=8;
gbl.setConstraints(b4,gbc);
add(b4);

b2.addActionListener(this);
b3.addActionListener(this);
b4.addActionListener(this);

setVisible(true);
setSize(400,250);
setLocation(400,200);
}

public void actionPerformed(ActionEvent ae){


if(ae.getSource()==b2){

t1.setText("");
t2.setText("");
}
if(ae.getSource()==b4){
System.exit(0);
}

21
if(ae.getSource()==b3){
try{
conn c1 = new conn();

String s1 = t1.getText();
String s2 = t2.getText();

String str = "select * from login where username =


'"+s1+"' and password = '"+s2+"'";
ResultSet rs = c1.s.executeQuery(str);

if(rs.next()){
Mainframe form = new Mainframe();
form.setVisible(true);
}else{
JOptionPane.showMessageDialog(null,"Invalid
Login");
setVisible(false);
}

}catch(Exception e){}

}
}

public static void main(String[] args){


new Login();
}
}

22
// Mainframe.java
package airlines;

import javax.swing.ImageIcon;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class Mainframe extends JFrame{

public static void main(String[] args) {


Mainframe form = new Mainframe();
form.setVisible(true);

public Mainframe() {
super("AIRLINE RESERVATION MANAGEMENT SYSTEM");
initialize();
}

private void initialize() {

setForeground(Color.CYAN);
setLayout(null);
JLabel NewLabel = new JLabel("");
NewLabel.setIcon(new
ImageIcon(ClassLoader.getSystemResource("airlines/icon/front.jpg")
));
NewLabel.setBounds(0, 0, 2500,700);
add(NewLabel);

JLabel AirlineManagementSystem = new JLabel("WELCOME


TO AIR INDIA");
AirlineManagementSystem.setForeground(Color.BLUE);

23
AirlineManagementSystem.setFont(new Font("Tahoma",
Font.PLAIN, 36));
AirlineManagementSystem.setBounds(550, 50, 9500, 55);
NewLabel.add(AirlineManagementSystem);

JMenuBar menuBar = new JMenuBar();


setJMenuBar(menuBar);

JMenu AirlineSystem = new JMenu("AIRLINE SYSTEM");


AirlineSystem.setForeground(Color.BLUE);
menuBar.add(AirlineSystem);

JMenuItem FlightDetails = new JMenuItem("FLIGHT_INFO");


AirlineSystem.add(FlightDetails);

JMenuItem ReservationDetails = new


JMenuItem("ADD_CUSTOMER_DETAILS");
AirlineSystem.add(ReservationDetails);

JMenuItem PassengerDetails = new


JMenuItem("JOURNEY_DETAILS");
AirlineSystem.add(PassengerDetails);

JMenuItem SectorDetails_1 = new


JMenuItem("PAYMENT_DETAILS");
AirlineSystem.add(SectorDetails_1);

JMenu Ticket = new JMenu("TICKET");


Ticket.setForeground(Color.RED);
menuBar.add(Ticket);

24
JMenuItem TicketReservation = new
JMenuItem("Ticket_Reservation");
Ticket.add(TicketReservation);

JMenuItem PaymentDetails = new


JMenuItem("PAYMENT_DETAILS");
Ticket.add(PaymentDetails);

JMenuItem Cancellation = new JMenuItem("Cancellation");


Ticket.add(Cancellation);

JMenu Misc = new JMenu("MISC");


Misc.setForeground(Color.RED);
menuBar.add(Misc);

JMenuItem Logout = new JMenuItem("Log_Out");

Misc.add(Logout);

Logout.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
new Login();

}
});

FlightDetails.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
new Flight_Info();

25
}
});

ReservationDetails.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
try {
new Add_Customer();
} catch (Exception e) {
e.printStackTrace();
}
}
});

PassengerDetails.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
try {
new Journey_Details();
} catch (Exception e) {
e.printStackTrace();
}
}
});

SectorDetails_1.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
try {
new Payment_Details();
} catch (Exception e) {
e.printStackTrace();
}
}
});

Cancellation.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){

26
new Cancel();
}
});
TicketReservation.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
new Ticket_Reservation();
}
});
PaymentDetails.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
try {
new Payment_Details();
} catch (Exception e) {
e.printStackTrace();
}
}
});

setSize(1950,1090);
setVisible(true);
}
}

package airlines;

import net.proteanit.sql.DbUtils;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import javax.swing.*;

public class Flight_Info extends JFrame{ //Second Frame

private JTable table;

27
private JTextField textField;

public static void main(String[] args){


new Flight_Info().setVisible(true);
}

public Flight_Info(){

getContentPane().setBackground(Color.WHITE);
getContentPane().setFont(new Font("Tahoma", Font.PLAIN, 13));

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(860,523);
setLayout(null);
setVisible(true);

JLabel Fcode = new JLabel("FLIGHT CODE");


Fcode.setFont(new Font("Tahoma", Font.PLAIN, 17));
Fcode.setBounds(50, 100, 200, 30);
add(Fcode);

JLabel FlightDetails = new JLabel("FLIGHT INFORMATION");


FlightDetails.setFont(new Font("Tahoma", Font.PLAIN, 31));
FlightDetails.setForeground(new Color(100, 149, 237));
FlightDetails.setBounds(50, 20, 570, 35);
add(FlightDetails);

JButton btnShow = new JButton("SHOW");


btnShow.setFont(new Font("Tahoma", Font.PLAIN, 20));

btnShow.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {

String code = textField.getText();

28
try {
conn c = new conn();
String str = "select
f_code,f_name,src,dst,capacity,class_code,class_name from flight ,sector where
f_code = '"+code+"'";

ResultSet rs = c.s.executeQuery(str);
table.setModel(DbUtils.resultSetToTableModel(rs));

}catch(SQLException e){
e.printStackTrace();
}
}
});

btnShow.setBounds(220, 150, 120, 30);


add(btnShow);

table = new JTable();


table.setBackground(Color.WHITE);
table.setBounds(23, 250, 800, 300);

JScrollPane pane = new JScrollPane(table);


pane.setBounds(23, 250, 800, 300);
pane.setBackground(Color.WHITE);
add(pane);

textField = new JTextField();


textField.setBounds(220, 100, 200, 30);
add(textField);

JLabel FlightCode = new JLabel("FLIGHT CODE");


FlightCode.setFont(new Font("Tahoma", Font.PLAIN, 13));
FlightCode.setBounds(23, 220, 126, 14);
add(FlightCode);

29
JLabel FlightName = new JLabel("FLIGHT NAME");
FlightName.setFont(new Font("Tahoma", Font.PLAIN, 13));
FlightName.setBounds(145, 220, 120, 14);
add(FlightName);

JLabel Source = new JLabel("SOURCE");


Source.setFont(new Font("Tahoma", Font.PLAIN, 13));
Source.setBounds(275, 220, 104, 14);
add(Source);

JLabel Destination = new JLabel("DESTINATION");


Destination.setFont(new Font("Tahoma", Font.PLAIN, 13));
Destination.setBounds(367, 220, 120, 14);
add(Destination);

JLabel Capacity = new JLabel("CAPACITY");


Capacity.setFont(new Font("Tahoma", Font.PLAIN, 13));
Capacity.setBounds(497, 220, 111, 14);
add(Capacity);

JLabel ClassCode = new JLabel("CLASS CODE");


ClassCode.setFont(new Font("Tahoma", Font.PLAIN, 13));
ClassCode.setBounds(587, 220, 120, 14);
add(ClassCode);

JLabel ClassName = new JLabel("CLASS NAME");


ClassName.setFont(new Font("Tahoma", Font.PLAIN, 13));
ClassName.setBounds(700, 220, 111, 14);
add(ClassName);

setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
setSize(900,650);

30
setVisible(true);
setLocation(200,90);

}
}

package airlines;

import java.awt.EventQueue;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import javax.swing.*;

public class Add_Customer extends JFrame{ //Third Frame

JTextField
textField,textField_1,textField_2,textField_3,textField_4,textField_5,textField_6;

public Add_Customer(){
getContentPane().setForeground(Color.BLUE);
getContentPane().setBackground(Color.WHITE);
setTitle("ADD CUSTOMER DETAILS");

setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
setSize(778,486);
getContentPane().setLayout(null);

JLabel Passportno = new JLabel("PASSPORT NO");


Passportno.setFont(new Font("Tahoma", Font.PLAIN, 17));
Passportno.setBounds(60, 80, 150, 27);
add(Passportno);

textField = new JTextField();


textField.setBounds(200, 80, 150, 27);
add(textField);

31
JButton Next = new JButton("SAVE");
Next.setBounds(200, 420, 150, 30);
Next.setBackground(Color.BLACK);
Next.setForeground(Color.WHITE);
add(Next);

JLabel Pnrno = new JLabel("PNR NO");


Pnrno.setFont(new Font("Tahoma", Font.PLAIN, 17));
Pnrno.setBounds(60, 120, 150, 27);
add(Pnrno);

textField_1 = new JTextField();


textField_1.setBounds(200, 120, 150, 27);
add(textField_1);

JLabel Address = new JLabel("ADDRESS");


Address.setFont(new Font("Tahoma", Font.PLAIN, 17));
Address.setBounds(60, 170, 150, 27);
add(Address);

textField_2 = new JTextField();


textField_2.setBounds(200, 170, 150, 27);
add(textField_2);

JLabel Nationality = new JLabel("NATIONALITY");


Nationality.setFont(new Font("Tahoma", Font.PLAIN, 17));
Nationality.setBounds(60, 220, 150, 27);
add(Nationality);

textField_3 = new JTextField();


textField_3.setBounds(200, 220, 150, 27);
add(textField_3);

JLabel Name = new JLabel("NAME");


Name.setFont(new Font("Tahoma", Font.PLAIN, 17));
Name.setBounds(60, 270, 150, 27);

32
add(Name);

textField_4 = new JTextField();


textField_4.setBounds(200, 270, 150, 27);
add(textField_4);

JLabel Gender = new JLabel("GENDER");


Gender.setFont(new Font("Tahoma", Font.PLAIN, 17));
Gender.setBounds(60, 320, 150, 27);
add(Gender);

JRadioButton NewRadioButton = new JRadioButton("MALE");


NewRadioButton.setBackground(Color.WHITE);
NewRadioButton.setBounds(200, 320, 70, 27);
add(NewRadioButton);

JRadioButton Female = new JRadioButton("FEMALE");


Female.setBackground(Color.WHITE);
Female.setBounds(280, 320, 70, 27);
add(Female);

JLabel Phno = new JLabel("PH NO");


Phno.setFont(new Font("Tahoma", Font.PLAIN, 17));
Phno.setBounds(60, 370, 150, 27);
add(Phno);

textField_5 = new JTextField();


textField_5.setBounds(200, 370, 150, 27);
add(textField_5);

setVisible(true);

JLabel AddPassengers = new JLabel("ADD CUSTOMER DETAILS");


AddPassengers.setForeground(Color.BLUE);
AddPassengers.setFont(new Font("Tahoma", Font.PLAIN, 31));
AddPassengers.setBounds(420, 24, 442, 35);
add(AddPassengers);

33
JLabel Flightcode = new JLabel("FLIGHT CODE");
Flightcode.setFont(new Font("Tahoma", Font.PLAIN, 17));
Flightcode.setBounds(60, 30, 150, 27);
add(Flightcode);

textField_6 = new JTextField();


textField_6.setBounds(200, 30, 150, 27);
add(textField_6);

ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("airlines/icon/emp.png"));
JLabel image = new JLabel(i1);
image.setBounds(450,80,280,410);
add(image);

Next.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
String passport_No = textField.getText();
String pnr_no = textField_1.getText();
String address = textField_2.getText();
String nationality = textField_3.getText();
String name = textField_4.getText();
String fl_code = textField_6.getText();

String gender = null;


String ph_no = textField_5.getText();

if(NewRadioButton.isSelected()){
gender = "male";

}else if(Female.isSelected()){
gender = "female";
}

34
try {
conn c = new conn();
String str = "INSERT INTO passenger values( '"+pnr_no+"',
'"+address+"', '"+nationality+"','"+name+"', '"+gender+"',
'"+ph_no+"','"+passport_No+"', '"+fl_code+"')";

c.s.executeUpdate(str);
JOptionPane.showMessageDialog(null,"Customer Added");
setVisible(false);

} catch (Exception e) {
e.printStackTrace();
}
}
});

setSize(900,600);
setVisible(true);
setLocation(200,100);
}

public static void main(String[] args){


new Add_Customer();
}
}
package airlines;

import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import javax.swing.*;
import net.proteanit.sql.DbUtils;

public class Journey_Details extends JFrame{ //Forth

35
JTable table;
JLabel
ReservationDetails,Pnrno,Ticketid,Fcode,Jnydate,Jnytime,Source,Destination,label,
label1;
JButton Show;

public static void main(String[] args){

public Journey_Details(){

setTitle("JOURNEY_DETAILS");
getContentPane().setBackground(Color.WHITE);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setLayout(null);

Source = new JLabel("SOURCE");


Source.setFont(new Font("Tahoma", Font.PLAIN, 19));
Source.setBounds(60, 100, 150, 27);
add(Source);

Destination = new JLabel("DESTINATION");


Destination.setFont(new Font("Tahoma", Font.PLAIN, 19));
Destination.setBounds(350, 100, 150, 27);
add(Destination);

Show = new JButton("SHOW");


Show.setBounds(680, 100, 100, 30);
add(Show);

setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);

ReservationDetails = new JLabel("JOURNEY DETAILS");

36
ReservationDetails.setForeground(Color.BLUE);
ReservationDetails.setFont(new Font("Tahoma", Font.PLAIN, 31));
ReservationDetails.setBounds(280, 27, 359, 31);
add(ReservationDetails);

Pnrno = new JLabel("PNR_NO");


Pnrno.setFont(new Font("Tahoma", Font.PLAIN, 13));
Pnrno.setBounds(79, 270, 83, 20);
add(Pnrno);

Ticketid = new JLabel("TICKET_ID");


Ticketid.setFont(new Font("Tahoma", Font.PLAIN, 13));
Ticketid.setBounds(172, 270, 71, 20);
add(Ticketid);

Fcode = new JLabel("F_CODE");


Fcode.setFont(new Font("Tahoma", Font.PLAIN, 13));
Fcode.setBounds(297, 270, 103, 20);
add(Fcode);

Jnydate = new JLabel("JNY_DATE");


Jnydate.setFont(new Font("Tahoma", Font.PLAIN, 13));
Jnydate.setBounds(390, 270, 94, 20);
add(Jnydate);

Jnytime = new JLabel("JNY_TIME");


Jnytime.setFont(new Font("Tahoma", Font.PLAIN, 13));
Jnytime.setBounds(494, 270, 83, 20);
add(Jnytime);

Source = new JLabel("SOURCE");


Source.setFont(new Font("Tahoma", Font.PLAIN, 13));
Source.setBounds(613, 270, 94, 20);
add(Source);

Destination = new JLabel("DESTINATION");


Destination.setFont(new Font("Tahoma", Font.PLAIN, 13));

37
Destination.setBounds(717, 270, 94, 20);
add(Destination);

String[] items1 = {"BANGALORE", "MUMBAI", "CHENNAI",


"PATNA","DELHI","HYDERABAD","USA"};
JComboBox comboBox = new JComboBox(items1);
comboBox.setBounds(150, 100, 150, 27);
add(comboBox);

String[] items2 = {"BANGALORE", "MUMBAI", "CHENNAI",


"PATNA","DELHI","HYDERABAD","USA"};
JComboBox comboBox_1 = new JComboBox(items2);
comboBox_1.setBounds(500, 100, 150, 27);
add(comboBox_1);

table = new JTable();


table.setBounds(38, 310, 770, 130);
add(table);

Show.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
try{
String src = (String) comboBox.getSelectedItem();
String dst = (String) comboBox_1.getSelectedItem();

conn c = new conn();

String str = "select pnr_no,ticket_id,f_code,jny_date,jny_time,src,dst


from reservation where src = '"+src+"' and dst = '"+dst+"'";
ResultSet rs=c.s.executeQuery(str);

if(rs.next()){
table.setModel(DbUtils.resultSetToTableModel(rs));
}else{

38
JOptionPane.showMessageDialog(null,"No Flights between Source
and Destination");

}catch(Exception e){}
}
});

setSize(860,600);
setLocation(200,100);
setVisible(true);

}
}

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package airlines;

import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import javax.swing.*;
import net.proteanit.sql.DbUtils;

public class Payment_Details extends JFrame{ //Fifth

JTextField textField;
JTable table;
JLabel Sector;
JLabel FlightCode, Capacity, Classcode, Classname, label;

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

public Payment_Details(){
initialize();
}

private void initialize(){


setTitle("PAYMENT_DETAILS");
getContentPane().setBackground(Color.WHITE);
setSize(860,486);
setLayout(null);

JLabel Fcode = new JLabel("PNR NO");


Fcode.setFont(new Font("Tahoma", Font.PLAIN, 17));
Fcode.setBounds(60, 160, 150, 26);
add(Fcode);

textField = new JTextField();


textField.setBounds(200, 160, 150, 26);
add(textField);

table = new JTable();


table.setBounds(45, 329, 766, 87);
add(table);

JButton Show = new JButton("SHOW");


Show.setFont(new Font("Tahoma", Font.PLAIN, 17));
Show.setBackground(Color.BLACK);
Show.setForeground(Color.WHITE);
Show.setBounds(200, 210, 150, 26);
add(Show);

Sector = new JLabel("PAYMENT DETAILS");


Sector.setForeground(Color.BLUE);

40
Sector.setFont(new Font("Tahoma", Font.PLAIN, 31));
Sector.setBounds(51, 17, 300, 39);
add(Sector);

FlightCode = new JLabel("PNR_NO");


FlightCode.setFont(new Font("Tahoma", Font.PLAIN, 13));
FlightCode.setBounds(84, 292, 108, 26);
add(FlightCode);

Capacity = new JLabel("PAID_AMOUNT");


Capacity.setFont(new Font("Tahoma", Font.PLAIN, 13));
Capacity.setBounds(183, 298, 92, 14);
add(Capacity);

Classcode = new JLabel("PAY_DATE");


Classcode.setFont(new Font("Tahoma", Font.PLAIN, 13));
Classcode.setBounds(322, 294, 101, 24);
add(Classcode);

Classname = new JLabel("CHEQUE_NO");


Classname.setFont(new Font("Tahoma", Font.PLAIN, 13));
Classname.setBounds(455, 298, 114, 14);
add(Classname);

label = new JLabel("");


label.setIcon(new
ImageIcon(ClassLoader.getSystemResource("airlines/icon/payment.png")));
label.setBounds(425, 15, 239, 272);
add(label);

JLabel Cardno = new JLabel("CARD_NO");


Cardno.setFont(new Font("Tahoma", Font.PLAIN, 13));
Cardno.setBounds(602, 299, 101, 19);
add(Cardno);

JLabel Phoneno = new JLabel("PHONE_NO");


Phoneno.setFont(new Font("Tahoma", Font.PLAIN, 13));

41
Phoneno.setBounds(712, 294, 86, 24);
add(Phoneno);

setVisible(true);

Show.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){

try {
String code = textField.getText();

conn c = new conn();


String str = "select
pnr_no,paid_amt,pay_date,cheque_no,card_no,ph_no from payment where pnr_no
= '"+code+"'";

ResultSet rs = c.s.executeQuery(str);

table.setModel(DbUtils.resultSetToTableModel(rs));

}catch(SQLException e) {
e.printStackTrace();
}
}
});

setSize(960,590);
setLocation(200,100);
setVisible(true);

}
}

package airlines;

import java.awt.*;
import java.awt.event.*;

42
import java.sql.*;
import javax.swing.*;
import net.proteanit.sql.DbUtils;

public class Ticket_Reservation extends JFrame{ //Forth

JTable table;
JLabel
ReservationDetails,Pnrno,Ticketid,Fcode,Jnydate,Jnytime,Source,Destination,label,
label1;
JButton Show;

public static void main(String[] args){

public Ticket_Reservation(){

setTitle("Ticket_Reservation");
getContentPane().setBackground(Color.WHITE);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setLayout(null);

Source = new JLabel("SOURCE");


Source.setFont(new Font("Tahoma", Font.PLAIN, 19));
Source.setBounds(60, 100, 150, 27);
add(Source);

Destination = new JLabel("DESTINATION");


Destination.setFont(new Font("Tahoma", Font.PLAIN, 19));
Destination.setBounds(350, 100, 150, 27);
add(Destination);

Show = new JButton("SHOW");

43
Show.setBounds(680, 100, 100, 30);
add(Show);

setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);

ReservationDetails = new JLabel("JOURNEY DETAILS");


ReservationDetails.setForeground(Color.BLUE);
ReservationDetails.setFont(new Font("Tahoma", Font.PLAIN, 31));
ReservationDetails.setBounds(280, 27, 359, 31);
add(ReservationDetails);

Pnrno = new JLabel("PNR_NO");


Pnrno.setFont(new Font("Tahoma", Font.PLAIN, 13));
Pnrno.setBounds(79, 270, 83, 20);
add(Pnrno);

Ticketid = new JLabel("TICKET_ID");


Ticketid.setFont(new Font("Tahoma", Font.PLAIN, 13));
Ticketid.setBounds(172, 270, 71, 20);
add(Ticketid);

Fcode = new JLabel("F_CODE");


Fcode.setFont(new Font("Tahoma", Font.PLAIN, 13));
Fcode.setBounds(297, 270, 103, 20);
add(Fcode);

Jnydate = new JLabel("JNY_DATE");


Jnydate.setFont(new Font("Tahoma", Font.PLAIN, 13));
Jnydate.setBounds(390, 270, 94, 20);
add(Jnydate);

Jnytime = new JLabel("JNY_TIME");


Jnytime.setFont(new Font("Tahoma", Font.PLAIN, 13));
Jnytime.setBounds(494, 270, 83, 20);
add(Jnytime);

Source = new JLabel("SOURCE");

44
Source.setFont(new Font("Tahoma", Font.PLAIN, 13));
Source.setBounds(613, 270, 94, 20);
add(Source);

Destination = new JLabel("DESTINATION");


Destination.setFont(new Font("Tahoma", Font.PLAIN, 13));
Destination.setBounds(717, 270, 94, 20);
add(Destination);

String[] items1 = {"BANGALORE", "MUMBAI", "CHENNAI",


"PATNA","DELHI","HYDERABAD","USA"};
JComboBox comboBox = new JComboBox(items1);
comboBox.setBounds(150, 100, 150, 27);
add(comboBox);

String[] items2 = {"BANGALORE", "MUMBAI", "CHENNAI",


"PATNA","DELHI","HYDERABAD","USA"};
JComboBox comboBox_1 = new JComboBox(items2);
comboBox_1.setBounds(500, 100, 150, 27);
add(comboBox_1);

table = new JTable();


table.setBounds(38, 310, 770, 130);
add(table);

Show.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
try{
String src = (String) comboBox.getSelectedItem();
String dst = (String) comboBox_1.getSelectedItem();

conn c = new conn();

45
String str = "select pnr_no,ticket_id,f_code,jny_date,jny_time,src,dst
from reservation where src = '"+src+"' and dst = '"+dst+"'";
ResultSet rs=c.s.executeQuery(str);

if(rs.next()){
table.setModel(DbUtils.resultSetToTableModel(rs));
}else{
JOptionPane.showMessageDialog(null,"No Flights between Source
and Destination");

}catch(Exception e){}
}
});

setSize(860,600);
setLocation(200,100);
setVisible(true);

}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package airlines;

import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import javax.swing.*;
import net.proteanit.sql.DbUtils;

46
public class Payment_Details extends JFrame{ //Fifth

JTextField textField;
JTable table;
JLabel Sector;
JLabel FlightCode, Capacity, Classcode, Classname, label;

public static void main(String[] args) {


new Payment_Details();
}

public Payment_Details(){
initialize();
}

private void initialize(){


setTitle("PAYMENT_DETAILS");
getContentPane().setBackground(Color.WHITE);
setSize(860,486);
setLayout(null);

JLabel Fcode = new JLabel("PNR NO");


Fcode.setFont(new Font("Tahoma", Font.PLAIN, 17));
Fcode.setBounds(60, 160, 150, 26);
add(Fcode);

textField = new JTextField();


textField.setBounds(200, 160, 150, 26);
add(textField);

table = new JTable();


table.setBounds(45, 329, 766, 87);
add(table);

JButton Show = new JButton("SHOW");


Show.setFont(new Font("Tahoma", Font.PLAIN, 17));
Show.setBackground(Color.BLACK);

47
Show.setForeground(Color.WHITE);
Show.setBounds(200, 210, 150, 26);
add(Show);

Sector = new JLabel("PAYMENT DETAILS");


Sector.setForeground(Color.BLUE);
Sector.setFont(new Font("Tahoma", Font.PLAIN, 31));
Sector.setBounds(51, 17, 300, 39);
add(Sector);

FlightCode = new JLabel("PNR_NO");


FlightCode.setFont(new Font("Tahoma", Font.PLAIN, 13));
FlightCode.setBounds(84, 292, 108, 26);
add(FlightCode);

Capacity = new JLabel("PAID_AMOUNT");


("PAY_DATE");
Classcode.setFont(new Font("Tahoma", Capacity.setFont(new Font("Tahoma",
Font.PLAIN, 13));
Capacity.setBounds(183, 298, 92, 14);
add(Capacity);

Classcode = new JLabel Font.PLAIN, 13));


Classcode.setBounds(322, 294, 101, 24);
add(Classcode);

Classname = new JLabel("CHEQUE_NO");


Classname.setFont(new Font("Tahoma", Font.PLAIN, 13));
Classname.setBounds(455, 298, 114, 14);
add(Classname);

label = new JLabel("");


label.setIcon(new
ImageIcon(ClassLoader.getSystemResource("airlines/icon/payment.png")));
label.setBounds(425, 15, 239, 272);
add(label);

48
JLabel Cardno = new JLabel("CARD_NO");
Cardno.setFont(new Font("Tahoma", Font.PLAIN, 13));
Cardno.setBounds(602, 299, 101, 19);
add(Cardno);

JLabel Phoneno = new JLabel("PHONE_NO");


Phoneno.setFont(new Font("Tahoma", Font.PLAIN, 13));
Phoneno.setBounds(712, 294, 86, 24);
add(Phoneno);

setVisible(true);

Show.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){

try {
String code = textField.getText();

conn c = new conn();


String str = "select
pnr_no,paid_amt,pay_date,cheque_no,card_no,ph_no from payment where pnr_no
= '"+code+"'";

ResultSet rs = c.s.executeQuery(str);

table.setModel(DbUtils.resultSetToTableModel(rs));

}catch(SQLException e) {
e.printStackTrace();
}
}
});

setSize(960,590);
setLocation(200,100);
setVisible(true);

49
}
}

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package airlines;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;

public class Cancel extends JFrame { //Sixth

private JTextField textField,textField_1,textField_2,textField_3,textField_4;

public static void main(String[] args) {


new Cancel();
}

public Cancel() {
initialize();
}

private void initialize() {


setTitle("CANCELLATION");
getContentPane().setBackground(Color.WHITE);
setBounds(100, 100, 801, 472);
setLayout(null);

JLabel Cancellation = new JLabel("CANCELLATION");


Cancellation.setFont(new Font("Tahoma", Font.PLAIN, 31));
Cancellation.setBounds(185, 24, 259, 38);

50
add(Cancellation);

ImageIcon i1 = new
ImageIcon(ClassLoader.getSystemResource("airlines/icon/cancel.png"));
Image i2 = i1.getImage().getScaledInstance(250, 250,
Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel NewLabel = new JLabel(i3);
NewLabel.setBounds(470, 100, 250, 250);
add(NewLabel);

JLabel PassengerNo = new JLabel("PASSENGER NO");


PassengerNo.setFont(new Font("Tahoma", Font.PLAIN, 17));
PassengerNo.setBounds(60, 100, 132, 26);
add(PassengerNo);

JLabel CancellationNo = new JLabel("CANCELLATION NO");


CancellationNo.setFont(new Font("Tahoma", Font.PLAIN, 17));
CancellationNo.setBounds(60, 150, 150, 27);
add(CancellationNo);

JLabel CancellationDate = new JLabel("CANCELLATION DATE");


CancellationDate.setFont(new Font("Tahoma", Font.PLAIN, 17));
CancellationDate.setBounds(60, 200, 180, 27);
add(CancellationDate);

JLabel Ticketid = new JLabel("TICKET_ID");


Ticketid.setFont(new Font("Tahoma", Font.PLAIN, 17));
Ticketid.setBounds(60, 250, 150, 27);
add(Ticketid);

JLabel Flightcode = new JLabel("FLIGHT_CODE");


Flightcode.setFont(new Font("Tahoma", Font.PLAIN, 17));
Flightcode.setBounds(60, 300, 150, 27);
add(Flightcode);

51
JButton Cancel = new JButton("CANCEL");
Cancel.setFont(new Font("Tahoma", Font.PLAIN, 14));
Cancel.setBackground(Color.BLACK);
Cancel.setForeground(Color.WHITE);
Cancel.setBounds(250, 350, 150, 30);
add(Cancel);

textField = new JTextField();


textField.setBounds(250, 100, 150, 27);
add(textField);

textField_1 = new JTextField();


textField_1.setBounds(250, 150, 150, 27);
add(textField_1);

textField_2 = new JTextField();


textField_2.setBounds(250, 200, 150, 27);
add(textField_2);

textField_3 = new JTextField();


textField_3.setBounds(250, 250, 150, 27);
add(textField_3);

textField_4 = new JTextField();


textField_4.setBounds(250, 300, 150, 27);
add(textField_4);

Cancel.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){

String passenger_no = textField.getText();


String cancellation_no = textField_1.getText();
String cancellation_date = textField_2.getText();
String ticket_id = textField_3.getText();
String flight_code = textField_4.getText();

52
try{
conn c = new conn();
String str = "INSERT INTO cancellation values('"+passenger_no+"',
'"+cancellation_no+"', '"+cancellation_date+"', '"+ticket_id+"', '"+flight_code+"')";

c.s.executeUpdate(str);
JOptionPane.showMessageDialog(null,"Ticket Canceled");
setVisible(false);

}catch (Exception e) {
e.printStackTrace();
}
}
});

setSize(860,500);
setVisible(true);
setLocation(200,100);
}
}

package airlines;

import java.sql.*;

public class conn{


Connection c;
Statement s;
public conn(){
try{
Class.forName("com.mysql.jdbc.Driver");
c=
DriverManager.getConnection("jdbc:mysql://localhost:3306/project4?zeroDateTim
eBehavior=convertToNull","root","");
s =c.createStatement();
}catch(Exception e){

53
System.out.println(e);
}
}
}

RESULTS
TABLES :-
Table Name :- Blood Bank
Column Data Type

Bank_id Integer

Bank_name Varchar

Bank_address Varchar

Bank_contact Integer

Table Name :- Blood Donor


Column Data Type

Donor_id Integer

Donor_name Varchar
Donor_address Varchar

Donor_contact Integer

Donor_blood_group Varchar

Table Name :- Enroll User Request


Column Data Type

User_id Integer

User_name Varchar

54
User_address Varchar

User_contact Integer

User_blood_group Varchar

SCREENSHOTS
User :-

55
56
Admin :-

57
58
59
60
61
FUTURE SCOPE

62
REFRENCE AND BIBLIOGRAPHY

1) www.stackoverflow.com

2) www.github.com

3) www.youtube.com

4) www.simplifiedcoding.com

63

Вам также может понравиться