Bus Reservation System WebBased Apllication
Bus Reservation System WebBased Apllication
INTRODUCTION
SYSTEM REQUIREMENT
Hardware Requirement
Software Requirement
Windows XP/Vista/7/8/8.1.
Eclipse 3.3.
Apache Tomcat server v5.5.
Internet explorer.
Google Chrome.
Mozilla Firefox.
TOOL DESCRIPTION
HTML
HTML consists of a series of short codes typed into a text-file by the site author
these are the tags. The text is then saved as an html file, and viewed through
a browser, like Internet Explorer or Netscape Navigator. This browser reads the
file and translates the text into a visible form, hopefully rendering the page as the
author had intended. Writing your own HTML entails using tags correctly to create
your vision. You can use anything from a rudimentary text-editor to a powerful
graphical editor to create HTML pages.
The tags are what separate normal text from HTML code. You might know them
as the words between the <angle-brackets>. They allow all the cool stuff like
images and tables and stuff, just by telling your browser what to render on the
page. Different tags will perform different functions. The tags themselves dont
appear when you view your page through a browser, but their effects do. The
simplest tags do nothing more than apply formatting to some text, like this:
Cascading Stylesheets are used to control how your pages are presented, and
make pages more accessible. Basic special effects and interaction is provided
by JavaScript, which adds a lot of power to basic HTML. Most of this advanced
stuff is for later down the road, but when using all of these technologies together,
you have a lot of power at your disposal.
SQL SERVER
SQLCMD is a command line application that comes with Microsoft SQL Server,
and exposes the management features of SQL Server. It allows SQL queries to be
written and executed from the command prompt. It can also act as a scripting
language to create and run a set of SQL statements as a script. Such scripts are
stored as a .sql file, and are used either for management of databases
This project enables us to reserve a bus ticket where in a customer has been
provided with many facilities like choosing his/her own seats, destinations,
departure areas, type of buses at affordable rates. The administrator can have any
information regarding the bus reservations and cancellations.
Even a normal person can visit the website but can book the tickets
through the website.He/she can even cancel or print the tickets from the
website and book tickets with zero booking charges and can get home
delivery of the tickets.
Advantages
User Friendly: The user interface of the project is very simple. So the user
doesnt require any special training.
Module Description
Login: This module is much authorized where a admin can add new travels
or update the existing travels information and also check the booking details
so that he can issue the tickets on the doorstep.
Bus Details: This module provides the user to choose his/her from and to
destination with the date on which he/she will be travelling.
Booking details: In this module we have the details of the customer like
name, from and to destination, arrival time, departure time, departure areas,
the seat numbers, phone numbers and ticket fare.
Cancellations: This module is to cancel a tickets and the fare refund will be
made after some amount of deductions as per the travel management rules.
Printing ticket: This module is used to print the tickets where a user can
print his ticket when he pays through his debit/credit card.
Search: This module allows the user to view bus details and select the bus.
Booking: In this module the user enters his/her details to book the tickets.
USE-CASE DIAGRAM
User Admin
. . Searches for
buses Add a new . .
Travels
Selects
the bus
Update any
existing travels
Fills details for
booking
View booking
details
Confirms
the booking
Print ticket
Cancel ticket
Table Description
Admin
User-id Varchar(25)
pwd Varchar(25)
Book Details
Ticketno int
Date Varchar(45)
ArrivalPlace Varchar(45)
Noseats Varchar(45)
Name Varchar(45)
Gender Varchar(45)
Age Varchar(45)
E-mail Varchar(45)
Phno Varchar(45)
Address Varchar(45)
Altphno Varchar(45)
Landmark Varchar(45)
City Varchar(45)
Area Varchar(45)
Pincode int
Bus no int
Amount int
Bus
busno int
Travel bus type Varchar(45)
From1 Varchar(45)
To1 Varchar(45)
departure Varchar(45)
arrival Varchar(45)
duration Varchar(45)
ratings Varchar(45)
fare Varchar(45)
seats Varchar(45)
CODING
HOME.HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript">
function myfun()
{
var M=document.HFORM.NAME
var N=document.HFORM.TO
if((M.value=="") || (M.value==null))
{
alert("Enter City In From Field (Source)");
M.focus()
return false
}
else
if((N.value=="") || (N.value==null))
{
alert("Enter City In To Field (Destination)");
N.focus()
return false
}
return true
}
</script>
<title>Insert title here</title>
</head>
<body bgcolor="white" scrolling="auto">
<form action="search.jsp" name="HFORM" onSubmit="return myfun()">
<table width="900" height="1" border="0" align="center">
<tr>
<th><a style=color:blue href="home.html">Home</a></th>
<th><a style=color:blue href="print.html">Print Tickets</a></th>
<th><a style=color:blue href="cancel.jsp">Cancel Tickets</a></th>
<th><a style=color:blue href="aboutus.html">About Us</a></th>
<th>
</th>
</tr>
</table>
<hr style=color:#D3D3D3 size="2px">
<table bgcolor="white" width="900" height="20" align="center" border="0">
<tr>
<th><img src="D:\bus\images\th.jpg" align="right"><img src="D:\bus\images\Blue-Bus-Logo
(264 x 89).jpg" align="left"></th>
</tr>
</table>
<hr style=color:#D3D3D3 size="2px">
<table width="900" height="150" align="center" border="0">
<tr>
<th>
<h2 style=color:BLUE align="left">Book Bus Tickets with Zero Booking Fees</h2>
</tr>
</table>
</th>
</tr>
</table>
<hr style=color:#D3D3D3 size="2px">
<table width="900" height="250" align="center" border="0">
<tr>
<th>
<table>
<tr>
<th><img src="D:\bus\images\dussehra.png"></th>
<th><img src="D:\bus\images\rbapp100.png"></th>
<th><img src="D:\bus\images\roundtrip.png"></th>
<th><img src="D:\bus\images\9ipRr76iE (144 x 144).jpg"></th>
</tr>
</table>
</th>
</tr>
</table>
<hr style=color:#D3D3D3 size="2px">
<table align="left" border="0" width="350" height="400">
<tr>
<th><h4 style=color:#FF0000>Top Bus Routes</h4></th>
</tr>
<tr>
<td>Bangalore-Karwar</td><td>Bangalore-Hubli</td>
</tr>
<tr>
<td>Bangalore-Goa</td><td>Goa-Bangalore</td>
</tr>
<tr>
<td>Delhi-Manali</td><td>Hyderabad-Banagalore</td>
</tr>
<tr>
<td>Pune-Bangalore</td><td>Delhi-Lucknow</td>
</tr>
<tr>
<td>Bhubaneshwar-Hyderabad</td><td>Pune-Hyderabad</td>
</tr>
<tr>
<td>Chennai-Bangalore</td><td>Bhubaneshwar-Kolkata</td>
</tr>
<tr>
<td>Lucknow-Delhi</td><td>Bangalore-Chennai</td>
</tr>
<tr>
<td>Kolkata-Bhubaneshwar</td><td>Bangalore-Hyderabad</td>
</tr>
<tr>
<td>Manali-Delhi</td><td>Mumbai-Bangalore</td>
</tr>
</table>
<table align="right" border="0" width="350" height="400">
<tr>
<th><h4 style=color:#FF0000>Top Bus Routes</h4></th>
</tr>
<tr>
<td>Bangalore-Mumbai</td><td>Kerala-banagalore</td>
</tr>
<tr>
<td>Bangalore-Kerala</td><td>Karwar-banagalore</td>
</tr>
<tr>
<td>Bangalore-Belgaum</td><td>Hubli-bangalore</td>
</tr>
<tr>
<td>Belgaum-Bangalore</td><td>Bangalore-Mangalore</td>
</tr>
<tr>
<td>Mangalore-Bangalore</td><td>Bangalore-Mysore</td>
</tr>
<tr>
<td>Mysore-Bangalore</td><td>Bangalore-Udapi</td>
</tr>
<tr>
<td>Kolhapur-Bangalore</td><td>Bangalore-Ankola</td>
</tr>
<tr>
<td>Kolhapur-Belgaum</td><td>Belgaum-Goa</td>
</tr>
<tr>
<td>Kolhapur-Goa</td><td>Ankola-Bangalore</td>
</tr>
</table>
<table align="center" border="0" width="500" height="500">
<tr>
<th><h4 style=color:#FF0000>Top Bus Operators</h4></th>
</tr>
<tr>
<td>Vaibhav Travels(VOLVO A/C)</td><td>Naveen travels(VOLVO A/C)</td>
</tr>
<tr>
<td>Ameer Travels</td><td>Parshawanath travel PVT LTD. ...</td>
</tr>
<tr>
<td>SVR Tours And Travels</td><td>SRS Travels</td>
</tr>
<tr>
<td>VRL Travels</td><td>Orange Tours And Travels</td>
</tr>
<tr>
<td>Sharma Transport</td><td>Royal Cruiser</td>
</tr>
<tr>
<td>Paulo Travels</td><td>Kallada Travels(VOLVO A/C)</td>
</tr>
<tr>
<td>Universal Travels</td><td>Sugama Travels</td>
</tr>
<tr>
<td>Sea Bird Travels</td><td>Neeta Travels</td>
</tr>
<tr>
<td>KSRTC Airavat(VOLVO A/C)</td><td>Rajesh Travels</td>
</tr>
<tr>
<td>Durgamba Travels</td><td>K.P.N</td>
</tr>
</table>
</form>
<hr style=color:#D3D3D3 size="2px">
SEARCH.JSP
pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*"%>
<%@ page import="javax.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body bgcolor="white">
<a style=color:blue href="home.html">Back</a>
<form action="booking.jsp">
<table width="900" height="1" border="0" align="center">
<tr>
<th><a style=color:blue href="home.html">Home</a></th>
<th><a style=color:blue href="print.html">Print Tickets</a></th>
<th><a style=color:blue href="cancel.html">Cancel Tickets</a></th>
<th><a style=color:blue href="aboutus.html">About Us</a></th>
<th>
Need Help?Call <b style=color:blue>Bangalore</b> <select name="phno">
<option>8904296377</option>
<option>9535389398</option>
<option>8553432070</option>
</select>
</th>
</tr>
</table>
<hr style=color:#D3D3D3 size="2px">
<table bgcolor="white" width="900" height="40" align="center" border="0">
<tr>
<th><img src="D:\bus\images\th.jpg" align="right"><img src="D:\bus\images\Blue-Bus-Logo
(264 x 89).jpg" align="left"></th>
</tr>
</table>
<hr style=color:#D3D3D3 size="2px">
<%
String f=request.getParameter("FROM");
String t=request.getParameter("TO");
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");
Statement st=con.createStatement();
ResultSet rt=null;
rt=st.executeQuery("select * from bus where from1='"+f+"' and to1='"+t+"'");
%>
<table>
<tr>
<th> <h2
style=color:#4169E1><b>To Change The Route Go Back To Home</b></h2></th>
</tr>
</table>
<table border="1" align="center" BGCOLOR="white">
<tr>
<th>
<table align="center" width="1000" height="200" cellspacing="30"
BORDERCOLOR="#000000">
<tr><th><u> Bus No</u></th><th><u>Travel(Bus
Type)</u></th><th><u>From</u></th><th><u>To</u></th><th><u>Departure</u></th><th>
<u>Arrival</u></th><th><u>Duration</u></th><th><u>Ratings</u></th><th><u>Fare</u></t
h><th><u>Available Seats</u></th><th><u>Book</u></th></tr>
<%
while(rt.next())
{
%>
<tr><td><input readonly="readonly" border="0" size="1" color="#000000" type="text"
name="Busno" value="<%=rt.getString("busno")%>"></td>
<td><input readonly="readonly" border="0" size="25"color="#000000" type="text"
name="Travelbustype" value="<%=rt.getString("travelbustype")%>"></td>
<td><input readonly="readonly" border="0" size="8" color="#000000" type="text"
name="From" value="<%=rt.getString("from1")%>"></td>
<td><input readonly="readonly" border="0" size="8" color="#000000" type="text" name="To"
value="<%=rt.getString("to1")%>"></td>
<td><input readonly="readonly" border="0" size="6" color="#000000" type="text"
name="Departure" value="<%=rt.getString("departure")%>"></td>
<td><input readonly="readonly" border="0" size="6" color="#000000" type="text"
name="Arrival" value="<%=rt.getString("arrival")%>"></td>
<td><input readonly="readonly" border="0" size="7" color="#000000" type="text"
name="Duration" value="<%=rt.getString("duration")%>"></td>
<td><input readonly="readonly" border="0" size="1" color="#000000" type="text"
name="Ratings" value="<%=rt.getString("ratings")%>"></td>
<td><input readonly="readonly" border="0" size="2" color="#000000" type="text"
name="Fare" value="<%=rt.getString("fare")%>"></td>
<%
}
%>
</table>
</th>
</tr>
</table>
</body>
</html>
BOOKING.JSP
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.io.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="javascript">
function Validation()
{
var BP=document.frm.BP
var noseats=document.frm.noseats
var name1=document.frm.name1
var age=document.frm.age
var email=document.frm.email
var mobile=document.frm.mobile
var add=document.frm.address
var contact=document.frm.contact
var land=document.frm.landmark
var city=document.frm.city
var area=document.frm.area
var pin=document.frm.pincode
var dt=document.frm.date1;
if((dt.value=="") || (dt.value==null))
{
alert("Enter The Date Of Journey");
dt.focus()
return false
}
else
if((BP.value=="") || (BP.value==null))
{
alert("Select The Bording Point");
BP.focus()
return false
}
else
if((noseats.value=="") || (noseats.value==null))
{
alert("Select Number Of Seats");
noseats.focus()
return false
}
else
if((name1.value=="") || (name1.value==null))
{
alert("Enter Your Name");
name1.focus()
return false
}
else
if((age.value=="") || (age.value==null))
{
alert("Enter Your Age");
age.focus()
return false
}
else
if(isNaN(age.value))
{
alert("Text Not Allowed In Age Field");
age.focus();
return false;
}
else
if((email.value=="") || (email.value==null))
{
alert("Enter Your E-mail ID ");
email.focus()
return false
}
else
if((mobile.value=="") || (mobile.value==null))
{
alert("Enter Your Mobile Number");
mobile.focus()
return false
}
else
if(isNaN(mobile.value))
{
alert("Text Not Allowed In Mobile Number Field");
mobile.focus();
return false;
}
else
if(mobile.value.length<10||mobile.value.length>10)
{
alert("Enter Correct 10 Digit Phone Number In Mobile Number Field");
mobile.focus();
return false;
}
else
if((add.value=="") || (add.value==null))
{
alert("Enter Your Home Address");
add.focus()
return false
}
else
if((contact.value=="") || (contact.value==null))
{
alert("Enter Your Alternate Contact Number");
contact.focus()
return false
}
else
if(isNaN(contact.value))
{
alert("Text Not Allowed In Alternate Contact Number Field");
contact.focus();
return false;
}
else
if(contact.value.length<10||contact.value.length>10)
{
alert("Enter Correct 10 Digit Phone Number Alternate Contact Number Field");
contact.focus();
return false;
}
else
if((land.value=="") || (land.value==null))
{
alert("Enter Your Nearest Landmark ");
land.focus()
return false
}
else
if((city.value=="") || (city.value==null))
{
alert("Enter Your City");
city.focus()
return false
}
else
if((area.value=="") || (area.value==null))
{
alert("Enter Your Area Name");
area.focus()
return false
}
else
if((pin.value=="") || (pin.value==null))
{
alert("Enter Your Pincode");
pin.focus()
return false
}
else
if(isNaN(pin.value))
{
alert("Text Not Allowed In Pincode Field");
pin.focus();
return false;
}
else
if(pin.value.length<6||pin.value.length>6)
{
alert("Enter Correct 6 Digit Pincode Number");
pin.focus();
return false;
}
return true
}
</script>
<title>Insert title here</title>
</head>
<body>
<form action="last1.jsp" method=post name=frm onSubmit="return Validation()">
<a style=color:blue href="search.jsp">Back</a>
<table width="900" height="1" border="0" align="center">
<tr>
<th><a style=color:blue href="home.html">Home</a></th>
<th><a style=color:blue href="print.jsp">Print Tickets</a></th>
<th><a style=color:blue href="cancel.jsp">Cancel Tickets</a></th>
<th><a style=color:blue href="aboutus.html">About Us</a></th>
<th>
Need Help?Call <b style=color:blue>Bangalore</b> <select name="phno">
<option>8904296377</option>
<option>9535389398</option>
<option>8553432070</option>
</select>
</th>
</tr>
</table>
<hr style=color:#D3D3D3 size="2px">
<table width="900" height="70" align="center" border="0">
<tr>
<th><img src="D:\bus\images\th.jpg" align="right"><img src="D:\bus\images\Blue-Bus-Logo
(264 x 89).jpg" align="left"></th>
</tr>
</table>
<hr style=color:#D3D3D3 size="2px">
</tr>
<tr>
<td>Bus No</td>
<td>Available seats</td>
<td>Date</td>
<td>Boarding Point</td>
<td>No of Seats</td>
<td>Fare Per Seats</td>
</tr>
<tr>
<%
String available=request.getParameter("Seats");
String B=request.getParameter("Busno");
String F=request.getParameter("Fare");
%>
<td><input type="text" name="busno" value="<%=B %>" readonly="readonly"></td>
<td><input type="text" name="seats" value="<%=available %>" readonly="readonly"></td>
<td><input type="date" name="date1"></td>
<td><select name="BP">
<option></option>
<option value=Majestic>Majestic</option>
<option value=Jayanagar>Jayanagar 4th block</option>
<option value=Shantinagar>Shantinagar</option>
<option value=Brigade>J.P nagar(Brigade Millenium)</option>
<option value=BTM>B.T.M Layout</option>
</select>
</td>
<td><select name="noseats">
<option></option>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
</select></td>
<td><input type="text" name="fare1" value="<%=F %>" readonly="readonly"></td>
</tr>
<tr>
<tr>
<td><input type="text" name="name1"></td>
<td><input type="radio" name="gender" value="M" checked="checked"> M <input
type="radio" name="gender" value="F"> F</td>
<td>
<input type="text" name="age"></td>
</tr>
<tr>
</table>
<table width="500" height="300" align="center" border="1">
<tr>
<th>
<table width="500" height="300" align="center" border="0">
<tr>
<td> Home Address
<input type="text" name="address"></td>
</tr>
<tr>
<td>Alternate Contact No <input type="text" name="contact"></td>
</tr>
<tr>
<td> Landmark
<input type="text" name="landmark"></td>
</tr>
<tr>
<td> City
<input type="text" name="city"></td>
</tr>
<tr>
<td> Area  
;
<input type="text" name="area"></td>
</tr>
<tr>
<td> Pincode &n
bsp;
<input type="text" name="pincode"></td>
</tr>
<tr>
<td colspan="2">
<input style=background:red style=color:white style=border-style:none type="submit"
name="Book" value="Confirm" onfocus="Validation()">
</td>
</tr>
</table>
</th>
</tr>
</table>
</body>
</html>
CONFIRM.JSP
try
{
String NS=request.getParameter("noseats");
String BS1=request.getParameter("busno");
int BS2=Integer.parseInt(BS1);
String AS=request.getParameter("seats");
int AS1=Integer.parseInt(AS);
int NS1=Integer.parseInt(NS);
int X=AS1-NS1;
String F1=request.getParameter("fare1");
int F2=Integer.parseInt(F1);
int F3=NS1*F2;
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");
Statement st1=con.createStatement();
<tr>
<th>Bus Number</th>
<td><input type="text" name="bsno" value="<%=BS1%>" readonly="readonly"></td>
<th>Passanger Name</th>
<td><input type="text" name="pname" value="<%=n4%>" readonly="readonly"></td>
</tr>
<tr>
<th>E-mail ID</th>
<td><input type="text" name="eml" value="<%=n7%>" readonly="readonly">
<th>Phone Number</th>
<td><input type="text" name="cnt" value="<%=n8%>" readonly="readonly"></td>
</tr>
<tr>
<th>Number Of Seats</th>
<td><input type="text" name="nos" value="<%=NS%>" readonly="readonly"></td>
<th>Fare Per Seat</th>
<td><input type="text" name="fre" value="<%=F1%>" readonly="readonly"></td>
</tr>
<tr>
<th>Amount Payable</th>
<td><input type="text" name="tf" value="<%=F3%>" readonly="readonly"></td>
</tr>
<tr>
<th><input type="submit" name="SUB" value="Proceed To Print"></th>
</tr>
</table>
<%
}
catch(Exception e)
{
out.println("heloo");
}
%>
</form>
</body>
</html>
LAST.JSP
<%
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");
Statement st2=con.createStatement();
Statement st3=con.createStatement();
String BS=request.getParameter("bsno");
String Em=request.getParameter("eml");
ResultSet rt1=st2.executeQuery(("select * from bus b, bookdetails c where c.busno=b.busno and
b.busno='"+BS+"' and c.Email='"+Em+"'"));
while(rt1.next())
{
%>
<table>
<tr>
<th><h2 style=color:#4169E1><b>Your Ticket Booking Details Are</b></h2></th>
</tr>
</table>
<table align="center" width="1000" height="200" cellspacing="4"
BORDERCOLOR="#000000">
<tr>
<th>Bus Number</th>
<th><input style=border:hidden type="text" name="BSN"
value="<%=rt1.getString("busno")%>" readonly="readonly"></th>
<th>Ticket Number</th>
<th><input style=border:hidden type="text" name="TKN"
value="<%=rt1.getString("Ticketno")%>" readonly="readonly"></th>
</tr>
<tr>
<th>Travel(Bus Type)</th>
<th><input style=border:hidden type="text" name="TR"
value="<%=rt1.getString("travelbustype")%>"
readonly="readonly"></th>
<th>Date</th>
<th><input style=border:hidden type="text" name="DT" value="<%=rt1.getString("Date")%>"
readonly="readonly"></th>
</tr>
<tr>
<th>From</th>
<th><input style=border:hidden type="text" name="FR" value="<%=rt1.getString("from1")%>"
readonly="readonly"></th>
<th>To</th>
<th><input style=border:hidden type="text" name="T" value="<%=rt1.getString("to1")%>"
readonly="readonly"> </th>
<th>Arrival Place</th>
<th><input style=border:hidden type="text" name="AR"
value="<%=rt1.getString("Arrivalplace")%>" readonly="readonly"></th>
</tr>
<tr>
<th>Departure</th>
<th><input style=border:hidden type="text" name="DP"
value="<%=rt1.getString("departure")%>" readonly="readonly"></th>
<th>No Of Seats</th><th><input style=border:hidden type="text"
name="NSS" value="<%=rt1.getString("Noseats") %>" readonly="readonly"></th>
</tr>
<tr>
<th>Arrival</th>
<th><input style=border:hidden type="text" name="AR1"
value="<%=rt1.getString("arrival")%>" readonly="readonly"></th>
<th>Name</th><th><input style=border:hidden type="text" name="NM"
value="<%=rt1.getString("Name")%>" readonly="readonly"></th>
</tr>
<tr>
<th>Duration</th>
<th><input style=border:hidden type="text" name="DR"
value="<%=rt1.getString("duration")%>" readonly="readonly"></th>
<th>Gender</th><th><input style=border:hidden type="text" name="GN"
value="<%=rt1.getString("Gender")%>" readonly="readonly"></th>
</tr>
<tr>
<th>Fare/seat</th>
<th><input style=border:hidden type="text" name="FR" value="<%=rt1.getString("fare")%>"
readonly="readonly"></th>
<th>Age</th>
<th><input style=border:hidden type="text" name="AG" value="<%=rt1.getString("Age")%>"
readonly="readonly"></th>
</tr>
<tr>
<th>E-Mail ID</th>
<th><input style=border:hidden type="text" name="EM"
value="<%=rt1.getString("Email")%>" readonly="readonly"></th>
<th>Phone Number</th>
<%
}
%>
<form action="home.html">
<table align="right" width="400" height="5">
<tr>
<th>
<input type="submit" name="finish" value="Finish">
</th>
</tr>
</table>
</form>
</body>
</html>
PRINT.HTML
var Nme=document.f1.Nme
var Eid=document.f1.Eid
var Phn=document.f1.Phn
if((ptext.value=="") || (ptext.value==null))
{
alert("Enter Your Ticket Number");
ptext.focus()
return false
}
else
if((pbusno.value=="") || (pbusno.value==null))
{
alert("Enter Bus Number");
pbusno.focus()
return false
}
else
if((Nme.value=="") || (Nme.value==null))
{
alert("Enter Your Name");
Nme.focus()
return false
}
else
if((Eid.value=="") || (Eid.value==null))
{
alert("Enter Your E-mail ID ");
Eid.focus()
return false
}
else
if((Phn.value=="") || (Phn.value==null))
{
alert("Enter Your Contact Number");
Phn.focus()
return false
}
return true
}
</script>
<title>Insert title here</title>
</head>
<body bgcolor="white">
<form action="retrievenprint.jsp" name="f1" onSubmit="return val()" method="post">
<a style=color:blue href="home.html">Back</a>
</th>
</tr>
</table>
<hr style=color:#D3D3D3 size="2px">
<table bgcolor="white" width="900" height="40" align="center" border="0">
<tr>
<th><img src="D:\bus\images\th.jpg" align="right"><img src="D:\bus\images\Blue-Bus-Logo
(264 x 89).jpg" align="left"></th>
</tr>
</table>
<hr style=color:#D3D3D3 size="2px">
<h1 style=color:blue align="center">Print Ticket</h1>
<table width="500" height="200" align="center" border="0" cellspacing="20">
<tr>
<th>Ticket Number </th><th><input type="text" name="ptext"></th><th>Bus
Number</th><th><input type="text" name="bsno"></th>
</tr>
<tr>
<th>Your Name</th><th><input type="text" name="Nme"></th><th>E-mail
ID</th><th><input type="text" name="eml"></th>
</tr>
<tr>
<th>Phone Number</th><th><input type="text" name="Phn"></th>
</tr>
<tr>
<th><input style="background:red;color:white;border-style:none;" type="submit"
name="psubmit" value="Submit" onfocus="val()"></th>
</tr>
</table>
</form>
<hr style=color:#D3D3D3 size="2px">
<p align="center" class="copy">2014 © BlueBus.com Designed By Vaibhav</p>
</body>
</html>
RETRIEVENPRINT.JSP
<%
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");
Statement st2=con.createStatement();
Statement st3=con.createStatement();
String BS=request.getParameter("bsno");
String Em=request.getParameter("eml");
<th>No Of Seats</th>
<th><input style=border:hidden type="text" name="NSS" value="<%=rt1.getString("Noseats")
%>" readonly="readonly"></th>
</tr>
<tr>
<th>Arrival</th>
<th><input style=border:hidden type="text" name="AR1"
value="<%=rt1.getString("arrival")%>" readonly="readonly"></th>
<th>Name</th><th><input style=border:hidden type="text" name="NM"
value="<%=rt1.getString("Name")%>" readonly="readonly"></th>
</tr>
<tr>
<th>Duration</th>
<th><input style=border:hidden type="text" name="DR"
value="<%=rt1.getString("duration")%>" readonly="readonly"></th>
<th>Gender</th><th><input style=border:hidden type="text" name="GN"
value="<%=rt1.getString("Gender")%>" readonly="readonly"></th>
</tr>
<tr>
<th>Fare/seat</th>
<th><input style=border:hidden type="text" name="FR" value="<%=rt1.getString("fare")%>"
readonly="readonly"></th>
<th>Age</th>
<th><input style=border:hidden type="text" name="AG" value="<%=rt1.getString("Age")%>"
readonly="readonly"></th>
</tr>
<tr>
<th>E-Mail ID</th>
<th><input style=border:hidden type="text" name="EM"
value="<%=rt1.getString("Email")%>" readonly="readonly"></th>
<th>Phone Number</th>
<th><input style=border:hidden type="text" name="PH" value="<%=rt1.getString("Phno")%>"
readonly="readonly"></th>
</tr>
<tr>
<th>Pincode</th>
<th><input style=border:hidden type="text" name="PN"
value="<%=rt1.getString("Pincode")%>" readonly="readonly"></th>
</tr>
<tr>
<th>Amount Payable</th>
<th><input style=border:hidden type="text" name="AM" value="<%=rt1.getString("Fare")%>"
readonly="readonly"></th>
</tr>
</table>
<%
}
%>
</form>
<table align="right" width="400" height="1" border="0">
<tr>
<th>
<input type=button onclick="C()" value="print" align="center">
</th>
</tr>
</table>
</body>
</html>
CANCEL.JSP
if((ctext1.value=="") || (ctext1.value==null))
{
alert("Enter Your Ticket Number");
ctext1.focus()
return false
}
else
if((ctext2.value=="") || (ctext2.value==null))
{
alert("Enter Bus Number");
ctext2.focus()
return false
}
else
if((ctext3.value=="") || (ctext3.value==null))
{
alert("Enter Your Name");
ctext3.focus()
return false
}
else
if((ctext4.value=="") || (ctext4.value==null))
{
alert("Enter Your E-mail ID ");
ctext4.focus()
return false
}
else
if((ctext5.value=="") || (ctext5.value==null))
{
alert("Enetr Your Contact Number");
ctext5.focus()
return false
}
return true
}
</script>
<title>Insert title here</title>
</head>
<body bgcolor="white">
<form action="complete.jsp" name="f2" onSubmit="return vali()">
<a style=color:blue href="home.html">Back</a>
<table width="900" height="1" border="0" align="center">
<tr>
<th><a style=color:blue href="home.html">Home</a></th>
<th><a style=color:blue href="print.html">Print Tickets</a></th>
<th><a style=color:blue href="cancel.jsp">Cancel Tickets</a></th>
<th><a style=color:blue href="aboutus.html">About Us</a></th>
<th>
Need Help?Call <b style=color:blue>Bangalore</b> <select name="phno">
<option>8904296377</option>
<option>9535389398</option>
<option>8553432070</option>
</select>
</th>
</tr>
</table>
<hr style=color:#D3D3D3 size="2px">
<table bgcolor="white" width="900" height="40" align="center" border="0">
<tr>
<th><img src="D:\bus\images\th.jpg" align="right"><img src="D:\bus\images\Blue-Bus-Logo
(264 x 89).jpg" align="left"></th>
</tr>
</table>
<hr style=color:#D3D3D3 size="2px">
<h1 style=color:blue align="center">Cancel Ticket</h1>
<table width="350" height="200" align="center" border="0" cellspacing="20">
<tr>
<th>Ticket Number</th><th><input type="text" name="ctext1"></th><th>Bus
Number</th><th><input type="text" name="ctext2"></th>
</tr>
<tr>
<th>Your Name</th><th><input type="text" name="ctext3"></th><th>E-mail</th><th><input
type="text" name="ctext4"></th>
</tr>
<tr>
<th>Phone Number</th><th><input type="text" name="ctext5"></th>
</tr>
<tr>
<th><input style=background:red style=color:white style=border-style:none type="submit"
name="Csubmit" value="Submit" onfocus="vali()"></th>
</tr>
</table>
</body></html>
COMPLETE.JSP
</head>
<body>
<form action="cancel1.jsp" name="can">
<%
String TN=request.getParameter("ctext1");
String BN=request.getParameter("ctext2");
String NN=request.getParameter("ctext3");
String EM=request.getParameter("ctext4");
String PH=request.getParameter("ctext5");
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");
Statement st5=con.createStatement();
ResultSet rs5=st5.executeQuery("select * from bookdetails where Ticketno='"+TN+"' and
busno='"+BN+"'");
while(rs5.next())
{%>
<table width="350" height="200" align="center" border="0" cellspacing="20">
<tr>
<th>Ticket Number</th><th><input type="text" name="c1" value="<%=TN%>"></th><th>Bus
Number</th><th><input type="text" name="c2" value="<%=BN%>"></th>
</tr>
<tr>
<th>Your Name</th><th><input type="text" name="c3" value="<%=NN%>"></th><th>E-
mail</th><th><input type="text" name="c4" value="<%=EM%>"></th>
</tr>
<tr>
<th>Phone Number</th><th><input type="text" name="c5" value="<%=PH%>"></th>
<th>No Of Seats</th><th><input type="text" name="c6"
value="<%=rs5.getString("Noseats")%>"></th>
</tr>
<tr>
<th>Arrival Place</th><th><input type="text" name="c7"
value="<%=rs5.getString("Arrivalplace")%>"></th>
<th>Date</th><th><input type="text" name="c8" value="<%=rs5.getString("Date")%>"></th>
</tr>
<tr>
<th>Age</th><th><input type="text" name="c9" value="<%=rs5.getString("Age")%>"></th>
<th>Gender</th><th><input type="text" name="c10"
value="<%=rs5.getString("Gender")%>"></th>
</tr>
<tr>
<th>Address</th><th><input type="text" name="c11"
value="<%=rs5.getString("Address")%>"></th>
<%
}
%>
</form>
</body>
</html>
CANCEL1.JSP
%>
<h1><% out.println("Your Ticket Is Cancelled Successfully");%></h1>
</body>
</html>
ADMIN.HTML
if(y1.value==""||y1.value==null)
{
alert("Enter Password")
y1.focus();
return false;
}
if(y1.value.length<7)
{
alert("password should be atleast 7 characters")
y1.focus();
return false;
}
return true;
}
</script>
<title>ADMIN PAGE</title>
</head>
<body bgcolor="white">
<img src="D:\bus\images\Blue-Bus-Logo (264 x 89).jpg" align="left"><img
src="D:\bus\images\administrator.jpg" align="left"><br><br>
<h2 align=center style=color:grey>LOGIN</h2><br><br>
INNER.JSP
<%
String name=request.getParameter("uname");
String name1=request.getParameter("pwd");
String qry;
qry="select uname,pwd from admin";
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery(qry);
int x=0;
while(rs.next())
{
String un=rs.getString(1);
String pd=rs.getString(2);
if(un.equalsIgnoreCase(name)&&pd.equalsIgnoreCase(name1))
{
%>
<jsp:forward page="update.jsp"></jsp:forward>
x=1;
<%
}
if(x==0)
{
%>
UPDATE.JSP
</form>
</body>
</html>
NEW.JSP
if((B1.value=="") || (B1.value==null))
{
alert("Enter The Busno");
B1.focus()
return false
}
else
if((T1.value=="") || (T1.value==null))
{
alert("Enter Travels Name");
T1.focus()
return false
}
else
if((F1.value=="") || (F1.value==null))
{
alert("Enter From Place (Source)");
F1.focus()
return false
}
else
if((T11.value=="") || (T11.value==null))
{
alert("Enter To Place (Destination)");
T11.focus()
return false
}
else
if((D1.value=="") || (D1.value==null))
{
alert("Enter The Departure Time");
return false
}
else
if((A1.value=="") || (A1.value==null))
{
alert("Enter The Arrival Time");
A1.focus()
return false
}
else
if((D11.value=="") || (D11.value==null))
{
alert("Enter The Duration Of Journey");
D11.focus()
return false
}
else
if((R1.value=="") || (R1.value==null))
{
alert("Enter The Ratings");
R1.focus()
return false
}
else
if((F11.value=="") || (F11.value==null))
{
alert("Enter Fare Per Seat");
F11.focus()
return false
}
else
if(isNaN(F11.value))
{
alert("Text Not Allowed In Fare Field");
F11.focus();
return false;
}
else
if((S1.value=="") || (S1.value==null))
{
alert("Enter Number Of Seats");
S1.focus()
return false
}
else
if(isNaN(S1.value))
{
alert("Text Not Allowed In Seats Field");
S1.focus();
return false;
}
return true
}
</script>
<title>Insert title here</title>
</head>
<body>
<a style=color:blue href="update.jsp">Back</a>
<table bgcolor="white" width="500" height="20" align="left" border="0">
<tr>
<th><img src="D:\bus\images\administrator.jpg" align="left"></th>
</tr>
</table>
<h1>Insert The Information To Be Applied For New Travels</h1>
<form action="new.jsp" name="frm1" onsubmit="return valid()">
<table width="400" height="70" align="center" border="0">
<tr>
<th>Bus no</th><th><input type="text" name="Nbusno"></th>
</tr>
<tr>
<th>Travel(Bus type)</th><th><input type="text" name="Ntravelbustype"></th>
</tr>
<tr>
<th>From</th><th><input type="text" name="Nfrom"></th>
</tr>
<tr>
int NB1=Integer.parseInt(NB);
String NTBT=request.getParameter("Ntravelbustype");
String NF=request.getParameter("Nfrom");
String NT=request.getParameter("Nto");
String ND=request.getParameter("Ndept");
String NA=request.getParameter("Narr");
String NDR=request.getParameter("Ndur");
String NR=request.getParameter("Nrate");
String NFR=request.getParameter("Nfare");
String NS=request.getParameter("Nseats");
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");
Statement st1=con.createStatement();
int rs=st1.executeUpdate("insert into bus
(busno,travelbustype,from1,to1,departure,arrival,duration,ratings,fare,seats)
values('"+NB1+"','"+NTBT+"','"+NF+"','"+NT+"','"+ND+"','"+NA+"','"+NDR+"','"+NR+"','"+N
FR+"','"+NS+"')");
out.println("Inserted");
}
catch(Exception e)
{
out.println("");
}
%>
</body>
</html>
EDIT.JSP
var B2=document.frm2.Ebusno
if((B2.value=="") || (B2.value==null))
{
alert("Enter The Busno");
B2.focus()
return false
}
return true
}
</script>
<title>Insert title here</title>
</head>
<body>
<form action="edit.jsp" name="frm2" onsubmit="return validate()">
<a style=color:blue href="update.jsp">Back</a>
<table bgcolor="white" width="500" height="20" align="left" border="0">
<tr>
<th><img src="D:\bus\images\administrator.jpg" align="left"></th>
</tr>
</table>
<h1>Insert The Information To Be Updated For Existing Travels</h1>
<table width="400" height="70" align="center" border="0">
<tr>
<th>Bus no</th><th><input type="text" name="Ebusno"></th>
<th><input type="Submit" name="Editsearch" value="search" align="middle"
onfocus="validate()"></th>
</tr>
</table>
<%ss
String BS=request.getParameter("Ebusno");
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");
Statement st1=con.createStatement();
ResultSet rs=st1.executeQuery("select * from bus where busno='"+BS+"'");
if(rs.next())
{
%>
<table>
<tr>
<th>Bus no</th><th><input type="text" name="Ebusno" value="<%=rs.getString("busno")%>"
readonly="readonly"></th>
</tr>
<tr>
<th>Travel(Bus type)</th><th><input type="text" name="Etravelbustype"
value="<%=rs.getString("travelbustype")%>"></th>
</tr>
<tr>
<th>From</th><th><input type="text" name="Efrom"
value="<%=rs.getString("from1")%>"></th>
</tr>
<tr>
<th>To</th><th><input type="text" name="Eto" value="<%=rs.getString("to1")%>"></th>
</tr>
<tr>
<th>Departure</th><th><input type="text" name="Edept"
value="<%=rs.getString("departure")%>"></th>
</tr>
<tr>
<th>Arrival</th><th><input type="text" name="Earr"
value="<%=rs.getString("arrival")%>"></th>
</tr>
<tr>
<th>Duration</th><th><input type="text" name="Edur"
value="<%=rs.getString("duration")%>"></th>
</tr>
<tr>
<th>Ratings</th><th><input type="text" name="Erate"
value="<%=rs.getString("ratings")%>"></th>
</tr>
<tr>
<th>Fare</th><th><input type="text" name="Efare" value="<%=rs.getString("fare")%>"></th>
</tr>
<tr>
<th>Seats Containing</th><th><input type="text" name="Eseats"
value="<%=rs.getString("seats")%>"></th>
</tr>
</table>
<%
}
%>
</form>
<table>
<tr>
<td><input type="Submit" name="EditUpdate" value="Proceed" align="right"></td>
</tr>
</table>
<%
try
{
String EB=request.getParameter("Ebusno");
int EB1=Integer.parseInt(EB);
String ETBT=request.getParameter("Etravelbustype");
String EF=request.getParameter("Efrom");
String ET=request.getParameter("Eto");
String ED=request.getParameter("Edept");
String EA=request.getParameter("Earr");
String EDR=request.getParameter("Edur");
String ER=request.getParameter("Erate");
String EFR=request.getParameter("Efare");
String ES=request.getParameter("Eseats");
Class.forName("com.mysql.jdbc.Driver");
Connection
con1=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");
Statement st2=con.createStatement();
int rt=st2.executeUpdate("update bus set
travelbustype='"+ETBT+"',from1='"+EF+"',to1='"+ET+"',departure='"+ED+"',arrival='"+EA+"',
duration='"+EDR+"',ratings='"+ER+"',fare='"+EFR+"',seats='"+ES+"' where
busno='"+EB1+"'");
}
catch(Exception e)
{
out.println(e);
}
%>
</body>
</html>
MESSAGE.jsp:
</body>
</html>
CHECKING.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*"%>
<%@ page import="javax.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<a style=color:blue href="update.jsp">Back</a>
<table bgcolor="white" width="900" height="40" align="center" border="0">
<tr>
<th><img src="images\th.jpg" align="right"><img src="images\Blue-Bus-Logo (264 x 89).jpg"
align="left"></th>
</tr>
</table>
<hr style=color:#D3D3D3 size="2px">
<%
String f=request.getParameter("FROM");
String t=request.getParameter("TO");
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","123456");
Statement st=con.createStatement();
ResultSet rtt=null;
rtt=st.executeQuery("select * from bookdetails");
%>
<table>
<tr>
<th> <h2
style=color:#4169E1><b>Customer Booking Deatils</b></h2></th>
</tr>
</table>
<table border="1" align="center" BGCOLOR="white">
<tr>
<th>
<table align="center" width="900" height="200" cellspacing="30"
BORDERCOLOR="#000000">
<tr><th><u>Ticket Number</u></th><th><u>Date</u></th><th><u>Arrival
Place</u></th><th><u>No Of
Seats</u></th><th><u>Name</u></th><th><u>Gender</u></th>
<th><u>Age</u></th><th><u>Email-ID</u></th><th><u>Phone
Number</u></th><th><u>Address</u></th><th><u>Alternate
Contact</u></th><th><u>Landmark</u></th>
<th><u>City</u></th><th><u>Area</u></th><th><u>Pincode</u></th><th><u>Bus
Number</u></th><th><u>Amount Payable</u></th></tr>
<%
while(rtt.next())
{
%>
<tr><td><input readonly="readonly" style=border:"0" size="1" color="#000000" type="text"
name="chTCK" value="<%=rtt.getString("Ticketno")%>"></td>
<td><input readonly="readonly" style=border:"0" size="8"color="#000000" type="text"
name="chDTE" value="<%=rtt.getString("Date")%>"></td>
<td><input readonly="readonly" style=border:"0" size="10" color="#000000" type="text"
name="chARR" value="<%=rtt.getString("Arrivalplace")%>"></td>
<td><input readonly="readonly" style=border:"0" size="1" color="#000000" type="text"
name="chNOS" value="<%=rtt.getString("Noseats")%>"></td>
<td><input readonly="readonly" style=border:"0" size="10" color="#000000" type="text"
name="chNME" value="<%=rtt.getString("Name")%>"></td>
<td><input readonly="readonly" style=border:"0" size="1" color="#000000" type="text"
name="chGEN" value="<%=rtt.getString("Gender")%>"></td>
<td><input readonly="readonly" style=border:"0" size="1" color="#000000" type="text"
name="chAGE" value="<%=rtt.getString("Age")%>"></td>
<td><input readonly="readonly" style=border:"0" size="10" color="#000000" type="email"
name="chEML" value="<%=rtt.getString("Email")%>"></td>
<td><input readonly="readonly" style=border:"0" size="10" color="#000000" type="text"
name="chPHN" value="<%=rtt.getString("Phno")%>"></td>
<td><input readonly="readonly" style=border:"0" size="25"color="#000000" type="text"
name="chADD" value="<%=rtt.getString("Address")%>"></td>
<td><input readonly="readonly" style=border:"0" size="10"color="#000000" type="text"
name="chALT" value="<%=rtt.getString("AltPhno")%>"></td>
<td><input readonly="readonly" style=border:"0" size="10"color="#000000" type="text"
name="chLND" value="<%=rtt.getString("Landmark")%>"></td>
<%
}
%>
</table>
</th>
</tr>
</table>
SNAPSHOTS
TESTING
Unit Testing: Initial every module was tested here to detect coding errors. AlsoEvery module
is authenticated with validation using certain tools. Every
part of each module was tested here.
Integrated Testing : After Unit testing , different modules were combined to form
entire system. This testing was done to check errors that occur while interconnection of
modules. To see if all modules are working and linking properly on generation of events.
CONCLUSION
The project has been a rewarding experience in more ways than one. We have
gained a lot of knowledge in HTML, J.S, SQL and J.S.P etc. By developing the
project.
We got a platform to put in our ideas into the project. We also have
experienced that how much creative we are and we have also gained much in
developing forms.
FUTURE ENHANCEMENT
Our future enhancement would be, to develop this project using high-end
softwares so that the customer can the it from anywhere, anytime very
conveniently.
We aim to provide packages for the Customer including Hotel and Taxi services.
The customer would also be able to receive the tickets online if necessary.
We also aim to increase the security of the Customer details by using High security
techniques.
BIBLIOGRAHY
www.w3schools.com.
www.google.com.