You are on page 1of 154

This is to certify that the following students of NARULA INSTITUTE OF TECHNOLGY Have successfully completed the project on AIRLINE

RESERVATION SYSTEM From WEBEL-HCL IT ACADEMY

1.ATANU BAIRAGI 2.CHANDAN SHARMA 3.KRISHNENDU BERA 4.RAJKUMAR DEY 5SAGNIKA SAHA 6.SANHITA DATTA 7.SOUMYAJYOTI DUTTA

..

SIGNATURE OF FACULTY WITH DATE TITLE: ezAIRTICKETS (Online Airline Ticket Reservation System)

Group members:
Atanu Bairagi Rajkumar Dey Sanhita Datta Sagnika Saha Chandan Sharma Krishnendu Bera Soumyajyoti Dutta

ABSTRACT

EZ AIR TICKET is a leading travel company offering leisure and business travelers the widest selection of low fares as well as deals on lodging and vacation packages. The site was created to address the need for an unbiased, comprehensive display of fares and rates in a single location for consumers. EZ AIR TICKET search results are presented in an easy-to-use Matrix that displays a vast array of travel options for you. EZ AIR TICKET is the first and only travel site with a seasoned Customer Care Team that monitors nationwide travel conditions for our travelers around the clock, every day. EZ AIR TICKET is a site, which helps the flight travelers. Its mission is to offer flexible leisure travelers a quick and easy way to get better deals on airline tickets. All purchases made on EZ AIR TICKET are not final and can be cancelled, refunded or changed. If you want, you can also receive your updates by calling Indian Travels toll-free number and using your personalized PIN. When customers prefer a specific travel itinerary, they offer the widest range of flight options and fares. The project will be in any platform with Front End as JSP and SQL SERVER-2005 as Back End.

INTENDED AUDIENCE

The project is basically targeted at those people who would like to travel through air and have an Internet access. As we will be making our site WAP enabled, this will facilitate our site to accept requests from other alternative devices like PDAs and WAP-enabled browsers. Apart from the above category of audience, passengers using hand-held devices will be our second major category of audience. Finally passengers curious in comparing the prices for various Airlines for their selected source and destination cities form our third category of audience.
INTRODUCTION

Our project aimed to offer a range of best-value products and services along with cutting-edge technology and dedicated round-the-clock customer support. After consolidating its position in the market as a brand recognized for its reliability and transparency, EZ AIRTICKET followed its success in other foresight to seize the opportunities in the domestic travel market, brought on by a slew of new airlines, EZ AIRTICKET offered travellers the convenience of online travel bookings at rock-bottom prices.

TECHNOLOGIES USED.

Following are the core technologies used in developing our website.

A. Server Technologies:

WEB SERVER :

1. Tomcat Server Tomcat is enterprise class, robust web server which comes bundled with JavaServlets and JSP that provides a java application server environment

One of the other major issues why we chose Tomcat was Scalability. Presently Java is our core technology used for portability and in future if we want to make our site be reachable to users using Microsoft products we would be having no conflicts between the servers because Tomcat can be deployed as either a standalone product with its own internal Web server or in conjunction with several other Web servers, including

Netscape Enterprise Server. Microsoft Internet Information Server. Microsoft Personal Web Server.
It adheres to the latest standards, which expands the security features. Configuration, tuning and maintenance are lot easier than compared to other prevailing web servers. Since we were not going for enterprise java beans in our project we didnt feel the necessity of going for other application servers like J2EE or JBOSS .We were basically looking for a reliable web server which would be compatible with both the front-end and back-end technologies we were using and our ultimate choice was Apaches Tomcat Web Server.

DATABASE SERVER:

1. SQL Server 2005

B. Software Technologies:

We have used the Netbeans IDE


1.Java Server Pages (JSP) 2.Java Beans 3.XML & XSL 4.HTML&CSS 5.JavaScript 6. HTTP Sessions

Java Server Pages (JSP)

Regular HTML, of course, cannot contain dynamic information. JSP is so easy and convenient that it is quite feasible to augment HTML pages that only benefit marginally by the insertion of small amounts of dynamic data. JSP was designed to work with Java Servlets and JavaBeans in a seamless fashion, it provides applications developers with the capability to cleanly separate content generation from content presentation. This means that Web page designers can work independently from business logic developers, and the end result will work in a distributed, heterogeneous computing environment.

XML & XSL XML was mainly used because of its extensibility feature. It had this added advantage of presenting the same content in different formats to different clients. Our site is completely driven by XML data. We have implemented all our servlets in such a way that they throw XML DOM tree for each and every page. So once we had this XML DOM tree in hand we implemented XSLs to throw out either a HTML data or WML data to the client depending on either the request coming from http browser or WAP browser. In this way our site is more extensible, suppose that in future we had to extend our site to clients with a new markup language what all we need to do is write out a separate XSL to display the data in the form specific to that client.

Another major advantage of sending XML data to the client instead of html data is, we can offload some computation to the client from the server. i.e. we werent forced to bother about the presentation data on the server's side, instead we concentrated on sending the data and using style sheets to display it in according to the clients needs.

HTML&CSS

We used HTML&CSS to design our site.

JavaScript
JavaScript was basically used for client-side validation. JavaScript is compatible with all versions of Microsoft Internet Explorer and Netscape Navigator. We have small java scripts, which are lightweight and will not hinder the download time of the HTML document significantly.

HTTP Sessions& Java Beans:

Every user who logs in to our system is given a new session. We implemented this feature using the Http Session API provided by the Java Beans.

Architecture Model Used:

CONTROL FLOW IN A TYPICAL USER SESSION:

1. User will type the URL of our site: ezairtickets.com in the browser. 2. User will be shown our homepage containing various page links and search option. 3. User will click on the Login button to log on into our system. 4. The user-id and password are validated and the user is allowed to login. 5. The user is directed to the home page where he can start his search for his travel options. 6. The user can select the Departure and arrival cities and date and click on the Search button. 7. The user will be shown a page with various list boxes he has to choose for his tickets. 8. The user clicks on book ticket. 9. The user will be shown the details of the option and the money transaction is shown. 10. The user can click on the Confirm button or can cancel even at this point. 11. The user is allotted a Flight seating arrangement in a respective flight.

DATABASE DESIGN: We use SQL SERVER 2005 as the backend and use JDBC connectivity to access the database. The JSPs access the database using JDBC and output the results according to the query, which again takes into account the options, selected by the user. The following gives the various tables and their fields used in our database, which was a major design decision of our project. Reg_customer Table contains the details of the users registered for our services. The fields in this table are as follows: F_NAME M_NAME L_NAME ADDR STATE DISTRICT MOBILE LANDLINE EMAIL_ID PIN CITY USERNAME PASSWORD USERNAME is the PRIMARY KEY of this table.
FLIGHT TABLE contains information about flights. The corresponding fields are given below: FLIGHT_NO AIRLINE_NAME SOURCE DESTINATION TOTAL_BS_SEAT TOTAL_EC_SEAT BS_FARE EC_FARE DEPARTURE_TIME ARRIVAL_TIME SEAT_BS_REMAIN SEAT_EC_REMAIN MONDAY TUESDAY WEDNESDAY THRUSDAY FRIDAY SATURDAY SUNDAY

FLIGHT_NO is the PRIMARY KEY of this table.

PASSENGER TABLE contains information about passenger booking details. Fields are: TICKET_NO DEPARTUREDATE FLIGHT_NO SOURCE DESTINATION FIRST_NAME MID_NAME LAST_NAME SEAT_NO SEX AGE PHONE_NO EMAIL DEPARTURE_TIME TICKET_NO is the PRIMARY KEY of this table and FLIGHT_NO is the FOREIGN KEY from FLIGHT table. PAYMENT TABLE contains the required transactions. The fields of this table is given below: TICKET_NO PAYMENT_MODE PAYMENT_NO AMOUNT TICKET_NO is the PRIMARY KEY of this table and also a FOREIGN KEY from

PASSENGER table.

MODULAR DESIGN
A software system is always divided into several sub systems that makes it easier for the development. A software system that is structured into several subsystems makes it easy for the development and testing. The different subsystems are known as the modules and the process of dividing an entire system into subsystems is known as modularization or decomposition. A system cannot be decomposed into several subsystems in any way. There must some logical barrier, which facilitates the separation of each module. The separation must be simple but yet must be effective so that the development is not affected. The system under consideration has been divided into several modules taking in consideration the above-mentioned criteria.

The whole project is basically divided into three different modules :

The Admin Module The Ticketing Booking Module The User Module

1. Admin Module Features: a. The administrator can ADD new flights to the database. b. The administrator can retrieve the details of the existing flights corresponding to the flight number & edit the details & UPDATE it. c. The administrator can DELETE flights from the database by entering the corresponding flight number.

2. User Module
Features: a. New Users have to REGISTER themselves as the Users of the site & then only utilize the privileges. b. Existing users can MODIFY/UPDATE their respective details stored in our database. c. Only Registered users can avail the facility to BOOK TICKETS while guest Users can only SEARCH/VIEW flights.

3. Ticket Booking Module


Features: a. SEARCH FLIGHTS from a particular source to DESTINATION for a particular day. b. BOOK TICKET for that particular journey. c. SEARCH RETURN FLIGHTS for the return journey on any other day of the year. d. BOOK RETURN TICKET for that journey. e. CANCEL TICKET corresponding to the already booked ticket with the help of the unique ticket number.

DIAGRAMS

CODING

Bean File:
connect.java
package propack; import java.sql.*; public class connect { int a[] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int sum = 0; String g=""; String b[] = {"Sat","Sun","Mon","Tue","Wed","Thu","Fri"}; public Connection getConnection() throws Exception { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:airpro","sa","bera");

return con } public int getcount(int d,int cont){ for(int i=0;i<cont;i++){ sum = sum + a[i]; } sum = sum + d; sum = sum % 7; return sum; } public String getday(int d){ if(d==0){ return b[6];} else return b[d-1]; }}

Jsp Files:
index.java <the home page>

<html > <% int flag = 0; session.setAttribute("logstat", flag); String error=request.getParameter("error"); if(error==null || error=="null"){ error=""; } %>

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document2</title> <style type="text/css"> .book { } .book { } </style> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 color: #FF0; color: #008040;

