0% found this document useful (0 votes)
4 views

AIRLINES RESERVATION SYSTEM- FINAL PDF1 (1)

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)
4 views

AIRLINES RESERVATION SYSTEM- FINAL PDF1 (1)

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/ 44

Airline reservation system

A Project Report
Submitted by

SAHA ANUSHREE ASITBHAI


MEVLANI KHUSHI POPATBHAI

FOR FULFILLMENT OF FIFTH SEMESTER IN


[BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY]

Under the Guidance Of MRS. KARISHMA RUPANI.


Department of Computer Science & I.T

SHREE H.N SHUKLA GROUP OF COLLEGES

1
INDEX
 Certificate of College…………………………………….…...3
 Preface…………………………………………………….…..4
 Project Profile……………………………………………..….5
 Acknowledgement…………………………………………....6
 Student Profile…………………………………………….….7
 Introduction……………………………………………….….8
 Use Case Diagram…………………………………………....9
 Class diagram ……………………………………………....10
 Data dictionary ……………………….…………………….11-13
DFD diagram and Er
diagram……………………………………………….14-15
 Design form………………………………………………………16-23
 Sample Coding…………………………………………….…24-63
 Summary……………………………………………………..64
 Future Enhancement………………………………………..64
 Bibliography…………………………………………………65

2
3
PREFACE

➢ Welcome to Airline reservation system.

➢ You come and enjoy wonderful hope so.

➢ That first web page quickly grew into an entire website (the subject and point
of which I honestly can’t remember—I suspect it was just a list of links to other
sites). Mainstream adoption of PHP And MYSQL, and a bunch of images (you
were nobody if you didn’t have a tiled, textured background on your page of
links).

4
PROJECT PROFILE

Project Title: - AIRLINE RESERVATION PROGRAM (AK AIRLINES)

FRONTEND TOOL: - PHP.

BACKEND TOOL:- MYSQL,HTML.

INTERNAL GUIDE:- MR.HARDIK DAVE AND MR. NIKHIL DAVE.

DEVELOPED BY:- SAHA ANUSHREE AND MEVLANI KHUSHI.

SUBMITTED TO:- IT DEPARTMENT.

DOCUMENTATION:- PHP AND MYSQL

Software Requirement: - Google CROME Web Browser MOZILA Firefox [Web


Browser]
Language :- PHP,MYSQL,HTML

REQUIREMENT: - XAMP HTDOCS

UNIVERSITY: - SAURASTRA UNIVERSITY


Internet Connection Required

ACKNOWLEDGEMENT
5
➢ It is our great Pleasure to Present our Project Report on “AIRLINE RESERVATION
SYSTEM”.

➢ Firstly, we are Highly Thankful to the Head of department to MRS. Karishma RUPANI
Mam. For giving Permission & allocation such an Interesting Project.

➢ We have Special thanks to MR. HARDIK DAVE and MR. NIKHIL DAVE our guided
Constantly Motivated our to develop best Project.

Student Profile :-

6
NAME:- SAHA ANUSHREE
STREAM:-BSCIT5
MOBILE NO:-7203091680
Email:[email protected]

NAME:-MEVLANI KHUSHI
STREAM:-BSCIT5

MOBILENO:-8200227868
Email:[email protected]

7
INTRODUCTION

➢ What is PHP?
PHP is a general-purpose scripting language geared toward web development. It was
originally created by Danish-Canadian programmer Rasmus Lerdorf in 1994. The PHP
reference implementation is now produced by The PHP Group

➢ How it helps in our project?


In its simplest form, PHP is a server-side scripting language that is embedded in HTML. PHP
allows web developers to create dynamic content and to interact with databases. PHP is
known for its simplicity, speed, and flexibility — features which have made it a cornerstone
in the web development world.

➢ What is the features of PHP?


•PHP can generate dynamic page content.
•PHP can create, open, read, write, delete, and close files on the server.
•PHP can collect form data.
•PHP can send and receive cookies.
•PHP can add, delete, modify data in your database.
•PHP can be used to control user-access.
•PHP can encrypt data.

USE CASE DIAGRAM

8
CLASS DIAGRAM
COMMON INTERFACE

SEARCH TICKET

BOOKED TICKET
9

FILL DETAILS

MAKE PAYMENT
PAYMENT
PASSENGER
ID
CUSTOMER NAME
CARD
CUSTOMER AGE
CARD ID
CUSTOMER GENDER
CARD TYPE
CUSTOMER MOBILE NO.
PRICE

