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
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
|
<?php require_once ('../webadmin/basic_info.php');
if(!isset($_GET["id"]) || (int)$_GET["id"] <= 0){ echo "<script>alert('Please select a unit size.'); window.location.href='pricing.php';</script>"; exit; }
$master_room_info = get_master_room_info_web();
uasort($master_room_info, 'sorting_by_LWH');
$product_info = get_product();
$customer_type = get_master_type_code("CUSTOMER_TYPE");
exit; ?> <!DOCTYPE html> <html dir="ltr" lang="en-US"> <head>
<?php require_once ("html_head.php") ?>
<script type="text/javascript" src="../js/jquery-ui-1.11.4/jquery-ui.min.js"></script> <!--<script type="text/javascript" src="../js/jquery-ui-1.11.4/datepicker-zh-HK.js"></script>--> <link type="text/css" href="../js/jquery-ui-1.11.4/jquery-ui.css" rel="stylesheet"/> <link rel="stylesheet" href="../js/jquery-ui-1.11.4/jquery-ui.theme.min.css">
<?php if($langcode == "tc"){ $recaptcha_langcode = "zh-HK"; }else{ $recaptcha_langcode = "en"; }
?> <script src='https://www.google.com/recaptcha/api.js?hl=<?=$recaptcha_langcode?>'></script>
<script type="text/javascript">
function numberWithCommas(x) { return x.toString().replace(/\B(?=(?:\d{3})+(?!\d))/g, ","); }
function select_room_size() { var email = $("#billing-form-email").val(); var phone = $("#billing-form-phone").val(); var master_room_id = $("#billing-form-master-room-id").val(); var rent_month = $("#billing-form-month").val(); var prepaid = 0; $("#recurring-payment").show(); if($("#billing-form-prepaid").prop("checked") == true){ prepaid = 1; $("#recurring-payment").hide(); }
var xmlhttp;
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var result = $.trim(xmlhttp.responseText);
//console.log(result);
if(result == "0"){ alert("Not available to rent this kind of size.");
$(".cart-product-name .product-price").html(""); $(".cart-product-prepaid .product-prepaid").html(""); $(".cart-product-name .product-price1").html(""); $(".cart-product-name .product-price-total_amt").html(""); $(".cart-product-first-month .product-price1").html("");
}else{ // To decode (This produces an object) var obj = JSON.parse(result); /*console.log(obj.price_text); console.log(result);*/
$(".cart-product-name .product-price").html(obj.price_text); $(".cart-product-prepaid .product-prepaid").html(obj.discount_text); $(".cart-product-name .product-price1").html("HK$"+numberWithCommas(obj.deposit.toFixed(2))); $(".cart-product-name .product-price-total_amt").html("HK$"+numberWithCommas(obj.total_amount.toFixed(2)));
if(parseFloat(obj.first_month_half_price) > 0){ $("#first_month_deduct").show(); $(".cart-product-first-month .product-price1").html("-HK$"+obj.first_month_half_price.toFixed(2)); }else{ $("#first_month_deduct").hide(); $(".cart-product-first-month .product-price1").html("-HK$0.00"); }
if(parseFloat(obj.warehousing_date_range) == 1){ $("#billing-form-moveindate").show(); $("#billing-form-moveindate").removeAttr("disabled"); $("#billing-form-moveindate_now").hide(); }else{ $("#billing-form-moveindate").hide(); $("#billing-form-moveindate").attr("disabled", true); $("#billing-form-moveindate_now").show(); } } } } xmlhttp.open("POST", "_ajax.php?for=select_room_size", true); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.send("master_room_id=" + (master_room_id) + "&rent_month="+rent_month + "&prepaid="+prepaid + "&email="+email+ "&phone="+phone); }
$(function () {
$("#billing-form-master-room-id, #billing-form-month, #billing-form-email").on("change", function () { select_room_size(); });
$("#billing-form-prepaid").on("click", function () { select_room_size(); });
select_room_size(<?=(int)$_GET["id"]?>);
$("#billing-form-transervice").on("click", function () { if($(this).prop("checked") == true){ $(".transervice").show(); $("#billing-form-service-date").datepicker({dateFormat: 'yy-mm-dd', minDate : '0'}); }else{ $(".transervice").hide(); } });
$("#billing-form-customer-type").on("change", function () { if($(this).val() == "BUSINESS"){ $(".BUSINESS").show(); }else{ $(".BUSINESS").hide(); } });
$(".plus").on("click", function () { var qty = parseFloat($(this).closest(".cart-product-quantity").find(".qty").val()); qty += 1;
$(this).closest(".cart-product-quantity").find(".qty").val(qty);
var price = parseFloat($(this).closest(".cart-product-quantity").find(".sp-price_int").val()); $(this).closest(".cart-product-quantity").find(".sp-price").text("HK$"+numberWithCommas((price*qty).toFixed(2)));
//console.log(price);
});
$(".minus").on("click", function () { var qty = parseFloat($(this).closest(".cart-product-quantity").find(".qty").val()); if(qty > 0) qty -= 1;
$(this).closest(".cart-product-quantity").find(".qty").val(qty);
if(qty == 0){ var price = parseFloat($(this).closest(".cart-product-quantity").find(".sp-price_int").val()); $(this).closest(".cart-product-quantity").find(".sp-price").text("HK$"+numberWithCommas((price).toFixed(2))); }else{ var price = parseFloat($(this).closest(".cart-product-quantity").find(".sp-price_int").val()); $(this).closest(".cart-product-quantity").find(".sp-price").text("HK$"+numberWithCommas((price*qty).toFixed(2))); } });
}) </script>
<style> .transervice{ display: none; } </style> </head>
<body class="stretched no-transition">
<?php require_once ("google_analysis.php"); ?>
<!-- Document Wrapper ============================================= --> <div id="wrapper" class="clearfix">
<!-- Header ============================================= --> <?php require_once ("html_header.php") ?> <!-- Content ============================================= --> <section id="content">
<div class="content-wrap">
<div class="container clearfix">
<div class="heading-block center"> <h1>RENT STORAGE</h1> </div>
<form class="nobottommargin" id="billing-form" name="billing-form" action="rent_post.php" method="post">
<div class="col-md-12 reserve"> <h4>Your Summary</h4> <div class="table-responsive"> <table class="table cart"> <tbody> <tr class="cart_item"> <td class="cart-product-name noborder"> <strong>Unit Size(LxWxH):</strong> </td>
<td class="cart-product-name noborder"> <select id="billing-form-master-room-id" name="billing-form-master-room-id" class="sm-form-control required"> <?php foreach($master_room_info as $master_room){ if((int)$_GET["id"] == $master_room["master_room_id"]) $selected = "selected"; else $selected = "";
echo "<option value='".$master_room["master_room_id"]."' ".$selected.">".$master_room["size"]."</option>"; } ?> </select> </td> </tr> <tr class="cart_item"> <td class="cart-product-name noborder"> <strong>Unit Fee/ month:</strong> </td>
<td class="cart-product-name noborder"> <span class="product-price"></span> </td> </tr> <tr class="cart_item"> <td class="cart-product-name noborder" style="vertical-align:top !important;"> <strong>Rent Month:</strong> </td>
<td class="cart-product-month noborder"> <select id="billing-form-month" name="billing-form-month" class="sm-form-control required"> <?php for($i = 1; $i <= 36; $i++){ if(isset($_SESSION["warehousing_web"]["rent_month"]) && $_SESSION["warehousing_web"]["rent_month"] == $i) $selected = "selected"; else $selected = "";
echo '<option value="'.$i.'" '.$selected.'>'.$i.'</option>'; } ?> </select> </td> </tr> <tr class="cart_item"> <td class="cart-product-name noborder"> <strong>Prepaid all rent fee:</strong>
</td>
<td class="cart-product-prepaid noborder"> <span class="product-price1"> <input type="checkbox" name="billing-form-prepaid" id="billing-form-prepaid" value="1" <?php if(isset($_SESSION["warehousing_web"]["prepaid"]) && $_SESSION["warehousing_web"]["prepaid"] == 1) echo "checked"; ?>> </span> <br> <span class="product-prepaid"></span> </td> </tr>
<tr class="cart_item" style="display: none;" id="first_month_deduct"> <td class="cart-product-name noborder"> <strong>First month free:</strong> </td>
<td class="cart-product-first-month noborder"> <span class="product-price1"></span> </td> </tr>
<tr class="cart_item"> <td class="cart-product-name noborder"> <strong>Deposit fee(2 months of rent):</strong> </td>
<td class="cart-product-name noborder"> <span class="product-price1"></span> </td> </tr> <tr class="cart_item"> <td class="cart-product-name noborder"> <span class="product-price-total">Unit Total Amount:</span> </td>
<td class="cart-product-name noborder"> <span class="product-price-total_amt"></span> </td> </tr> </tbody>
</table>
</div>
<div class="line"></div>
<h4>Order Storage Products</h4>
<div class="row">
<?php foreach($product_info as $product){ if($product["status"] == 0 || $product["show_frontend"] == 0) continue; $product_image_info = get_product_images($product["id"]); ?> <div class="col-md-3 col-sm-6 bottommargin">
<div class="team"> <div class="team-image"> <?php if(!empty($product_image_info[0]["photo"])){ echo '<img src="../images/product_images/thumb/'.$product_image_info[0]["photo"].'" alt="'.$product["name_".$langcode].'">'; }else{ echo '<img src="../images/product_images/thumb/no_image.png" alt="'.$product["name_".$langcode].'">'; } ?> </div> <div class="team-desc cart-product-quantity"> <div class="sp-name"><?=$product["name_".$langcode]?></div> <div class="sp-price"> HK$<?= isset($_SESSION["warehousing_web"]["order_product"][$product["id"]]["qty"]) ? numberformat($product["price"]*$_SESSION["warehousing_web"]["order_product"][$product["id"]]["qty"]) : numberformat($product["price"]) ?> </div>
<input type="hidden" name="price_int" value="<?=numberformat($product["price"]); ?>" class="sp-price_int"/> <div class="quantity clearfix"> <input type="hidden" name="product_id[<?=$product["id"]?>]" value="<?=$product["id"]?>"> <input type="hidden" name="product_price[<?=$product["id"]?>]" value="<?=numberformat($product["price"]);?>"> <input type="button" value="-" class="minus">
<?php if(isset($_SESSION["warehousing_web"]["order_product"][$product["id"]]["qty"]) && $_SESSION["warehousing_web"]["order_product"][$product["id"]]["qty"] > 0){ $qty = $_SESSION["warehousing_web"]["order_product"][$product["id"]]["qty"]; }else{ $qty = 0; } ?> <input type="text" name="quantity[<?=$product["id"]?>]" value="<?=$qty?>" class="qty" /> <input type="button" value="+" class="plus"> </div> </div> </div>
</div> <?php } ?>
</div>
<div class="clear"></div>
<!--<div class="col_full"> <span class="product-price-total">Product Total Amount:</span> <span class="product-price-total_amt">123</span> </div>-->
<div class="line"></div>
<h4>Billing Information</h4>
<p></p>
<div class="form-process"></div>
<div class="col_one_third"> <label for="billing-form-title">Title: *</label> <select id="billing-form-title" name="billing-form-title" class="sm-form-control required"> <option value="">-- Select One --</option> <option value="Mr" <?php if(isset($_SESSION["warehousing_web"]["title"]) && $_SESSION["warehousing_web"]["title"] == "Mr") echo "selected"; ?>>Mr</option> <option value="Mrs" <?php if(isset($_SESSION["warehousing_web"]["title"]) && $_SESSION["warehousing_web"]["title"] == "Mrs") echo "selected"; ?>>Mrs</option> <option value="Ms" <?php if(isset($_SESSION["warehousing_web"]["title"]) && $_SESSION["warehousing_web"]["title"] == "Ms") echo "selected"; ?>>Ms</option> </select> </div>
<div class="col_one_third"> <label for="billing-form-firstname">First Name: *</label> <input type="text" id="billing-form-firstname" name="billing-form-firstname" value="<?php if(isset($_SESSION["warehousing_web"]["firstname"])) echo $_SESSION["warehousing_web"]["firstname"]; ?>" class="sm-form-control required" placeholder="First Name" /> </div>
<div class="col_one_third col_last"> <label for="billing-form-lastname">Last Name: *</label> <input type="text" id="billing-form-lastname" name="billing-form-lastname" value="<?php if(isset($_SESSION["warehousing_web"]["lastname"])) echo $_SESSION["warehousing_web"]["lastname"]; ?>" class="sm-form-control required" placeholder="Last Name" /> </div>
<div class="clear"></div>
<div class="col_one_third"> <label for="billing-form-customer-type">Customer Type: *</label> <select id="billing-form-customer-type" name="billing-form-customer-type" class="sm-form-control required"> <?php foreach($customer_type as $type){ if(isset($_SESSION["warehousing_web"]["customer_type"]) && $_SESSION["warehousing_web"]["customer_type"] == $type["code"]) $selected = "selected"; else $selected = "";
echo '<option value="'.$type["code"].'" '.$selected.'>'.$type["name_".$langcode].'</option>'; } ?>
</select> </div>
<div class="clear"></div>
<div class="col_full BUSINESS" style="display: none;"> <label for="billing-form-companyname">Company Name: *</label> <input type="text" id="billing-form-companyname" name="billing-form-companyname" value="<?php if(isset($_SESSION["warehousing_web"]["companyname"])) echo $_SESSION["warehousing_web"]["companyname"]; ?>" class="sm-form-control required" placeholder="Company Name" /> </div>
<div class="col_half"> <label for="billing-form-phone">Phone: *</label> <input type="text" id="billing-form-phone" name="billing-form-phone" value="<?php if(isset($_SESSION["warehousing_web"]["tel"])) echo $_SESSION["warehousing_web"]["tel"]; ?>" class="sm-form-control required" placeholder="Phone" /> </div>
<div class="col_half col_last"> <label for="billing-form-email">Email Address: *</label> <input type="email" id="billing-form-email" name="billing-form-email" value="<?php if(isset($_SESSION["warehousing_web"]["email"])) echo $_SESSION["warehousing_web"]["email"]; ?>" class="sm-form-control required" placeholder="Email Address" /> </div>
<div class="clear"></div>
<div class="col_full"> <label for="billing-form-address">Billing Address: *</label> <input type="text" id="billing-form-address" name="billing-form-address" value="<?php if(isset($_SESSION["warehousing_web"]["address"])) echo $_SESSION["warehousing_web"]["address"]; ?>" class="sm-form-control required" placeholder="Address" /> </div>
<!--<div class="col_full"> <input type="text" id="billing-form-address2" name="billing-form-adress" value="" class="sm-form-control" /> </div>-->
<div class="col_half"> <label for="billing-form-title">Move in date: *</label> <?php echo "<div id='billing-form-moveindate_now'>".date("Y-m-d")."</div>"; ?>
<select id="billing-form-moveindate" name="billing-form-warehousing-date" class="sm-form-control required" style="display: none;" disabled> <option value="">-- Select One --</option> <?php for($i=1; $i<=7; $i++){ $date = new DateTime(); $date->modify('+'.$i.' day');
if(isset($_SESSION["warehousing_web"]["warehousing_date"]) && $_SESSION["warehousing_web"]["warehousing_date"] == $date->format("Y-m-d")) $selected = "selected"; else $selected = "";
echo '<option value="'.$date->format("Y-m-d").'" '.$selected.'>'.$date->format("Y-m-d").'</option>'; } ?> </select> </div> <div class="clear"></div>
<div class="col_full"> If you require transportation service, we can help organise third-party transportation service for you, please click below<br /> <label for="billing-form-transervice"><input id="billing-form-transervice" name="billing-form-transervice" type="checkbox" value="1" <?php if(isset($_SESSION["warehousing_web"]["transervice"]) && $_SESSION["warehousing_web"]["transervice"] == 1) echo "checked";?>/> <span style="font-size:18px;">Transportation services</span></label> </div>
<div class="col_full transervice"> <label for="billing-form-service-date">Service Date: *</label> <input type="text" id="billing-form-service-date" name="billing-form-service-date" value="<?php if(isset($_SESSION["warehousing_web"]["service_date"])) echo $_SESSION["warehousing_web"]["service_date"]; ?>" class="sm-form-control required" placeholder="Service Date" /> </div>
<div class="col_half transervice"> <label for="billing-form-delivery-from">Delivery From: *</label> <input type="text" id="billing-form-delivery-from" name="billing-form-delivery-from" value="<?php if(isset($_SESSION["warehousing_web"]["delivery_from"])) echo $_SESSION["warehousing_web"]["delivery_from"]; ?>" class="sm-form-control required" placeholder="Delivery From" /> </div>
<div class="col_half col_last transervice"> <label for="billing-form-delivery-to">Delivery To: *</label> <input type="text" id="billing-form-delivery-to" name="billing-form-delivery-to" value="<?php if(isset($_SESSION["warehousing_web"]["delivery_to"])) echo $_SESSION["warehousing_web"]["delivery_to"]; ?>" class="sm-form-control required" placeholder="Delivery To" /> </div>
<!--<div class="col_full" id="recurring-payment"> If you want to using recurring payment service (monthly auto payment), please click below<br /> <label for="billing-form-recurring-payment"><input id="billing-form-recurring-payment" name="billing-form-recurring-payment" type="checkbox" value="1" /> <span style="font-size:18px;">Recurring payment service</span></label> </div>-->
<div class="col_full"> <b>Payment method:</b><br /> <img src="../images/visa_mastercard_logo_<?=$langcode?>.png" height="30"></div>
<div class="col_full"> <b>Terms and Conditions:</b><br /> You hereby agree to the terms and conditions. You are also aware that you are responsible for the timely payment of all fees and for providing In N Out Storage with a valid payment method for payment of all fees.<br /><br /> You will be charged starting on the day of your move-in to our storage facility. You agree that 2 months rental deposit and at least one month payment are required before commencing our service. By paying online through Paypal, you agree to be automatically billed for the storage fee on the monthly billing date. </div>
<div class="col_full"> <label for="billing-form-agree"><input id="billing-form-agree" name="billing-form-agree" type="checkbox" value="1" class="required" /> <span style="font-size:18px;">I agree to the terms and conditions</span></label> <label for="billing-form-agree" class="error" style="display: block !important;"></label> </div>
<div class="col_full"> <label for="template-contactform-message">Verification <small>*</small></label> <div class="g-recaptcha" data-theme="light" data-sitekey="<?=$google_recaptcha_site_key?>"></div>
</div>
<div class="col_full center"> <button class="button nomargin" type="submit" id="billing-form-submit" name="billing-form-submit" value="submit">NEXT</button> </div>
<script type="text/javascript">
$("#billing-form").validate({ });
</script> </div>
</form> </div>
</div>
</section><!-- #content end -->
<!-- Footer ============================================= --> <?php require_once ("html_footer.php"); ?>
</div><!-- #wrapper end -->
<!-- Go To Top ============================================= --> <div id="gotoTop" class="icon-angle-up"></div>
<!-- Footer Scripts ============================================= --> <script type="text/javascript" src="../js/functions.js"></script>
</body> </html>
|