var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } function makeChoice() { var val = 0; for( i = 0; i < document.form1.fruit.length; i++ ) { if( document.form1.fruit[i].checked == true ) { val = document.form1.fruit[i].value; if(val=='return') { document.form1.input2.disabled=false; document.form1.input2.focus(); } else{ document.form1.input2.disabled=true; }}}} function trim(s) { return s.replace(/^\s*/,"").replace(/\s*$/,""); } function validate() { if(trim(document.form1.input1.value)=="")

{ alert("Date Field Is Empty"); document.form1.input1.focus(); return false; } } </script <style type="text/css"> .face { font-family: Palatino Linotype, Book Antiqua, Palatino, serif; } .face strong { color: #FFF; } .abpu { color: #FFF; } .Flight { color: #FFF; } .follow { color: #FFF; } </style> <script language="JavaScript" src="calendar_us.js"></script> <link rel="stylesheet" href="calendar.css"> </head>

<body background="oxford.jpg" onLoad="MM_preloadImages('images/home_button_ro.jpg','images/REGISTER_button_ro.jpg' ,'images/signin_button_ro.jpg','images/aboutus_button_ro.jpg','images/CONTACTus_button_r o.jpg','images/User_ro.jpg','images/PrivacyPolicy_button_ro.jpg','images/homebuttons_ro.jpg','images/Register_ro.jpg','images/Signin_ro.jpg','images/Aboutus_ro.jpg','imag es/Contactus_ro.jpg','images/Privacy_ro.jpg','images/User_ro.jpg'),document.form1.input2.di sabled=true"> <form action="" method="post" name="header"> <div align="center"> <table width="77%" border="0"> <tr> <td width="24%" height="185"><p><a href="index.jsp"><img src="images/main_logo.jpg" width="276" height="141"></a></p> <p align="center"><marquee behavior="scroll" direction="left"><strong>ezAirTickets.com</strong></marquee></p></td> <td width="46%"><img src="images/17071-rs.jpg" width="759" height="150"></td> <td width="30%"><h4 align="right"><a href="Register.jsp">Register</a> <a href="Login.jsp">Sign in</a></h4> <p align="right"><font size="4"><a href="adminLogin.jsp"><b>|Administrator| </b></a></font></p> <p align="right"><img src="images/google-button.gif" width="72" height="72" align="right"></p> <h5 align="right">GoogleSearch</h5> <p align="right">&nbsp;</p></td> </tr> </table> </div> &nbsp;&nbsp; <div align="center"> <table width="79%" height="51" border="0"> <tr>

<td width="14%" height="47"><a href="index.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','images/home-buttons_ro.jpg',1)"><img src="images/home-buttons.jpg" name="Image3" width="150" height="45" border="0"></a></td> <td width="14%"><a href="Register.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','images/Register_ro.jpg',1)"><img src="images/Register.jpg" name="Image4" width="150" height="45" border="0"></a></td> <td width="14%"><a href="Login.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','images/Signin_ro.jpg',1)"><img src="images/Signin.jpg" name="Image5" width="150" height="45" border="0"></a></td> <td width="14%"><a href="AboutUs.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','images/Aboutus_ro.jpg',1)"><img src="images/Aboutus.jpg" name="Image6" width="150" height="45" border="0"></a></td> <td width="14%"><a href="ContactUs.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','images/Contactus_ro.jpg',1)"><img src="images/Contactus.jpg" name="Image7" width="150" height="45" border="0"></a></td> <td width="16%"><a href="PrivacyPolicy.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','images/Privacy_ro.jpg',1)"><img src="images/Privacy.jpg" name="Image8" width="150" height="45" border="0"></a></td> <td width="14%"><a href="userAgreement.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','images/User_ro.jpg',1)"><img src="images/User.jpg" name="Image9" width="150" height="45" border="0"></a></td> </tr> </table> </div> </form>

<td bgcolor="black"><div align="center"> <table cellpadding='0' cellspacing='0' border='0' width='82%'> <tr><td background="dark-metal-texture.jpg" style="padding:2;paddingbottom:4"><b>

<div align="center"><font size=4 color="white" face="verdana,arial"> </font></div>

<marquee behavior="scroll" direction="left"> <font color="white" size="5" face="verdana,arial">Welcome To ezAirTickets.com</font> </marquee>

</table> </div> <p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>

<div align="center"> <table width="62%" border="0"> <tr> <td width="34%" rowspan="2"><form action="flsearch_main2.jsp" method="post" onSubmit="return validate();" name="form1" id="Select"> <div align="center"> <h3><%= error %></h3> <table width="97%" border="5"> <tr> <td height="39" colspan="2" background="131.jpg"><h2 align="center" class="book"><strong>BOOK YOUR TICKETS</strong></h2></td> </tr> <tr> <td height="5" colspan="2" background="subtle_textures_8.jpg"> <input type="radio" name="fruit" value="one" onclick="makeChoice()" checked>One Way Trip

<input type="radio" name="fruit" value="return" onclick="makeChoice()">Return Trip</td> </tr> <tr> <td height="6" colspan="2" background="subtle_textures_8.jpg"><h4> Departure Date: </h4> <input type="text" name="input1" /> <script language="JavaScript"> new tcal ({ 'formname': 'form1', 'controlname': 'input1' });

</script>

<h4>Return Date: </h4> <input type="text" name="input2" /> <script language="JavaScript"> new tcal ({ 'formname': 'form1', 'controlname': 'input2' });

</script> </td> </tr> <tr>

<td width="51%" height="29" background="subtle_textures_8.jpg"><h3 align="center">Leaving From:</h3></td> <td width="49%" height="29" background="subtle_textures_8.jpg"><h3 align="center">Going To:</h3></td> </tr> <tr> <td height="63" background="subtle_textures_8.jpg"><div align="center"> <select name="srchome"> <option>--------</option> <option>Kolkata</option> <option>Mumbai</option> <option>Delhi</option> <option>Chennai</option> <option>Pune</option> <option>Ahmedabad</option> <option>Bengaluru</option> </select> &nbsp;</div></td> <td height="63" background="subtle_textures_8.jpg"><div align="center"> <select name="deshome"> <option>--------</option> <option>Kolkata</option> <option>Mumbai</option> <option>Delhi</option> <option>Chennai</option> <option>Pune</option> <option>Ahmedabad</option> <option>Bengaluru</option>

</select> &nbsp;</div></td> </tr> <tr> <td height="60" colspan="2" background="subtle_textures_8.jpg"><div align="center"> <input type="image" src="images/checkflights.gif" width="106" height="26" style="margin-left:90px;"/></td> </tr> </table> <p>&nbsp;</p> <p><a href="cancelticket.jsp"><img src="images/cancelTicket_button.jpg" width="204" height="52"></a></p> </div> </form></td> <td width="40%" height="234"><p align="center"><img src="images/anigif.gif" width="369" height="223" align="middle" /></p> <p align="center"></p></td> <td width="26%" height="503" rowspan="3"> <marquee behavior="scroll" direction="up"><img src="images/side_banner.jpg" width="216" height="648" alt="side_banner"/> </marquee> <marquee behavior="scroll" direction="up"><img src="images/side_banner.jpg" width="216" height="648" alt="side_banner"/> </marquee> <marquee behavior="scroll" direction="up"><img src="images/side_banner.jpg" width="216" height="648" alt="side_banner"/> </marquee> </td> </tr>

<tr> <td height="251"><table width="30%" border="0"> <tr> <td><img src="images/banner_news.jpg" width="397" height="84" /></td> </tr> <tr> <td background="glpa.jpg" height="185"><marquee behavior="scroll" direction="up" scrollamount="3" loop="repeat" onmouseover="this.stop();" onmouseout="this.start();"> <h5>&gt; Flight FK10012 Kolkata-Mumbai has Been Cancelled for Today.</h5> <h5>&gt; Flight AI23478 Delhi-Pune has been Delayed by 1 hour.</h5> <h5>&gt; Flight JA89789 Kolkata-Ahmedabad has Been Delayed by 2 hours.</h5> <h5>&gt; Flight SJ56784 Kolkata-Chennai has Been Cancelled for Today.</h5> <h5>&gt; Flight IG78436 Chennai-Ahmedabad has Been Cancelled for Today.</h5> </marquee></td> </tr> </table></td> </tr> <tr> <td width="34%"><img src="images/anigif2.gif" width="295" height="160" align="absmiddle" /></td> <td height="120"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#versio n=7,0,19,0" width="350" height="450"> <param name="movie" value="homeFlash9.swf" /> <param name="quality" value="high" /> <embed src="homeFlash9.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/xshockwave-flash" width="350" height="250"></embed>

</object></td> </tr> </table> </div>

<p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <div align="center"> <table width="65%" border="0"> <tr> <td width="23%" height="20" background="blue-scratched-texture.jpg"><div align="center" class="face"><font size="5"><strong>ezAirTickets</strong></font></div></td> <td width="23%" background="blue-scratched-texture.jpg"><div align="center" class="abpu"><font size="5"><strong>About The Site</strong></font></div></td> <td width="23%" background="blue-scratched-texture.jpg"><div align="center" class="Flight"><font size="5">Flight Partners</div></font></td> <td width="23%" background="blue-scratched-texture.jpg"><div align="center" class="follow"><font size="5">Follow Us</div></font></td> </tr> <tr> <td height="119" rowspan="2" background="blue_95.jpg"><h4 align="center"><a href="AboutUs.jsp">About Us</a></h4> <p align="center">&nbsp;</p></td> <td rowspan="2" background="blue_95.jpg"><h4 align="center"><a href="ContactUs.jsp">Contact Us</a></h4> <h4 align="center"><a href="PrivacyPolicy.jsp">Privacy Policy</a></h4> </td> <td rowspan="2" background="blue_95.jpg"><p align="center"><b><a href="flykingfisher.jsp">Fly Kingfisher </a> </p>

<p align="center"><b>Air India </p> <p align="center"><b>Jet Airways</p> <p align="center"><b>Spicejet</p> <p align="center"><b> Indigo </p> <p><br> </p></td> <td background="blue_95.jpg"><p align="center"><img src="images/follow us/FaceBook-icon.png" width="41" height="43" /> <img src="images/follow us/blogicon.png" width="44" height="44" /> <img src="images/follow us/Twitter-08.png" width="34" height="42" /> <img src="images/follow us/rss.png" width="40" height="41" /></p> <p align="center">&nbsp;</p></td> </tr> <tr> <td background="blue_95.jpg"><h4 align="center"><strong><cite><em>We Accept:</em></cite></strong></h4> <h2 align="center"><img src="images/We-Accept-Credit-Card.jpg" alt="" width="218" height="39" align="middle" /></h2></td> </tr> </table> </div> <p align="center">&nbsp;&nbsp;</p> <div align="center"> <font size="4"> <b> 2011 ezAirTickets.com. All Rights Reserved.</b></font></div> </body> </html>

home_header.jsp

<header>

<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript"> function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} }

function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; }

function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } </script>

</head>

<body background="oxford.jpg" onLoad="MM_preloadImages('images/home_button_ro.jpg','images/REGISTER_button_ro.jpg' ,'images/signin_button_ro.jpg','images/aboutus_button_ro.jpg','images/CONTACTus_button_r o.jpg','images/CUSTsUPP_button_ro.jpg','images/PrivacyPolicy_button_ro.jpg','images/homebuttons_ro.jpg','images/Register_ro.jpg','images/Signin_ro.jpg','images/Aboutus_ro.jpg','imag es/Contactus_ro.jpg','images/Privacy_ro.jpg','images/User_ro.jpg'),document.form1.otherCho ice.disabled=true, document.form1.month.disabled=true, document.form1.year.disabled=true"> <form action="" method="post" name="header"> <div align="center"> <table width="77%" border="0"> <tr> <td width="24%" height="185"><p><a href="index.jsp"><img src="images/main_logo.jpg" width="276" height="141"></a></p> <p align="center"><marquee behavior="scroll" direction="left"><strong>ezAirTickets.com</strong></marquee></p></td> <td width="46%"><img src="images/17071-rs.jpg" width="759" height="150"></td> <td width="30%"><h4 align="right"><a href="Register.jsp">Register</a> <a href="Login.jsp">Sign in</a></h4> <p align="right"><font size="4"><a href="adminLogin.jsp"><b>|Administrator| </b></a></font></p> <p align="right"><img src="images/google-button.gif" width="72" height="72" align="right"></p> <h5 align="right">GoogleSearch</h5> <p align="right">&nbsp;</p></td> </tr> </table> </div> &nbsp;&nbsp;

<div align="center"> <table width="79%" height="51" border="0"> <tr> <td width="14%" height="47"><a href="index.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','images/home-buttons_ro.jpg',1)"><img src="images/home-buttons.jpg" name="Image3" width="150" height="45" border="0"></a></td> <td width="14%"><a href="Register.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','images/Register_ro.jpg',1)"><img src="images/Register.jpg" name="Image4" width="150" height="45" border="0"></a></td> <td width="14%"><a href="Login.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','images/Signin_ro.jpg',1)"><img src="images/Signin.jpg" name="Image5" width="150" height="45" border="0"></a></td> <td width="14%"><a href="AboutUs.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','images/Aboutus_ro.jpg',1)"><img src="images/Aboutus.jpg" name="Image6" width="150" height="45" border="0"></a></td> <td width="14%"><a href="ContactUs.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','images/Contactus_ro.jpg',1)"><img src="images/Contactus.jpg" name="Image7" width="150" height="45" border="0"></a></td> <td width="16%"><a href="PrivacyPolicy.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','images/Privacy_ro.jpg',1)"><img src="images/Privacy.jpg" name="Image8" width="150" height="45" border="0"></a></td> <td width="14%"><a href="userAgreement.jsp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','images/User_ro.jpg',1)"><img src="images/User.jpg" name="Image9" width="150" height="45" border="0"></a></td> </tr> </table> </div> </form> </body>

</html>

footer.jsp
<head>

<footer>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> .face { font-family: Palatino Linotype, Book Antiqua, Palatino, serif; } .face strong { color: #FFF; } .abpu { color: #FFF; } .Flight { color: #FFF; } .follow { color: #FFF; } </style> </head>

<body> <div align="center">

<table width="65%" border="0"> <tr> <td width="23%" height="20" background="blue-scratched-texture.jpg"><div align="center" class="face"><font size="5"><strong>ezAirTickets</strong></font></div></td> <td width="23%" background="blue-scratched-texture.jpg"><div align="center" class="abpu"><font size="5"><strong>About The Site</strong></font></div></td> <td width="23%" background="blue-scratched-texture.jpg"><div align="center" class="Flight"><font size="5">Flight Partners</div></font></td> <td width="23%" background="blue-scratched-texture.jpg"><div align="center" class="follow"><font size="5">Follow Us</div></font></td> </tr> <tr> <td height="119" rowspan="2" background="blue_95.jpg"><h4 align="center"><a href="AboutUs.jsp">About Us</a></h4> <p align="center">&nbsp;</p></td> <td rowspan="2" background="blue_95.jpg"><h4 align="center"><a href="ContactUs.jsp">Contact Us</a></h4> <h4 align="center"><a href="PrivacyPolicy.jsp">Privacy Policy</a></h4> </td> <td rowspan="2" background="blue_95.jpg"><p align="center"><b><a href="flykingfisher.jsp">Fly Kingfisher </a> </p> <p align="center"><b>Air India </p> <p align="center"><b>Jet Airways</p> <p align="center"><b>Spicejet</p> <p align="center"><b> Indigo </p> <p><br> </p></td> <td background="blue_95.jpg"><p align="center"><img src="images/follow us/FaceBook-icon.png" width="41" height="43" /> <img src="images/follow us/blogicon.png" width="44" height="44" />

<img src="images/follow us/Twitter-08.png" width="34" height="42" /> <img src="images/follow us/rss.png" width="40" height="41" /></p> <p align="center">&nbsp;</p></td> </tr> <tr> <td background="blue_95.jpg"><h4 align="center"><strong><cite><em>We Accept:</em></cite></strong></h4> <h2 align="center"><img src="images/We-Accept-Credit-Card.jpg" alt="" width="218" height="39" align="middle" /></h2></td> </tr> </table> </div> <p align="center">&nbsp;&nbsp;</p> <div align="center"> <font size="4"> <b> 2011 ezAirTickets.com. All Rights Reserved.</b></font></div> </body> </html>

USER MODULE
Register.jsp
<html> <% String error=request.getParameter("error"); if(error==null || error=="null"){ error=""; } String err=request.getParameter("err"); if(err==null || err=="null"){ err="";

<User Registration Page>

} %> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Register</title> <script type="text/javascript"> function trim(s) { return s.replace( /^\s*/, "" ).replace( /\s*$/, "" ); }

function validate() { if(trim(document.form1.fn.value)=="") { alert("First Name Must Be Filled"); document.form1.fn.focus(); return false; } else if(trim(document.form1.add.value)=="") { alert("Address Must Be Filled"); document.form1.add.focus(); return false; } else if(trim(document.form1.ct.value)=="") {

alert("Enter Your City Name"); document.form1.ct.focus(); return false; } else if(trim(document.form1.st.value)=="") { alert("Enter Your State"); document.form1.st.focus(); return false; } else if(trim(document.form1.pin.value)=="") { alert("Area Code Must Be Filled"); document.form1.pin.focus(); return false; } else if(trim(document.form1.mob.value)=="" ) { alert("Contact No. Must Be Filled"); document.form1.mob.focus(); return false; } else if(trim(document.form1.land.value)=="") { alert("Contact No. Must Be Filled"); document.form1.land.focus(); return false;

} else if(trim(document.form1.uname.value)=="") { alert("Username Must Be Filled"); document.form1.uname.focus(); return false; } else if(trim(document.form1.psd.value)=="") { alert("Password Must Be Filled"); document.form1.psd.focus(); return false; } else if(trim(document.form1.cpwd.value)=="") { alert("Confirm Your Password"); document.form1.cpwd.focus(); return false; } } </script> </head> <body background="oxford.jpg"> <%@include file="home_header.jsp"%> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <div><%=error%></div> <div><%=err%></div>

<div align="center"> <table width="60%" border="1"> <tr> <td width="65%" height="23" background="131.jpg"><h4 align="center"><font color="white">Account Creation</font></h4></td> <td width="35%" background="131.jpg"><h4 align="center"><font color="white">Membership Benefits</font></h4></td> </tr> <tr> <td height="600" background="w000114.jpg"><strong><h3>To avail exclusive offers, added savings and more, kindly take a few minutes to complete the registration process below.</h3></strong> <form id="form1" name="form1" method="post" action="reg.jsp" onSubmit="return validate();"> &nbsp;&nbsp; <p> <label for="textfield"><b>First Name:</b></label> <input type="text" name="fn" id="textfield" /> </p> <p> <label for="textfield2"><b>Middle Name: </b></label> <input type="text" name="mn" id="textfield2" /> </p> <p> <label for="textfield3"><b>Last Name: </b></label> <input type="text" name="ln" id="textfield3" /> </p> <p> <label for="textfield31"><b>Address: </b></label>

<input type="text" name="add" id="textfield31" /> </p> <p> <label for="textfield4"><b>City : </b></label> <input type="text" name="ct" id="textfield4" /> </p> <p> <label for="textfield5"><b>State: </b></label> <input type="text" name="st" id="textfield5" /> </p> <p> <label for="textfield6"><b>District: </b></label> <input type="text" name="ds" id="textfield6" /> </p> <p> <label for="textfield7"><b>PIN: </b></label> <input type="text" name="pin" id="textfield7" /> </p> <p> <label for="textfield8"><b>Mobile Number: </b></label> <input type="text" name="mob" id="textfield8" /> </p> <p> <label for="textfield9"><b>Landline Number: (Along With The STD Code) </b></label> <input type="text" name="land" id="textfield9" /> </p>

<p> <label for="textfield11"><b>Username: </b></label> <input type="text" name="uname" id="textfield11" /> </p> <p> <label for="textfield12"><b>Password: </b>(Minimum 6 Characters)</label> <input type="password" name="psd" id="textfield12" /> </p> <p> <label for="textfield13"><b>Confirm Password: </b></label> <input type="password" name="cpwd" id="textfield13" /> </p> <p> <label for="textfield13"><b>Email Id: </b></label> <input type="text" name="eid" id="textfield13" /> </p> <p> <input type="checkbox" name="terms" id="checkbox" checked="checked"/> <label for="checkbox"></label> I agree to the Terms of Use and <a href="PrivacyPolicy.jsp">Privacy Policy.</a></p> <p> <div align="center"><input type="submit" name="button" id="button" value="Create My Account" /></div> </form></td> <td background="sky-blue.jpg"><p align="left"><strong><u>24x7 Customer Service</u></strong><br /> <br />

<b>We make getting in touch with us easy! Reach our travel specialists round-theclock via our Toll Free numbers, email and Live Web Chat facilities.</b></p> <p align="left"><strong><b><u>Free SMS Alerts</u></b></strong><br /> <br /> <b>Receive booking confirmations and alerts through our free SMS service. It's a convenient way to stay updated on the status of your booking. Also, be the first to know of the hottest travel deals.</b></p> <p align="left"><strong><u>Exclusive Promotions</u></strong><br /> <br /> <b>As a registered member, avail of exclusive promotional offers and last-minute deals on airfares, hotels, holiday packages, weekend breaks and more!</b></p> <p align="left">&nbsp;</p> <p align="left">&nbsp;</p> <p align="left">&nbsp;</p> <p align="left">&nbsp;</p> <p align="left">&nbsp;</p></td> </tr> </table> </div> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <%@include file="footer.jsp" %> </body> </html>

reg.jsp

<User Registration Logic Page>

<%@page import="java.sql.*"%> <%@ page import="java.lang.*" %> <html>

<head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title>

</head> <body background="oxford.jpg"> <jsp:useBean id="connect" scope="request" class="propack.connect" > <% String m1 = "Password length must be greater than 6."; String m2 = "Select a Unique Username"; Connection con = connect.getConnection(); String fname=request.getParameter("fn"); String mname=request.getParameter("mn"); String lname=request.getParameter("ln"); String ad=request.getParameter("add"); String cy=request.getParameter("ct"); String sa=request.getParameter("st"); String dt=request.getParameter("ds"); String pn=request.getParameter("pin"); String mb=request.getParameter("mob"); String ln=request.getParameter("land"); String us=request.getParameter("uname"); String ps2=request.getParameter("psd"); String cps=request.getParameter("cpwd"); String email=request.getParameter("eid"); int flag = 0; if(ps2.length()<6 ) response.sendRedirect("Register.jsp?error="+m1);

else { if(!(pn.length()==6)) response.sendRedirect("Register.jsp? error=Entered Area Code is Invalid"); else { if (!(mb.length()==10)) response.sendRedirect("Register.jsp? error=Entered Mobile No. is Invalid"); else { if (!(ln.length()==11)) response.sendRedirect("Register.jsp? error=Entered Landline No. is Invalid"); else { if(fname!="" && us!="" && ps2!="" && cps!="") { if(ps2.equals(cps)) { PreparedStatement ps1=con.prepareStatement("select * from reg_customer where username=?"); ps1.setString(1,us); ResultSet rs=ps1.executeQuery(); if(rs.next()) { flag = 1; err="+m2); } else { PreparedStatement ps=con.prepareStatement("insert into reg_customer values(?,?,?,?,?,?,?,?,?,?,?,?,?)"); ps.setString(1,fname); ps.setString(2,mname); ps.setString(3,lname); ps.setString(4,ad); ps.setString(5,cy); ps.setString(6,pn); response.sendRedirect("Register.jsp?

ps.setString(7,sa); ps.setString(8,dt); ps.setString(9,mb); ps.setString(10,ln); ps.setString(11,email); ps.setString(12,us); ps.setString(13,cps); ps.executeUpdate(); ps.close(); out.println(fname+" "+"Your Account is Successfully Created");%> <h1> <p><a href="Login.jsp">Login</a> with Your account..</p></h1> <% } else response.sendRedirect("Register.jsp?err=Password and Confirm Password didn't Match"); }}}}} %> </body> </jsp:useBean> </html> }

Login.jsp
<html> <% int flag = 0;

<User Login Page>

session.setAttribute("logstat", flag); String error=request.getParameter("error");

if(error==null || error=="null"){ error=""; } %> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Login Page</title> <link href="login-box.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> function trim(s) { return s.replace(/^\s*/,"").replace(/\s*$/,""); } function validate() { if(trim(document.frmLogin.un.value)=="") { alert("Username empty"); document.frmLogin.un.focus(); return false; } else if(trim(document.frmLogin.pwd.value)=="") { alert("password empty"); document.frmLogin.pwd.focus(); return false; }

} </script> </head> <body background="oxford.jpg"> <div align="center"> <%@include file="home_header.jsp"%> <table width="80%" border="0"> <tr> <td background="free_high_res_texture_280.jpg" width="52%" height="428"><h1><img src="images/userLoginDescLogo.gif" width="302" height="65"></h1> <p><img src="images/vg.hi.png" width="257" height="256"><img src="images/user_login.png" width="180" height="187"></p> <p>&nbsp;</p> </td> <td background="free_high_res_texture_280.jpg" width="48%"> <% int f=0; session.setAttribute("amount",f); %> <form name="frmLogin" onSubmit="return validate();" action="Login_logic.jsp" method="POST">

<div style="padding: 100px 0 0 250px;"> <h3><div align="center"><%= error %></div> </h3> <div id="login-box"> <H2>Login</H2> <br /> <br /> <div id="login-box-name" style="margin-top:20px;">Username:</div> <div id="login-box-field" style="margin-top:20px;">

<input name="un" class="form-login" title="Username" value="" size="30" maxlength="2048" /> </div> <div id="login-box-name">Password:</div> <div id="login-box-field"> <input name="pwd" type="password" class="form-login" title="Password" value="" size="30" maxlength="2048" /> </div> <br /> <span class="login-box-options"> <input type="checkbox" name="1" value="1"> Remember Me <br /> <br /> Not a Member? <a href="Register.jsp">Register Now </a><br /> &nbsp; <br> <input type="image" src="images/login-btn.png" width="103" height="42" style="margin-left:90px;" /> </div> </div>

</form></td> </tr> </table> </div> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <%@include file="footer.jsp" %>

</body>

</html>

login_logic.jsp

<User Login Logic page>

<%@page import="java.sql.*"%> <html> <% String error=request.getParameter("error"); if(error==null || error=="null"){ error=""; } %> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <jsp:useBean id="connect" scope="request" class="propack.connect" > <% String message="Logged Successfully"; String username= request.getParameter("un"); String password= request.getParameter("pwd"); session.setAttribute("thename",username); session.setAttribute("thepass",password); Connection con = connect.getConnection(); PreparedStatement ps1=con.prepareStatement("select * from reg_customer where username=? and password=?"); ps1.setString(1,username); ps1.setString(2,password);

ResultSet rs=ps1.executeQuery(); if(rs.next()) { int flag = 1; session.setAttribute("logstat", flag); session.setAttribute("thename",username); session.setAttribute("thepass",password); response.sendRedirect("home2.jsp?error="+message); } else { message="Username or Password not matched" ; response.sendRedirect("Login.jsp?error="+message); } %> </jsp:useBean> </body> </html>

myaccount.jsp

<Profile view page>

<%@page import="java.sql.*"%> <%@page import="java.util.*"%> <%@page import="java.lang.*"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>My Account</title> </head> <body background="oxford.jpg">

<div align="center"> <%@include file="header2.jsp"%></div> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>

<jsp:useBean id="connect" scope="request" class="propack.connect" > </jsp:useBean> <div align="center"> <table width="75%" border="0"> <tr> <td height="10" background="blue_95.jpg"><p> <% String message = "User Not Logged In"; String log = session.getAttribute("logstat").toString(); if(log.equals("0")) response.sendRedirect("Login.jsp?error="+message); %> <%!String fn,mn,ln,addn,pin,city,st,dt,mob,ll,ei,us,pw;%> <% String m1=(String)session.getAttribute("thename");%> </p> <h1>WELCOME <font color="blue" face="verdana" size="7"><%=m1%><font</h1> <jsp:useBean id="connect2" scope="request" class="propack.connect" > <% try{ Connection con=connect.getConnection(); String name=(String)session.getAttribute("thename");

String pass=(String)session.getAttribute("thepass"); PreparedStatement ps1=con.prepareStatement("select * from reg_customer where username=? and password=?"); ps1.setString(1,name); ps1.setString(2,pass); ResultSet rs=ps1.executeQuery(); if(rs.next()) { fn=rs.getString("f_name"); mn=rs.getString("m_name"); if (mn.equals("null")||mn.equals(null)) mn = " "; ln=rs.getString("l_name"); if (ln.equals("null")||ln.equals(null)) ln = " "; addn=rs.getString("addr"); if (addn.equals("null")||addn.equals(null)) addn = " "; city=rs.getString("city"); if (city.equals("null")||city.equals(null)) city = " "; pin=rs.getString("pin"); st=rs.getString("state"); dt=rs.getString("district"); if (dt.equals("null")||dt.equals(null)) dt = " "; mob=rs.getString("mobile"); if (mob.equals("null")||mob.equals(null)) mob = " "; ll=rs.getString("landline"); if (ll.equals("null")||ll.equals(null)) ll = " "; ei=rs.getString("emailid"); if (ei.equals("null")||ei.equals(null)) ei = " ";

us=rs.getString("username"); pw=rs.getString("password"); } ps1.close(); } catch(Exception e){out.println(e);} %> </jsp:useBean></td> </tr>

<tr> <td background="body-bg.jpg"><h1><a href="editProfile.jsp"><img src="images/profile-button.jpg" width="165" height="41" align="right" /></a></h1> <h1><font color="blue"><u>User Profile:</u></font></h1> <p> <b><h2><font color="green">Name:</font> <%= fn + " "+ mn +" "+ ln %>&nbsp;</h2></p> <p><b><h2><font color="green">Address: </font><%= addn %>&nbsp;</h2></p> <p><b><h2><font color="green">City: </font><%=city%>&nbsp;</h2></p> <p><b><h2><font color="green">District: </font><%= dt %>&nbsp;</h2></p> <p><b><h2><font color="green">State: </font><%= st %>&nbsp;</h2></p> <p><b><h2><font color="green">PIN code: </font><%= pin %>&nbsp;</h2></p> <p><b><h2><font color="green">Mobile Number: </font><%= mob %>&nbsp;</h2></p> <p><b><h2><font color="green">Land line Number: </font> <%= ll %>&nbsp;</h2></p> <p><b><h2><font color="green">email id: </font><%= ei %>&nbsp;</h2></p> </td>

</tr> </table> </div> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <%@include file="footer.jsp" %> </body> </html>

editProfile.jsp

<User Profile Editor Page>

<%@page import="java.sql.*"%> <%@page import="java.util.*"%> <%@page import="java.lang.*"%> <!DOCTYPE html> <html> <% String error=request.getParameter("error"); if(error==null || error=="null"){ error=""; } %> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Profile Edited</title>

</head> <body background="oxford.jpg"> <div align="center"> <%@include file="header2.jsp"%></div> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <div><%= error %></div> <%!String fna,mna,lna,addna,pinc,city1,sta,dit,mobi,lla,eid,usn,pwd;%> <% String m1=(String)session.getAttribute("thename");%> <h2>Welcome <%=m1%> </h2> <jsp:useBean id="connect" scope="request" class="propack.connect"> <% Connection con=connect.getConnection(); String name=(String)session.getAttribute("thename"); String pass=(String)session.getAttribute("thepass"); PreparedStatement ps1=con.prepareStatement("select * from reg_customer where username=? and password=?"); ps1.setString(1,name); ps1.setString(2,pass); ResultSet rs=ps1.executeQuery(); if(rs.next()) { fna=rs.getString("f_name"); mna=rs.getString("m_name"); lna=rs.getString("l_name"); addna=rs.getString("addr"); city1=rs.getString("city"); pinc=rs.getString("pin");

sta=rs.getString("state"); dit=rs.getString("district"); mobi=rs.getString("mobile"); lla=rs.getString("landline"); eid=rs.getString("emailid"); usn=rs.getString("username"); pwd=rs.getString("password"); } ps1.close(); %> </jsp:useBean> <div align="center">

<table width="70%" border="0"> <tr> <td background="131.jpg"> <div align="center"><font color="white" face="verdana" size="8">Edit & Update Profile</font></div></td> </tr> <tr> <td background="subtle_textures_8.jpg"><form action="updateProfile.jsp" method="post"> <h2 align="center">FIRST NAME: <input type="text" name="fn" value= "<%= fna %>" /> </h2> <h2 align="center">MIDDLE NAME: <input type="text" name="mn" value="<%=mna%>" /> </h2> <h2 align="center">LAST NAME: <input type="text" name="ln" value="<%=lna%>" />

</h2> <h2 align="center">ADDRESS: <input type="text" name="add" value="<%=addna%>" /> </h2> <h2 align="center">CITY: <input type="text" name="ct" value="<%=city1%>" /> </h2> <h2 align="center">STATE: <input type="text" name="st" value="<%=sta%>" /> </h2> <h2 align="center">DISTRICT: <input type="text" name="ds" value="<%=dit%>" /> </h2> <h2 align="center">PIN: <input type="text" name="pin" value="<%=pinc%>" /> </h2> <h2 align="center">MOBILE NO: <input type="text" name="mob" value="<%=mobi%>" /> </h2> <h2 align="center">LAND NO:. <input type="text" name="land" value="<%=lla%>" /> </h2> <h2 align="center">EMAIL ID <input type="text" name="eid" value="<%=eid%>" /> </h2> <h2 align="center">PASSWORD <input type="password" name="pwd" value="<%=pwd%>" />

</h2> <h2 align="center">CONFIRM PASSWORD <input type="password" name="cpwd" value="<%=pwd%>" /> </h2> <p align="center"> <input type="image" img="img" src="images/400_F_14848173_d0ShT1sKd5bvsRFCTTZxvV4WehG29wpc.jpg" width="101" height="39" /> </p> </form> </table> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <%@include file="footer.jsp" %> </body> </html>

updateProfile.jsp

<User Profile Updated Page>

<%@page import="java.sql.*"%> <%@ page import="java.lang.*" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Update Final</title> </head> <body background="oxford.jpg"> <jsp:useBean id="connect" scope="request" class="propack.connect" >

<% Connection con=connect.getConnection(); String fname=request.getParameter("fn"); String mname=request.getParameter("mn"); String lname=request.getParameter("ln"); String ad=request.getParameter("add"); String cy=request.getParameter("ct"); String pn=request.getParameter("pin"); String sa=request.getParameter("st"); String dt=request.getParameter("ds"); String mb=request.getParameter("mob"); String ln=request.getParameter("land"); String email=request.getParameter("eid"); String pwd = request.getParameter("pwd"); String cpwd = request.getParameter("cpwd"); String m1=(String)session.getAttribute("thename"); if(pwd.equals(cpwd)){ PreparedStatement ps=con.prepareStatement("UPDATE reg_customer set f_name=?,m_name=?,l_name=?,addr=?,city=?,pin=?,state=?,district=?,mobile=?,landline= ?,emailid=?,password=? WHERE username=?"); ps.setString(1, fname); ps.setString(2, mname); ps.setString(3, lname); ps.setString(4, ad); ps.setString(5, cy); ps.setString(6, pn); ps.setString(7, sa); ps.setString(8, dt); ps.setString(9, mb);

ps.setString(10, ln); ps.setString(11, email); ps.setString(12,pwd); ps.setString(13, m1); ps.executeUpdate(); ps.close(); %> <h1> Profile Updated </h1> <form action="myaccount.jsp" method="POST"> <input type="image" src="images/view_profile.png" /> </form> <%-- <a href="myaccount.jsp">Go to My account</a>--%> <% } else { String message="Sorry! Profile Can't Be Updated.Please Confirm The Password."; response.sendRedirect("editProfile.jsp?error="+message); } %> </jsp:useBean> </body> </html>

logout.jsp
<html> <head>

<Log Out Page>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head>

