-
Notifications
You must be signed in to change notification settings - Fork 0
/
ad_showtrain.jsp
66 lines (65 loc) · 3.33 KB
/
ad_showtrain.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*"%>
<%
Connection con = null;
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/project?zeroDateTimeBehavior=convertToNull", "root", "password");
Statement st = con.createStatement();
String q = "select * from train";
ResultSet rs = st.executeQuery(q);
%>
<html>
<head>
<link rel="icon" type="image/x-icon" href="Images/admin1.png"/>
<!--link rel="stylesheet" type="text/css" href="external.css"/-->
<style>
@import url(ad_external.css);
</style>
<title>Online Railway Reservation Admin Portal</title>
<script src="JvScript.js" type="text/javascript" language="javascript"></script>
</head>
<body bgcolor="whitesmoke">
<div class="header" style="position:fixed;">
<img src="Images/logoad.png">
<h1>Online Railway Enquiry & Reservation System</h1>
<h4>India Grows, where Railway Goes.</h4>
<input type="button" onclick="location.href='index.jsp';" value="Home Page" class="home_btn">
<%
String a = (String)session.getAttribute("admin");
if (a!=null) {
%>
<input type="button" onclick="location.href='ad_logout.jsp';" value="Log Out" class="home_btn" style="margin-top:-2.2%; margin-left:5%; float:left;">
<% } else { %>
<input type="button" onclick="location.href='admin.jsp';" value="Log In" class="home_btn" style="margin-top:-2.2%; margin-left:5%; float:left;">
<% } %>
<img src="Images/homebtn.png" class="home" onclick="location.href='admin.jsp'" style="margin-left:5%;">
</div>
<div class="outer" style="background-image:url('Images/hd3.jpg'); background-attachment:fixed;">
<%
if(a!=null) {
%>
<div class="action" style="margin-left:79%; position:fixed;">
<div class="insert" onclick="location.href='adminuserinfo.jsp';">Show User Database</div>
<div class="insert" onclick="location.href='adminupdate.jsp';">Update Database</div>
<div class="insert" onclick="location.href='adminfeedback.jsp';">Check Feedbacks</div>
</div>
<% } %>
<div class="inner" style="margin-top:13%; margin-bottom:5%; margin-left:1%; width:77%; height:auto;">
<h1>Train Database</h1>
<table cellspacing="3px" cellpadding="3px" align="center">
<tr><th class="head1"> Train ID <th class="head1"> Train Name <th class="head1"> Source <th class="head1"> Destination <th class="head1"> Arrival <th class="head1"> Departure <th class="head1"> Status
<% while(rs.next()) { %>
<tr><th><%= rs.getString(1) %>
<th><%= rs.getString(2) %>
<th><%= rs.getString(3) %>
<th><%= rs.getString(4) %>
<th><%= rs.getString(5) %>
<th><%= rs.getString(6) %>
<th><%= rs.getString(7) %>
<% } %>
</table>
</div>
</div>
<div class="footer" style="position:fixed;"></div>
</body>
</html>