forked from Rezgo/rezgo-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
booking_summary.php
358 lines (307 loc) · 13 KB
/
booking_summary.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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
<?php
// any new page must start with the page_header, it will include the correct files
// so that the rezgo parser classes and functions will be available to your templates
require('rezgo/include/page_header.php');
// start a new instance of RezgoSite
$site = new RezgoSite();
if(!$site->getBookings('q='.$_REQUEST['trans_num'])) { $site->sendTo("/booking-not-found:".$_REQUEST['trans_num']); }
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="noindex, nofollow">
<title>Booking Summary for <?php echo $_REQUEST['trans_num']?></title>
<!-- Bootstrap CSS -->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css" rel="stylesheet">
<!-- Font awesome -->
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<!--[if IE 7]>
<link href="<?php echo $site->path;?>/css/font-awesome-ie7.css" rel="stylesheet">
<![endif]-->
<!-- Rezgo stylesheet -->
<link href="<?php echo $site->path;?>/css/rezgo.css?v=<?php echo REZGO_VERSION?>" rel="stylesheet">
<?php if($site->exists($site->getStyles())) { ?>
<style>
<?php echo $site->getStyles();?>
</style>
<?php } ?>
<?php $company = $site->getCompanyDetails(); ?>
</head>
<body>
<?php foreach( $site->getBookings($_REQUEST['trans_num']) as $booking ) { ?>
<?php $site->readItem($booking); ?>
<div class="container" id="rezgo-booking-summary">
<h2>Booking details for <?php echo $site->getCompanyName($booking->cid)?></h2>
<h3>
<span><?php echo $booking->tour_name?> - <?php echo $booking->option_name?></span>
<span><?php if ((string) $booking->date != 'open') { ?>
<div class="rezgo-add-cal">
<div class="rezgo-add-cal-cell">
<a href="https://feed.rezgo.com/b/<?php echo $booking->trans_num?>"><i class="fa fa-calendar"></i> Add to my calendar</a>
</div>
</div>
<?php } ?></span>
</h3>
<small class="rezgo-booked-on">booked on <?php echo date((string) $company->date_format, (int) $booking->date_purchased_local)?> / local time</small>
<table class="table-responsive">
<table class="table table-bordered table-striped rezgo-billing-cart">
<tr>
<td class="text-right"><label>Type</label></td>
<td class="text-right"><label class="hidden-xs">Qty.</label></td>
<td class="text-right"><label>Cost</label></td>
<td class="text-right"><label>Total</label></td>
</tr>
<?php foreach( $site->getBookingPrices() as $price ): ?>
<tr>
<td class="text-right"><?php echo $price->label?></td>
<td class="text-right"><?php echo $price->number?></td>
<td class="text-right">
<?php if($site->exists($price->base)) { ?>
<span class="discount"><?php echo $site->formatCurrency($price->base)?></span>
<?php } ?>
<?php echo $site->formatCurrency($price->price)?></td>
<td class="text-right"><?php echo $site->formatCurrency($price->total)?></td>
</tr>
<?php endforeach; ?>
<tr>
<td colspan="3" class="text-right"><strong>Subtotal</strong></td>
<td class="text-right"><?php echo $site->formatCurrency($booking->sub_total)?></td>
</tr>
<?php foreach( $site->getBookingLineItems() as $line ) { ?>
<?php
unset($label_add);
if($site->exists($line->percent) || $site->exists($line->multi)) {
$label_add = ' (';
if($site->exists($line->percent)) $label_add .= $line->percent.'%';
if($site->exists($line->multi)) {
if(!$site->exists($line->percent)) $label_add .= $site->formatCurrency($line->multi);
if($site->exists($line->meta)) {
$pax_totals = array( 'adult_num' => 'price_adult', 'child_num' => 'price_child', 'senior_num' => 'price_senior', 'price4_num' => 'price4', 'price5_num' => 'price5', 'price6_num' => 'price6', 'price7_num' => 'price7', 'price8_num' => 'price8', 'price9_num' => 'price9');
$line_pax = 0;
foreach ($pax_totals as $p_num => $p_rate) {
if ( (int) $booking->{$p_num} > 0 && ((float) $booking->price_range->date->{$p_rate} > (float) $line->meta)) {
$line_pax += (int) $booking->{$p_num};
}
}
$label_add .= ' x '.$line_pax;
} else {
$label_add .= ' x '.$booking->pax;
}
}
$label_add .= ')';
}
?>
<tr>
<td colspan="3" class="text-right"><strong><?php echo $line->label?><?php echo $label_add?></strong></td>
<td class="text-right"><?php echo $site->formatCurrency($line->amount)?></td>
</tr>
<?php } ?>
<?php foreach( $site->getBookingFees() as $fee ): ?>
<?php if( $site->exists($fee->total_amount) ): ?>
<tr>
<td colspan="3" class="text-right"><strong><?php echo $fee->label?></strong></td>
<td class="text-right"><?php echo $site->formatCurrency($fee->total_amount)?></td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
<tr>
<td colspan="3" class="text-right"><strong>Total</strong></td>
<td class="text-right"><strong><?php echo $site->formatCurrency($booking->overall_total)?></strong></td>
</tr>
<?php if($site->exists($booking->deposit)) { ?>
<tr>
<td colspan="3" class="text-right"><strong>Deposit</strong></td>
<td class="text-right"><strong><?php echo $site->formatCurrency($booking->deposit)?></strong></td>
</tr>
<?php } ?>
<?php if($site->exists($booking->overall_paid)) { ?>
<tr>
<td colspan="3" class="text-right"><strong>Total Paid</strong></td>
<td class="text-right"><strong><?php echo $site->formatCurrency($booking->overall_paid)?></strong></td>
</tr>
<tr>
<td colspan="3" class="text-right"><strong>Total Owing</strong></td>
<td class="text-right"><strong><?php echo $site->formatCurrency(((float)$booking->overall_total - (float)$booking->overall_paid))?></strong></td>
</tr>
<?php } ?>
</table>
</table>
<table border="0" cellspacing="0" cellpadding="2" class="rezgo-table-list">
<tr>
<td class="rezgo-td-label">Transaction</td>
<td class="rezgo-td-data"><?php echo $booking->trans_num?></td>
</tr>
<?php if ((string) $booking->date != 'open') { ?>
<tr>
<td class="rezgo-td-label">Booked<span class="hidden-xs"> For</span></td>
<td class="rezgo-td-data"><?php echo date((string) $company->date_format, (int)$booking->date)?>
<?php if ($booking->time != '') { ?> at <?php echo $booking->time?><?php } ?>
</td>
</tr>
<?php } else { ?>
<?php if ($booking->time) { ?>
<tr>
<td class="rezgo-td-label">Time</td>
<td class="rezgo-td-data"><?php echo $booking->time?></td>
</tr>
<?php } ?>
<?php } ?>
<?php if (isset($booking->expiry)) { ?>
<tr>
<td class="rezgo-td-label">Expires</td>
<td class="rezgo-td-data">
<?php if ((int) $booking->expiry !== 0) { ?>
<span><?php echo date((string) $company->date_format, (int) $booking->expiry)?></span>
<?php } else { ?>
<span>Never</span>
<?php } ?>
</td>
</tr>
<?php } ?>
<tr>
<td class="rezgo-td-label">Payment<span class="hidden-xs"> Status</span></td>
<td class="rezgo-td-data"><?php if($booking->status == 1) { ?>RECEIVED<?php } ?><?php if($booking->status == 2) { ?>PENDING<?php } ?><?php if($booking->status == 3) { ?>CANCELLED<?php } ?></td>
</tr>
<?php if($site->exists($booking->trigger_code)) { ?>
<tr>
<td class="rezgo-td-label">Promo<span class="hidden-xs">tional Code</span></td>
<td class="rezgo-td-data"><?php echo $booking->trigger_code?></td>
</tr>
<?php } ?>
<?php if($site->exists($booking->refid)) { ?>
<tr>
<td class="rezgo-td-label">Ref<span class="hidden-xs">erral</span> ID</td>
<td class="rezgo-td-data"><?php echo $booking->refid?></td>
</tr>
<?php } ?>
</table>
<div class="clearfix"> </div>
<fieldset>
<legend>Owner</legend>
<table border="0" cellspacing="0" cellpadding="2" class="rezgo-table-list">
<?php if($booking->user_name) { ?>
<tr>
<td class="rezgo-td-label">User</td>
<td class="rezgo-td-data"><?php echo $booking->user_name?></td>
</tr>
<?php } ?>
<?php if($booking->desk_name) { ?>
<tr>
<td class="rezgo-td-label">Desk</td>
<td class="rezgo-td-data"><?php echo $booking->desk_name?></td>
</tr>
<?php } ?>
<?php if($booking->location_name) { ?>
<tr>
<td class="rezgo-td-label">Location</td>
<td class="rezgo-td-data"><?php echo $booking->location_name?></td>
</tr>
<?php } ?>
</table>
</fieldset>
<div class="clearfix"> </div>
<fieldset>
<legend>Billing Details</legend>
<table border="0" cellspacing="0" cellpadding="2" class="rezgo-table-list">
<tr>
<td class="rezgo-td-label">Contact</td>
<td class="rezgo-td-data"><?php echo $booking->first_name?> <?php echo $booking->last_name?></td>
</tr>
<tr>
<td class="rezgo-td-label">Address</td>
<td class="rezgo-td-data"><?php echo $booking->address_1?><?php if($site->exists($booking->address_2)) { ?>, <?php echo $booking->address_2?><?php } ?><?php if($site->exists($booking->city)) { ?>, <?php echo $booking->city?><?php } ?><?php if($site->exists($booking->stateprov)) { ?>, <?php echo $booking->stateprov?><?php } ?><?php if($site->exists($booking->postal_code)) { ?>, <?php echo $booking->postal_code?><?php } ?> <?php echo $site->countryName($booking->country)?></td>
</tr>
<tr>
<td class="rezgo-td-label">Tel<span class="hidden-xs">ephone</span></td>
<td class="rezgo-td-data"><?php echo $booking->phone_number?></td>
</tr>
<tr>
<td class="rezgo-td-label">Email</td>
<td class="rezgo-td-data"><?php echo $booking->email_address?></td>
</tr>
</table>
</fieldset>
<div class="clearfix"> </div>
<?php if($booking->overall_total > 0) { ?>
<fieldset>
<legend>Payment Details</legend>
<table border="0" cellspacing="0" cellpadding="2" class="rezgo-table-list">
<tr>
<td class="rezgo-td-label">Payment<span class="hidden-xs"> Method</span></td>
<td class="rezgo-td-data"><?php echo $booking->payment_method?></td>
</tr>
<?php if($booking->payment_method == 'Credit Cards') { ?>
<tr>
<td class="rezgo-td-label">Card Number</td>
<td class="rezgo-td-data"><?php echo $booking->card_number?></td>
</tr>
<?php } ?>
<?php if($site->exists($booking->payment_method_add->label)) { ?>
<tr>
<td class="rezgo-td-label"><?php echo $booking->payment_method_add->label?></td>
<td class="rezgo-td-data"><?php echo $booking->payment_method_add->value?></td>
</tr>
<?php } ?>
</table>
</fieldset>
<div class="clearfix"> </div>
<?php } ?>
<?php if(count($site->getBookingForms()) > 0) { ?>
<fieldset>
<legend>Additional Information</legend>
<table border="0" cellspacing="0" cellpadding="2" class="rezgo-table-list">
<?php foreach( $site->getBookingForms() as $form ) { ?>
<?php if(in_array($form->type, array('checkbox','checkbox_price'))) { ?>
<?php if($site->exists($form->answer)) { $form->answer = 'yes'; } else { $form->answer = 'no'; } ?>
<?php } ?>
<tr>
<td class="rezgo-td-label"><?php echo $form->question?></td>
<td class="rezgo-td-data"><?php echo $form->answer?></td>
</tr>
<?php } ?>
</table>
</fieldset>
<div class="clearfix"> </div>
<?php } ?>
<?php if(count($site->getBookingPassengers()) > 0) { ?>
<fieldset>
<legend>Group Details</legend>
<table border="0" cellspacing="0" cellpadding="2" class="rezgo-table-list">
<?php foreach( $site->getBookingPassengers() as $passenger ) { ?>
<tr>
<td class="rezgo-td-label"><?php echo $passenger->label?> <?php echo $passenger->num?></td>
<td class="rezgo-td-data"><?php echo $passenger->first_name?> <?php echo $passenger->last_name?></td>
</tr>
<?php if ((string) $passenger->phone_number != '') { ?>
<tr>
<td class="rezgo-td-label">Phone Number</td>
<td class="rezgo-td-data"><?php echo $passenger->phone_number?></td>
</tr>
<?php } ?>
<?php if ((string) $passenger->email_address != '') { ?>
<tr>
<td class="rezgo-td-label">Email</td>
<td class="rezgo-td-data"><?php echo $passenger->email_address?></td>
</tr>
<?php } ?>
<?php foreach( $passenger->forms->form as $form ) { ?>
<?php if(in_array($form->type, array('checkbox','checkbox_price'))) { ?>
<?php if($site->exists($form->answer)) { $form->answer = 'yes'; } else { $form->answer = 'no'; } ?>
<?php } ?>
<tr>
<td class="rezgo-td-label"><?php echo $form->question?></td>
<td class="rezgo-td-data"><?php echo $form->answer?></td>
</tr>
<?php } ?>
<?php } ?>
</table>
</fieldset>
<div class="clearfix"> </div>
<?php } ?>
</div>
<?php } ?>
</body>
</html>