<body> <% int flag = 0; String message = " Logged Out Successfully"; session.setAttribute("logstat",flag); response.sendRedirect("index.jsp?error="+message); %> </body> </html>

TICKET BOOKING MODULE


flsearch_main.jsp <Flight Search Page>

<%@page import="java.sql.*"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>One Way Flight Search</title> </head> <body background="oxford.jpg"> <div align="center"> <%@include file="header2.jsp"%></div> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <% String fd = ""; int f=0;

String month=""; String day=""; String year=""; String month1=""; String day1=""; String year1=""; String hmsrc = request.getParameter("srchome"); session.setAttribute("sesrc", hmsrc); String hmdes = request.getParameter("deshome"); session.setAttribute("sedes", hmdes); String date=request.getParameter("input1"); for(int i=0;i<=2;i++) { if(date.charAt(i)!='/') { month=month+date.charAt(i); } } for(int i=3;i<=5;i++) { if(date.charAt(i)!= '/'){ day=day+date.charAt(i); } }

for(int i=6;i<=9;i++) { year=year+date.charAt(i); } int day11 = Integer.parseInt(day); int month11 = Integer.parseInt(month);

String dt1 = day + "/" + month + "/" + year ; session.setAttribute("onewaydate",dt1); String date2=request.getParameter("input2"); if(date2!=null) { f=1; for(int j=0;j<=2;j++) { if(date2.charAt(j)!='/') { month1=month1+date2.charAt(j); } } for(int j=3;j<=5;j++) { if(date2.charAt(j)!='/'){ day1=day1+date2.charAt(j); } } for(int j=6;j<=9;j++) { year1=year1+date2.charAt(j); }} else f=0; String dt2= day1 + "/" + month1 + "/" + year1 ; session.setAttribute("rday", day1); session.setAttribute("rmon", month1); session.setAttribute("returnwayshow", dt2);

session.setAttribute("ckret",f); %> <jsp:useBean id="connect" scope="request" class="propack.connect"> <% Connection con = connect.getConnection(); PreparedStatement ps = null; int c = connect.getcount(day11,month11); fd = connect.getday(c); if(fd.equalsIgnoreCase("Mon")) ps = con.prepareStatement ("select * from flight where source =? and destination =? and Mon = 'true'"); else { if(fd.equalsIgnoreCase("Tue")) ps = con.prepareStatement ("select * from flight where source =? and destination =? and Tue = 'true'"); else { if(fd.equalsIgnoreCase("Wed")) ps = con.prepareStatement ("select * from flight where source =? and destination =? and Wed = 'true'"); else { if(fd.equalsIgnoreCase("Thu")) ps = con.prepareStatement ("select * from flight where source =? and destination =? and Thu = 'true'"); else { if(fd.equalsIgnoreCase("Fri")) ps = con.prepareStatement ("select * from flight where source =? and destination =? and Fri = 'true'"); else { if(fd.equalsIgnoreCase("Sat")) ps = con.prepareStatement ("select * from flight where source =? and destination =? and Sat = 'true'");

else { if(fd.equalsIgnoreCase("Sun")) ps = con.prepareStatement ("select * from flight where source =? and destination =? and Sun = 'true'"); }}}}}} ps.setString(1, hmsrc); ps.setString(2, hmdes); ResultSet r = ps.executeQuery(); if(!r.next()) out.println("Nothing Found"); else { %> <form action="insertpassenger.jsp" method ="POST"> <div align="center"> <table width="50%" border="0"> <tr> <td><div align="center"> <h1>Enter Flight No. <input type="text" name="flightno" value="" /> </h1> <h1> <input type="image" src="images/button.png" alt="" width="169" height="40" align="bottom"></h1> </div></td> </tr> </table></div> </form> <p>&nbsp;&nbsp;&nbsp;&nbsp;</p> <p> <div align="center"> <table border="0"> <thead>

<tr> <th background="sky-blue.jpg" height="37"><h3>Flight</h3></th> <th background="sky-blue.jpg"><h3>Airline</h3></th> <th background="sky-blue.jpg"><h3>Source</h3></th> <th background="sky-blue.jpg"><h3>Destination</h3></th> <th background="sky-blue.jpg"><h3>Business Class Fare</h3></th> <th background="sky-blue.jpg"><h3>Economy Class Fare</h3></th> <th background="sky-blue.jpg"><h3>Departure Date</h3></th> <th background="sky-blue.jpg"><h3>Departure Time</h3></th> <th background="sky-blue.jpg"><h3>Arrival Time</h3></th> <th background="sky-blue.jpg"><h3>Business Seats</h3></th> <th background="sky-blue.jpg"><h3>Economy Seats</h3></th> </tr> </thead> <tbody> <tr> <td background="texture10.jpg"><font size="5"><b>< %=r.getString("Flight_no")%></b></font></td> <td background="texture10.jpg"><b><%=r.getString("airline_name") %></b></td> <td background="texture10.jpg"><b><%=r.getString("Source") %></b></td> <td background="texture10.jpg"><b><%=r.getString("Destination") %></b></td> <td background="texture10.jpg"><b><%=r.getString("bs_fare") %></b></td> <td background="texture10.jpg"><b><%=r.getString("ec_fare") %></b></td> <td background="texture10.jpg"><b><%=dt1%></b></td>

<td background="texture10.jpg"><b><%=r.getString("departure_time") %></b></td> <td background="texture10.jpg"><b><%=r.getString("arrival_time")%> </b></td> <td background="texture10.jpg"><b><%=r.getString("seat_bs_rem") %></b></td> <td background="texture10.jpg"><b><%=r.getString("seat_ec_rem") %></b></td> </tr> <% while(r.next()){ %> <tr> <td background="texture10.jpg"><font size="5"><b>< %=r.getString("Flight_no")%></b></font></td> <td background="texture10.jpg"><b><%=r.getString("airline_name") %></b></td> <td background="texture10.jpg"><b><%=r.getString("Source") %></b></td> <td background="texture10.jpg"><b><%=r.getString("Destination") %></b></td> <td background="texture10.jpg"><b><%=r.getString("bs_fare") %></b></td> <td background="texture10.jpg"><b><%=r.getString("ec_fare") %></b></td> <td background="texture10.jpg"><b><%=dt1%></b></td> <td background="texture10.jpg"><b><%=r.getString("departure_time") %></b></td> <td background="texture10.jpg"><b><%=r.getString("arrival_time")%> </b></td> <td background="texture10.jpg"><b><%=r.getString("seat_bs_rem") %></b></td> <td background="texture10.jpg"><b><%=r.getString("seat_ec_rem") %></b></td> </tr>

<% } %> </tbody> </table> <% } %> </div> </jsp:useBean>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <%@include file="footer.jsp" %> </body> </html>

insertpassenger.jsp Way >


<%

<Insert Passenger Details For One

String error=request.getParameter("error"); if(error==null || error=="null"){ error=""; } %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert Passenger Details</title> <script type="text/javascript"> function trim(s)

{ return s.replace(/^\s*/,"").replace(/\s*$/,""); } function validate() { if(trim(document.form1.fnam.value)=="") { alert("Enter Your First Name"); document.form1.fnam.focus(); return false; } else if(trim(document.form1.sex.value)=="") { alert("Enter Your Gender"); document.form1.sex.focus(); return false; } else if(trim(document.form1.age.value)=="") { alert("Enter Your Age"); document.form1.age.focus(); return false; } else if(trim(document.form1.phne.value)=="") { alert("Enter Contact No. Details"); document.form1.phne.focus();

return false; } else if(trim(document.form1.email.value)=="") { alert("Enter Email ID"); document.form1.email.focus(); return false; } else if(trim(document.form1.stype.value)=="") { alert("Enter Your Seat Choice"); document.form1.stype.focus(); return false; } else if(trim(document.form1.paymode.value)=="") { alert("Enter Payment Mode"); document.form1.paymode.focus(); return false; } else if(trim(document.form1.ccno.value)=="") { alert("Enter Your Card No./Acc. No."); document.form1.ccno.focus(); return false; } else if(trim(document.form1.cvvno.value)=="")

{ alert("Enter Your Card Password"); document.form1.cvvno.focus(); return false; } } </script> </head> <body background="oxford.jpg"> <div align="center"> <%@include file="header2.jsp"%></div> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>

<div><%=error%></div> <div align="center"> Amount :<%=session.getAttribute("amount")%> <% String message = "User Not Logged In"; String log = session.getAttribute("logstat").toString(); if(log.equals("0")) response.sendRedirect("Login.jsp?error="+message); String h= request.getParameter("flightno"); session.setAttribute("f_no",h);%> <div align="center"> <table width="40%" border="0"> <tr>

<td background="subtle_textures_8.jpg"><h1><div align="center">Customer Details for Booking Ticket:</div> </h1></td> </tr> </table> </div> <table width="60%" border="0"> <tr> <td background="free_high_res_texture_280.jpg"><form method="POST" action="insertpassengerlogic.jsp" name="form1" onSubmit="return validate();"> <h3 align="center">First Name <input type="text" name="fnam" value="" size="30" /> </h3> <h3 align="center"> Middle Name <input type="text" name="mnam" value="" size="30" /> </h3> <h3 align="center"> Last Name <input type="text" name="lnam" value="" size="30" /> </h3> <h3 align="center">Sex <select name="sex"> <option>M</option> <option>F</option> </select> Age <input type="text" name="age" value="" size="4" /> </h3> <h3 align="center">Phone <input type="text" name="phne" value="" size="25" />

</h3> <h3 align="center">Email ID <input type="text" name="email" value="" size="35" /> </h3> <h3 align="center">Flight No <input type="text" name="flno" value="<%=h%>" readonly="readonly" /> </h3> <h3 align="center">Seat Type <select name="stype"> <option>Business</option> <option>Economy</option> </select> <p> &nbsp;&nbsp;&nbsp;</p> </h3> <p align="center"><font color="blue" size="6"><u>Payment Options:</u></font> </p> <h3 align="center">Payment Mode : <select name="paymode"> <option>Credit Card</option> <option>Debit Card</option> <option>Net Banking</option> </select> </h3> <h3 align="center">Card No/Bank Account No.: <input type="text" name="ccno" value="" /> </h3> <h3 align="center">CVV No /Password :

<input type="password" name="cvvno" value="" size="2" /> </h3> <p align="center"> <input type="image" src="images/continue-button.png" width="204" height="40" /> </form>&nbsp;</td> </tr> </table> </div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <%@include file="footer.jsp" %> </body> </html>

insertpassengerlogic.jsp One Way Logic >


<%@page import="java.sql.*"%> <html> <head>

<Insert Passenger Details for

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>insert passenger logic</title> </head> <body> <% String message = "User Not Logged In"; String log = session.getAttribute("logstat").toString(); if(log.equals("0"))

response.sendRedirect("Login.jsp?error="+message); %> <% int ectseat=0; int bsseatrem=0 ; int ecseatrem=0; int sum = 0; int bstseat=0; String seatno; int bsfare =0; int ecfare =0; String dtim = ""; String bookid=""; String msg ="Seat booked"; String fname = request.getParameter("fnam"); String mname = request.getParameter("mnam"); String lname = request.getParameter("lnam"); String sex = request.getParameter("sex"); String age = request.getParameter("age"); String phne = request.getParameter("phne"); String emailid = request.getParameter("email"); String flno = request.getParameter("flno"); String stype = request.getParameter("stype"); String sorce = session.getAttribute("sesrc").toString(); String dest = session.getAttribute("sedes").toString(); String temdat = session.getAttribute("onewaydate").toString(); String cardno = request.getParameter("ccno"); String paymode = request.getParameter("paymode");

String pass = request.getParameter("cvvno"); %> <jsp:useBean id="connect" scope="request" class="propack.connect" > <% Connection con1 = connect.getConnection(); PreparedStatement ps2 =null; PreparedStatement ps = con1.prepareStatement ("select * from passenger"); ResultSet r1 = ps.executeQuery(); int ind=1; while(r1.next()) ind++; String nbookid = String.valueOf(ind); if (nbookid == null || nbookid == "null") bookid = "ON00000001"; else{ switch ( nbookid .length()){ case 1: bookid = "ON0000000"+nbookid; break; case 2: bookid = "ON000000"+nbookid; break; case 3: bookid = "ON00000"+nbookid; break; case 4: bookid = "ON0000"+nbookid; break; case 5: bookid = "ON000"+nbookid; break; case 6: bookid = "ON00"+nbookid; break; case 7: bookid = "ON0"+nbookid; break; } session.setAttribute("tktno",bookid);} ps.close(); PreparedStatement ps1 = con1.prepareStatement ("select * from flight where flight_no=? and source =? and destination =?");

ps1.setString(1,flno ); ps1.setString(2,sorce); ps1.setString(3,dest); ResultSet r2 = ps1.executeQuery(); if(r2.next()){ bstseat = Integer.parseInt(r2.getString("Tot_bs_st")); ectseat = Integer.parseInt(r2.getString("Tot_ec_st")); bsfare = r2.getInt("Bs_fare"); ecfare = r2.getInt("Ec_fare"); dtim = r2.getString("departure_time"); session.setAttribute("deptime", dtim); bsseatrem = Integer.parseInt(r2.getString("Seat_bs_rem")); ecseatrem = Integer.parseInt(r2.getString("Seat_ec_rem"));} if(stype.equals("Business")){ int st = bstseat - bsseatrem; seatno = "BS" + String.valueOf(st); bsseatrem=bsseatrem-1; sum = sum + bsfare; session.setAttribute("amount",sum);

} else { int st = ectseat - ecseatrem; seatno = "EC" + String.valueOf(st); ecseatrem = ecseatrem-1; sum = sum + ecfare; }

ps1.close(); PreparedStatement ps3 = con1.prepareStatement ("insert into passenger values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); ps3.setString(1,bookid); ps3.setString(2,temdat); ps3.setString(3,flno); ps3.setString(4,sorce); ps3.setString(5,dest); ps3.setString(6,fname); ps3.setString(7,mname); ps3.setString(8,lname); ps3.setString(9,sex); ps3.setString(10,age); ps3.setString(11,phne); ps3.setString(12,emailid); ps3.setString(13,dtim); ps3.setString(14,seatno); ps3.executeUpdate();

if(stype.equals("Business")){ if(bsseatrem>=0){ ps2 = con1.prepareStatement ("update flight set Seat_bs_rem =? where flight_no=?"); ps2.setInt(1,bsseatrem); ps2.setString(2,flno); ps2.executeUpdate(); } else { msg ="No Seat Available";

response.sendRedirect("insertpassenger.jsp?error="+msg); }} else { if(ecseatrem>=0){ ps2 = con1.prepareStatement ("update flight set Seat_ec_rem =? where flight_no=?"); ps2.setInt(1,ecseatrem); ps2.setString(2,flno); ps2.executeUpdate(); } else { msg ="No Seat Available"; response.sendRedirect("insertpassenger.jsp?error="+msg); }}

PreparedStatement ps4 = con1.prepareStatement("insert into payment values(?,?,?,?)"); ps4.setString(1,bookid); ps4.setString(2,paymode); ps4.setString(3,cardno); ps4.setInt(4,sum); ps4.executeUpdate(); response.sendRedirect("ticketinfo.jsp"); </jsp:useBean> </body> </html> %>

ticketinfo.jsp <Information About the Booked Ticket & Transaction Done>

<%@page import="java.sql.*"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Transaction Done</title> </head> <body background="oxford.jpg"> <div align="center"> <%@include file="header2.jsp"%></div> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p> <% String message = "User Not Logged In"; String log = session.getAttribute("logstat").toString(); if(log.equals("0")) response.sendRedirect("Login.jsp?error="+message); %> <% int k = Integer.parseInt(session.getAttribute("ckret").toString()); %> </p> <h1 align="center">TRANSACTION DONE:</h1>

<h1 align="center"><br> <img src="Create ticket.png" width="66" height="64"><a href="finalticket.jsp" target="_blank"> Download Booked Ticket</a> <% if(k==1) { %> </h1> <h3 align="center">&nbsp;</h3>

<h1 align="center"><img src="Airplane.png" width="66" height="62"><a href="retflightsearch.jsp">Book a Return Flight</a> <% k=0; session.setAttribute("ckret", k); } %> </h1>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <%@include file="footer.jsp" %> </body> </html>

retflightsearch.jsp

<Return Flight Search Page>

<%@page import="java.sql.*"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Return Flight Search</title> <script type="text/javascript"> function trim(s) { return s.replace(/^\s*/,"").replace(/\s*$/,""); } function validate()

{ if(trim(document.form2.flightno.value)=="") { alert("Enter Your First Name"); document.form2.flightno.focus(); return false; } } </script> </head> <body background="oxford.jpg"> <div align="center"> <%@include file="header2.jsp"%></div> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <% String fd = " "; String des = session.getAttribute("sesrc").toString(); String src = session.getAttribute("sedes").toString(); String dshow = session.getAttribute("returnwayshow").toString(); int day = Integer.parseInt(session.getAttribute("rday").toString()); int mon = Integer.parseInt(session.getAttribute("rmon").toString()); %> <jsp:useBean id="connect" scope="request" class="propack.connect"> <% Connection con = connect.getConnection(); PreparedStatement ps = null; int q = connect.getcount(day,mon); fd = connect.getday(q); if(fd.equalsIgnoreCase("Mon"))

ps = con.prepareStatement ("select * from flight where source =? and destination =? and Mon = 'true'"); else { if(fd.equalsIgnoreCase("Tue")) ps = con.prepareStatement ("select * from flight where source =? and destination =? and Tue = 'true'"); else { if(fd.equalsIgnoreCase("Wed")) ps = con.prepareStatement ("select * from flight where source =? and destination =? and Wed = 'true'"); else { if(fd.equalsIgnoreCase("Thu")) ps = con.prepareStatement ("select * from flight where source =? and destination =? and Thu = 'true'"); else { if(fd.equalsIgnoreCase("Fri")) ps = con.prepareStatement ("select * from flight where source =? and destination =? and Fri = 'true'"); else { if(fd.equalsIgnoreCase("Sat")) ps = con.prepareStatement ("select * from flight where source =? and destination =? and Sat = 'true'"); else { if(fd.equalsIgnoreCase("Sun")) ps = con.prepareStatement ("select * from flight where source =? and destination =? and Sun = 'true'"); }}}}}} ps.setString(1, src); ps.setString(2, des); ResultSet r = ps.executeQuery();

if(!r.next()) {

%><h1><div align="center"><font color="red"><%="Sorry! No Flights Available. Want to "%><a href="home2.jsp">Search Again</a></font></div></h1> <% } else { %> <form action="insertpassretrn.jsp" method ="POST" name="form2" onSubmit="return validate();"> <div align="center"> <table width="50%" border="0"> <tr> <td><div align="center"> <h1>Enter Flight No. <input type="text" name="flightno" value="" /> </h1> <h1> <input type="image" src="images/button.png" alt="" width="169" height="40" align="bottom"></h1> </div></td> </tr> </table></div> </form> <p>&nbsp;&nbsp;&nbsp;&nbsp;</p> <p> <div align="center"> <table border="0"> <thead> <tr> <th background="sky-blue.jpg" height="37"><h3>Flight</h3></th> <th background="sky-blue.jpg"><h3>Airline</h3></th> <th background="sky-blue.jpg"><h3>Source</h3></th>

<th background="sky-blue.jpg"><h3>Destination</h3></th> <th background="sky-blue.jpg"><h3>Business Class Fare</h3></th> <th background="sky-blue.jpg"><h3>Economy Class Fare</h3></th> <th background="sky-blue.jpg"><h3>Departure Date</h3></th> <th background="sky-blue.jpg"><h3>Departure Time</h3></th> <th background="sky-blue.jpg"><h3>Arrival Time</h3></th> <th background="sky-blue.jpg"><h3>Business Seats</h3></th> <th background="sky-blue.jpg"><h3>Economy Seats</h3></th> </tr> </thead> <tbody> <tr> <td background="texture10.jpg"><font size="5"><b>< %=r.getString("Flight_no")%></b></font></td> <td background="texture10.jpg"><b><%=r.getString("airline_name") %></b></td> <td background="texture10.jpg"><b><%=r.getString("Source") %></b></td> <td background="texture10.jpg"><b><%=r.getString("Destination") %></b></td> <td background="texture10.jpg"><b><%=r.getString("bs_fare") %></b></td> <td background="texture10.jpg"><b><%=r.getString("ec_fare") %></b></td> <td background="texture10.jpg"><b><%=dshow%></b></td> <td background="texture10.jpg"><b><%=r.getString("departure_time") %></b></td> <td background="texture10.jpg"><b><%=r.getString("arrival_time")%> </b></td> <td background="texture10.jpg"><b><%=r.getString("seat_bs_rem") %></b></td>

<td background="texture10.jpg"><b><%=r.getString("seat_ec_rem") %></b></td> </tr> <% while(r.next()){ %> <tr> <td background="texture10.jpg"><font size="5"><b>< %=r.getString("Flight_no")%></b></font></td> <td background="texture10.jpg"><b><%=r.getString("airline_name") %></b></td> <td background="texture10.jpg"><b><%=r.getString("Source") %></b></td> <td background="texture10.jpg"><b><%=r.getString("Destination") %></b></td> <td background="texture10.jpg"><b><%=r.getString("bs_fare") %></b></td> <td background="texture10.jpg"><b><%=r.getString("ec_fare") %></b></td> <td background="texture10.jpg"><b><%=dshow%></b></td> <td background="texture10.jpg"><b><%=r.getString("departure_time") %></b></td> <td background="texture10.jpg"><b><%=r.getString("arrival_time")%> </b></td> <td background="texture10.jpg"><b><%=r.getString("seat_bs_rem") %></b></td> <td background="texture10.jpg"><b><%=r.getString("seat_ec_rem") %></b></td> </tr> <% } %> </tbody> </table> <% } %>

</div> </jsp:useBean>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <%@include file="footer.jsp" %> </body> </html>

insertpassreturn.jsp return Journey>

<Insert Passenger Details for

<%@page contentType="text/html" pageEncoding="UTF-8"%> <% String error=request.getParameter("error"); if(error==null || error=="null"){ error=""; } %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert Return Passenger Details</title> <script type="text/javascript"> function trim(s) { return s.replace(/^\s*/,"").replace(/\s*$/,""); }

function validate() { if(trim(document.form1.fnam.value)=="") { alert("Enter Your First Name"); document.form1.fnam.focus(); return false; } else if(trim(document.form1.sex.value)=="") { alert("Enter Your Gender"); document.form1.sex.focus(); return false; } else if(trim(document.form1.age.value)=="") { alert("Enter Your Age"); document.form1.age.focus(); return false; } else if(trim(document.form1.phne.value)=="") { alert("Enter Contact No. Details"); document.form1.phne.focus(); return false; } else if(trim(document.form1.email.value)=="")

{ alert("Enter Email ID"); document.form1.email.focus(); return false; } else if(trim(document.form1.stype.value)=="") { alert("Enter Your Seat Choice"); document.form1.stype.focus(); return false; } else if(trim(document.form1.paymode.value)=="") { alert("Enter Payment Mode"); document.form1.paymode.focus(); return false; } else if(trim(document.form1.ccno.value)=="") { alert("Enter Your Card No./Acc. No."); document.form1.ccno.focus(); return false; } else if(trim(document.form1.cvvno.value)=="") { alert("Enter Your Card Password"); document.form1.cvvno.focus();

return false; } } </script> </head> <body background="oxford.jpg"> <div align="center"> <%@include file="header2.jsp"%></div> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>

<div><%=error%></div> <div align="center">

Amount :<%=session.getAttribute("amount")%> <div><%=error%></div> <% String message = "User Not Logged In"; String log = session.getAttribute("logstat").toString(); if(log.equals("0")) response.sendRedirect("Login.jsp?error="+message); String h= request.getParameter("flightno"); %>

<div align="center"> <table width="40%" border="0"> <tr>

<td background="subtle_textures_8.jpg"><h1><div align="center">Customer Details for Booking Ticket:</div> </h1></td> </tr> </table> </div> <table width="60%" border="0"> <tr> <td background="free_high_res_texture_280.jpg"><form method="POST" action="insertpassretrnlogic.jsp"> <h3 align="center">First Name <input type="text" name="fnam" value="" size="30" /> </h3> <h3 align="center"> Middle Name <input type="text" name="mnam" value="" size="30" /> </h3> <h3 align="center"> Last Name <input type="text" name="lnam" value="" size="30" /> </h3> <h3 align="center">Sex <select name="sex"> <option>M</option> <option>F</option> </select> Age <input type="text" name="age" value="" size="4" /> </h3> <h3 align="center">Phone <input type="text" name="phne" value="" size="25" />

</h3> <h3 align="center">Email ID <input type="text" name="email" value="" size="35" /> </h3> <h3 align="center">Flight No <input type="text" name="flno" value="<%=h%>" readonly="readonly" /> </h3> <h3 align="center">Seat Type <select name="stype"> <option>Business</option> <option>Economy</option> </select> <p> &nbsp;&nbsp;&nbsp;</p> </h3> <p align="center"><font color="blue" size="6"><u>Payment Options:</u></font> </p> <h3 align="center">Payment Mode : <select name="paymode"> <option>Credit Card</option> <option>Debit Card</option> <option>Net Banking</option> </select> </h3> <h3 align="center">Card No/Bank Account No.: <input type="text" name="ccno" value="" /> </h3> <h3 align="center">CVV No /Password :

<input type="password" name="cvvno" value="" size="2" /> </h3> <p align="center"> <input type="image" src="images/continue-button.png" width="204" height="40" /> </form>&nbsp;</td> </tr> </table> </div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <%@include file="footer.jsp" %> </body> </html>

insertpassreturnlogic.jsp return Journey Logic>


<%@page import="java.sql.*"%>

<Insert Passenger Details for

<%@page contentType="text/html" pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>insert passenger logic</title> </head> <body> <% String message = "User Not Logged In"; String log = session.getAttribute("logstat").toString();

if(log.equals("0")) response.sendRedirect("Login.jsp?error="+message); %> <% int ectseat=0; int bsseatrem=0 ; int ecseatrem=0; int sum = 0; int bstseat=0; String seatno; int bsfare = 0; int ecfare = 0; String dtim = ""; String bookid=""; String msg =""; String cardno = request.getParameter("ccno"); String paymode = request.getParameter("paymode"); String pass = request.getParameter("cvvno"); String fname = request.getParameter("fnam"); String mname = request.getParameter("mnam"); String lname = request.getParameter("lnam"); String sex = request.getParameter("sex"); String age = request.getParameter("age"); String phne = request.getParameter("phne"); String emailid = request.getParameter("email"); String flno = request.getParameter("flno"); String stype = request.getParameter("stype"); String sorce = session.getAttribute("sedes").toString();

String dest = session.getAttribute("sesrc").toString(); String temdat = session.getAttribute("returnwayshow").toString(); %> <jsp:useBean id="connect" scope="request" class="propack.connect" > <% Connection con1 = connect.getConnection(); PreparedStatement ps2 = null; PreparedStatement ps = con1.prepareStatement ("select * from passenger"); ResultSet r1 = ps.executeQuery(); int ind=1; while(r1.next()) ind++; String nbookid = String.valueOf(ind); if (nbookid == null || nbookid == "null") bookid = "RE00000001"; else{ switch ( nbookid .length()){ case 1: bookid = "RE0000000"+nbookid; break; case 2: bookid = "RE000000"+nbookid; break; case 3: bookid = "RE00000"+nbookid; break; case 4: bookid = "RE0000"+nbookid; break; case 5: bookid = "RE000"+nbookid; break; case 6: bookid = "RE00"+nbookid; break; case 7: bookid = "RE0"+nbookid; break; } session.setAttribute("tktno",bookid);} ps.close();

PreparedStatement ps1 = con1.prepareStatement ("select * from flight where flight_no=? and source =? and destination =?"); ps1.setString(1,flno ); ps1.setString(2,sorce); ps1.setString(3,dest); ResultSet r2 = ps1.executeQuery(); if(r2.next()){ bstseat = Integer.parseInt(r2.getString("Tot_bs_st")); ectseat = Integer.parseInt(r2.getString("Tot_ec_st")); bsfare = r2.getInt("Bs_fare"); ecfare = r2.getInt("Ec_fare"); dtim = r2.getString("departure_time"); session.setAttribute("deptime", dtim); bsseatrem = Integer.parseInt(r2.getString("Seat_bs_rem")); ecseatrem = Integer.parseInt(r2.getString("Seat_ec_rem"));} if(stype.equals("Business")){ int st = bstseat - bsseatrem; seatno = "BS" + String.valueOf(st); bsseatrem=bsseatrem-1; sum = sum + bsfare;

} else { int st = ectseat - ecseatrem; seatno = "EC" + String.valueOf(st); ecseatrem = ecseatrem-1; sum = sum + ecfare;

} ps1.close(); PreparedStatement ps3 = con1.prepareStatement ("insert into passenger values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); ps3.setString(1,bookid); ps3.setString(2,temdat); ps3.setString(3,flno); ps3.setString(4,sorce); ps3.setString(5,dest); ps3.setString(6,fname); ps3.setString(7,mname); ps3.setString(8,lname); ps3.setString(9,sex); ps3.setString(10,age); ps3.setString(11,phne); ps3.setString(12,emailid); ps3.setString(13,dtim); ps3.setString(14,seatno); ps3.executeUpdate(); ps3.close(); if(stype.equals("Business")){ if(bsseatrem>=0){ ps2 = con1.prepareStatement ("update flight set Seat_bs_rem =? where flight_no=?"); ps2.setInt(1,bsseatrem); ps2.setString(2,flno); ps2.executeUpdate(); }

else { msg ="No Seat Available"; response.sendRedirect("insertpassenger.jsp?error="+msg); }} else { if(ecseatrem>=0){ ps2 = con1.prepareStatement ("update flight set Seat_ec_rem =? where flight_no=?"); ps2.setInt(1,ecseatrem); ps2.setString(2,flno); ps2.executeUpdate(); } else { msg ="No Seat Available"; response.sendRedirect("insertpassenger.jsp?error="+msg); }} ps2.close(); PreparedStatement ps4 = con1.prepareStatement("insert into payment values(?,?,?,?)"); ps4.setString(1,bookid); ps4.setString(2,paymode); ps4.setString(3,cardno); ps4.setInt(4,sum); ps4.executeUpdate(); ps4.close(); response.sendRedirect("ticketinfo.jsp");%> </jsp:useBean> </body> </html>

finalticket.jsp

<Ticket Presentation Page>

<%@page import="java.sql.*"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Final Ticket</title> <style type="text/css"> .dd { color: #F00; } </style> <script> function myprintfunction() { window.print(); } </script> </head> <body> <div align="center"> <table width="62%" border="0"> <tr> <td colspan="3"><% String message = "User Not Logged In"; String log = session.getAttribute("logstat").toString(); if(log.equals("0")) response.sendRedirect("index.jsp?error="+message); %>

<% String ftno = session.getAttribute("tktno").toString();%> <jsp:useBean id="connect" scope="request" class="propack.connect" > <% Connection con = connect.getConnection();

PreparedStatement ps = con.prepareStatement("select * from passenger where ticket_no=?"); ps.setString(1,ftno); ResultSet rs = ps.executeQuery(); if(rs.next()){ String tk = rs.getString("ticket_no"); String dd = rs.getString("departure_date"); String fl = rs.getString("flight_no"); String s = rs.getString("source"); String d = rs.getString("destination"); String fn = rs.getString("first_name"); String mn = rs.getString("mid_name"); String ln = rs.getString("last_name"); String sx = rs.getString("sex"); String ag = rs.getString("age"); String pn = rs.getString("phone_no"); String em = rs.getString("email"); String dt = rs.getString("departure_time"); String sn = rs.getString("seat_no");

%> <img src="images/main_logo.jpg" width="185" height="102">

<td><h2 align="center">Flight Boarding Pass (eTicket)</h2></td> </tr> <tr> <td bgcolor="grey" colspan="4"><font color="white"><b>Booking Details</font></b></td> </tr> <tr> <td colspan="2"><p><img src="barcode.jpg" width="168" height="113"></p> <h3 align="center" class="dd">TICKET NO:</h3> <p align="center"><b>Ticket No. :<%= tk%> </b></p></td> <td colspan="2"><h4>Departure Date :<%= dd%></h4> <h4>Name :<%=fn%> <%=mn%> <%=ln%></h4> <h4>Age :<%= ag%></h4> <h4>Sex :<%= sx%></h4> <h4>Phone No. :<%= pn%></h4> <h4>Email ID :<%= em%></h4></td> </tr> <tr> <td bgcolor="red" height="23" colspan="4"><font color="white"><b>Flight Details:</font></b></td> </tr> <tr> <td width="23%" height="34">&nbsp;</td> <td bgcolor="grey" width="17%"> <div align="center"><font color="white"> Flight </font></div></td> <td bgcolor="grey" width="29%"><div align="left"> <img src="tcm.gif" width="25" height="26"><font color="white"><b> Departing </b> </font> </div></td> <td bgcolor="grey" width="31%"><div align="left"> <img src="tcm.gif" width="28" height="27"><font color="white"><b>Arriving </b> </font> </div></td>

</tr> <tr> <td height="99"><img src="barcode.jpg" width="145" height="83"></td> <td><h4>Flight No. :<%=fl %></h4> <h4>Seat No. :<%= sn%> </h4></td> <td><h4>Source :<%= s%> </h4> <h4>Departure Date :<%= dd%></h4> <h4>Departure Time :<%=dt %> </h4></td> <td><h4>Destination :<%=d %></h4> <h4>Arrival Date: <%= dd%> <% } %> <% String f1=session.getAttribute("f_no").toString(); PreparedStatement ps1 = con.prepareStatement("select * from flight where flight_no=?"); ps1.setString(1,f1); ResultSet rs1=ps1.executeQuery(); if(rs1.next()){ String ar_time=rs1.getString("arrival_time"); %> </h4> <h4>Arrival Time: <%= ar_time%></h4></td> </tr> </table> </div> </jsp:useBean></td> <p>&nbsp;</p> <% } %>

<div align="center"> <input type="image" src="images/printButton.png" onClick="myprintfunction();"></div> </body> </html>

cancelticket.jsp

<User Ticket Cancel Page>

<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Cancel Ticket</title> </head>

<body background="oxford.jpg"> <%@include file="home_header.jsp"%> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>

<div align="center"> <table width="70%" border="0"> <tr> <td><h1 align="center">Cancel Booking</h1></td> </tr> <tr> <td height="125"> <form method="get" action="cancelticketlogic.jsp">

<h2 align="center"> <img src="images/remove-ticket.png" width="64" height="60" /> Enter Ticket Number: <input type="text" name="tn" value="" /> <input type="image" src="images/Cancel Booking.gif" name="b1" /> </h2> </form>&nbsp;</td> </tr> </table> </div>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <%@include file="footer.jsp" %> </body> </html>

cancelticketlogic.jsp
<%@page import="java.sql.*"%>

<User Ticket Cancel Logic>

<%@page contentType="text/html" pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body background="oxford.jpg"> <%@include file="home_header.jsp"%> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>

<% String fn =""; String sn = ""; int bsn=0; int esn=0; String ticketno=request.getParameter("tn"); %> <jsp:useBean id="connect" scope="request" class="propack.connect" /> <% Connection con1 = connect.getConnection(); PreparedStatement ps=con1.prepareStatement("select * from passenger where ticket_no=?"); ps.setString(1,ticketno); ResultSet rs=ps.executeQuery(); if(rs.next()) { fn=rs.getString("flight_no"); sn=rs.getString("seat_no"); PreparedStatement ps1=con1.prepareStatement("delete from payment where ticket_no=?"); ps1.setString(1,ticketno); ps1.executeUpdate(); PreparedStatement ps2=con1.prepareStatement("select * from flight where flight_no=?"); ps2.setString(1,fn); ResultSet rs1=ps2.executeQuery(); if(rs1.next()) { bsn=rs1.getInt("seat_bs_rem"); esn = rs1.getInt("seat_ec_rem"); } if(sn.startsWith("BS")){ PreparedStatement ps3 = con1.prepareStatement ("update flight set Seat_bs_rem =? where flight_no=?"); bsn++;

ps3.setInt(1,bsn); ps3.setString(2,fn); ps3.executeUpdate(); } else { if(sn.startsWith("EC")){ PreparedStatement ps4 = con1.prepareStatement ("update flight set Seat_ec_rem =? where flight_no=?"); esn++; ps4.setInt(1,esn); ps4.setString(2,fn); ps4.executeUpdate(); } } PreparedStatement ps5=con1.prepareStatement("delete from passenger where ticket_no=?"); ps5.setString(1,ticketno); ps5.executeUpdate(); %> <h1><div align="center"><font color="red"> <%="Your Ticket Has Been Cancelled"%> </font></div></h1> <% } else { %> <h1><div align="center"><font color="red"> <%="Your Ticket Number Is Not Valid"%> </font></div></h1> <% } %>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <%@include file="footer.jsp" %> </body> </html>

ADMIN MODULE:
adminLogin.jsp
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Administrator Login</title> <link href="admin_login.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> function trim(s) { return s.replace(/^\s*/,"").replace(/\s*$/,""); } function validate() { if(trim(document.adminLogin.un.value)=="") { alert("Login Empty"); document.adminLogin.un.focus(); return false; } else if(trim(document.adminLogin.pwd.value)=="") { alert("Password Empty"); document.adminLogin.pwd.focus(); return false; }

<Admin Login Page>

} </script> </head> <body> <body background="oxford.jpg"> <div align="center"> <%@include file="home_header.jsp"%> <table width="80%" border="0"> <tr> <td background="free_high_res_texture_280.jpg" width="52%" height="428"><h1><img src="images/Administrator Logo.jpg" width="302" height="65"></h1> <p><img src="images/Administrator.jpg" width="257" height="256"><img src="images/Home Administrator Settings.jpg" width="180" height="187"></p> <p>&nbsp;</p> </td> <td background="free_high_res_texture_280.jpg" width="48%"> <h1><div align="center"><font color="red"> <u>Administrator Only </u></font></div></h1> <form name="adminLogin" onSubmit="return validate();" action="adminlogin_logic.jsp" method="POST"> <div style="padding: 100px 0 0 250px;"> <div id="login-box"> <div align="left"> <H2>Administrator Login</H2> <br /> <div id="login-box-name" style="margin-top:20px;">Username:</div> <div id="login-box-field" style="margin-top:20px;"> <input name="un" class="form-login" title="Username" value="" size="30" maxlength="2048" /> </div>

<div id="login-box-name">Password:</div> <div id="login-box-field"> <input name="pwd" type="password" class="form-login" title="Password" value="" size="30" maxlength="2048" /> </div> <br /> <input type="image" src="images/redlogin-box_button.png" width="103" height="42" style="margin-left:90px;" /> </div> </div> </form></td> </tr> </table> </div> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p> <%@include file="footer.jsp" %>

</body> </body> </html>

adminlogin_logic.jsp
<html> <head>

<Admin Login Logic>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head>

<body> <% String uname=request.getParameter("un"); String pass=request.getParameter("pwd"); if(uname.equals("admin")) { if(pass.equals("admin")) response.sendRedirect("admin_fp.jsp"); else out.println("Password Invalid"); } else { if(pass.equals("admin")) out.println("Username Invalid"); else out.println("Username and Password Invalid"); } %> </body> </html>

admin_fp.jsp
<html> <head>

<Admin Task Page>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title>

</head> <body background="blue-abstract-background.jpg"> <div align="center"> <table width="80%" border="0"> <tr> <td background="10383.jpg" width="33%" height="107"><img src="images/1.gif" width="94" height="103" /></td> <td background="10383.jpg" width="67%"><img src="images/WelcomeAdministrator.jpg" width="315" height="30" /></td> </tr>

<td background="body-bg.jpg" height="171" colspan="2"><p align="center"><a href="adminLogin.jsp"><img src="images/button_sign_out.jpg" width="129" height="47" align="right" /></a></p> <p align="center">&nbsp;</p> <h1 align="center"><u>ADMINISTRATOR TASKS:</u></h1></td>

<tr> <td background="body-bg.jpg" height="177" colspan="2"> <p align="center"><a href="add_flight.jsp"><img src="images/add_flight.png" width="185" height="58" /></a></p> <p align="center"><a href="updateFlight1.jsp"><img src="images/update_flights.png" width="185" height="57" /></a></p> <p align="center"><a href="delete_flight.jsp"><img src="images/delete_flights.png" width="186" height="58" /></a></p> <p align="center"></p></td> </tr>

</table> </div>

</body> </html>

add_flight.jsp
<html> <head>

<Admin task to ADD flight>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> <script type="text/javascript"> function trim(s) { return s.replace(/^\s*/,"").replace(/\s*$/,""); } function validate() { if(trim(document.addFlight.flno.value)=="") { alert("Enter Flight No"); document.addFlight.flno.focus(); return false; } else if(trim(document.addFlight.airname.value)=="") { alert("Enter Valid Airline Name"); document.addFlight.airname.focus(); return false; } else if(trim(document.addFlight.src.value)=="")

{ alert("Enter Valid Source"); document.addFlight.src.focus(); return false; } else if(trim(document.addFlight.dest.value)=="") { alert("Enter Valid Destination"); document.addFlight.dest.focus(); return false; } else if(trim(document.addFlight.bsseats.value)=="") { alert("Enter Valid No of Business Seats"); document.addFlight.bsseats.focus(); return false; } else if(trim(document.addFlight.ecseats.value)=="") { alert("Enter Valid No of Economy Seats"); document.addFlight.ecseats.focus(); return false; } else if(trim(document.addFlight.bfare.value)=="") { alert("Enter Valid Business Fare"); document.addFlight.bfare.focus();

return false; } else if(trim(document.addFlight.efare.value)=="") { alert("Enter Valid Economy Fare"); document.addFlight.efare.focus(); return false; } else if(trim(document.addFlight.depttime.value)=="") { alert("Enter Valid Departure Time"); document.addFlight.depttime.focus(); return false; } else if(trim(document.addFlight.arrtime.value)=="") { alert("Enter Valid Arrival Time"); document.addFlight.arrtime.focus(); return false; } } </script> </head> <body background="blue-abstract-background.jpg"> <div align="center"> <table width="68%" border="0"> <tr>

<td background="10383.jpg"><p align="center"><font size="20">ADD FLIGHT DETAILS</font></p></td> </tr> <form name="addFlight" onSubmit="return validate();" action="add_flight2.jsp" method="POST"> <tr> <td background="body-bg.jpg"><h2 align="center"><a href="admin_fp.jsp"><img src="images/HomeButton.png" width="82" height="72" align="right"></a></h2> <h2 align="center">&nbsp;</h2> <h2 align="center">Flight Number: <input type="text" name="flno" value="" /> </h2> <h2 align="center">Airline Name: <select name="airname"> <option>--------</option> <option>Air India</option> <option>Fly KingFisher</option> <option>Jet Airways</option> <option>Spice Jet</option> <option>Indigo</option> </select> </h2> <h2 align="center">Source City: <select name="src"> <option>---------</option> <option>Ahmedabad</option> <option>Delhi</option> <option>Kolkata</option>

<option>Chennai</option> <option>Mumbai</option> <option>Pune</option> <option>Bengaluru</option> </select> </h2> <h2 align="center">Destination City: <select name="dest"> <option>---------</option> <option>Ahmedabad</option> <option>Delhi</option> <option>Kolkata</option> <option>Chennai</option> <option>Mumbai</option> <option>Pune</option> <option>Bengaluru</option> </select> </h2> <h2 align="center">No of Business Class Seats: <input type="text" name="bsseats" value="" /> </h2> <h2 align="center">No of Economy Class Seats: <input type="text" name="ecseats" value="" /> </h2> <h2 align="center">Business Class Fare: <input type="text" name="bfare" value="" /> </h2>

<h2 align="center">Economy Class Fare: <input type="text" name="efare" value="" /> </h2> <h2 align="center">Will be available for: <input name="day" type="checkbox" value="mon" />Monday<br> <h2 align="center"> />Tuesday<br> <h2 align="center"> />Wednesday<br> <h2 align="center"> />Thursday<br> <input name="day" type="checkbox" value="tue"

<input name="day" type="checkbox" value="wed"

<input name="day" type="checkbox" value="thu"

<h2 align="center"> <input name="day" type="checkbox" value="fri" />Friday<br> <h2 align="center"> <input name="day" type="checkbox" value="sat" />Saturday<br> <h2 align="center"> <input name="day" type="checkbox" value="sun" />Sunday<br> </h2> <h2 align="center">Departure Time: <input type="text" name="depttime" value="" /> </h2> <h2 align="center">Arrival Time: <input type="text" name="arrtime" value="" /> </h2> <div align="center"> <p><input type="image" img src="images/add_flight.png" width="185" height="58" align="middle"> <p></div></td> </tr> </form> </table> </div>

</body> </html>

add_flight2.jsp

<Admin task to ADD flight logic>

<%@page import="java.sql.*" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body background="body-bg.jpg"> <jsp:useBean id="connect" scope="request" class="propack.connect" > <% int arr[] = {0,0,0,0,0,0,0}; Connection con = connect.getConnection(); String flno = request.getParameter("flno"); String airname = request.getParameter("airname"); String src = request.getParameter("src"); String dest = request.getParameter("dest"); int a=Integer.parseInt(request.getParameter("bsseats")); int b=Integer.parseInt(request.getParameter("ecseats")); int bfare = Integer.parseInt(request.getParameter("bfare")); int efare = Integer.parseInt(request.getParameter("efare")); String deptime = request.getParameter("depttime"); String arrtime = request.getParameter("arrtime"); int brem=a-1; int erem=b-1; String select[] = request.getParameterValues("day");

for (int i = 0; i < select.length; i++) { if(select[i].equals("mon"))arr[0]=1; if(select[i].equals("tue"))arr[1]=1; if(select[i].equals("wed"))arr[2]=1; if(select[i].equals("thu"))arr[3]=1; if(select[i].equals("fri"))arr[4]=1; if(select[i].equals("sat"))arr[5]=1; if(select[i].equals("sun"))arr[6]=1; } int flag=0; PreparedStatement ps=null; ps=con.prepareStatement("select * from flight where flight_no=?"); ps.setString(1,flno); ResultSet rs=ps.executeQuery(); if(rs.next()) { out.println("The flight Already Exists"); flag=1; } if(flag==1){ response.sendRedirect("add_flight.jsp"); } else{ ps=con.prepareStatement("INSERT INTO flight values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); ps.setString(1,flno);

ps.setString(2,airname ); ps.setString(3,src); ps.setString(4,dest); ps.setInt(5,a); ps.setInt(6,b); ps.setInt(7,bfare); ps.setInt(8,efare); ps.setString(9,deptime ); ps.setString(10,arrtime ); ps.setInt(11,brem); ps.setInt(12,erem); if(arr[0]==0) ps.setString(13,"false"); else ps.setString(13,"true"); if(arr[1]==0) ps.setString(14,"false"); else ps.setString(14,"true"); if(arr[2]==0) ps.setString(15,"false"); else ps.setString(15,"true"); if(arr[3]==0) ps.setString(16,"false"); else ps.setString(16,"true");

if(arr[4]==0) ps.setString(17,"false"); else ps.setString(17,"true"); if(arr[5]==0) ps.setString(18,"false"); else ps.setString(18,"true"); if(arr[6]==0) ps.setString(19,"false"); else ps.setString(19,"true"); ps.executeUpdate(); ps.close(); } %> <h1> <div align="center"> Flight Successfully Added To Database <p> <a href="admin_fp.jsp">Go to Admin Front Page</a></p></div></h1> </jsp:useBean> </body> </html>

updateFlight1.jsp

<Admin task to UPDATE flight>

<%@page import="java.sql.*" %> <%@page import="java.util.*"%> <%@page import="java.lang.*"%> <html>

<head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> <script type="text/javascript"> function trim(s) { return s.replace(/^\s*/,"").replace(/\s*$/,""); } function validate() { if(trim(document.updateFlight.fl_no.value)=="") { alert("Enter a valid Flight Number"); document.updateFlight.fl_no.focus(); return false; }} </script> </head> <body background="blue-abstract-background.jpg"> <form name="updateFlight" onSubmit="return validate();" action="updateFlight2.jsp" method="POST"> <div align="center"> <table width="80%" border="1"> <tr> <td background="10383.jpg" height="133"><h1 align="center"><img src="images/2486-1-flight-update-live-flight.jpg" width="90" height="87" /> Update Flight Details

<a href="admin_fp.jsp"> <img src="images/HomeButton.png" width="87" height="79" align="right"></a></h1></td> </tr> <tr> <td background="body-bg.jpg" height="176"><div align="center"> <table width="852" height="99" border="1"> <thead> <tr> <th height="79">Flight Number</th> <th>Franchisee</th> <th>Source</th> <th>Destination</th> <th>Business Class Fare</th> <th><p>Economy Class Fare</p></th> <th>Departure Time</th> <th>Arrival Time</th> </tr> </thead> <jsp:useBean id="connect" scope="request" class="propack.connect"> <% Connection con = connect.getConnection(); PreparedStatement ps=con.prepareStatement("select * from flight"); ResultSet r = ps.executeQuery(); %> <p><h2>Input The Flight Number To Update<input type="text" name="fl_no" value="" /></h2></p> <p><input type="image" img src="images/update_flights.png" width="185" height="57" alt="update_flights"/> </p> <% while(r.next()){%>

<tbody> <tr><b> <td><%=r.getString("Flight_no")%></td> <td><%=r.getString("airline_name")%></td> <td><%=r.getString("Source")%></td> <td><%=r.getString("Destination")%></td> <td><%=r.getString("bs_fare")%></td> <td><%=r.getString("ec_fare")%></td> <td><%=r.getString("departure_time")%></td> <td><%=r.getString("arrival_time")%> </td> <%-<td><%=r.getString("Mon")%> </td>

<td><%=r.getString("Tue")%> </td> <td><%=r.getString("Wed")%> </td> <td><%=r.getString("Thu")%> </td> <td><%=r.getString("Fri")%> </td> <td><%=r.getString("Sat")%> </td> <td><%=r.getString("Sun")%> </td> --%> </b></tr> </tbody> <%}%> </table> &nbsp;</div></td> </tr> </table> </div> </form> </jsp:useBean>

</body> </html>

updateFlight2.jsp

<Editor to UPDATE flight details>

<%@page import="java.sql.*" %> <%@page import="java.util.*"%> <%@page import="java.lang.*"%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body background="blue-abstract-background.jpg"> <%! String src,dest,tbs,tes,bfa,efa,dti,ati;%> <% String mon=""; String tue=""; String wed=""; String thu=""; String fri=""; String sat=""; String sun=""; String select = request.getParameter("fl_no"); session.setAttribute("Flght_no", select); int arr[] = {0,0,0,0,0,0,0}; %> <jsp:useBean id="connect" scope="request" class="propack.connect"> <% Connection con = connect.getConnection();

PreparedStatement ps=con.prepareStatement("select * from flight where Flight_no=?"); ps.setString(1, select); ResultSet r=ps.executeQuery(); if(r.next()) { src=r.getString("Source"); dest=r.getString("Destination"); tbs=r.getString("Tot_bs_st"); tes=r.getString("Tot_ec_st"); bfa=r.getString("Bs_fare"); efa=r.getString("Ec_fare"); dti=r.getString("Departure_time"); ati=r.getString("Arrival_time"); mon=r.getString("Mon"); tue=r.getString("Tue"); wed=r.getString("Wed"); thu=r.getString("Thu"); fri=r.getString("Fri"); sat=r.getString("Sat"); sun=r.getString("Sun"); }

if(mon.equals("true"))arr[0]=1; if(tue.equals("true"))arr[1]=1; if(wed.equals("true"))arr[2]=1; if(thu.equals("true"))arr[3]=1;

if(fri.equals("true"))arr[4]=1; if(sat.equals("true"))arr[5]=1; if(sun.equals("true"))arr[6]=1; ps.close(); %>

<div align="center"> <table width="80%" border="0"> <tr> <td background="10383.jpg"><img src="images/update-button-mouse.jpg" width="191" height="132" align="middle" /></td> </tr>

<tr> <td background="body-bg.jpg"><form action="updateFlight3.jsp" method="post"> <h2> The Flight Number selected for Updation: <font color="red"><%= select%> </font></h2> <h2 align="center">Source: <input type="text" name="fn" value= "<%= src %>" /> </h2> <h2 align="center">Destination: <input type="text" name="mn" value="<%=dest%>" /> </h2> <h2 align="center">Total Business Seats: <input type="text" name="ln" value="<%=tbs%>" /> </h2> <h2 align="center">Total Economy Seats: <input type="text" name="add" value="<%=tes%>" />

</h2> <h2 align="center">Business Class Fare: <input type="text" name="ct" value="<%=bfa%>" /> </h2> <h2 align="center">Economy Class Fare: <input type="text" name="st" value="<%=efa%>" /> </h2> <h2 align="center">Will be available for: <% if(arr[0]==1) {%> <input name="day" type="checkbox" value="mon" checked="checked"/>Monday<br> <%}%> <% if(arr[0]==0) { %> <h2 align="center"> <input name="day" type="checkbox" value="mon" />Monday<br> <%}%> <% if(arr[1]==1) { %> <h2 align="center"> <input name="day" type="checkbox" value="tue" checked="checked" />Tuesday<br><%}%> <% if(arr[1]==0) {%> <h2 align="center"> <input name="day" type="checkbox" value="tue" />Tuesday<br><%}%> <% if(arr[2]==1) { %> <h2 align="center"> <input name="day" type="checkbox" value="wed" checked="checked"/>Wednesday<br> <%}%> <% if(arr[2]==0){ %> <h2 align="center"> <input name="day" type="checkbox" value="wed" />Wednesday<br><%}%> <% if(arr[3]==1) {%> <h2 align="center"> <input name="day" type="checkbox" value="thu" checked="checked"/>Thursday<br> <%}%> <% if(arr[3]==0) {%> <h2 align="center"> <input name="day" type="checkbox" value="thu" />Thursday<br><%}%> <% if(arr[4]==1) {%> <h2 align="center"> <input name="day" type="checkbox" value="fri" checked="checked" />Friday<br><%}%>

<% if(arr[4]==0) {%> <h2 align="center"> <input name="day" type="checkbox" value="fri" />Friday<br><%}%> <% if(arr[5]==1){ %> <h2 align="center"> <input name="day" type="checkbox" value="sat" checked="checked" />Saturday<br><%}%> <% if(arr[5]==0){ %> <h2 align="center"> <input name="day" type="checkbox" value="sat" />Saturday<br><%}%> <% if(arr[6]==1) {%> <h2 align="center"> <input name="day" type="checkbox" value="sun" checked="checked"/>Sunday<br><%}%> <% if(arr[6]==0){ %> <h2 align="center"> <input name="day" type="checkbox" value="sun" />Sunday<br><%}%> </h2> <h2 align="center">Departure Time: <input type="text" name="mob" value="<%=dti%>" /> </h2> <h2 align="center">Arrival Time:. <input type="text" name="land" value="<%=ati%>" /> </h2> <p align="center"> <input type="image" img="img" src="images/400_F_14848173_d0ShT1sKd5bvsRFCTTZxvV4WehG29wpc.jpg" width="101" height="39" /> </p> </form> </jsp:useBean> </body> </html>

updateFlight3.jsp

<Admin task to UPDATE flight done>

<%@page import="java.sql.*"%> <%@ page import="java.lang.*" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body background="body-bg.jpg"> <% int arr[] = {0,0,0,0,0,0,0}; String src=request.getParameter("fn"); String dest=request.getParameter("mn"); String tbs=request.getParameter("ln"); String tes=request.getParameter("add"); String bfs=request.getParameter("ct"); String efs=request.getParameter("st"); String dti=request.getParameter("mob"); String ati=request.getParameter("land"); String n1=(String)session.getAttribute("Flght_no"); String select[] = request.getParameterValues("day"); for (int i = 0; i < select.length; i++) { if(select[i].equals("mon"))arr[0]=1; if(select[i].equals("tue"))arr[1]=1; if(select[i].equals("wed"))arr[2]=1; if(select[i].equals("thu"))arr[3]=1; if(select[i].equals("fri"))arr[4]=1; if(select[i].equals("sat"))arr[5]=1;

if(select[i].equals("sun"))arr[6]=1;

}%> <jsp:useBean id="connect" scope="request" class="propack.connect"> <% Connection con = connect.getConnection(); PreparedStatement ps=con.prepareStatement("update flight set Source=?,destination=?,Tot_bs_st=?,Tot_ec_st=?,Bs_fare=?,Ec_fare=?,Departure_time=?,Ar rival_time=?,Mon=?,Tue=?,Wed=?,Thu=?,Fri=?,Sat=?,Sun=? where Flight_no=?"); ps.setString(1,src); ps.setString(2,dest); ps.setString(3,tbs); ps.setString(4,tes); ps.setString(5,bfs); ps.setString(6,efs); ps.setString(7,dti); ps.setString(8,ati); if(arr[0]==0) ps.setString(9,"false"); else ps.setString(9,"true"); if(arr[1]==0) ps.setString(10,"false"); else ps.setString(10,"true"); if(arr[2]==0) ps.setString(11,"false"); else ps.setString(11,"true");

if(arr[3]==0) ps.setString(12,"false"); else ps.setString(12,"true"); if(arr[4]==0) ps.setString(13,"false"); else ps.setString(13,"true"); if(arr[5]==0) ps.setString(14,"false"); else ps.setString(14,"true"); if(arr[6]==0) ps.setString(15,"false"); else ps.setString(15,"true"); ps.setString(16, n1); ps.executeUpdate(); ps.close(); %> </jsp:useBean> <h1><div align="center"><p>Flight Table Updated</p> <a href="admin_fp.jsp">Go to Admin Front Page</a></div></h1> </body> </html>

delete_flight.jsp

<Deletion of flight by admin>

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> <script type="text/javascript"> function trim(s) { return s.replace(/^\s*/,"").replace(/\s*$/,""); } function validate() { if(trim(document.deleteFlight.flno.value)=="") { alert("Enter a valid Flight Number"); document.deleteFlight.flno.focus(); return false; }} </script> </head> <body background="blue-abstract-background.jpg"> <div align="center"> <table width="80%" border="1"> <tr> <td background="10383.jpg"><div align="center"><font size="20">DELETE FLIGHT</font></div></td> </tr> <tr>

<td background="body-bg.jpg"><p align="center">&nbsp;</p> <form name="deleteFlight" onSubmit="return validate();" action="delete_flight2.jsp"> <h2>Flight Number to be Deleted From the Database: <input type="text" name="flno" value=""/> </h2> <p><a href="admin_fp.jsp"> <img src="images/HomeButton.png" width="87" height="79" align="right"></p> <p align="center"><input type="image" img src="images/delete_flights.png" width="169" height="46"></p> </form></td> </tr> </table> </div> </body> </body> </html>

delete_flight2.jsp

<Deletion of flight by admin logic>

<%@page import="java.sql.*" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <body background="body-bg.jpg"> <%

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:airpro","sa","bera");

String s=request.getParameter("flno"); PreparedStatement ps=null; try{ ps=con.prepareStatement("DELETE from flight WHERE flight_no=?");

ps.setString(1, s); ps.executeUpdate(); con.commit(); ps.close(); } catch(Exception e) { e.printStackTrace(); } %> <h1> <div align="center"> Flight Successfully Deleted To Database <p> <a href="admin_fp.jsp">Go to Admin Front Page</a></p></div></h1> </body> </body> </html>

CSS Files:
login-box.css <User Login Box>

#login-box { width:333px; height: 352px; padding: 58px 76px 0 76px; color: #ebebeb; font: 12px Arial, Helvetica, sans-serif; background: url(images/login-box-backg.png) no-repeat left top; }

#login-box img { border:none; }

#login-box h2 { padding:0; margin:0; color: #ebebeb; font: bold 44px "Calibri", Arial; }

#login-box-name { float: left; display:inline; width:80px; text-align: right; padding: 14px 10px 0 0;

margin:0 0 7px 0; }

#login-box-field { float: left; display:inline; width:230px; margin:0; margin:0 0 7px 0; }

.form-login { width: 205px; padding: 10px 4px 6px 3px; border: 1px solid #0d2c52; background-color:#1e4f8a; font-size: 16px; color: #ebebeb; }

.login-box-options { clear:both; padding-left:87px; font-size: 11px; }

.login-box-options a { color: #ebebeb; font-size: 11px; }

calendar.css
/* calendar icon */ img.tcalIcon { cursor: pointer;

<Calendar>

margin-left: 1px; vertical-align: middle; } /* calendar container element */ div#tcal { position: absolute; visibility: hidden; z-index: 100; width: 158px; padding: 2px 0 0 0; } /* all tables in calendar */ div#tcal table { width: 100%;

border: 1px solid silver; border-collapse: collapse; background-color: white; } /* navigation table */ div#tcal table.ctrl { border-bottom: 0; } /* navigation buttons */ div#tcal table.ctrl td { width: 15px; height: 20px; } /* month year header */ div#tcal table.ctrl th { background-color: white; color: black; border: 0; } /* week days header */ div#tcal th { border: 1px solid silver; border-collapse: collapse; text-align: center; padding: 3px 0; font-family: tahoma, verdana, arial; font-size: 10px;

background-color: gray; color: white; } /* date cells */ div#tcal td { border: 0; border-collapse: collapse; text-align: center; padding: 2px 0; font-family: tahoma, verdana, arial; font-size: 11px; width: 22px; cursor: pointer; } /* date highlight in case of conflicting settings order here determines the priority from least to most important */ div#tcal td.othermonth { color: silver; } div#tcal td.weekend { background-color: #ACD6F5; } div#tcal td.today { border: 1px solid red; } div#tcal td.selected {

background-color: #FFB3BE; } /* iframe element used to suppress windowed controls in IE5/6 */ iframe#tcalIF { position: absolute; visibility: hidden; z-index: 98; border: 0; } /* transparent shadow */ div#tcalShade { position: absolute; visibility: hidden; z-index: 99; } div#tcalShade table { border: 0; border-collapse: collapse; width: 100%;} div#tcalShade table td { border: 0; border-collapse: collapse; padding: 0; }

admin_login.css <Admin Login box>


#login-box { width:333px;

height: 352px; padding: 58px 76px 0 76px; color: #ebebeb; font: 12px Arial, Helvetica, sans-serif; background: url(images/red-login-box.png) no-repeat left top; }

#login-box img { border:none; }

#login-box h2 { padding:0; margin:0; color: #ebebeb; font: bold 44px "Calibri", Arial; }

#login-box-name { float: left; display:inline; width:80px; text-align: right; padding: 14px 10px 0 0; margin:0 0 7px 0; }

#login-box-field { float: left; display:inline; width:230px; margin:0; margin:0 0 7px 0; }

.form-login { width: 205px; padding: 10px 4px 6px 3px; border: 1px solid #0d2c52; background-color:#1e4f8a; font-size: 16px; color: #ebebeb; }

.login-box-options { clear:both; padding-left:87px; font-size: 11px; }

.login-box-options a {

color: #ebebeb; font-size: 11px; }

JavaScript Files:
calendar_us.js
var A_TCALDEF = { 'months' : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], 'yearscroll': true, // show year scroller 'weekstart': 0, // first day of week: 0-Su or 1-Mo 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx. 'imgpath' : 'img/' // directory with calendar images }; // date parsing function function f_tcalParseDate (s_date) {

<Calendar Javascript>

var re_date = /^\s*(\d{1,2})\/(\d{1,2})\/(\d{2,4})\s*$/; if (!re_date.exec(s_date)) return alert ("Invalid date: '" + s_date + "'.\nAccepted format is mm/dd/yyyy.") var n_day = Number(RegExp.$2), n_month = Number(RegExp.$1), n_year = Number(RegExp.$3);

if (n_year < 100)

n_year += (n_year < this.a_tpl.centyear ? 2000 : 1900); if (n_month < 1 || n_month > 12) return alert ("Invalid month value: '" + n_month + "'.\nAllowed range is 0112."); var d_numdays = new Date(n_year, n_month, 0); if (n_day > d_numdays.getDate()) return alert("Invalid day of month value: '" + n_day + "'.\nAllowed range for selected month is 01 - " + d_numdays.getDate() + ".");

return new Date (n_year, n_month - 1, n_day); } // date generating function function f_tcalGenerDate (d_date) { return ( (d_date.getMonth() < 9 ? '0' : '') + (d_date.getMonth() + 1) + "/" + (d_date.getDate() < 10 ? '0' : '') + d_date.getDate() + "/" + d_date.getFullYear() ); }

// implementation function tcal (a_cfg, a_tpl) {

// apply default template if not specified if (!a_tpl) a_tpl = A_TCALDEF;

// register in global collections

if (!window.A_TCALS) window.A_TCALS = []; if (!window.A_TCALSIDX) window.A_TCALSIDX = [];

this.s_id = a_cfg.id ? a_cfg.id : A_TCALS.length; window.A_TCALS[this.s_id] = this; window.A_TCALSIDX[window.A_TCALSIDX.length] = this;

// assign methods this.f_show = f_tcalShow; this.f_hide = f_tcalHide; this.f_toggle = f_tcalToggle; this.f_update = f_tcalUpdate; this.f_relDate = f_tcalRelDate; this.f_parseDate = f_tcalParseDate; this.f_generDate = f_tcalGenerDate;

// create calendar icon this.s_iconId = 'tcalico_' + this.s_id; this.e_icon = f_getElement(this.s_iconId); if (!this.e_icon) { document.write('<img src="' + a_tpl.imgpath + 'cal.gif" id="' + this.s_iconId + '" onclick="A_TCALS[\'' + this.s_id + '\'].f_toggle()" class="tcalIcon" alt="Open Calendar" />'); this.e_icon = f_getElement(this.s_iconId); } // save received parameters

this.a_cfg = a_cfg; this.a_tpl = a_tpl; }

function f_tcalShow (d_date) {

// find input field if (!this.a_cfg.controlname) throw("TC: control name is not specified"); if (this.a_cfg.formname) { var e_form = document.forms[this.a_cfg.formname]; if (!e_form) throw("TC: form '" + this.a_cfg.formname + "' can not be found"); this.e_input = e_form.elements[this.a_cfg.controlname]; } else this.e_input = f_getElement(this.a_cfg.controlname);

if (!this.e_input || !this.e_input.tagName || this.e_input.tagName != 'INPUT') throw("TC: element '" + this.a_cfg.controlname + "' does not exist in " + (this.a_cfg.formname ? "form '" + this.a_cfg.controlname + "'" : 'this document'));

// dynamically create HTML elements if needed this.e_div = f_getElement('tcal'); if (!this.e_div) { this.e_div = document.createElement("DIV");

this.e_div.id = 'tcal'; document.body.appendChild(this.e_div); } this.e_shade = f_getElement('tcalShade'); if (!this.e_shade) { this.e_shade = document.createElement("DIV"); this.e_shade.id = 'tcalShade'; document.body.appendChild(this.e_shade); } this.e_iframe = f_getElement('tcalIF'); if (b_ieFix && !this.e_iframe) { this.e_iframe = document.createElement("IFRAME"); this.e_iframe.style.filter = 'alpha(opacity=0)'; this.e_iframe.id = 'tcalIF'; this.e_iframe.src = this.a_tpl.imgpath + 'pixel.gif'; document.body.appendChild(this.e_iframe); }

// hide all calendars f_tcalHideAll();

// generate HTML and show calendar this.e_icon = f_getElement(this.s_iconId); if (!this.f_update()) return;

this.e_div.style.visibility = 'visible';

this.e_shade.style.visibility = 'visible'; if (this.e_iframe) this.e_iframe.style.visibility = 'visible';

// change icon and status this.e_icon.src = this.a_tpl.imgpath + 'no_cal.gif'; this.e_icon.title = 'Close Calendar'; this.b_visible = true; }

function f_tcalHide (n_date) { if (n_date) this.e_input.value = this.f_generDate(new Date(n_date));

// no action if not visible if (!this.b_visible) return;

// hide elements if (this.e_iframe) this.e_iframe.style.visibility = 'hidden'; if (this.e_shade) this.e_shade.style.visibility = 'hidden'; this.e_div.style.visibility = 'hidden';

// change icon and status this.e_icon = f_getElement(this.s_iconId);

this.e_icon.src = this.a_tpl.imgpath + 'cal.gif'; this.e_icon.title = 'Open Calendar'; this.b_visible = false; }

function f_tcalToggle () { return this.b_visible ? this.f_hide() : this.f_show(); }

function f_tcalUpdate (d_date) {

var d_today = this.a_cfg.today ? this.f_parseDate(this.a_cfg.today) : f_tcalResetTime(new Date()); var d_selected = this.e_input.value == '' ? (this.a_cfg.selected ? this.f_parseDate(this.a_cfg.selected) : d_today) : this.f_parseDate(this.e_input.value);

// figure out date to display if (!d_date) // selected by default d_date = d_selected; else if (typeof(d_date) == 'number') // get from number d_date = f_tcalResetTime(new Date(d_date)); else if (typeof(d_date) == 'string') // parse from string d_date = this.f_parseDate(d_date);

if (!d_date) return false;

// first date to display var d_firstday = new Date(d_date); d_firstday.setDate(1); d_firstday.setDate(1 - (7 + d_firstday.getDay() - this.a_tpl.weekstart) % 7);

var a_class, s_html = '<table class="ctrl"><tbody><tr>' + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, -1, 'y') + ' title="Previous Year"><img src="' + this.a_tpl.imgpath + 'prev_year.gif" /></td>' : '') + '<td' + this.f_relDate(d_date, -1) + ' title="Previous Month"><img src="' + this.a_tpl.imgpath + 'prev_mon.gif" /></td><th>' + this.a_tpl.months[d_date.getMonth()] + ' ' + d_date.getFullYear() + '</th><td' + this.f_relDate(d_date, 1) + ' title="Next Month"><img src="' + this.a_tpl.imgpath + 'next_mon.gif" /></td>' + (this.a_tpl.yearscroll ? '<td' + this.f_relDate(d_date, 1, 'y') + ' title="Next Year"><img src="' + this.a_tpl.imgpath + 'next_year.gif" /></td></td>' : '') + '</tr></tbody></table><table><tbody><tr class="wd">';

