You are on page 1of 52

TABLE OF CONTENTS

S.NO TOPIC PAGE NO.

1. Introduction 5

2. Air Alliance 9

3. Objectives 11

4. Work Plan 13

5. Coding and Implementation 18

6. Conclusion 52

7. References 53
1. INTRODUCTION

1.1 TOOLS/TECHNOLOGIES

HTML

It is a style sheet language used for describing Hyper Text Markup language, commonly
referred as HTML, is the standard markup language to create the web pages. Along with
CSS, Javascript, HTML is a cornerstone technology used to create web pages, as well as
to create user interfaces for mobile and web applications. Web browsers can read HTML
files and render them into visible or audible web pages. HTML describes the structure of
the website semantically along with the cues for the presentation, making it a markup
language, rather than a programming language

CSS

It is a style sheet language used for describing the presentation document written in
markup language.Although most often used to set the visual style of web pages and user
interfaces written in HTML and XHTML , the language can be applied to any XML
document including plain XML, SVG and XUL and is applicable to rendering in speech.
CSS is designed primarily to enable the separation of document content from the
document presentation, including aspects such as layout,color and font. This separation
canimprove content accessibility provide more flexibility and control in specification of
presentation characterstics, enable multiple HTML pages to share formatting by
specifying the relevant CSS in a separate .css file reduce a complexity.

WAMP SERVER

Wamp server refers to software stack for the Microsoft Windows operating system,
created by Romain Bourdon and consisting of the Apache web server,openSSL for SSL
support, MySQL database and PHP programming language.

MySQL is a high-speed database, while PHP is a scripting language that can be used to
access data from the database. By installing these two components locally, a developer
can build and test dynamic website before publishing it to a public web server. Apache,
MySQL and PHP are described as following:
1) APACHE WEB SERVER:

It is a web server that allows you to host your web sites or any other content for that
matter. Apache is available for UNIX as well as WINDOWS . Some of the most common
server side languages supported by Apache are – PHP, Python and Perl. It is free of
charge.

Apache supports a variety of features, many implemented as compiled modules which


extend the core functionality. These can range from server side programming language
supports to authentication schemes. Some common language interfaces support Perl,
Python and PHP. Popular authentication modules include mod_access, mod_auth,
mod_digest, and mod_auth_digest, the successor to mod_digest.

2) PHP :

A server side programming language which is used to produce dynamic web pages. PHP
code can be embedded within HTML. It is also free and platform independent which
means that it can be installed on any operating system.

PHP code can be simply mix with HTML code, or it can be used in combination with
various templating engines and web frameworks. PHP code is usually processed by a
PHP interpreter, which is usually implemented as a web server’s native module or a
common gateway interface executable. After the PHP code is interpreted and executed,
the web server sends the resulting output to its client, usually in the form of a part of the
generated web page; for example, PHP code can generate a web page’s HTML code, and
image, or some other data. PHP has also evolved to include a command –line
interface(CLI) capability and can be used in stand alone graphical applications.

The standard PHP interpreter, powered by the Zend Engine, is free software released the
PHP License. PHP has the widely ported and can be deployed on most web servers on
almost every operating system and platform, free of charge.

 JavaScript: JavaScript is used in millions of web pages to improve the design,


validate forms, delete browsers, create cookies, and much more. JavaScript is the
most popular scripting language on the internet, and works in all major browsers,
such as Internet Explorer, Firefox and Opera.
 JavaScript was designed to add interactivity to HTML pages.
 It is a scripting language.
 A scripting language is a lightweight programming language.
 JavaScript is usually embedded directly into HTML pages.
 JavaScript is an interpreted language.
 Everyone can use JavaScript without purchasing license.

3) MySQL:

It is the world’s most popular open source database. It is a relational database


management system- data and its relationship are stored in the form of tables that can be
accessed by the use of MySQL queries in almost any format that the user wants. MySQL
is popular choice of database for use in web applications, and is a central component of
the widely used LAMP open source web application software stack . LAMP is an
acronym for “linux, apache, MySQL and perl/PHP/Python”.Free-software-open source
projects that require a full-featured database management system often use MySQL.

The MySQL server software itself and the client libraries use dual-licensing
distribution.They are offered under GPL version 2, beginning from 28 June or to use a
proprietary license.

Support can be obtained from the official manual.Oracle offers paid support via its
MySQL Enterprise products. They differ in the scope of services and in price.

MySQL has received positive reviews, and reviewers noticed it “performs extremely well
in the average case” and that the “developer interfaces are there, and the documentation is
very, very good”. It has also been tested to be a “fast, stable and true multi-user, multi-
threaded sql database server”.

