This repository has been archived by the owner on Feb 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
layout.php
284 lines (266 loc) · 8.77 KB
/
layout.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
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<?php
require 'file/booking_connection.php';
session_start();
if(!isset($_SESSION['uid']))
{
header('location:loginasrs.php');
}
else {
$p_pnr=$_GET['p_pnr'];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Select your seat</title>
<link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="layout.css">
<style>
body {
font-family: 'Roboto', sans-serif;
background-color:#fafafa;
}
a {
color: #b71a4c;
}
.front-indicator {
width: 145px;
margin: 5px 32px 15px 32px;
background-color: #f6f6f6;
color: #adadad;
text-align: center;
padding: 3px;
border-radius: 5px;
}
.wrapper {
width: 100%;
text-align: center;
margin-top:150px;
}
.container {
margin: 0 auto;
width: 500px;
text-align: left;
}
.booking-details {
float: left;
text-align: left;
margin-left: 35px;
font-size: 12px;
position: relative;
height: 401px;
}
.booking-details h2 {
margin: 25px 0 20px 0;
font-size: 17px;
}
.booking-details h3 {
margin: 5px 5px 0 0;
font-size: 14px;
}
div.seatCharts-cell {
color: #182C4E;
height: 25px;
width: 25px;
line-height: 25px;
}
div.seatCharts-seat {
color: #FFFFFF;
cursor: pointer;
}
div.seatCharts-row {
height: 35px;
}
div.seatCharts-seat.available {
background-color: #B9DEA0;
}
div.seatCharts-seat.available.first-class {
/* background: url(vip.png); */
background-color: #3a78c3;
}
div.seatCharts-seat.focused {
background-color: #76B474;
}
div.seatCharts-seat.selected {
background-color: #E6CAC4;
}
div.seatCharts-seat.unavailable {
background-color: #472B34;
}
div.seatCharts-container{
border-right: 1px dotted #adadad;
width: 200px;
padding: 20px;
float: left;
}
div.seatCharts-legend{
padding-left: 0px;
position: absolute;
bottom: 16px;
}
ul.seatCharts-legendList{
padding-left: 0px;
}
span.seatCharts-legendDescription{
margin-left: 5px;
line-height: 30px;
}
.checkout-button{
display: block;
margin: 10px 0;
font-size: 14px;
}
#selected-seats{
max-height: 90px;
overflow-y: scroll;
overflow-x: none;
width: 170px;
}
</style>
</head>
<body><div id="jquery-script-menu">
<div class="jquery-script-center">
<li><a>No Cancellation Policy</a></li>
<li><a>Enjoy the service</a></li>
</ul>
<div class="jquery-script-ads"><script type="text/javascript"><!--
google_ad_client = "ca-pub-2783044520727903";
/* jQuery_demo */
google_ad_slot = "2780937993";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<div class="jquery-script-clear"></div>
</div>
</div>
<div class="wrapper">
<div class="container">
<h1>Select your seat</h1>
<div id="seat-map">
<div class="front-indicator">Cock-Pit</div>
</div>
<div class="booking-details">
<h2>Booking Details</h2>
<h3> Selected Seats (<span id="counter">0</span>):</h3>
<ul id="selected-seats">
</ul>
Total: <b>Rs<span id="total">0</span></b>
<?php
$p_pnr=$_GET['p_pnr'];
?>
<td><a href="payment.php?p_pnr=<?php echo $p_pnr;?>" class="Checkout-button">Checkout</a></td>
<div id="legend"></div>
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="layout.js"></script>
<script>
var firstSeatLabel = 1;
$(document).ready(function() {
var $cart = $('#selected-seats'),
$counter = $('#counter'),
$total = $('#total'),
sc = $('#seat-map').seatCharts({
map: [
'ee_ee',
'ee_ee',
'ee_ee',
'ee_ee',
'ee_ee',
'ee_ee',
'ee_ee',
'ee_ee',
'ee_ee',
'e___e',
'e___e',
'e___e',
'e___e',
],
seats: {
e: {
price : 100,
classes : 'economy-class', //your custom CSS class
category: 'Economy Class'
}
},
naming : {
top : false,
getLabel : function (character, row, column) {
return firstSeatLabel++;
},
},
legend : {
node : $('#legend'),
items : [
[ 'e', 'available', 'Available seats'],
[ 'f', 'unavailable', 'Already Booked']
]
},
click: function () {
if (this.status() == 'available') {
//let's create a new <li> which we'll add to the cart items
$('<li>'+this.data().category+' Seat # '+this.settings.label+': <b>Rs'+this.data().price+'</b> <a href="#" class="cancel-cart-item">[cancel]</a></li>')
.attr('id', 'cart-item-'+this.settings.id)
.data('seatId', this.settings.id)
.appendTo($cart);
/*
* Lets update the counter and total
*
* .find function will not find the current seat, because it will change its stauts only after return
* 'selected'. This is why we have to add 1 to the length and the current seat price to the total.
*/
$counter.text(sc.find('selected').length+1);
$total.text(recalculateTotal(sc)+this.data().price);
return 'selected';
} else if (this.status() == 'selected') {
//update the counter
$counter.text(sc.find('selected').length-1);
//and total
$total.text(recalculateTotal(sc)-this.data().price);
//remove the item from our cart
$('#cart-item-'+this.settings.id).remove();
//seat has been vacated
return 'available';
} else if (this.status() == 'unavailable') {
//seat has been already booked
return 'unavailable';
} else {
return this.style();
}
}
});
//this will handle "[cancel]" link clicks
$('#selected-seats').on('click', '.cancel-cart-item', function () {
//let's just trigger Click event on the appropriate seat, so we don't have to repeat the logic here
sc.get($(this).parents('li:first').data('seatId')).click();
});
});
function recalculateTotal(sc) {
var total = 0;
//basically find every selected seat and sum its price
sc.find('selected').each(function () {
total += this.data().price;
});
return total;
}
</script><script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-36251023-1']);
_gaq.push(['_setDomainName', 'jqueryscript.net']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
<?php } ?>