FLIGHT

FLIGHT ID

DESTINATION
TICKET
ARRIVING LOCATION
NAME
TIME
MOBLIE NO.
DATE
AGE
CLASS BUSI/ECO
GENDER

FLIGHT ID

DATE

Data Dictionary
10
ADMIN PAGE:- it consists admin_id, passoword, staff_id , name, email which
required in admin database.

CUSTOMER PAGE:- it consists admin_id, passoword, phone no., name,


address which required in admin database.

FLIGHT DETAILS PAGE:- it is consist of flight_no, rom_city,


to_city, departure_date, arrival_date, departure_time, arrival_time,
seats_economy, seats business, price_economy, price_business.
11
PASSENGER PAGE:- it is consist of passenger_id, pnr_no., name,
age, gender, meal_choice, frequent_flier_no.

12
PAYMENT PAGE:- it is consist of payment_id, pnr
no.,payment_date,payment _mode.

TICKETS PAGE:- it is consist of


pnr,date_of_reservation,flight_no.,journey_no.,class,booking_status,n
o_of_passengers,lounge_access, priority_checkin, insurance,
payment_id, customer_id

13
ER- DIAGRAM

14
DFD DAIGRAM
0 LEVEL
15
1ST LEVEL

16
FORM DESGIN
1.ADMIN PAGE

DESCRIPTION:-THIS IS A ADMIN HOME PAGE OF AK AIRLINES.

DESCRIPTION:-THIS IS A ADMIN VIEW BOOKED TICKETS PAGE OF AK AIRLINES.

DESCRIPTION:-THIS IS A ADMIN ADD FLIGHT SCHEDULE DETAILS PAGE OF AK


AIRLINES

17
DESCRIPTION:-THIS IS A ADMIN DELETE PAGE OF AK AIRLINES.

2.CUSTOMER PAGE.
18
DESCRIPTION:-THIS IS A CUSTOMER HOME PAGE OF AK AIRLINES.

DESCRIPTION:-THIS IS A CUSTOMER BOOKED FLIGHT TICKETS PAGE OF AK


AIRLINE.

19
DESCRIPTION:-THIS IS A CUSTOMER VIEW BOOKED FLIGHT TICKETS PAGE OF
AK AIRLINES.

DESCRIPTION:-THIS IS A CUSTOMER CANCEL BOOKED FLIGHT TICKETS PAGE OF


AK AIRLINES.

20
3. CUSTOMER PAYMENT PAGE

DESCRIPTION:-THIS IS A PAYMENT CUSTOMER PAGE OF AK AIRLINES.

21
4.LOGIN PAGE

DESCRIPTION:-THIS IS A PAYMENT CUSTOMER PAGE OF AK AIRLINES.


22
SOURCE CODE OF FORM DESGIN.

ADMIN PAGE.:- VIEW LIST OF BOOKED TICKETS FOR A FLIGHT

<?php
if(isset($_POST['Submit']))
{
$data_missing=array();
if(empty($_POST['flight_no']))
{
$data_missing[]='Flight No.';
}
else
{
$flight_no=trim($_POST['flight_no']);
}
if(empty($_POST['departure_date']))
{
$data_missing[]='Departure Date';
}
23
else
{

$departure_date=$_POST['departure_date'];
}

if(empty($data_missing))
{
require_once('Database Connection
file/mysqli_connect.php');
$query="SELECT
pnr,date_of_reservation,class,no_of_passengers,payment_id,customer_id FROM
Ticket_Details where flight_no=? and journey_date=? and
booking_status='CONFIRMED' ORDER BY class";
$stmt=mysqli_prepare($dbc,$query);
mysqli_stmt_bind_param($stmt,"ss",
$flight_no,$departure_date);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt,$pnr,
$date_of_reservation,$class,$no_of_passengers,$payment_id,$customer_id);
mysqli_stmt_store_result($stmt);
if(mysqli_stmt_num_rows($stmt)==0)
{
echo "<h3>No booked tickets
information is available!</h3>";
}
else
{
echo "<table
cellpadding=\"10\"";
echo "<tr><th>PNR</th>
<th>Date of Reservation</th>
<th>Class</th>
<th>No. of Passengers</th>
<th>Payment ID</th>
<th>Customer ID</th>
</tr>";

while(mysqli_stmt_fetch($stmt)) {
echo "<tr>
<td>".$pnr."</td>
<td>".
$date_of_reservation."</td>
<td>".$class."</td>
<td>".
$no_of_passengers."</td>
<td>".
$payment_id."</td>
<td>".
$customer_id."</td>
</tr>";
}
echo "</table> <br>";
}
mysqli_stmt_close($stmt);
mysqli_close($dbc);
// else
// {
// echo "Submit Error";
// echo mysqli_error();
// }
24
}
else
{
echo "The following data fields were
empty! <br>";
foreach($data_missing as $missing)
{
echo $missing ."<br>";
}
}
}
else
{
echo "Submit request not received";
}
?>