// print weekdays titles for (var i = 0; i < 7; i++) s_html += '<th>' + this.a_tpl.weekdays[(this.a_tpl.weekstart + i) % 7] + '</th>'; s_html += '</tr>' ;

// print calendar table var n_date, n_month, d_current = new Date(d_firstday); while (d_current.getMonth() == d_date.getMonth() ||

d_current.getMonth() == d_firstday.getMonth()) {

// print row heder s_html +='<tr>'; for (var n_wday = 0; n_wday < 7; n_wday++) {

a_class = []; n_date = d_current.getDate(); n_month = d_current.getMonth();

// other month if (d_current.getMonth() != d_date.getMonth()) a_class[a_class.length] = 'othermonth'; // weekend if (d_current.getDay() == 0 || d_current.getDay() == 6) a_class[a_class.length] = 'weekend'; // today if (d_current.valueOf() == d_today.valueOf()) a_class[a_class.length] = 'today'; // selected if (d_current.valueOf() == d_selected.valueOf()) a_class[a_class.length] = 'selected';

s_html += '<td onclick="A_TCALS[\'' + this.s_id + '\'].f_hide(' + d_current.valueOf() + ')"' + (a_class.length ? ' class="' + a_class.join(' ') + '">' : '>') + n_date + '</td>'; d_current.setDate(++n_date); }

// print row footer s_html +='</tr>'; } s_html +='</tbody></table>';

// update HTML, positions and sizes this.e_div.innerHTML = s_html;

var n_width = this.e_div.offsetWidth; var n_height = this.e_div.offsetHeight; var n_top = f_getPosition (this.e_icon, 'Top') + this.e_icon.offsetHeight; var n_left = f_getPosition (this.e_icon, 'Left') - n_width + this.e_icon.offsetWidth; if (n_left < 0) n_left = 0;

this.e_div.style.left = n_left + 'px'; this.e_div.style.top = n_top + 'px';

this.e_shade.style.width = (n_width + 8) + 'px'; this.e_shade.style.left = (n_left - 1) + 'px'; this.e_shade.style.top = (n_top - 1) + 'px'; this.e_shade.innerHTML = b_ieFix ? '<table><tbody><tr><td rowspan="2" colspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_tr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td height="' + (n_height - 7) + '" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_mr.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td width="7" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bl.png\', sizingMethod=\'scale\');"><img src="' +

this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_bm.png\', sizingMethod=\'scale\');" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + this.a_tpl.imgpath + 'shade_br.png\', sizingMethod=\'scale\');"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tbody></table>' : '<table><tbody><tr><td rowspan="2" width="6"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td rowspan="2"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td width="7" height="7"><img src="' + this.a_tpl.imgpath + 'shade_tr.png"></td></tr><tr><td background="' + this.a_tpl.imgpath + 'shade_mr.png" height="' + (n_height - 7) + '"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td></tr><tr><td><img src="' + this.a_tpl.imgpath + 'shade_bl.png"></td><td background="' + this.a_tpl.imgpath + 'shade_bm.png" height="7" align="left"><img src="' + this.a_tpl.imgpath + 'pixel.gif"></td><td><img src="' + this.a_tpl.imgpath + 'shade_br.png"></td></tr><tbody></table>';