1.2 Company Profile

NIIT Institute

NIIT is a leading skills and talent development corporation that is building a manpower
pool for global industry requirements. The company which was set up in 1981to help the
nascent IT industry overcome its human resource challenges, today ranks among the
world’s leading training companies owing to its vast, yet comprehensive array of talent
development programs. With a footprint across 40 nations, NIIT offers training and
development solutions to Individuals, Enterprises and Institutions.

In 2006, the IT services business of NIIT was demerged into a separately listed company
NIIT Technologies. NIIT Limited now focuses on Corporate Training , Vocational
Training for Services Sectors and Education and Training in Schools. NIIT Limites owns
23.98%of NIIT Technologies.

Established in 1981, NIIT Limited, a global leader in Skill and Talent Department, offers
multi-disciplinary learning management and training delivery solutions to corporations,
institutions, and individuals in over 40 countries. The company ranks among the world’s
leading training companies owing to its vast, yet comprehensive array of talent
development programs.

With a strong focus on assuming leadership role in the Digital Learning World and to
further accelerate NIIT’s growth and profitability, the company has charted a focused
business strategy to address the Digital Transformation needs for individuals and
corporate customers by offering training and consulting to help them re-invent themselves
& their organisations.

NIIT classrooms to every digitally connected Indian, for free, at any time and place of
their choice to train the masses to evolve their skills and participate productively in the
future digital world.
2 . AIR ALLIANCE

An air alliance is an aviation industry arrangement between two or more airlines agreeing
to cooperate on a substantial level. Alliances may provide marketing branding to facilitate
travelers making inter-airline code share connections within countries. This branding may
involve unified aircraft liveries of member aircraft

Benefits can consist of:

An extended network, often realised through codeshare agreements. Many alliances


started as only codeshare networks.

 Cost reduction from sharing of:


 sales offices
 maintenance facilities
 operational facilities, e.g. catering or computer systems.
 operational staff, e.g. ground handling personnel, at check-in and boarding desks.

Traveler benefits can include:

 lower prices due to lowered operational costs for a given route.


 more departure times to choose from on a given route.
 more destinations within easy reach.
 shorter travel times as a result of optimised transfers.
 Ovewider range of airport lounges shared with alliance members
 fast track access on all alliance members if having frequent flyer status
 faster mileage rewards by earning miles for a single account on several different
carriers.
 round-the-world tickets, enabling travelers to fly over the world for a relatively
low price.
2.1 OVERVIEW

Founded in 1930, AirAlliance has evolved into one of the most respected travel brands
around the world. We have one of the world’s youngest fleet in the air, a network
spanning 5 continents. Customers, investors, partners and staff- everyone expects
excellence of us. And so, in our lounges, our conferences, working relationships, and in
the smallest details of flights, we rise to each occasion and deliver the AirAlliance
experience.

The airline operates over 370 flights daily across 44 destinations within India and also
operates flights to United Kingdom, United States of America, Nepal, Sri Lanka, Canada,
Belgium, Singapore, Thailand, Malaysia, Bangladesh, Bahrain, Kuwait, Oman & Qatar
on one of the youngest and best maintained fleets.

Airline plans to extend its international operations further in North America, Europe,
Africa & Asia in the coming years with the induction of wide-body aircraft into its fleet.
3. OBJECTIVE

The objective of this project is to implement the airline reservation system to the best
satisfaction of the customer. The normal process which was followed until recently was to
manually fill the data and then process the data which used to cause a lot of
inconvenience to both the administrator and the customer as well.

Now, we would like to use databases to facilitate this process of smooth reservation of
airline tickets with minimal work on the part of both the customer and the administrators
involved .

Now let us look at the various aspects of airline reservation

The various aspects of the Airline Reservation System can be presented in views of the
different people involved with it. The main people involved in the airline reservation are

1. Administrator

2. Customer

3. Broker

Administrator’s view:-

The administrator needs to know and control the following information at all times

1. Total Number of seats per flight and seats available (1st and 2nd classes if
applicable)

2. Number of reservations per flight (1st and 2nd classes if applicable)

3. Schedule of all flights in a day and flights which have arrived.

4. Schedule of a particular flight in a week.

5. List of passengers who are in the waiting list for a given flight

6. Information of each traveler with flight number.

Information about the traveler includes details like

a) First Name
b) Last Name
c) Sex
d) Date of birth,
e) Address, City, State, Zip Code
f) Phone number and other information like is he requesting for any
concession or not
7. Other perks like giving rewards to fliers who have filed most frequently in that
month and special offers for those flights which are normally half full or less

Customer’s view:-

A customer needs to know the following information:

1) Availability of flights to the destination from the departure.

2) Reservation status for a particular flight.

3) Ticket price and the Concessions.

4) Different booking counters available and their addresses.

5) Status i.e., if the ticket has been confirmed or still in waiting list
4. WORKPLAN

4.1 REQUIREMENT ANALYSIS

A Software Requirements Specification (SRS) – a requirements specification for a


software system– is a complete description of the behavior of a system to be developed. It
includes a set of use cases that describe all the interactions the users will have with the
software. In addition to use cases, the SRS also contains non-functional requirements.
Non-functional requirements are requirements which impose constraints on the design or
implementation (such as performance engineering requirements, quality standards, or
design constraints).

Functional specification:- A functional specification (also, functional spec, specs,


functional specifications document (FSD), functional requirements specification, or
Program specification) in systems engineering and software development is the
documentation that describes the requested behavior of an engineering system. The
documentation typically describes what is needed by the system user as well as requested
properties of inputs and outputs.

Functional requirements are observable tasks or processes that must be performed by the
system under development. For example, a functional requirement of a stock trading
system is "must update and remember stock prices;" for a web search engine, "must
accurately parse Boolean queries;" for an automated teller machine, "must process
withdrawals and dispense cash to the customer."

Typical functional requirements are:-

 Business Rules

 Transaction corrections, adjustments, cancellations

 Administrative functions

 Authentication

 Authorization –functions user is delegated to perform


 Audit Tracking

 External Interfaces

 Certification Requirements

 Reporting Requirements

 Historical Data

 Legal or Regulatory Requirements

Non Functional specification:-

In systems engineering and requirements engineering, a non-functional requirement is a


requirement that specifies criteria that can be used to judge the operation of a system,
rather than specific behaviors. This should be contrasted with functional requirements that
define specific behavior or functions. The plan for implementing functional requirements
is detailed in the system design. The plan for implementing non-functional requirements
is detailed in the system architecture.

Non-functional requirements are qualities or standards that the system under development
must have or comply with, but which are not tasks that will be automated by the system.
It is important to note that these kinds of requirements always exist, regardless of the
approach or method used to manage software development. A software development
methodology helps to identify, document, and realize the requirements.

In general, functional requirements define what a system is supposed to do whereas non-


functional requirements define how a system is supposed to be. Functional requirements
are usually in the form of "system shall do <requirement>", while non-functional
requirements are "system shall be <requirement>".

Non-functional requirements are often called qualities of a system. Other terms for non-
functional requirements are "constraints", "quality attributes", "quality goals", "quality of
service requirements" and "non-behavioral requirements". Qualities, that are non-
functional requirements, can be divided into two main categories:

 Execution qualities, such as security and usability, which are observable at run time.
 Evolution qualities, such as testability, maintainability, extensibility and scalability,
which are embodied in the static structure of the software system.

Typical non-functional requirements are:

 Performance - Response Time, Throughput, Utilization, Static Volumetric

 Scalability

 Capacity

 Availability

 Reliability

 Recoverability

 Maintainability

 Serviceability

 Security

 Regulatory

 Manageability

 Environmental

 Data Integrity

 Usability

 Interoperability

In general, requirements are partitioned into functional requirements and non-functional


requirements. Functional requirements are associated with specific functions, tasks or
behavior the system must support, while non-functional requirements are constraints on
various attributes of these functions or tasks. In terms of the ISO quality characteristics
for evaluation, the functional requirements address the quality characteristic of
functionality while the other quality characteristics are concerned with various kinds of
non-functional requirements. Because non-functional requirements tend to be stated in
terms of constraints on the results of tasks which are given as functional requirements
(e.g., constraints on the speed or efficiency of a given task), a task-based functional
requirements statement is a useful skeleton upon which to construct a complete
requirements statement. That is the approach taken in this work. It can be helpful to think
of non-functional requirements as adverbially related to tasks or functional requirements:
how fast, how efficiently, how safely, etc., is a particular task carried out by a particular
system.

4.2 Feasibility Study

Feasibility studies aim to objectively and rationally uncover the strengths and weaknesses
of the existing business or proposed venture, opportunities and threats as presented by the
environment, the resources required to carry through, and ultimately the prospects for
success. In its simplest term, the two criteria to judge feasibility are cost required and
value to be attained. As such, a well-designed feasibility study should provide a historical
background of the business or project, description of the product or service, accounting
statements, details of the operations and management, marketing research and policies,
financial data, legal requirements and tax obligations. Generally, feasibility studies
precede technical development and project implementation.