ENTER THE FLIGHT SCHEDULE DETAILS


<?php
if(isset($_POST['Submit']))
{
$data_missing=array();
if(empty($_POST['flight_no']))
{
$data_missing[]='Flight No.';
}
else
{
$flight_no=trim($_POST['flight_no']);
}

if(empty($_POST['origin']))
{
$data_missing[]='Origin';
}
else
{
$origin=$_POST['origin'];
}
if(empty($_POST['destination']))
{
$data_missing[]='Destination';
}
else
{
$destination=$_POST['destination'];
}

if(empty($_POST['dep_date']))
{

25
$data_missing[]='Departure Date';
}
else
{
$dep_date=$_POST['dep_date'];
}
if(empty($_POST['arr_date']))
{
$data_missing[]='Arrival Date';
}
else
{
$arr_date=$_POST['arr_date'];
}

if(empty($_POST['dep_time']))
{
$data_missing[]='Departure Time';
}
else
{
$dep_time=$_POST['dep_time'];
}
if(empty($_POST['arr_time']))
{
$data_missing[]='Arrival Time';
}
else
{
$arr_time=$_POST['arr_time'];
}

if(empty($_POST['seats_eco']))
{
$data_missing[]='Seats(Economy)';
}
else
{
$seats_eco=$_POST['seats_eco'];
}
if(empty($_POST['seats_bus']))
{
$data_missing[]='Seats(Business)';
}
else
{
$seats_bus=$_POST['seats_bus'];
}

if(empty($_POST['price_eco']))
{
$data_missing[]='Price(Economy)';
}
else
{
$price_eco=$_POST['price_eco'];
}
if(empty($_POST['price_bus']))
{
$data_missing[]='Price(Business)';
}
26
else
{
$price_bus=$_POST['price_bus'];
}

if($cnt==1)
{
$query="INSERT INTO
Flight_Details
(flight_no,from_city,to_city,departure_date,arrival_date,departure_time,arr
ival_time,seats_economy,seats_business,price_economy,price_business,jet_id)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?)";
$stmt=mysqli_prepare($dbc,
$query);

mysqli_stmt_bind_param($stmt,"sssssssiiiis",$flight_no,$origin,
$destination,$dep_date,$arr_date,$dep_time,$arr_time,$seats_eco,$seats_bus,
$price_eco,$price_bus,$jet_id);
mysqli_stmt_execute($stmt);

$affected_rows=mysqli_stmt_affected_rows($stmt);
mysqli_stmt_close($stmt);
}
else
{
$affected_rows=0;
}
mysqli_close($dbc);
if($affected_rows==1)
{
echo "Successfully
Submitted";
header("location:
add_flight_details.php?msg=success");
}
else
{
echo "Submit Error";
echo mysqli_error();
header("location:
add_flight_details.php?msg=failed");
}

else
{
echo "The following data fields were
empty! <br>";
foreach($data_missing as $missing)
{
echo $missing ."<br>";
}
}
}
else
{

27
echo "Submit request not received";
}
?>

ENTER THE FLIGHT SCHEDULE TO BE DELETED

<?php
if(isset($_POST['Delete']))
{
$data_missing=array();
if(empty($_POST['flight_no']))
{
$data_missing[]='Flight No.';
}
else
{
$flight_no=trim($_POST['flight_no']);
}
if(empty($_POST['departure_date']))
{
$data_missing[]='Departure Date';
}
else
{

$departure_date=trim($_POST['departure_date']);
}

if(empty($data_missing))
{
require_once('Database Connection
file/mysqli_connect.php');
$query="DELETE FROM Flight_Details
WHERE flight_no=? AND departure_date=?";
$stmt=mysqli_prepare($dbc,$query);
mysqli_stmt_bind_param($stmt,"ss",
$flight_no,$departure_date);
mysqli_stmt_execute($stmt);

$affected_rows=mysqli_stmt_affected_rows($stmt);
//echo $affected_rows."<br>";
// mysqli_stmt_bind_result($stmt,
$cnt);
// mysqli_stmt_fetch($stmt);
// echo $cnt;
mysqli_stmt_close($stmt);
mysqli_close($dbc);
/*
$response=@mysqli_query($dbc,$query);
*/
if($affected_rows==1)
{
echo "Successfully Deleted";

28
header("location:
delete_flight_details.php?msg=success");
}
else
{
echo "Submit Error";
echo mysqli_error();
header("location:
delete_flight_details.php?msg=failed");
}
}
else
{
echo "The following data fields were
empty! <br>";
foreach($data_missing as $missing)
{
echo $missing ."<br>";
}
}
}
else
{
echo "Delete request not received";
}
?>

CUSTOMER OR USER PAGE.:-

<?php
session_start();
session_destroy();
session_start();
if(isset($_POST['Login']))
{
$data_missing=array();
if(empty($_POST['username']))
{
$data_missing[]='Username';
}
else
{
$user_name=trim($_POST['username']);
}
if(empty($_POST['password']))
{
$data_missing[]='Password';
}
else
{
$pass_word=$_POST['password'];
}

29
if(empty($_POST['user_type']))
{
$data_missing[]='User Type';
}
else
{
$user_type=$_POST['user_type'];
$_SESSION['user_type']=$user_type;
}

if(empty($data_missing))
{
if($user_type=='Customer')
{
require_once('Database
Connection file/mysqli_connect.php');
$query="SELECT count(*) FROM
Customer where customer_id=? and pwd=?";
$stmt=mysqli_prepare($dbc,
$query);

mysqli_stmt_bind_param($stmt,"ss",$user_name,$pass_word);
mysqli_stmt_execute($stmt);

mysqli_stmt_bind_result($stmt,$cnt);
mysqli_stmt_fetch($stmt);
//echo $cnt;
mysqli_stmt_close($stmt);
mysqli_close($dbc);

/*$affected_rows=mysqli_stmt_affected_rows($stmt);
$response=@mysqli_query($dbc,
$query);
echo $affected_rows;
*/
if($cnt==1)
{
echo "Logged in
<br>";

$_SESSION['login_user']=$user_name;
echo
$_SESSION['login_user']." is logged in";
header("location:
customer_homepage.php");
}
else
{
echo "Login Error";
session_destroy();

header('location:login_page.php?msg=failed');
}
}
else if($user_type=='Administrator')
{
require_once('Database
Connection file/mysqli_connect.php');
$query="SELECT count(*) FROM
Admin where admin_id=? and pwd=?";
30
$stmt=mysqli_prepare($dbc,
$query);

mysqli_stmt_bind_param($stmt,"ss",$user_name,$pass_word);
mysqli_stmt_execute($stmt);

mysqli_stmt_bind_result($stmt,$cnt);
mysqli_stmt_fetch($stmt);
//echo $cnt;
mysqli_stmt_close($stmt);
mysqli_close($dbc);

/*$affected_rows=mysqli_stmt_affected_rows($stmt);
$response=@mysqli_query($dbc,
$query);
echo $affected_rows;
*/
if($cnt==1)
{
echo "Logged in
<br>";

$_SESSION['login_user']=$user_name;
echo
$_SESSION['login_user']." is logged in";

header('location:admin_homepage.php');
}
else
{
echo "Login Error";
session_destroy();

header('location:login_page.php?msg=failed');
}
}
}
else
{
echo "The following data fields were
empty<br>";
foreach($data_missing as $missing)
{
echo $missing ."<br>";
}
}
}
else
{
echo "Submit request not received";
}
?>

CREATE NEW USER ACCOUNT

31
<?php
if(isset($_POST['Submit']))
{
$data_missing=array();
if(empty($_POST['username']))
{
$data_missing[]='User Name';
}
else
{
$user_name=trim($_POST['username']);
}
if(empty($_POST['password']))
{
$data_missing[]='Password';
}
else
{
$password=$_POST['password'];
}
if(empty($_POST['email']))
{
$data_missing[]='Email ID';
}
else
{
$email_id=trim($_POST['email']);
}

if(empty($_POST['name']))
{
$data_missing[]='Name';
}
else
{
$name=$_POST['name'];
}
if(empty($_POST['phone_no']))
{
$data_missing[]='Phone No.';
}
else
{
$phone_no=trim($_POST['phone_no']);
}
if(empty($_POST['address']))
{
$data_missing[]='Address';
}
else
{
$address=$_POST['address'];
}

if(empty($data_missing))
{
require_once('Database Connection
file/mysqli_connect.php');
$query="INSERT INTO Customer
(customer_id,pwd,name,email,phone_no,address) VALUES (?,?,?,?,?,?)";
$stmt=mysqli_prepare($dbc,$query);
32
mysqli_stmt_bind_param($stmt,"ssssss",$user_name,$password,$name,
$email_id,$phone_no,$address);
mysqli_stmt_execute($stmt);

$affected_rows=mysqli_stmt_affected_rows($stmt);
//echo $affected_rows."<br>";
// mysqli_stmt_bind_result($stmt,
$cnt);
// mysqli_stmt_fetch($stmt);
// echo $cnt;
mysqli_stmt_close($stmt);
mysqli_close($dbc);
/*
$response=@mysqli_query($dbc,$query);
*/
if($affected_rows==1)
{

header('location:user_reg_success.php');
}
else
{
echo "Submit Error";
echo mysqli_error();
}
}
else
{
echo "The following data fields were
empty! <br>";
foreach($data_missing as $missing)
{
echo $missing ."<br>";
}
}
}
else
{
echo "Submit request not received";
}
?>

SEARCH FOR AVAILABLE FLIGHTS

<?php
$no_of_pass=$_SESSION['no_of_pass'];
$class=$_SESSION['class'];
33
$count=$_SESSION['count'];
$flight_no=$_POST['select_flight'];
$_SESSION['flight_no']=$flight_no;
//$pass_name=array();
echo "<h2>ADD PASSENGERS DETAILS</h2>";
echo "<form
action=\"add_ticket_details_form_handler.php\" method=\"post\">";
while($count<=$no_of_pass)
{
echo "<p><strong>PASSENGER ".
$count."<strong></p>";
echo "<table cellpadding=\"0\">";
echo "<tr>";
echo "<td
class=\"fix_table_short\">Passenger's Name</td>";
echo "<td
class=\"fix_table_short\">Passenger's Age</td>";
echo "<td
class=\"fix_table_short\">Passenger's Gender</td>";
echo "<td
class=\"fix_table_short\">Passenger's Inflight Meal</td>";
echo "<td
class=\"fix_table_short\">Passenger's Frequent Flier ID (if
applicable)</td>";
echo "</tr>";
echo "<tr>";
echo "<td
class=\"fix_table_short\"><input type=\"text\" name=\"pass_name[]\"
required></td>";
echo "<td
class=\"fix_table_short\"><input type=\"number\" name=\"pass_age[]\"
required></td>";
echo "<td
class=\"fix_table_short\">";
echo "<select
name=\"pass_gender[]\">";
echo "<option
value=\"male\">Male</option>";
echo "<option
value=\"female\">Female</option>";
echo "<option
value=\"other\">Other</option>";
echo "</select>";
echo "</td>";
echo "<td
class=\"fix_table_short\">";
echo "<select name=\"pass_meal[]\">";
echo "<option
value=\"yes\">Yes</option>";
echo "<option
value=\"no\">No</option>";
echo "</select>";
echo "</td>";
echo "<td
class=\"fix_table_short\"><input type=\"text\"
name=\"pass_ff_id[]\"></td>";
echo "</tr>";
echo "</table>";
echo "<br><hr>";
$count=$count+1;
}
34
echo "<br><h2>ENTER TRAVEL DETAILS</h2>";
echo "<table cellpadding=\"5\">";
echo "<tr>";
echo "<td class=\"fix_table_short\">Do you
want access to our Premium Lounge?</td>";
echo "<td class=\"fix_table_short\">Do you
want to opt for Priority Checkin?</td>";
echo "<td class=\"fix_table_short\">Do you
want to purchase Travel Insurance?</td>";
echo "</tr>";
echo "<tr>";
echo "<td class=\"fix_table\">";
echo "Yes <input type='radio'
name='lounge_access' value='yes' checked/> No <input type='radio'
name='lounge_access' value='no'/>";
echo "</td>";
echo "<td class=\"fix_table\">";
echo "Yes <input type='radio'
name='priority_checkin' value='yes' checked/> No <input type='radio'
name='priority_checkin' value='no'/>";
echo "</td>";
echo "<td class=\"fix_table\">";
echo "Yes <input type='radio'
name='insurance' value='yes' checked/> No <input type='radio'
name='insurance' value='no'/>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<br><br>";
echo "<input type=\"submit\" value=\"Submit
Travel/Ticket Details\" name=\"Submit\">";
echo "</form>";
?>

ENTER THE PAYMENT DETAILS

<?php

$flight_no=$_SESSION['flight_no'];
$journey_date=$_SESSION['journey_date'];
$no_of_pass=$_SESSION['no_of_pass'];

$total_no_of_meals=$_SESSION['total_no_of_meals'];
$payment_id=rand(100000000,999999999);
$pnr=$_SESSION['pnr'];
$_SESSION['payment_id']=$payment_id;
$payment_date=date('Y-m-d');
$_SESSION['payment_date']=$payment_date;

require_once('Database Connection
file/mysqli_connect.php');
if($_SESSION['class']=='economy')
{
$query="SELECT price_economy FROM
Flight_Details where flight_no=? and departure_date=?";
$stmt=mysqli_prepare($dbc,$query);

35
mysqli_stmt_bind_param($stmt,"ss",
$flight_no,$journey_date);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt,
$ticket_price);
mysqli_stmt_fetch($stmt);
}
else if($_SESSION['class']=='business')
{
$query="SELECT price_business FROM
Flight_Details where flight_no=? and departure_date=?";
$stmt=mysqli_prepare($dbc,$query);
mysqli_stmt_bind_param($stmt,"ss",
$flight_no,$journey_date);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt,
$ticket_price);
mysqli_stmt_fetch($stmt);
}
mysqli_stmt_close($stmt);
mysqli_close($dbc);

$total_ticket_price=$no_of_pass*$ticket_price;
$total_meal_price=250*$total_no_of_meals;
if($_SESSION['insurance']=='yes')
{
$total_insurance_fee=100*$no_of_pass;
}
else
{
$total_insurance_fee=0;
}
if($_SESSION['priority_checkin']=='yes')
{

$total_priority_checkin_fee=200*$no_of_pass;
}
else
{
$total_priority_checkin_fee=0;
}
if($_SESSION['lounge_access']=='yes')
{

$total_lounge_access_fee=300*$no_of_pass;
}
else
{
$total_lounge_access_fee=0;
}
$total_discount=0;
$total_amount=$total_ticket_price+
$total_meal_price+$total_insurance_fee+$total_priority_checkin_fee+
$total_lounge_access_fee+$total_discount;
$_SESSION['total_amount']=$total_amount;

echo "<table cellpadding=\"5\" style='margin-


left: 50px'>";
echo "<tr>";
echo "<td class=\"fix_table\">Base Fare,
Fuel and Transaction Charges (Fees & Taxes included):</td>";
36
echo "<td class=\"fix_table\">&#x20b9; ".
$total_ticket_price."</td>";
echo "</tr>";

echo "<tr>";
echo "<td class=\"fix_table\">Meal Combo
Charges:</td>";
echo "<td class=\"fix_table\">&#x20b9; ".
$total_meal_price."</td>";
echo "</tr>";

echo "<tr>";
echo "<td class=\"fix_table\">Priority
Checkin Fees:</td>";
echo "<td class=\"fix_table\">&#x20b9; ".
$total_priority_checkin_fee."</td>";
echo "</tr>";

echo "<tr>";
echo "<td class=\"fix_table\">Lounge Access
Fees:</td>";
echo "<td class=\"fix_table\">&#x20b9; ".
$total_lounge_access_fee."</td>";
echo "</tr>";

echo "<tr>";
echo "<td class=\"fix_table\">Insurance
Fees:</td>";
echo "<td class=\"fix_table\">&#x20b9; ".
$total_insurance_fee."</td>";
echo "</tr>";

echo "<tr>";
echo "<td
class=\"fix_table\">Discount:</td>";
echo "<td class=\"fix_table\">&#x20b9; ".
$total_discount."</td>";
echo "</tr>";

echo "</table>";

echo "<hr style='margin-right:900px; margin-


left: 50px'>";
echo "<table cellpadding=\"5\"
style='margin-left: 50px'>";
echo "<tr>";
echo "<td
class=\"fix_table\"><strong>Total:</strong></td>";
echo "<td class=\"fix_table\">&#x20b9; ".
$total_amount."</td>";
echo "</tr>";
echo "</table>";
echo "<hr style='margin-right:900px; margin-
left: 50px'>";
echo "<br>";
echo "<p style=\"margin-left:50px\">Your
Payment/Transaction ID is <strong>".$payment_id.".</strong> Please note it
down for future reference.</p>";
echo "<br>";
?>

37
VIEW BOOKED FLIGHT TICKETS

<?php
$todays_date=date('Y-m-d');
$thirty_days_before_date=date_create(date('Y-m-d'));

date_sub($thirty_days_before_date,date_interval_create_from_date_string("30
days"));

$thirty_days_before_date=date_format($thirty_days_before_date,"Y-m-
d");

$customer_id=$_SESSION['login_user'];
require_once('Database Connection
file/mysqli_connect.php');
$query="SELECT
pnr,date_of_reservation,flight_no,journey_date,class,booking_status,no_of_p
assengers,payment_id FROM Ticket_Details where customer_id=? AND
journey_date>=? AND booking_status='CONFIRMED' ORDER BY journey_date";
$stmt=mysqli_prepare($dbc,$query);
mysqli_stmt_bind_param($stmt,"ss",$customer_id,
$todays_date);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt,$pnr,
$date_of_reservation,$flight_no,$journey_date,$class,$booking_status,
$no_of_passengers,$payment_id);
mysqli_stmt_store_result($stmt);
if(mysqli_stmt_num_rows($stmt)==0)
{
echo "<h3><center>No upcoming
trips!</center></h3>";
}
else
{
echo "<table cellpadding=\"10\"";
echo "<tr><th>PNR</th>
<th>Date of Reservation</th>
<th>Flight No.</th>
<th>Journey Date</th>
<th>Class</th>
<th>Booking Status</th>
<th>No. of Passengers</th>
<th>Payment ID</th>
</tr>";
while(mysqli_stmt_fetch($stmt)) {
echo "<tr>
<td>".$pnr."</td>
<td>".$date_of_reservation."</td>
<td>".$flight_no."</td>
<td>".$journey_date."</td>
<td>".$class."</td>
<td>".$booking_status."</td>
38
<td>".$no_of_passengers."</td>
<td>".$payment_id."</td>
</tr>";
}
echo "</table> <br>";
}
echo "<br><h3
class=\"set_nice_size\"><center><u>Completed Trips</u></center></h3>";

$query="SELECT
pnr,date_of_reservation,flight_no,journey_date,class,booking_status,no_of_p
assengers,payment_id FROM Ticket_Details where customer_id=? and
journey_date<? and journey_date>=? ORDER BY journey_date";
$stmt=mysqli_prepare($dbc,$query);
mysqli_stmt_bind_param($stmt,"sss",$customer_id,
$todays_date,$thirty_days_before_date);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt,$pnr,
$date_of_reservation,$flight_no,$journey_date,$class,$booking_status,
$no_of_passengers,$payment_id);
mysqli_stmt_store_result($stmt);
if(mysqli_stmt_num_rows($stmt)==0)
{
echo "<h3><center>No trips completed in the
past 30 days!</center></h3>";
}
else
{
echo "<table cellpadding=\"10\"";
echo "<tr><th>PNR</th>
<th>Date of Reservation</th>
<th>Flight No.</th>
<th>Journey Date</th>
<th>Class</th>
<th>Booking Status</th>
<th>No. of Passengers</th>
<th>Payment ID</th>
</tr>";
while(mysqli_stmt_fetch($stmt)) {
echo "<tr>
<td>".$pnr."</td>
<td>".$date_of_reservation."</td>
<td>".$flight_no."</td>
<td>".$journey_date."</td>
<td>".$class."</td>
<td>".$booking_status."</td>
<td>".$no_of_passengers."</td>
<td>".$payment_id."</td>
</tr>";
}
echo "</table> <br>";
}
mysqli_stmt_close($stmt);
mysqli_close($dbc);
?>

39
CANCEL BOOKED TICKETS

<?php
if(isset($_POST['Cancel_Ticket']))
{
$data_missing=array();
if(empty($_POST['pnr']))
{
$data_missing[]='PNR';
}
else
{
$pnr=trim($_POST['pnr']);
}

if(empty($data_missing))
{
require_once('Database Connection
file/mysqli_connect.php');

$todays_date=date('Y-m-d');
$customer_id=$_SESSION['login_user'];

$query="SELECT count(*) from


Ticket_Details t WHERE pnr=? and journey_date>=?";
$stmt=mysqli_prepare($dbc,$query);
mysqli_stmt_bind_param($stmt,"ss",
$pnr,$todays_date);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt,$cnt);
mysqli_stmt_fetch($stmt);
mysqli_stmt_close($stmt);
if($cnt!=1)
{
mysqli_close($dbc);
header("location:
cancel_booked_tickets.php?msg=failed");
}
$query="UPDATE Ticket_Details SET
booking_status='CANCELED' WHERE pnr=? and customer_id=?";
$stmt=mysqli_prepare($dbc,$query);
mysqli_stmt_bind_param($stmt,"ss",
$pnr,$customer_id);
mysqli_stmt_execute($stmt);

$affected_rows=mysqli_stmt_affected_rows($stmt);
//echo $affected_rows."<br>";
// mysqli_stmt_bind_result($stmt,
$cnt);
// mysqli_stmt_fetch($stmt);
// echo $cnt;
mysqli_stmt_close($stmt);
if($affected_rows==1)
{
40
$query="SELECT
t.flight_no,t.journey_date,t.no_of_passengers,t.class,0.85*p.payment_amount
as refund_amount from Ticket_Details t,Payment_Details p WHERE t.pnr=? and
t.pnr=p.pnr";
$stmt=mysqli_prepare($dbc,
$query);

mysqli_stmt_bind_param($stmt,"s",$pnr);
mysqli_stmt_execute($stmt);

mysqli_stmt_bind_result($stmt,$flight_no,$journey_date,$no_of_pass,
$class,$refund_amount);
mysqli_stmt_fetch($stmt);
mysqli_stmt_close($stmt);

$_SESSION['refund_amount']=$refund_amount;
if($class=='economy')
{
$query="UPDATE
Flight_Details SET seats_economy=seats_economy+? WHERE flight_no=? AND
departure_date=?";

$stmt=mysqli_prepare($dbc,$query);

mysqli_stmt_bind_param($stmt,"iss",$no_of_pass,$flight_no,
$journey_date);

mysqli_stmt_execute($stmt);

$affected_rows_1=mysqli_stmt_affected_rows($stmt);
echo
$affected_rows_1.'<br>';

mysqli_stmt_close($stmt);
}
else if($class=='business')
{
$query="UPDATE
Flight_Details SET seats_business=seats_business+? WHERE flight_no=? AND
departure_date=?";

$stmt=mysqli_prepare($dbc,$query);

mysqli_stmt_bind_param($stmt,"iss",$no_of_pass,$flight_no,
$journey_date);

mysqli_stmt_execute($stmt);

$affected_rows_1=mysqli_stmt_affected_rows($stmt);
echo
$affected_rows_1.'<br>';

mysqli_stmt_close($stmt);
}
if($affected_rows_1==1)
{

header("location:
cancel_booked_tickets_success.php");
S }
else
41
{
echo "Submit Error";
echo mysqli_error();
}
}

}
else
{
echo "The following data fields were
empty! <br>";
foreach($data_missing as $missing)
{
echo $missing ."<br>";
}
}
}
else
{
echo "Cancel request not received";
}
?>

Summary
(1). In today's era no one have a time to do an lots of process for the
booking of flight.
(2). Thus the user can visit site which help them with some simple process
to book flight ticket.
(3). Airline reservation system is the site which help the user at anytime &
anywhere

42
Future Enhancement

Airline reservation systems (ARS) are systems that allow an airline to sell
their inventory (seats). It contains information on schedules and fares and
contains a database of reservations (or passenger name records) and of
tickets issued (if applicable). ARSs are part of passenger service systems
(PSS), which are applications supporting the direct contact with the
passenger.

ARS eventually evolved into the computer reservations system (CRS). A


computer reservation system is used for the reservations of a particular
airline and interfaces with a global distribution system (GDS) which
supports travel agencies and other distribution channels in making
reservations for most major airlines in a single system.

BIBLIOGRAPHY

WWW.YOUTUBE.COM
WWW.GOOGLE.COM

43
44

You might also like