-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpass-train-checkout-ticket.php
executable file
·137 lines (130 loc) · 6.43 KB
/
pass-train-checkout-ticket.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
126
127
128
129
130
131
132
133
134
135
136
137
<!--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">Checkout Tickets</h2>
<nav aria-label="breadcrumb" role="navigation">
<ol class="breadcrumb page-head-nav">
<li class="breadcrumb-item"><a href="pass-dashboard.php">Dashboard</a></li>
<li class="breadcrumb-item"><a href="">Train Tickets</a></li>
<li class="breadcrumb-item active">Checkout</li>
</ol>
</nav>
</div>
<div class="main-content container-fluid">
<div class="row">
<div class="col-sm-12">
<div class="card card-table">
<?php
/**
* We need to get firstname or username of logged in user!!
*/
$aid=$_SESSION['pass_id'];
$ret="select * from orrs_passenger where pass_id=?";
$stmt= $mysqli->prepare($ret) ;
$stmt->bind_param('i',$aid);
$stmt->execute() ;//ok
$res=$stmt->get_result();
//$cnt=1;
while($row=$res->fetch_object())
{
?>
<div class="card-header"><?php echo $row->pass_fname;?> <?php echo $row->pass_lname;?> This Is Your Booked Train Proceed to checkout your ticket!
<?php }?>
</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>Departure Station</th>
<th>Arrival Station</th>
<th>Departure Time</th>
<th>Fare</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
/**
*Lets select train booking details of logged in user using PASSENGER ID as the session
*/
//$aid=$_SESSION['pass_id'];
$ret="select * from orrs_passenger where pass_id=?";//sql to get details of our user
$stmt= $mysqli->prepare($ret) ;
$stmt->bind_param('i',$aid);
$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->pass_train_number;?></td>
<td><?php echo $row->pass_train_name;?></td>
<td class="center"><?php echo $row->pass_dep_station;?></td>
<td class="center"><?php echo $row->pass_arr_station;?></td>
<td class="center"><?php echo $row->pass_dep_time;?></td>
<td class="center"><span class="badge badge-pill badge-success">Ksh<?php echo $row->pass_train_fare;?></span></td>
<td class="center"><a href="pass-checkout-ticket.php?pass_id = <?php echo $row->pass_id;?>" class="badge badge-pill badge-success">Checkout</a></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>