-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpass-search-available-trains.php
executable file
·125 lines (120 loc) · 6.08 KB
/
pass-search-available-trains.php
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!--Start Server side code to give us and hold session-->
<?php
session_start();
include('assets/inc/config.php');
include('assets/inc/checklogin.php');
check_login();
$aid=$_SESSION['pass_id'];
?>
<!--End Server side scriptiing-->
<!DOCTYPE html>
<html lang="en">
<!--HeAD-->
<?php include('assets/inc/head.php');?>
<!-- end HEAD-->
<body>
<div class="be-wrapper be-fixed-sidebar">
<!--navbar-->
<?php include('assets/inc/navbar.php');?>
<!--End navbar-->
<!--Sidebar-->
<?php include('assets/inc/sidebar.php');?>
<!--End Sidebar-->
<div class="be-content">
<div class="page-head">
<h2 class="page-head-title">Advanced Train Search</h2>
<nav aria-label="breadcrumb" role="navigation">
<ol class="breadcrumb page-head-nav">
<li class="breadcrumb-item"><a href="pass">Dashboard</a></li>
<li class="breadcrumb-item"><a href="#">Trains</a></li>
<li class="breadcrumb-item active">Advanced Train Search</li>
</ol>
</nav>
</div>
<div class="main-content container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="card card-table">
<div class="card-header">Available Train Details
<div class="tools dropdown"><span class="icon mdi mdi-download"></span><a class="dropdown-toggle" href="#" role="button" data-toggle="dropdown"><span class="icon mdi mdi-more-vert"></span></a>
<div class="dropdown-menu" role="menu"><a class="dropdown-item" href="#">Action</a><a class="dropdown-item" href="#">Another action</a><a class="dropdown-item" href="#">Something else here</a>
<div class="dropdown-divider"></div><a class="dropdown-item" href="#">Separated link</a>
</div>
</div>
</div>
<div class="card-body">
<table class="table table-striped table-hover table-fw-widget" id="table1">
<thead>
<tr>
<th>Train Number</th>
<th>Train Name</th>
<th>Route</th>
<th>Current Station</th>
<th>Departure Station</th>
<th>Departure Time</th>
<th>Fare</th>
<th>No. Of Passengers</th>
</tr>
</thead>
<tbody>
<?php
/*
*Lets get details of available trains!!
*/
$ret="SELECT * FROM orrs_train "; //sql code to get all details of trains.
$stmt= $mysqli->prepare($ret) ;
$stmt->execute() ;//ok
$res=$stmt->get_result();
$cnt=1;
while($row=$res->fetch_object())
{
?>
<tr class="odd gradeX even gradeC odd gradeA even gradeA ">
<td><?php echo $row->number;?></td>
<td><?php echo $row->name;?></td>
<td><?php echo $row->route;?></td>
<td class="center"><?php echo $row->current;?></td>
<td class="center"><?php echo $row->destination;?></td>
<td class="center"><?php echo $row->time;?></td>
<td class="center"><span class="badge badge-pill badge-success">Ksh<?php echo $row->fare;?></span></td>
<td class="center"><?php echo $row->passengers;?></td>
</tr>
<?php }?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!--footer-->
<?php include('assets/inc/footer.php');?>
<!--End Footer-->
</div>
</div>
</div>
<script src="assets/lib/jquery/jquery.min.js" type="text/javascript"></script>
<script src="assets/lib/perfect-scrollbar/js/perfect-scrollbar.min.js" type="text/javascript"></script>
<script src="assets/lib/bootstrap/dist/js/bootstrap.bundle.min.js" type="text/javascript"></script>
<script src="assets/js/app.js" type="text/javascript"></script>
<script src="assets/lib/datatables/datatables.net/js/jquery.dataTables.js" type="text/javascript"></script>
<script src="assets/lib/datatables/datatables.net-bs4/js/dataTables.bootstrap4.js" type="text/javascript"></script>
<script src="assets/lib/datatables/datatables.net-buttons/js/dataTables.buttons.min.js" type="text/javascript"></script>
<script src="assets/lib/datatables/datatables.net-buttons/js/buttons.flash.min.js" type="text/javascript"></script>
<script src="assets/lib/datatables/jszip/jszip.min.js" type="text/javascript"></script>
<script src="assets/lib/datatables/pdfmake/pdfmake.min.js" type="text/javascript"></script>
<script src="assets/lib/datatables/pdfmake/vfs_fonts.js" type="text/javascript"></script>
<script src="assets/lib/datatables/datatables.net-buttons/js/buttons.colVis.min.js" type="text/javascript"></script>
<script src="assets/lib/datatables/datatables.net-buttons/js/buttons.print.min.js" type="text/javascript"></script>
<script src="assets/lib/datatables/datatables.net-buttons/js/buttons.html5.min.js" type="text/javascript"></script>
<script src="assets/lib/datatables/datatables.net-buttons-bs4/js/buttons.bootstrap4.min.js" type="text/javascript"></script>
<script src="assets/lib/datatables/datatables.net-responsive/js/dataTables.responsive.min.js" type="text/javascript"></script>
<script src="assets/lib/datatables/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
//-initialize the javascript
App.init();
App.dataTables();
});
</script>
</body>
</html>