if (this.e_iframe) { this.e_iframe.style.left = n_left + 'px'; this.e_iframe.style.top = n_top + 'px'; this.e_iframe.style.width = (n_width + 6) + 'px'; this.e_iframe.style.height = (n_height + 6) +'px'; } return true; }

function f_getPosition (e_elemRef, s_coord) { var n_pos = 0, n_offset, e_elem = e_elemRef;

while (e_elem) { n_offset = e_elem["offset" + s_coord]; n_pos += n_offset;

e_elem = e_elem.offsetParent; } // margin correction in some browsers if (b_ieMac) n_pos += parseInt(document.body[s_coord.toLowerCase() + 'Margin']); else if (b_safari) n_pos -= n_offset;

e_elem = e_elemRef; while (e_elem != document.body) { n_offset = e_elem["scroll" + s_coord]; if (n_offset && e_elem.style.overflow == 'scroll') n_pos -= n_offset; e_elem = e_elem.parentNode; } return n_pos; }

function f_tcalRelDate (d_date, d_diff, s_units) { var s_units = (s_units == 'y' ? 'FullYear' : 'Month'); var d_result = new Date(d_date); d_result['set' + s_units](d_date['get' + s_units]() + d_diff); if (d_result.getDate() != d_date.getDate()) d_result.setDate(0); return ' onclick="A_TCALS[\'' + this.s_id + '\'].f_update(' + d_result.valueOf() + ')"'; }

function f_tcalHideAll () { if (!window.A_TCALSIDX) return; for (var i = 0; i < window.A_TCALSIDX.length; i++) window.A_TCALSIDX[i].f_hide(); }

function f_tcalResetTime (d_date) { d_date.setHours(12); d_date.setMinutes(0); d_date.setSeconds(0); d_date.setMilliseconds(0); return d_date; }

f_getElement = document.all ? function (s_id) { return document.all[s_id] } : function (s_id) { return document.getElementById(s_id) };

if (document.addEventListener) window.addEventListener('scroll', f_tcalHideAll, false); if (window.attachEvent) window.attachEvent('onscroll', f_tcalHideAll);

// global variables var s_userAgent = navigator.userAgent.toLowerCase(), re_webkit = /WebKit\/(\d+)/i; var b_mac = s_userAgent.indexOf('mac') != -1,

b_ie5 = s_userAgent.indexOf('msie 5') != -1, b_ie6 = s_userAgent.indexOf('msie 6') != -1 && s_userAgent.indexOf('opera') == -1; var b_ieFix = b_ie5 || b_ie6, b_ieMac = b_mac && b_ie5, b_safari = b_mac && re_webkit.exec(s_userAgent) && Number(RegExp.$1) < 500;

SNAPSHOTS OF OUR PROJECT

USER SIGN IN/REGISTER PAGE

FLIGHT SEARCH PAGE

ADMIN TASK PAGE

CONCLUSION Our project is being developed into a website which facilitates the reservation of online air tickets through an effective and yet simple GUI for a normal passenger intending to travel in airways. Apart from reserving tickets, through our system a passenger can compare online fares from various cities to various cities.Our project offers flexibility and security. REFERENCES
1. Barry Burd(2005); JSP: Java Server Pages;WILEY Publications. 2. Pankaj Jalote(2004);An integrated approach to Software Engineering;Narosa Publications. 3. http://www.Javaworld.com 4. http://www.java.sun.com