Académique Documents
Professionnel Documents
Culture Documents
: 1
Session : 2008-2009
A project report on
Of
By
Internal Guide:
JANEET KAUR
Lecturer,
Department of Computer Science & IT,
P.C.M.S.D. College For Women,
Jalandhar – 144 001.
TRINITY COLLEGE
JALANDHAR
TRINITY COLLEGE
JALANDHAR
CERTIFICATE
This is to certify that project entitled
submitted by
Internal Guide:
Janeet Kaur,
Miss. Jaspreet Thind Head,
Lecturer, Department of Computer Science & IT,
Department of Computer Science & P.C.M.S.D. College for Women,
IT, Jalandhar – 144 001.
P.C.M.S.D. College for Women,
Jalandhar – 144 001.
Sister Stella
Principal,
__________________ TRINITY College,
Signature Jalandhar - 144001
____________________
SIGNATURE
Introduction
Reservation of Ticket
• Amritsar
• Jalandhar
• Ludhiana
• Ambala
• Panipat
• Sonipat
• New-Delhi
***************************************************
For the above mentioned destinations, the following type of
trains are available to run :
• Superfast
• Shatabadi Express
Reserve A Ticket
From To Train
***************************************************
Kms * 0.75 * No. of Passengers = Total Fair
***************************************************
***************************************************
Kms * 1.25 * No. of Passengers = Total Fair
***************************************************
Printing Of A Ticket
Ticket Info
Ticket Status
Cancel Ticket
Cancel A Ticket
Duplicate Ticket
Duplicate Ticket
Available Trains
Railway Network
DATA TYPES
INTEGER
FLOATING-POINT NUMBERS
STRING
DATE
BOOLEAN
CURRENCY
CONSTANTS
ARRAYS
VBSCRIPT ASSIGNMENTS
arrDays(5) = “Friday”
arrDays(6) = “Saturday”
Response.Write(“iIndex has a value of ”)
Response.Write(iIndex)
%>
<br>
arrDays(1) has a value of
<%
Response.Write(arrDays(1))
%>
<br>
arrDays(iIndex) has a value of
<%
Response.Write(arrDays(iIndex))
%>
<br>
arrDays(2+3) has a value of
<%
Response.Write(arrDays(2+3))
%>
<br>
arrDays(iIndex+1) has a value of
<%
Response.Write(arrDays(iIndex+1))
%>
</body>
</html>
OUTPUT
Conditional Logic
Looping Logic
Branching Logic
CONDIITIONAL LOGIC
1) If…Then Statements
The If…Then statement is one of the most
commonly used control structures. It takes the form
If condition Then
Code block
End If
2) If…Then…Else Statements
Sometimes it is useful to have segment of code
that executes only if the condition fails. You can add an else
statement to the if…then structure:
If condition Then
Code block 1
Else
Code block 2
End If
3) ElseIf Statement
MATH Functions
Abs(number) Absolute Value
Atn(number) Arctangent
Cos(number) Cosine
Exp(number) e ^ number
Fix(number) Integer portion
Hex(number) Base 10 to hexadecimal
Int(number) Integer portion
Log(number) Natural logarithm
DATE Functions
dtCurrentTime = Time
Response.Write(“Current time is “ & Time)
dtRightNow = Now
Examples
DateAdd(“m”, 1, #12/7/90#) would return
1/7/91
DateAdd(“d”, 1, Date) would return
tomorrow’s date.
DateAdd will not return an invalid date.
STRING Functions
It allow you to retrieve and change part or all of a
string or a series of strings. Many programmers
find string manipulation to be one of the most
annoying and tiresome aspects of programming,
but VBScript makes things much easier.
Response Object
Response is used to send output. The Write
method sends output to the user’s Web browser. Response
can also control how and when data is sent and write cookies
to store information.
Request Object
Request is used to retrieve data from the client.
When the client’s Web browser makes a request for a
particular page, it sends some information along to the
server. That data is packaged together in the Request object.
Some of it may be useful to the requested page; some of it
may not be. Request allows the page to retrieve what it needs
– cookie information, information from a form, query string
data, and more.
Application Object
Application is used to share information among
several clients visiting the same group of pages. In ASP, the
term application refers to all the .asp pages in a directory
and its subdirectories. Only one instance of the Application
object is created per application. It is shared among all the
clients accessing that application.
Session Object
Session refers to a single client accessing an
application. Therefore, a new instance of the Session object
is created for each session. Session is important to carrying
information as a client travels between pages because
Session variables persist for the entire session. One page can
store data into a Session variable, and that data can be
accessed from other page in the session.
Server Object
The Server object provides a few basic properties and
methods. Probably the most important of these is the
CreateObject method. CreateObject is used to create an
instance of server component. Components are packages of
related objects that you can use in your pages. They make
common ASP tasks easier, and add a great deal of power to
your pages. CreateObject is used in conjunction with the Set
statement.
Response.Write
Response.Buffer
You can specify whether you want buffering using
the Response property Response.buffer = True turns on
buffering, Response.buffer = False turns it off. Buffering
may seem unimportant. In most of your pages, the buffering
setting will not matter. In some circumstances it is helpful to
be able to specify it, though. If you have a page that will take
a long time to finish processing, you might want to turn off
buffering so that users can start reading part of your output
while the rest is processing.
Response.Clear
Suppose that you have buffering turned on. As
your script is executing, output is being sent to the buffer.
Calling Response.Clear causes that buffer to be wiped out.
Response.Flush
Like Response.Clear, Response.Flush flushes all
the data from the system buffer. However, Response.Flush
first sends it to the client. This is useful when you want to
send a chunk of the output on to the client. Like
Response.Clear, Response.Flush produces an error message
when buffering is turned off.
Response.End
Response.End ends execution of the script. If
buffering is turned on and there is any buffered data, it is
sent. Any statements after the Response.End are not carried
out. This is a more abrupt end than simply allowing the
script to end on its own, and so should be avoided if possible.
It can be useful, though, when problems (such as bad data)
are detected to prevent them from making things worse.
<html>
<body>
<%
Dim lngCounter, lngTimeWaster
Response.Write(“It is now: “ & Now)
Response.Write(“<BR>”)
For lngCounter = 1 to 5000000
lngTimeWaster = lngTimeWaster + 1
Next
Response.Write(“It is now: “ & Now)
%>
</body>
</html>
Sample Program
<html>
<body>
<form method=post action=”calculatelifeexpectancy.asp”>
</html>
iAge = Request(“Age”)
strGender = Request(“Gender”)
strE = Request(“E”)
strA = Request(“A”)
strB12 = Request(“B12”)
strC = Request(“C”)
strASP = Request(“ASP”)
strAttitude = Request(“Attitude”)
Dim iDaysAlive
iDaysAlive = iAge * 365
‘Now, find out how many days they have left to live by
‘subtracting the expected total days of life by the days
‘of life lived thus far (based upon gender)
Dim iDaysToLive
Using Cookies
which Web site created what cookie, and only allow cookied
to be read by the proper Web sites.
Reading Cookies
Writing Cookies
Response.Cookies(“MyFirstCookie”) = “Hello,
World!”
Response.Cookies(“UserInformation”)(“LastVisit”) =
Now
Response.Cookies(“UserInformation”)(“Name”) =
“Amit”
Resonse.Cookies(“UserInformation”)
(“UserAgentString”) =
Request.ServerVariables(“HTTP_USER_AGENT”)
Response.Redirect “ListAllCookies.asp”
%>
<html>
<body>
Hello <%=strName%>
<p>
What interests you?<br>
<li>
<a href=”sports.asp”>Sports</a><br>
<li>
<a href=”politics.asp”>Politics</a><br>
<li>
<a href=”fashion.asp”>Fashion</a><br>
<li>
<a href=”events.asp”>Current Events</a><br>
</body>
</html>
Reserveticket.asp
Validatenewticket.asp
Addnewticket.asp
Showticket.asp (used for displaying added data)
reserveticket.asp
Inputs the Ticket Information
For reservation
validatenewticket.asp
Validate the information filled
In reserveticket.asp and calculate
Kms, fair, Seat number and also
The coach.
addnewticket.asp
Adds the information to the database
To their required tables.
Deleteticket.html
Deleteticketinfo.asp
Deleteticket.html
Inputs the Ticket PNR number
For Cancellation or Deletion
Deleteticketinfo.asp
Get the data from the database
Relates to the given PNR number
And deletes the data whatever is
Displayed on the screen with the
Message.
Home Page
*********************************
Index.htm
*********************************
<html>
<head>
<title>Indian Railways Project : Ticket Reservation,
Cancellation, Duplicate, Railway Network, etc</title>
</head>
<frameset cols="50,*,50" border="0">
<frame src="side.html" name="side1" noresize>
<frameset rows="140,*" border="0">
<frame src="top.html" name="top" noresize
scrolling="auto">
<frameset cols="200,*" border="0">
<frame src="links.html" name="links" noresize
scrolling="auto">
<frame src="main.html" name="main" noresize
scrolling="auto"></frameset>
</frameset>
<frame src="side.html" name="side2" noresize>
</frameset> </html>
*********************************
Top.html
*********************************
<html>
<body>
<table align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/lalu1.jpg" width="125"
height="100"></td>
<td><img src="images/mainpic1.jpg" height="100"
width="125"></td>
<td> </td>
<td><img src="images/title.jpg"></td>
<td> </td>
<td><img src="images/mainpic2.jpg" height="100"
width="125"></td>
<td><img src="images/lalu2.jpg" height="100"
width="125"></td>
</tr>
</table>
</body> </html>
*********************************
Links.html
*********************************
<html>
<body alink="white" vlink="white" link="white">
<table align="center" cellpadding="0" cellspacing="0">
<tr><td><a href="main.html" target="main"><img
src="images/link0.jpg"></a></td></tr>
<tr><td><a href="reserveticket.asp" target="main"><img
src="images/link1.jpg"></a></td></tr>
<tr><td><a href="ticketinfo.html" target="main"><img
src="images/link2.jpg"></a></td></tr>
<tr><td><a href="cancelticket.html" target="main"><img
src="images/link3.jpg"></a></td></tr>
<tr><td><a href="ticket.html" target="main"><img
src="images/link4.jpg"></a></td></tr>
<tr><td><a href="trains.html" target="main"><img
src="images/link5.jpg"></a></td></tr>
<tr><td><a href="railnet.html" target="main"><img
src="images/link6.jpg"></a></td></tr>
<tr><td><font color="white">Indian
Railways</font></td></tr>
<tr><td><img src="images/leftlogo.jpg"></td></tr>
</table>
</body>
</html>
*********************************
Main.html
*********************************
<html>
<body>
<table align="center"><tr>
<td><img src="images/pic.jpg" style="border-
width:12px;border-color:salmon;border-
style:ridge"></td><td>  
;</td>
<td align="center"><img src="images/mainlogo1.gif">
<br /><font style="font-family:times new
roman;color:blue;font-weight:bold">Welcome to my site !!
</font>
*********************************
TRINITY College \ Roll No.: 2088 BCA 2008-2009
Indian Railways Page No.: 61
Reserveticket.asp
*********************************
<html>
<body>
<h1 align="center"><font color="blue">Reserve A
Ticket</font></h1>
<form method="post" name="form"
action="validatenewticket.asp">
<table align="center">
<tr><th>From</th><th>To</th><th>Train</th><tr>
<tr><td><select
name="from"><option></option><option>Amritsar</optio
n><option>Jalandhar</option><option>Ludhiana</option>
<option>Ambala</option><option>Panipat</option><optio
n>Sonipat</option><option>New-
Delhi</option></select></td><td><select
name="to"><option></option><option>Amritsar</option><
option>Jalandhar</option><option>Ludhiana</option><op
tion>Ambala</option><option>Panipat</option><option>S
onipat</option><option>New-
Delhi</option></select></td><td><select
name="train"><option></option><option>Superfast</optio
n><option>Shatabadi Express</option></td></tr>
</table>
<table align="center">
<tr><th>Sr.</th><th>Passenger
Name</th><th>Age</th><th>Sex</th></tr>
name="sex3"><option></option><option>M</option><opti
on>F</option></select></td></tr>
</table>
<table align="center">
<tr>
<td>Date (mm/dd/yyyy) : </td><td><select
name="date"><option><% = DateAdd("d",1,Date)
%></option><option><% = DateAdd("d",2,Date)
%></option><option><% = DateAdd("d",3,Date)
%></option><option><% = DateAdd("d",4,Date)
%></option><option><% = DateAdd("d",5,Date)
%></option><option><% = DateAdd("d",6,Date)
%></option><option><% = DateAdd("d",7,Date)
%></option><option><% = DateAdd("d",8,Date)
%></option><option><% = DateAdd("d",9,Date)
%></option><option><% = DateAdd("d",10,Date)
%></option></select></td>
</tr>
</table>
<br /><br />
<table align="center">
<tr>
<td><input type="submit" value="Reserve Ticket"
name="submit"></td>
*********************************
Validatenewticket.asp
*********************************
<%@ Language="VBScript"%>
<html>
<body>
<%
Const adOpenForwardOnly=0
Const adLockOptimistic=3
Const adLockPessimistic=2
Const adLockReadOnly=1
Const adCmdTable=2
Dim num
num=0
If(Request.Form("name2")="") then
num=1
Else
If(Request.Form("name3")="") then
num=2
Else
num=3
End If
End If
If(num=1) then
If(Request.Form("name1")="" OR
Request.Form("age1")="" OR Request.Form("sex1")=""
OR IsNumeric(Request.Form("age1"))=False) then
Response.Redirect("invalid.htm")
End If
Else
If(num=2) then
If(Request.Form("name1")="" OR
Request.Form("age1")="" OR Request.Form("sex1")=""
OR IsNumeric(Request.Form("age1"))=False OR
Request.Form("name2")="" OR Request.Form("age2")=""
OR Request.Form("sex2")="" OR
IsNumeric(Request.Form("age2"))=False) then
Response.Redirect("invalid.htm")
End If
Else
If(num=3) then
If(Request.Form("name1")="" OR
Request.Form("age1")="" OR Request.Form("sex1")=""
OR IsNumeric(Request.Form("age1"))=False OR
Request.Form("name2")="" OR Request.Form("age2")=""
OR Request.Form("sex2")="" OR
IsNumeric(Request.Form("age2"))=False OR
Request.Form("name3")="" OR Request.Form("age3")=""
OR Request.Form("sex3")="" OR
IsNumeric(Request.Form("age3"))=False) then
Response.Redirect("invalid.htm")
End If
Else
Response.Redirect("invalid.htm")
End If
End If
End If
If(Request.Form("from")=Request.Form("to")) then
Response.Redirect("invalid.htm")
End If
Session("num") = num
Session("from") = Request.Form("from")
Session("to") = Request.Form("to")
Session("train") = Request.Form("train")
Session("date") = Request.Form("date")
If(num=1) then
Session("name1") = Request.Form("name1")
Session("age1") = Request.Form("age1")
Session("sex1") = Request.Form("sex1")
Else
If(num=2) then
Session("name1") = Request.Form("name1")
Session("age1") = Request.Form("age1")
Session("sex1") = Request.Form("sex1")
Session("name2") = Request.Form("name2")
Session("age2") = Request.Form("age2")
Session("sex2") = Request.Form("sex2")
Else
If(num=3) then
Session("name1") = Request.Form("name1")
Session("age1") = Request.Form("age1")
Session("sex1") = Request.Form("sex1")
Session("name2") = Request.Form("name2")
Session("age2") = Request.Form("age2")
Session("sex2") = Request.Form("sex2")
Session("name3") = Request.Form("name3")
Session("age3") = Request.Form("age3")
Session("sex3") = Request.Form("sex3")
End If
End If
End If
iPNRnew=0
iSeatnew=0
iCoach = 0
Dim objConn
Set objConn =
Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=railway"
objConn.Open
Dim objRS
Set objRS =
Server.CreateObject("ADODB.Recordset")
objRS.Open "PNR", objConn, , adLockOptimistic,
adCmdTable
iPNRnew = objRS("PNR")
iSeatnew = objRS("Seat")
iCoach = objRS("Coach")
iPNRnew = iPNRnew + 1
If num=1 then
iSeat1 = iSeatnew + 1
If iSeat1>120 then
iSeat1 = 1
iCoach1 = iCoach + 1
Else
iCoach1 = iCoach
End If
Else
If num=2 then
iSeat1 = iSeatnew + 1
If iSeat1>120 then
iSeat1 = 1
iCoach1 = iCoach + 1
Else
iCoach1 = iCoach
End If
iSeat2 = iSeat1 + 1
If iSeat2>120 then
iSeat2 = 1
iCoach2 = iCoach + 1
Else
iCoach2 = iCoach
End If
Else
If num=3 then
iSeat1 = iSeatnew + 1
If iSeat1>120 then
iSeat1 = 1
iCoach1 = iCoach + 1
Else
iCoach1 = iCoach
End If
iSeat2 = iSeat1 + 1
If iSeat2>120 then
iSeat2 = 1
iCoach2 = iCoach + 1
Else
iCoach2 = iCoach
End If
iSeat3 = iSeat2 + 1
If iSeat3>120 then
iSeat3 = 1
iCoach3 = iCoach + 1
Else
iCoach3 = iCoach
End If
End If
End If
End If
objRS("PNR") = iPNRnew
If num=1 then
objRS("Seat") = iSeat1
Else
If num=2 then
objRS("Seat") = iSeat2
Else
If num=3 then
objRS("Seat") = iSeat3
End If
End If
End If
objRS("Coach") = iCoach
objRS.Update
objRS.Close
Session("PNR") = iPNRnew
Session("Seat1") = iSeat1
Session("Seat2") = iSeat2
Session("Seat3") = iSeat3
Session("Coach1") = iCoach1
Session("Coach2") = iCoach2
Session("Coach3") = iCoach3
Else
End If
End If
End If
End If
Else
kms = 100
Else
If(Request.Form("from") = "Ludhiana" AND
Request.Form("to") = "Panipat") then
kms = 200
Else
End If
End If
End If
End If
Else
kms = 100
Else
Else
If(Request.Form("from") = "Sonipat" AND
Request.Form("to") = "Jalandhar") then
kms = 320
Else
End If
End If
End If
End If
Else
kms = 220
Else
If num=2 then
Session("fair") = kms * 0.75 * 2
Else
If num=3 then
Session("fair") = kms * 0.75 * 3
Else
Session("fair") = kms * 0.75 * 1
End If
End If
Else
If num=2 then
Session("fair") = kms * 1.25 * 2
Else
If num=3 then
Session("fair") = kms * 1.25 * 3
Else
Session("fair") = kms * 1.25 * 1
End If
End If
End If
Response.Redirect("addnewticket.asp")
%>
</body>
</html>
*********************************
Addnewticket.asp
*********************************
<%@ Language=VBScript %>
<html>
<body>
<%
Const adOpenForwardOnly=0
Const adLockOptimistic=3
Const adLockPessimistic=2
Const adLockReadOnly=1
Const adCmdTable=2
Dim objConn
Set objConn =
Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=railway"
objConn.Open
Dim RS
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "ticket_info", objConn, , adLockOptimistic,
adCmdTable
RS.AddNew
RS("PNR") = Session("PNR")
RS("Fr") = Session("from")
RS("To") = Session("to")
RS("Dt") = Session("date")
RS("Kms") = Session("kms")
RS("Fair") = Session("fair")
RS("Pass") = Session("num")
RS("train") = Session("train")
RS.Update
RS.MoveFirst
Session("strPNR") = RS("PNR")
RS.Close
Set RS = Nothing
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "pass_info", objConn, , adLockOptimistic,
adCmdTable
If(Session("num") = 1) then
RS.AddNew
RS("PNR") = Session("PNR")
RS("PassName") = Session("name1")
RS("Age") = Session("age1")
RS("Sex") = Session("sex1")
RS("Seat") = Session("Seat1")
RS("Coach") = Session("Coach1")
RS.Update
Else
If(Session("num") = 2) then
RS.AddNew
RS("PNR") = Session("PNR")
RS("PassName") = Session("name1")
RS("Age") = Session("age1")
RS("Sex") = Session("sex1")
RS("Seat") = Session("Seat1")
RS("Coach") = Session("Coach1")
RS.Update
RS.AddNew
RS("PNR") = Session("PNR")
RS("PassName") = Session("name2")
RS("Age") = Session("age2")
RS("Sex") = Session("sex2")
RS("Seat") = Session("Seat2")
RS("Coach") = Session("Coach2")
RS.Update
Else
If(Session("num") = 3) then
RS.AddNew
RS("PNR") = Session("PNR")
RS("PassName") = Session("name1")
RS("Age") = Session("age1")
RS("Sex") = Session("sex1")
RS("Seat") = Session("Seat1")
RS("Coach") = Session("Coach1")
RS.Update
RS.AddNew
RS("PNR") = Session("PNR")
RS("PassName") = Session("name2")
RS("Age") = Session("age2")
RS("Sex") = Session("sex2")
RS("Seat") = Session("Seat2")
RS("Coach") = Session("Coach2")
RS.Update
RS.AddNew
RS("PNR") = Session("PNR")
RS("PassName") = Session("name3")
RS("Age") = Session("age3")
RS("Sex") = Session("sex3")
RS("Seat") = Session("Seat3")
RS("Coach") = Session("Coach3")
RS.Update
End If
End If
End If
RS.Close
Set RS = Nothing
objConn.Close
Set objConn = Nothing
Response.Redirect("showticket.asp")
%>
</body>
</html>
*********************************
Showticket.asp
*********************************
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include file="definitions.asp"-->
<html>
<head>
<style>
#print {font-size:11pt;font-weight:bold}
#print2 {font-size:9pt;font-weight:bold;font-family:arial}
</style>
</head>
<body>
<h1 align="center"><font color="blue">Reservation
Successful !!</font></h1>
<div style="position:absolute;left:60;top:80">
<img src="images/ticket.jpg">
</div>
<div style="position:absolute;left:140;top:160">
<table border="0" id="print">
<tr><td><%=Session("PNR")%></td><td><font
color="white">...........................</font>
<%=Session("train")%></td></tr>
</table>
</div>
<div style="position:absolute;left:250;top:215">
<% If Session("train") = "Superfast" then %>
<table id="print" border="0">
<tr><td><%=Session("from")%></td><td>To</td><td><
%=Session("to")%></td></tr>
</table>
</div>
<div style="position:absolute;left:100;top:270">
<table border="0" id="print2">
<tr><td><font color="white">.</font>S<
%=Session("Coach1")%></td><td><font
color="white">..........</font><%=Session("Seat1")
%></td><td><font color="white">..........</font><
%=Session("sex1")%></td><td><font
color="white">....</font><%=Session("age1")
%></td><td><font color="white">..</font><
%=Session("name1")%></td></tr>
<% If Session("num") >= 2 then %>
<tr><td><font color="white">.</font>S<
%=Session("Coach2")%></td><td><font
color="white">..........</font><%=Session("Seat2")
%></td><td><font color="white">..........</font><
%=Session("sex2")%></td><td><font
color="white">....</font><%=Session("age2")
%></td><td><font color="white">..</font><
%=Session("name2")%></td></tr>
<% End If
If Session("num") = 3 then %>
<tr><td><font color="white">.</font>S<
%=Session("Coach3")%></td><td><font
color="white">..........</font><%=Session("Seat3")
%></td><td><font color="white">..........</font><
%=Session("sex3")%></td><td><font
color="white">....</font><%=Session("age3")
%></td><td><font color="white">..</font><
%=Session("name3")%></td></tr>
<% End If %>
</table>
</div>
<br />
<br />
<div style="position:absolute;left:325;top:400">
<table align="center">
<tr><td><a href="main.html"
target="main">Home</a></td></tr>
</table>
</div>
<div style="position:absolute;left:380;top:280">
<table border="0" id="print">
<tr><td><%=Session("fair")%>/-</td><td></td></tr>
<tr><td><font
color="white">...................</font></td><td><
%=Session("kms")%> Kms</td></tr>
</table>
<% Else %>
<table id="print" border="0">
<tr><td><%=Session("from")%></td><td>To</td><td><
%=Session("to")%></td></tr>
</table>
</div>
<div style="position:absolute;left:100;top:270">
<table border="0" id="print2">
<tr><td><font color="white">.</font>C<
%=Session("Coach1")%></td><td><font
color="white">..........</font><%=Session("Seat1")
%></td><td><font color="white">..........</font><
%=Session("sex1")%></td><td><font
color="white">....</font><%=Session("age1")
%></td><td><font color="white">..</font><
%=Session("name1")%></td></tr>
<% If Session("num") >= 2 then %>
<tr><td><font color="white">.</font>C<
%=Session("Coach2")%></td><td><font
color="white">..........</font><%=Session("Seat2")
%></td><td><font color="white">..........</font><
%=Session("sex2")%></td><td><font
color="white">....</font><%=Session("age2")
%></td><td><font color="white">..</font><
%=Session("name2")%></td></tr>
<% End If
If Session("num") = 3 then %>
<tr><td><font color="white">.</font>C<
%=Session("Coach3")%></td><td><font
color="white">..........</font><%=Session("Seat3")
%></td><td><font color="white">..........</font><
%=Session("sex3")%></td><td><font
color="white">....</font><%=Session("age3")
%></td><td><font color="white">..</font><
%=Session("name3")%></td></tr>
<% End If %>
</table>
</div>
<br />
<br />
<div style="position:absolute;left:325;top:400">
<table align="center">
<tr><td><a href="main.html"
target="main">Home</a></td></tr>
</table>
</div>
<div style="position:absolute;left:380;top:280">
<table border="0" id="print">
<tr><td><%=Session("fair")%>/-</td><td></td></tr>
<tr><td><font
color="white">...................</font></td><td><
%=Session("kms")%> Kms</td></tr>
</table>
<% End If %>
</div>
</body>
</html>
*********************************
Ticketinfo.html
*********************************
<html>
<body>
<h1 align="center"><font color="blue">Ticket
Status</font></h1>
<form method="post" action="showticketinfo.asp">
<hr>
<table align="center">
<tr>
<td>Enter PNR Number : </td>
<td>
</td>
<td>
<input type="text" maxlength="5" size="25"
name="pnrno">
</td>
<td>
</td>
<td>
<input type="submit" value="Check Status"
name="PNRstatus">
</td>
</tr>
</table>
<hr>
</form>
</body>
</html>
*********************************
Showticketinfo.asp
*********************************
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include file="definitions.asp"-->
<html>
<body>
<h1 align="center">Ticket Information</h1>
<%
Dim ifound
ifound = 0
Dim objConn
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "ticket_info", objConn, , , adCmdTable
objRS.MoveFirst
<tr>
<td>Travels From </td>
<td> &
nbsp; </td><td> : </td>
<td> &
nbsp; </td><td><% = objRS("fr") %></td>
</tr>
<tr>
<td>Travels To </td>
<td>
</td><td> : </td>
<td> &
nbsp; </td><td><% = objRS("to")
%></td></tr>
<tr><td>Journey On </td>
<td>
</td><td> : </td>
<td> &
nbsp; </td><td><% = objRS("dt") %></td>
</tr>
<tr>
<td>Fair </td>
<td>
</td><td> : </td>
<td> &
nbsp; </td><td><% = objRS("fair") %></td>
</tr>
<tr>
<td>No. Of Passengers </td>
<td>
</td><td> : </td>
<td>
</td><td><% = objRS("pass") %></td>
</tr>
</table>
<% ifound = 1
End If
objRS.MoveNext
Loop
If (ifound=0) then
<br />
<br />
<table align="center">
<tr>
<td>
<a href="main.html" target="main">Home</a>
</td>
</tr>
</table>
</body>
</html>
*********************************
Ticket.html
*********************************
<html>
<body>
<h1 align="center"><font color="blue">Duplicate
Ticket</font></h1>
<form method="post" action="ticketduplicate.asp"
name="form1">
<hr>
<table align="center">
*********************************
Ticketduplicate.asp
*********************************
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include file = "definitions.asp"-->
<html>
<head>
<style>
#print {font-size:11pt;font-weight:bold}
#print2 {font-size:9pt;font-weight:bold;font-family:arial}
</style>
</head>
<body>
<h1 align="center"><font color="blue">Duplicate
Ticket</font></h1>
<%
dim ifnd
ifnd=0
dim objConn
Set objConn =
Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=railway"
objConn.Open
dim objRS
Set objRS =
Server.CreateObject("ADODB.Recordset")
objRS.Open "ticket_info", objConn, , , adCmdTable
Do until objRS.EOF
If objRS("PNR") = Request.Form("pnrno") then
ifnd = 1
Session("traintype") = objRS("train")
%>
<div style="position:absolute;left:60;top:80">
<img src="images/ticket.jpg">
</div>
<div style="position:absolute;left:140;top:160">
<table border="0" id="print">
<tr><td><%=objRS("PNR")%></td><td><font
color="white">...........................</font>
<%=objRS("train")%></td></tr>
</table>
</div>
<div style="position:absolute;left:380;top:280">
<table border="0" id="print">
<tr><td><%=objRS("fair")%>/-</td><td></td></tr>
<tr><td><font
color="white">...................</font></td><td><
%=objRS("kms")%> Kms</td></tr>
</table>
</div>
<div style="position:absolute;left:250;top:215">
<table id="print" border="0">
<tr><td><%=objRS("fr")%></td><td>To</td><td><
%=objRS("to")%></td></tr>
</table>
</div>
<%
End If
objRS.MoveNext
Loop
objRS.Close
If ifnd = 0 then
Response.Write("Ticket Not Found")
End If
%>
<div style="position:absolute;left:100;top:270">
<table border="0" id="print2">
<%
If ifnd = 1 then
objRS.Open "pass_info", objConn, , , adCmdtable
objRS.MoveFirst
Do until objRS.EOF
If objRS("PNR") = Request.Form("pnrno") then
If Session("traintype") = "Superfast" then
%>
<tr><td><font color="white">.</font>S<
%=objRS("Coach")%></td><td><font
color="white">..........</font><%=objRS("Seat")
%></td><td><font color="white">..........</font><
%=objRS("sex")%></td><td><font
color="white">....</font><%=objRS("age")
%></td><td><font color="white">..</font><
%=objRS("Passname")%></td></tr>
<% Else %>
<tr><td><font color="white">.</font>C<
%=objRS("Coach")%></td><td><font
color="white">..........</font><%=objRS("Seat")
%></td><td><font color="white">..........</font><
%=objRS("sex")%></td><td><font
color="white">....</font><%=objRS("age")
%></td><td><font color="white">..</font><
%=objRS("Passname")%></td></tr>
<% End If
End If
objRS.MoveNext
Loop
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
End If
%>
</table> </div>
<div style="position:absolute;left:200;top:120">
<font face="arial" color="gray" size=7 style="font-
weight:bold">DUPLICATE</font>
</div>
</body> </html>
*********************************
Cancelticket.html
*********************************
<html>
<body>
<h1 align="center"><font color="blue">Cancel A
Ticket</h1>
<form method="post" action="cancelticketinfo.asp"
name="form">
<hr>
<table align="center">
*********************************
Cancelticketinfo.asp
*********************************
<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include file="definitions.asp"-->
<html>
<body>
<h1 align="center">Ticket Cancellation</h1>
<%
Dim found
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="DSN=railway"
objConn.Open
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open "ticket_info", objConn, , adLockOptimistic,
adCmdTable
objRS.MoveFirst
Do While Not objRS.EOF
If objRS("PNR") = Request.Form("pnrno") then %>
<br /><table align="center">
<tr><td>PNR No.
</td><td> &nb
sp; </td><td> :
</td><td> &nb
sp; </td><td><% = objRS("PNR")
%></td></tr>
<tr><td>Travels From
</td><td> &nb
sp; </td><td> :
</td><td> &nb
sp; </td><td><% = objRS("fr")
%></td></tr>
<tr><td>Travels To
</td><td> &nb
sp; </td><td> :
</td><td> &nb
sp; </td><td><% = objRS("to")
%></td></tr>
<tr><td>Journey On
</td><td> &nb
sp; </td><td> :
</td><td> &nb
sp; </td><td><% = objRS("dt")
%></td></tr>
<tr><td>Fair
</td><td> &nb
sp; </td><td> :
</td><td> &nb
sp; </td><td><% = objRS("fair")
%></td></tr>
<tr><td>No. Of Passengers
</td><td> &nb
sp; </td><td> :
</td><td> &nb
sp; </td><td><% = objRS("pass")
%></td></tr>
</table>
<% found = 1
objRS.Delete
End If
objRS.MoveNext
Loop
If (found=0) then
Response.Write("Ticket Not Found")
Else
%><h1 align="center"><font color="salmon">The
Above Ticket has been Cancelled !!</font></h1><%
End If
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
<br /> <br />
<table align="center">
<tr><td><a href="main.html"
target="main">Home</a></td></tr>
</table>
</body>
</html>
*********************************
Railnet.html
*********************************
<html>
<body>
<table align="center">
<tr>
<td><img src="images/map.jpg" width="400"
height="600"></td><td> &nb
sp;</td>
<td><a href="railnetlarge.html" target="_blank">Click
Here To Explore The Map</a></td>
</tr>
</table>
</body>
</html>
*********************************
Railnetlarge.html
*********************************
<html>
<head>
<title>Indian Railways Project</title>
</head>
<body>
<img src="images/map.jpg">
</body>
</html>
*********************************
Trains.html
*********************************
<html>
<body>
<hr>
<table align="center">
<tr><td>Available Trains : <font
color="blue"><b>Superfast
And Shatabadi
Express</b></font></td></tr>
</table>
<hr><hr>
<table align="center">
<tr><td>Route : </td><td><b>Amritsar to New
Delhi</b></td></tr>
<tr><td>Stations : </td><td>Amritsar</td></tr>
<tr><td></td><td>Jalandhar</td></tr>
<tr><td></td><td>Ludhiana</td></tr>
<tr><td></td><td>Ambala</td></tr>
<tr><td></td><td>Panipat</td></tr>
<tr><td></td><td>Sonipat</td></tr>
<tr><td></td><td>New Delhi</td></tr>
</table>
<hr>
</body>
</html>
*********************************
Definitions.asp
*********************************
<%
Const adOpenForwardOnly=0
Const adLockOptimistic=3
Const adLockPessimistic=2
Const adLockReadOnly=1
Const adCmdTable=2
%>
*********************************
Side.html
*********************************
<html>
<body bgcolor="621517">
</body>
</html>
*********************************
Invalid.html
*********************************
<html>
<body>
<font color="red" size="5">We are Unable to process
further due to Invalid data.</font>
<br /><br />
<font color="blue" size="6">Please Try Again with Valid
Credentials !!</font>
</body>
</html>