12
Home Page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf- 8" /> <title>Home</title> <meta name="keywords" content="" /> <meta name="Premium Series" content="" /> <link href="default.css" rel="stylesheet" type="text/css" media="screen" /> </head><body><div id="header"><div id="logo"> <h1><a href="#"><span>Flight Enquiry System</span></a></h1> <li class="current_page_item"><a href="Home.html">Home</a></li> <li><a href="login.html">Admin</a></li> <li><a href="flight1.jsp">Ticket Reservation</a></li> <li><a href="cont.jsp">Contact Us</a></li> </ul> <center><img src="images2/i2.jpg" alt="" width="1000" height="450"/></center> <div id="footer"> </div> </body> </html> Flight Information Coding:

Flight Enquiry System

Embed Size (px)

Citation preview

Page 1: Flight Enquiry System

Home Page:

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

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

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

<head>

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

<title>Home</title>

<meta name="keywords" content="" />

<meta name="Premium Series" content="" />

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

</head><body><div id="header"><div id="logo">

<h1><a href="#"><span>Flight Enquiry System</span></a></h1>

<li class="current_page_item"><a href="Home.html">Home</a></li>

<li><a href="login.html">Admin</a></li>

<li><a href="flight1.jsp">Ticket Reservation</a></li>

<li><a href="cont.jsp">Contact Us</a></li></ul>

<center><img src="images2/i2.jpg" alt="" width="1000" height="450"/></center>

<div id="footer">

</div>

</body>

</html>

Flight Information Coding:

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

<%@page import="javax.swing.*"%>

<head><script type="text/javascript">

function del()

{if(confirm("Do You Want to Delete this Ingredient?"))

{}

else

{return false;}}</script>

Page 2: Flight Enquiry System

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

<title>Flight Detail Page</title>

<meta name="keywords" content="" />

<meta name="Premium Series" content="" />

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

</head><body>

<%Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con=DriverManager.getConnection("jdbc:odbc:mca","system","manager");

String p=request.getParameter("ingredient_slno");

String delete_ingredient=request.getParameter("delete_ingredient");

if("yes".equals(delete_ingredient))

{String p1=request.getParameter("ingredient_code");

PreparedStatement p10=con.prepareStatement("delete from flight where n1='"+p1+"'");

p10.executeUpdate();

JOptionPane.showMessageDialog(null,"Flight Detail Deleted Successfully");

p10.close();}%>

<html><div id="header"><div id="logo">

<h1><a href="#"><span>Flight Enquiry System</span></a></h1></div>

<li class="current_page_item"><a href="f1.jsp">Back</a></li></ul></div>

<form><table border="1" width="40%">

<caption>Flight Detail</caption>

<tr>

<th>S.No</th>

<th>Flight No</th>

<th>Flight Name</th>

<th>Source</th>

<th>Dept Time</th>

<th>Destination</th>

<th>Arrival Time</th>

<th>----Date----</th>

<th>Avaliable Sheets</th>

Page 3: Flight Enquiry System

<th>Ticket Rate</th>

<th colspan="2">Action</th></tr>

<% int i=0;

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Statement s=con.createStatement();

ResultSet rs=s.executeQuery("select * from flight");

while(rs.next())

{

String pid=rs.getString("n1");

String pid1=rs.getString("n2");

String uid=rs.getString("sou");

String uid1=rs.getString("dt");

String uid2=rs.getString("des");

String uid3=rs.getString("at");

Date pid3=rs.getDate("date1");

int pid4=rs.getInt("cap1");

int pid5=rs.getInt("trs");%><tr> <td><%=++i%></td><td><%=pid

%></td> <td><%=pid1%></td><td><%=uid%></td><td><%=uid1%></td>

<td><%=uid2%></td><td><%=uid3%></td><td><%=pid3%></td>

<td><%=pid4%></td><td><%=pid5%></td> <td>

<a href="edit1.jsp?pid=<%=pid%>">Edit</a></td><td><a href="f.jsp?

delete_ingredient=yes&ingredient_slno=<%=i%>&ingredient_code=<%=pid%>"

onclick="return del()">Delete</a></td></tr>

<% } %> </table> </form>

</html>

Reservation Detail Coding:

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

<%@page import="javax.swing.*"%>

<head>

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

<title>reservation Detail Page</title>

Page 4: Flight Enquiry System

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

</head><body><html>

<h1><a href="#"><span>Flight Enquiry System</span></a></h1>

<li class="current_page_item"><a href="Home.html">Home</a></li></ul>

<form><table border="1" width="40%">

<caption>Reservation Detail</caption>

<tr>

<th>S.No</th>

<th>Passenger Name</th>

<th>Passenger Address</th>

<th>Mobile Number</th>

<th>Email-Id</th>

<th colspan="2">Action</th>

</tr>

<%

int i=0;

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection

con=DriverManager.getConnection("jdbc:odbc:mca","system","manager");

Statement s=con.createStatement();

ResultSet rs=s.executeQuery("select * from register2");

while(rs.next())

{String pid=rs.getString("n1");

String pid1=rs.getString("a1");

String pid2=rs.getString("m1");

String pid3=rs.getString("e1");

String pid4=rs.getString("na");

session.setAttribute("g",pid4);

%>

<tr>

<td><%=++i%></td><td><%=pid%></td><td><%=pid1%></td>

Page 5: Flight Enquiry System

<td><%=pid2%></td><td><%=pid3%></td><td><a href="flight3.jsp?pid=<

%=pid4%>">Flight Details</a></td></tr><% } %> </form></body></html>

Customer Reservation Coding:

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

<%@page import="javax.swing.*"%>

<head>

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

<title>View flight Page</title>

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

</head><body>

<%

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con=DriverManager.getConnection("jdbc:odbc:mca","system","manager");

String p=request.getParameter("ingredient_slno");

String delete_ingredient=request.getParameter("delete_ingredient");

if("yes".equals(delete_ingredient))

{

String p1=request.getParameter("ingredient_code");

if("yes".equals(delete_ingredient))

{ PreparedStatement p10=con.prepareStatement("update supplier set status='Not Accepted'

where paid='Null' And pname='"+p1+"'");

p10.executeUpdate();

JOptionPane.showMessageDialog(null,"Item Returned Successfully");

p10.close();}}%><html>

<h1><a href="#"><span>Flight Enquiry System</span></a></h1>

<li class="current_page_item"><a href="Home.html">Home</a></li>

<form>

<table border="1" width="40%">

<caption>Flight List</caption>

<tr>

<th>S.No</th>

Page 6: Flight Enquiry System

<th>Flight Name</th>

<th>Source Place</th>

<th>Dept Time</th>

<th>Destination Place</th>

<th>Arrival Time</th>

<th>----Date----</th>

<th>Available Sheet</th>

<th>Ticket Rate</th>

<th colspan="2">Action</th>

</tr>

<%

int icount=0;

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Statement s=con.createStatement();

String pid=request.getParameter("pid");

session.setAttribute("pid", pid);

ResultSet rs=s.executeQuery("select * from flight where n1='"+pid+"'");

while(rs.next())

{

String pid1=rs.getString("n2");

session.setAttribute("m",pid1);

String uid=rs.getString("sou");

String uid1=rs.getString("dt");

String uid2=rs.getString("des");

String uid3=rs.getString("at");

int pid2=rs.getInt("trs");

session.setAttribute("b",pid2);

int pid4=rs.getInt("cap1");

session.setAttribute("a1",pid4);

Date pid3=rs.getDate("date1");%> <tr>

<td><%=++icount%></td><td><%=pid1%></td>

Page 7: Flight Enquiry System

<td><%=uid%></td><td><%=uid1%></td>

<td><%=uid2%></td><td><%=uid3%></td>

<td><%=pid3%></td><td><%=pid4%></td><td><%=pid2%></td>

<td><a href="registration1.jsp?pid=<%=pid2%>">Ticket Booking</a></td>

</tr><% } %> </table></form></body></html>

Payment Process Coding:

<%@ page language="java" import="java.sql.*,java.util.*,java.text.*" %>

<%@page import="javax.swing.*"%>

<%

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Connection c=DriverManager.getConnection("jdbc:odbc:mca","system","manager");

Statement s=c.createStatement();

String user=(String)session.getAttribute("s");try{

ResultSet rs3 = s.executeQuery("select amt from bank1 WHERE cname='"+user+"'");

while(rs3.next())

{int tempbal=rs3.getInt("amt");

int newbal=tempbal-x;

if(newbal>0)

{ PreparedStatement p9=c.prepareStatement("update

bank1 set amt=? where cname='"+user+"'");

p9.setInt(1,newbal); p9.executeUpdate();

String query1 = "select * from bank1 WHERE cname='Admin'";

ResultSet rs1 = s.executeQuery(query1);

if(rs1.next())

{int tempbal1=rs1.getInt("amt");

int newbal1=tempbal1+x;

PreparedStatement p10=c.prepareStatement("update bank1 set amt=? where

cname='Admin'");

p10.setInt(1,newbal1);

p10.executeUpdate();

JOptionPane.showMessageDialog(null,"Payment Succuessfully");

Page 8: Flight Enquiry System

response.sendRedirect("Home.html");}

else{

JOptionPane.showMessageDialog(null,"In your Account Balance Not Sufficient For

Payment");

response.sendRedirect("creditcard2.jsp");}}}}

catch (Exception ex){out.println(ex + "Error");}%>

Output:

Flight Information:

Update Flight Detail:

Reservaration Process:

Page 9: Flight Enquiry System

Search Detail:

Payment Process: