-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpassenger.php
More file actions
238 lines (219 loc) · 6.47 KB
/
passenger.php
File metadata and controls
238 lines (219 loc) · 6.47 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<?php
if(session_status() == PHP_SESSION_NONE)
{
session_start();//start session if session not start
}
if(isset($_SESSION['accomodation'])){
?>
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Train Ticketing</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap-theme.min.css">
</head>
<body style="background-color: lightblue;">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Train Ticketing</a>
</div>
<ul class="nav navbar-nav">
<li class="active">
<a href="#">Rerservation
<span class="glyphicon glyphicon-share-alt" aria-hidden="true"></span>
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="index.php"><span class="glyphicon glyphicon-backward"></span> Back To Home</a></li>
</ul>
</div>
</nav>
<div class="container-fluid">
<div class="col-md-1"></div>
<div class="col-md-10">
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">STEPS FOR BOOKING</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-3">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">1. ROUTE
</h3>
</div>
<div class="panel-body">
SCHEDULE OF TRAVEL
</div>
</div>
</div>
<div class="col-md-3">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">2. ACCOMODATION
</h3>
</div>
<div class="panel-body">
ACCOMODATION TYPE
</div>
</div>
</div>
<div class="col-md-3">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">3. PASSENGER INFO
<span class="glyphicon glyphicon-saved" aria-hidden="true"></span>
</h3>
</div>
<div class="panel-body">
PASSENGER DETAILS
</div>
</div>
</div>
<div class="col-md-3">
<div class="panel panel-warning">
<div class="panel-heading">
<h3 class="panel-title">4. PAYMENT INFO</h3>
</div>
<div class="panel-body">
TOTAL PAYMENT
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-1"></div>
</div>
<div class="container-fluid">
<div class="col-md-4"></div>
<div class="col-md-4">
<div class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<strong>Message!</strong> Please review your passenger information.
You cannot change your reservation once you proceed.
</div>
<div class="panel panel-default">
<div class="panel-body">
<h2>
<center>PASSENGER INFO</center>
</h2>
<div class="container-fluid">
<form class="form-horizontal" role="form" id="form-pass">
<div class="form-group">
<label for="">Booked By:</label>
<input type="text" class="form-control" id="book-by" placeholder="Enter Name"
autofocus="" required="" autocomplete="off">
</div>
<div class="form-group">
<label for="">Contact:</label>
<input type="text" class="form-control" id="cont" placeholder="Enter Contact" required="" autocomplete="off">
</div>
<div class="form-group">
<label for="">Address:</label>
<input type="text" class="form-control" id="address" placeholder="Enter Address" required="" autocomplete="off">
</div>
<br />
<?php
$tb = $_SESSION['totalPass'];
$count = 1;
for($i = 0; $i < $tb; $i++){
?>
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Booked(<?= $count; ?>)</h3>
</div>
<div class="panel-body">
<div class="container-fluid">
<div class="form-group">
<label for="">Full Name (<?= $count; ?>):</label>
<input type="text" class="form-control" id="fN<?php echo $i; ?>"
placeholder="Enter Fullname" required autocomplete="off">
</div>
<div class="form-group">
<label for="">Age: (<?= $count; ?>):</label>
<input type="number" class="form-control" id="age<?php echo $i; ?>"
placeholder="Enter Age" required autocomplete="off">
</div>
<div class="form-group">
<label for="">Gender: (<?= $count; ?>):</label>
<select class="btn btn-default" id="gender<?php echo $i; ?>">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
</div>
</div>
</div>
</div>
<?php
$count++;
}//end for
?>
<button type="submit" class="btn btn-success">NEXT
<span class="glyphicon glyphicon-arrow-right" aria-hidden="true"></span>
</button>
</form>
</div>
</div>
</div>
</div>
<div class="col-md-4"></div>
</div>
<?php require_once('admin/modal/message.php'); ?>
<script type="text/javascript" src="assets/js/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).on('submit', '#form-pass', function(event) {
event.preventDefault();
/* Act on the event */
var bookBy = $('#book-by').val();
var cont = $('#cont').val();
var address = $('#address').val();
var counter = <?= $i; ?>;
for(var i = 0; i < counter; i++){
var fN = $('#fN'+i).val();
var age = $('#age'+i).val();
var gender = $('#gender'+i).val();
$.ajax({
url: 'data/save_booked.php',
type: 'post',
dataType: 'json',
data: {
bookBy : bookBy,
cont : cont,
address : address,
fN : fN,
age : age,
gender : gender
},
success: function (data) {
// console.log(data);
if(data.valid == true){
window.location = data.url;
}
},
error: function(){
// alert('Error: L192+');
}
});
}//end for
alert('Booked Successfully!');
});
</script>
</body>
</html>
<?php
}else{
echo '<strong>';
echo 'Page Not Exist';
echo '</strong>';
}//end if else isset
?>