Types of feasibility study:-

Economic feasibility:-It is the most frequently used method for evaluating the
effectiveness of a new system. More commonly known as cost/benefit analysis, the
procedure is to determine the benefits and savings that are expected from a candidate
system and compare them with costs. If benefits outweigh costs, then the decision is made
to design and implement the system. An entrepreneur must accurately weigh the cost
versus benefits before taking an action.

 Cost-based study: It is important to identify cost and benefit factors, which can
be categorized as follows: 1. Development costs; and 2. Operating costs. This is
an analysis of the costs to be incurred in the system and the benefits derivable out
of the system.
 Time-based study: This is an analysis of the time required to achieve a return on
investments. The future value of a project is also a factor.

Operational feasibility:-Operational feasibility is a measure of how well a proposed


system solves the problems like transport management system which provides facilities to
the students as well as the employees of the organization, and takes advantage of the
opportunities identified during scope definition and satisfies all the requirements
identified in the requirements analysis phase of system development.

Technical Feasibility:- The Technical Feasibility Study assesses the details of how you
will deliver a product or service (i.e., materials, labor, transportation, where your business
will be located, technology needed, etc.). Think of the technical feasibility study as the
logistical or tactical plan of how your business will produce, store, deliver, and track its
products or services.

A technical feasibility study is an excellent tool for trouble-shooting and long-term


planning. In some regards it serves as a flow chart of how your products and services
evolve and move through your business to physically reach your market.

In technical feasibility the following issues are taken into consideration.

 Whether the required technology is available or not

 Whether the required resources are available

 Manpower programmers, testers & debuggers

 Software and hardware


5. CODING AND IMPLEMENTATION

Index.php

<?php

session_start();

include("conf/conf.php");

$dbConf = new AAConf();

$databaseURL = $dbConf->get_databaseURL();

$databaseUName = $dbConf->get_databaseUName();

$databasePWord = $dbConf->get_databasePWord();

$databaseName = $dbConf->get_databaseName();

//Set DB Info. in-session

$_SESSION['databaseURL']=$databaseURL;

$_SESSION['databaseUName']=$databaseUName;

$_SESSION['databasePWord']=$databasePWord;

$_SESSION['databaseName']=$databaseName;

$connection = @mysql_connect($databaseURL,$databaseUName,$databasePWord);

// or die ("Error while connecting to localhost");

$db = @mysql_select_db($databaseName,$connection);

//or die ("Error while connecting to database");

$rowArray;

$rowID = 1;
$query = "SELECT * FROM Sectors";

$result = @mysql_query($query);

