-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreserved.php
More file actions
185 lines (171 loc) · 4.88 KB
/
reserved.php
File metadata and controls
185 lines (171 loc) · 4.88 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
<?php
require_once('data/get_origin.php');
require_once('data/get_destination.php');
// echo '<pre>';
// print_r($origins);
// echo '</pre>';
?>
<!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>Online Ticket Rerservation</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="#">Online 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
<span class="glyphicon glyphicon-saved" aria-hidden="true"></span>
</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</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="panel panel-default">
<div class="panel-body">
<h2>
<center>ROUTE</center>
</h2>
<div class="container-fluid">
<form class="form-horizontal" role="form" id="form-itinerary">
<div class="form-group">
<label for="">Origin:</label>
<select class="btn btn-default" id="orig-id">
<?php foreach($origins as $o): ?>
<option value="<?= $o['origin_id']; ?>"><?= $o['origin_desc']; ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="">Destination:</label>
<select class="btn btn-default" id="dest-id">
<?php foreach($destinations as $d): ?>
<option value="<?= $d['dest_id']; ?>"><?= $d['dest_destination']; ?></option>
<?php endforeach; ?>
</select>
</div>
<div class="form-group">
<label for="">Departure Date:</label>
<input type="date" class="btn btn-default" id="dept-date">
</div>
<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>
<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-itinerary', function(event) {
event.preventDefault();
/* Act on the event */
var validate = "";
var origin = $('select[id=orig-id]').val();
var dest = $('select[id=dest-id]').val();
var dept = $('input[id=dept-date]').val();
if(dept.length == 0){
alert('Please Select Departure Date!');
}else{
$.ajax({
url: 'data/session_itinerary.php',
type: 'post',
dataType: 'json',
data: {
oid : origin,
did : dest,
dd : dept
},
success: function (data) {
console.log(data);
if(data.valid == true){
window.location = data.url;
console.log('sss');
}
},
error: function(){
alert('Error: L161+');
}
});
}//end dept kung == 0
});
</script>
</body>
</html>