while($row = @mysql_fetch_array($result)){

$rowArray[$rowID] = $row['Sector'];

$rowID = $rowID +1;

//Update the session with the sectors.

$_SESSION['sectors']=$rowArray;

@mysql_close($connection);

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<title>AirAlliance</title>

<meta name="keywords" content="itinerary, list" />

<meta name="description" content="This page provides a list of all itineraries" />

<link href="css/default.css" rel="stylesheet" type="text/css" />

</head>

<body>

<div id="wrapper">
<?php include 'include/header.php'; ?>

<!-- end div#header -->

<div id="page">

<div id="content">

<div id="welcome">

<h1>Welcome to AirAlliance</h1>

<!--body-->

<p>

AirAlliance has evolved into one of the

most respected travel brands around the world.

We have one of the world's youngest fleet in the air,

a network spanning five continents.

Customers, investors, partners, and staff

— everyone expects excellence of us. And so, in

our lounges, our conferences, working relationships,

and in the smallest details of flight, we rise to

each occasion and deliver the AirAlliance

experience.

</p>

<p>

The airline operates over 370 flights daily


across 44 destinations within India and also

operates flights to United Kingdom, United States

of America, Canada, Belgium, Singapore, Thailand,

Malaysia, Nepal, Sri Lanka, Bangladesh, Bahrain,

Kuwait, Oman & Qatar on one of the youngest and

best maintained fleets. AirAlliance plans to extend

its international operations further in North America,

Europe, Africa & Asia in the coming years with the

induction of wide-body aircraft into its fleet.

</p>

<p>

Feel the AirAlliance Experience!

</p>

<!--body ends-->

</div>

<!-- end div#welcome -->

</div>

<!-- end div#content -->

<div id="sidebar">

<ul>

<?php include 'include/nav.php'; ?>


<!-- end navigation -->

<?php include 'include/updates.php'; ?>

<!-- end updates -->

</ul>

</div>

<!-- end div#sidebar -->

<div style="clear: both; height: 1px"></div>

</div>

<?php include 'include/footer.php'; ?>

</div>

<!-- end div#wrapper -->

</body>

</html>
Home.php

<?php include('connect.php'); ?>

<html>

<head>

</head>

<body>

<form action="register.php" method="post">

name: <input type="text" name="name" value=""><br>

email id: <input type="text" name="email" value=""><br>

pass: <input type="password" name="pass" value=""><br>

gender: <input type="radio" name="gender" value="male">male

<input type="radio" name="gender" value="female">female<br>

address: <textarea name="address" value=""></textarea><br>

<input type="submit" name="submit" value="register">

<input type="reset" name="reset" value="reset">

</form>

</body>

</html>
itinerarymanager.php

<?php

/*

This file contains the functions

that performs the DB operation. The

Database properties are taken from the

session.

*/

include("classes/guestitinerary.php");

include("classes/flight.php");

include("classes/schedule.php");

$databaseURL;

$databaseUName;

$databasePWord;

$databaseName;

/*

DB Initialization method.

Returns the connection variable.

*/

function initDB(){

/* Get Sectors from session */

if(! isset($_SESSION['databaseURL'])){

include("conf/conf.php");
$dbConf = new AAConf();

$databaseURL = $dbConf->get_databaseURL();

$databaseUName = $dbConf->get_databaseUName();

$databasePWord = $dbConf->get_databasePWord();

$databaseName = $dbConf->get_databaseName();

//Set DB Info. in-session

$_SESSION['databaseURL']=$databaseURL;

$_SESSION['databaseUName']=$databaseUName;

$_SESSION['databasePWord']=$databasePWord;

$_SESSION['databaseName']=$databaseName;

$connection =

@mysql_connect($databaseURL,$databaseUName,$databasePWord);

// or die ("Error while connecting to localhost");

$db = @mysql_select_db($databaseName,$connection);

//or die ("Error while connecting to database");

$rowArray;

$rowID = 1;

$query = "SELECT * FROM Sectors";

$result = @mysql_query($query);

while($row = @mysql_fetch_array($result)){

$rowArray[$rowID] = $row['Sector'];

$rowID = $rowID +1;

}
//Update the session with the sectors.

$_SESSION['sectors']=$rowArray;

@mysql_close($connection);

$databaseURL = $_SESSION['databaseURL'];

$databaseUName = $_SESSION['databaseUName'];

$databasePWord = $_SESSION['databasePWord'];

$databaseName = $_SESSION['databaseName'];

$connection = @mysql_connect($databaseURL,$databaseUName,$databasePWord);

//or die ("Error while connecting to host");

$db = @mysql_select_db($databaseName,$connection);

//or die ("Error while connecting to database");

return $connection;

/*

DB Closing method.

Pass the connection variable

obtained through initDB().

*/

function closeDB($connection){

@mysql_close($connection);

/*
Guests are allowed to cancel

reservation based on thier Itinerary

IID. This function flushes the

itinerary records from the Itinerary

table and the Schedule table. However,

the guest information is retained.

Pass an Itinerary ID.

Returns 0 upon flushing.

*/

function cancelReservation($IID){

$connection = initDB();

$query2;

$query2 = "SELECT * FROM Itinerary WHERE IID='".$IID."'";

$result2 = @mysql_query($query2);

//or die ("Query Failed ".mysql_error());

$SID;

while($row2 = @mysql_fetch_array($result2)){

$SID = $row2['SID'];

//Remove Itinerary information

$query2 = "DELETE FROM Schedule WHERE SID='".$SID."'";

$result2 = @mysql_query($query2);

//or die ("Query Failed ".mysql_error());


//Remove Schedule information

$query2 = "DELETE FROM Itinerary WHERE IID='".$IID."'";

$result2 = @mysql_query($query2);

//or die ("Query Failed ".mysql_error());

closeDB($connection);

return 0;

/*

This method accepts the itinerary

information from the guests and updates

the DB. After updating the DB, it

generates an IID that can be used for

checking the status of the itinerary.

Pass the first name, last nmae, source

sector (Example, SFO), destination

sector, preffered flight (Example AA056),

and the travel date.

Returns the Itinerary ID.

*/

function processReservation($fname,$lname,$sourcelist,$destlist,$flight,$sdate){

$connection = initDB();

$query2;

//Update Guest Table


$query2 = "SELECT * FROM Guest WHERE FirstName='".$fname."' AND
LastName='".$lname."'";

$result2 = @mysql_query($query2);

//or die ("Query Failed ".mysql_error());

$registeredGuest = false;

$guestID;

while($row2 = @mysql_fetch_array($result2)){

$guestID = $row2['GID'];

$registeredGuest = true;

//Guest ID not available. First time flyer.

if(! $registeredGuest){

//Update Guest table.

//Get last Guest ID

$query2 = "SELECT MAX(GID) FROM Guest";

$result2 = @mysql_query($query2);

//or die ("Query Failed ".mysql_error());

$row2 = @mysql_fetch_array($result2);

$MGID = $row2[0];

$guestID = $MGID + 1;

query2 = "INSERT INTO Guest Values('".$guestID."','".$fname."','".$lname."')";

$result2 = @mysql_query($query2);

//or die ("Query Failed ".mysql_error());


}

//Get the flight ID

$query = "SELECT * FROM Flights WHERE FName='".$flight."'";

$result = @mysql_query($query);

//or die ("Query Failed ".mysql_error());

$row2 = @mysql_fetch_array($result);

$FID = $row2['FID'];

//Update schedule table

$query2 = "SELECT MAX(SID) FROM Schedule";

$result2 = @mysql_query($query2);

//or die ("Query Failed ".mysql_error());

$row2 = @mysql_fetch_array($result2);

$MSID = $row2[0];

//echo "MAX GID ".$MGID;

$SID = $MSID + 1;

//Before updating the schedule and itinerary table

//check duplicate itinerary.

$query2 = "SELECT * FROM Schedule WHERE GID='".$guestID."' AND


FID='".$FID."' AND Date='".$sdate."'";

$result2 = @mysql_query($query2);

//or die ("Query Failed ".mysql_error());

$duplicateItinerary = false;

$guestID;
while($row2 = @mysql_fetch_array($result2)){

$duplicateItinerary = true;

if($duplicateItinerary){

//Duplicate itineraries not allowed.

return -1;

$query2 = "INSERT INTO Schedule Values

('".$SID."','".$guestID."','".$FID."','".$sdate."')";

$result2 = @mysql_query($query2);

//or die ("Query Failed ".mysql_error());

//Finally update the Itinerary Table

$query2 = "SELECT MAX(IID) FROM Itinerary";

$result2 = @mysql_query($query2);

// or die ("Query Failed ".mysql_error());

$row2 = @mysql_fetch_array($result2);

$MIID = $row2[0];

$IID = $MIID + 1;

$query2 = "INSERT INTO Itinerary

Values('".$IID."','".$guestID."','".$FID."','".$SID."')";

$result2 = @mysql_query($query2);

//or die ("Query Failed ".mysql_error());

closeDB($connection);
return $IID;

/*

This method accepts two sectors and

returns all the avilable flights between

those two sectors querying the Flights

table.

Pass the source sector (Example, SFO) and

the destination sector.

Returns an array of Flights.

*/

function getAvailableFlights($source,$dest){

$connection = initDB();

$query2;

$query2 = "SELECT * FROM Sectors WHERE Sector='".$source."'";

$result2 = @mysql_query($query2);

//or die ("Query Failed ".mysql_error());

$row2 = @mysql_fetch_array($result2);

$SourceSID = $row2['SID'];

$query3 = "SELECT * FROM Sectors WHERE Sector='".$dest."'";

$result3 = @mysql_query($query3);

// or die ("Query Failed ".mysql_error());

$row3 = @mysql_fetch_array($result3);
$destSID= $row3['SID'];

//Get available flights

$query3 = "SELECT * FROM Flights WHERE SourceSID='".$SourceSID."' AND


DestSID='".$destSID."'";

$result3 = @mysql_query($query3);

// or die ("Query Failed ".mysql_error());

$flightsArray;

$flightsID=1;

while($row = @mysql_fetch_array($result3)){

$fName= $row['FName'];

$flightsArray[$flightsID] = $fName;

$flightsID = $flightsID +1;

closeDB($connection);

//return $flightsArray;

/*

This method returns the flight information

given the Flight ID. The Flight table

is queries to return the sectors supported.

Pass the Flight ID.

Returns an array of Flight objects. See classes/

Flight for the helper class.


*/

function getFlightInfo($FID){

$connection = initDB();

$query;

if($FID == 0){

$query = "SELECT * FROM Flights";

else{

$query = "SELECT * FROM Flights WHERE FID='".$FID."'";

$result = @mysql_query($query);

// or die ("Query Failed ".mysql_error());

$flightData;

$flightID = 0;

while($row = @mysql_fetch_array($result)){

$FID = $row['FID'];

$FName = $row['FName'];

$SourceSID = $row['SourceSID'];

$DestSID = $row['DestSID'];

$query2 = "SELECT * FROM Sectors WHERE SID='".$SourceSID."'";

$result2 = @mysql_query($query2);
//or die ("Query Failed ".mysql_error());

$row2 = @mysql_fetch_array($result2);

$source = $row2['Sector'];

$query3 = "SELECT * FROM Sectors WHERE SID='".$DestSID."'";

$result3 = @mysql_query($query3);

//or die ("Query Failed ".mysql_error());

$row3 = @mysql_fetch_array($result3);

$dest= $row3['Sector'];

//Build the Flight object

$flight = new Flight();

$flight->set_FID($FID);

$flight->set_FName($FName);

$flight->set_source($source);

$flight->set_dest($dest);

//Build the Flight object array

$flightData[$flightID] = $flight;

$flightID = $flightID +1;

closeDB($connection);

return $flightData;

/*

This method fetches the itinerary


given an Itinerary ID. It can also return

and array of all the itineraries if

a value of '0' is passed.

Pass a valid itinerary ID. '0' for

getting all itineraries.

Returns an array of GuestItinerary obejcts.

Refer to classes/guestitinerary.php.

*/

function getItinerary($IID){

$connection = initDB();

$query;

if($IID == 0){

$query = "SELECT * FROM Itinerary";

else{

$query = "SELECT * FROM Itinerary WHERE IID='".$IID."'";

$result = @mysql_query($query);

//or die ("Query Failed ".mysql_error());

$itineraryID = 0;

$itineraryData;
while($row = @mysql_fetch_array($result)){

$GID = $row['GID'];

$FID = $row['FID'];

$SID = $row['SID'];

//Retrieve Guest Information

$query2 = "SELECT * FROM Guest WHERE GID='".$GID."'"; //gid is primary key ,so
one at a time ;no use of while loop

$result2 = @mysql_query($query2);

$row2 = @mysql_fetch_array($result2);

$firstName = $row2['FirstName'];

$lastName = $row2['LastName'];

//Retrieve Travel Schedule Information

$query3 = "SELECT * FROM Schedule WHERE SID='".$SID."'";

$result3 = @mysql_query($query3);

$row3 = @mysql_fetch_array($result3);

$travelDate = $row3['Date'];

//Retrieve Sector Information

$query3 = "SELECT * FROM Flights WHERE FID='".$FID."'";

$result3 = @mysql_query($query3);

$row3 = @mysql_fetch_array($result3);

$sourceSID = $row3['SourceSID'];

$destSID = $row3['DestSID'];

$fName = $row3['FName'];
$query4 = "SELECT Sector FROM Sectors WHERE SID='".$sourceSID."'";

$result4 = @mysql_query($query4);

$row4 = @mysql_fetch_array($result4);

$source = $row4['Sector'];

$query4 = "SELECT Sector FROM Sectors WHERE SID='".$destSID."'";

$result4 = @mysql_query($query4);

$row4 = @mysql_fetch_array($result4);

$dest = $row4['Sector'];

//Build GuestItinerary object

$guestItinerary = new GuestItinerary();

$guestItinerary->set_FID($FID);

$guestItinerary->set_FName($fName);

$guestItinerary->set_SID($SID);

$guestItinerary->set_source($source);

$guestItinerary->set_dest($dest);

$guestItinerary->set_travelDate($travelDate);

$guestItinerary->set_GID($GID);

$guestItinerary->set_firstName($firstName);

$guestItinerary->set_lastName($lastName);

$itineraryData[$itineraryID]=$guestItinerary;

$itineraryID = $itineraryID + 1;

}
closeDB($connection);

return $itineraryData;

?>
Confirmreservation.php

<?php

include("itinerarymanager.php");

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<title>Reservation Confirmation</title>

<meta name="keywords" content="itinerary, list" />

<meta name="description" content="This page provides a list of all itineraries" />

<link href="css/default.css" rel="stylesheet" type="text/css" />

</head>

<body>

<div id="wrapper">

<?php include 'include/header.php'; ?>

<!-- end div#header -->

<div id="page">

<div id="content">

<div id="welcome">

<h1>Reservation Confirmation</h1>

<p>
When you book your ticket, you get an Itinerary ID from AirAlliance.

You can use that ID to check the status of your reservation.

</p>

<!--body-->

<?php

$IID;

if(isset($_REQUEST["IID"])){

$IID = $_REQUEST["IID"];

//Check if it a cancel action

$isCancelAction = false;

if(isset($_REQUEST["action"])){

$action = $_REQUEST["action"];

if($action == "cancel"){

$isCancelAction = true;

if(!$isCancelAction){

//Process the Itinerary ID

$itineraryData = getItinerary($IID);

if(count($itineraryData) > 0){

echo "<h3>Reservation Confirmed</h3>";

echo "<table class='aatable'>";

echo "<tr>";
echo "<th>Guest Name</th>";

echo "<th>Flight</th>";

echo "<th>Source</th>";

echo "<th>Destination</th>";

echo "<th>Travel Date</th> ";

echo "</tr>";

for($index=0;$index < count($itineraryData);$index++){

$guestItinerary = $itineraryData[$index];

echo "<tr>";

echo "<td>".$guestItinerary->get_firstName()." ".$guestItinerary-


>get_lastName()."</td>";

echo "<td><a class='data' href='flightinfo.php?FID=".$guestItinerary-


>get_FID()."'>".$guestItinerary->get_FName()."</a></td>";

echo "<td>".$guestItinerary->get_source()."</td>";

echo "<td>".$guestItinerary->get_dest()."</td>";

echo "<td>".$guestItinerary->get_travelDate()."</td>";

echo "</tr>";

echo "</table>";

echo "<br><a href='confirmreservation.php?action=cancel&IID=".$IID."'>Cancel


Reservation</a>";

else{

echo "<br><br><h3>No record found. Please check the Itinerary ID</h3>";


echo "<h4><a href='confirmreservation.php'>Try Again</a></h4>";

else{

//Guest requested to cancel itinerary

$result = cancelReservation($IID);

if($result == 0){

echo "<h2>Itinerary Cancelled";

echo "<h4>The itinerary has been successfully removed. However the guest information
is retained for further processing.</h4>";

echo "<p><a href='processitinerary.php'>Process new itinerary</a></p>";

}}

else{

?>

<form action="confirmreservation.php">

<input class="form_tfield" type="text" name="IID" value="" />

<input class="form_submitb" name="imageField" type="submit" value="Submit" >

</form>

<div id="note">

<p>Enter the Itinerary ID. (Example: 5)</p>

</div>

<?php
}

?>

<!--body ends-->

</div>

<!-- end div#welcome -->

</div>

<!-- end div#content -->

<div id="sidebar">

<ul>

<?php include 'include/nav.php'; ?>

<!-- end navigation -->

<?php include 'include/updates.php'; ?>

<!-- end updates -->

</ul>

</div>

<!-- end div#sidebar -->

<div style="clear: both; height: 1px"></div>

</div>

<?php include 'include/footer.php'; ?>

</div>

<!-- end div#wrapper -->

</body>

</html>
6. CONCLUSION
To conclude the description about the website; the website, developed
using PHP and MySQL is based on the requirement specification of the user
and the analysis of the existing system, with flexibility for future
enhancement. 5.2 Conclusion

Before modern computing, the reservation system was done using manual
means. This meant that a person about to travel had to spend a lot of
unnecessary time waiting in queues in order to book their tickets. The
manual process of reservation was also prone to human errors, which lead
to a lot of dissatisfaction amongst travellers. Nowadays competition is so
fierce between airlines that there are lot of discounts and a lot of luxuries
given to customers that will give an edge to that particular airline. The
online airline reservation automates these processes of booking airline
tickets online, thus reducing the time wasted as well as the errors that are
involved in the manual process. People will argue that online airline
reservation system are expensive, and create unfair competition between
other airlines that don’t have them.

From the researchers view, online airline reservation is one the best
innovation that has taken place in the airline industry and those companies
that have not yet embraced airline reservation system ought to lose out,
they may sight, additional costs, maintenance cost and the cost
of development as their drawbacks. World Wide Web and the Internet is
here and airline companies for the future will seize this opportunity develop
airline reservation systems.
REFERENCES

 P. N. Seth, S. S. Bhat (2002): “An Introduction to Travel and Tourism”, Prentice


Hall, London.17.
 R. Doganis, C. Routledge (2001): “The Airline Business in the 21st Century.”
McGraw-Hill, New York.
 www.w3school.com
 www.wikipedia.com
 www.phptutorial.com
 www.metamorphozis.com
 www.wpfree.com
 www.freephpguide.com

You might also like