/
home
/
desid573
/
book.familycab.com.au
/
/home/desid573/book.familycab.com.au
mkdir
upload
Name
Size
Mode
Actions
.well-known/
-
0755
rm
assets/
-
0755
rm
cgi-bin/
-
0755
rm
eway-rapid-php-master/
-
0755
rm
invoice/
-
0755
rm
ltjvghp/
-
0755
rm
pdd/
-
0755
rm
pwcsebh/
-
0755
rm
swtrvog/
-
0755
rm
w1mcglu/
-
0755
rm
.htaccess
281
0644
edit
dl
rm
10.php
1941
0644
edit
dl
rm
11.php
1176
0644
edit
dl
rm
22.php
9106
0644
edit
dl
rm
array.php
2141
0644
edit
dl
rm
a_name_address.php
959
0644
edit
dl
rm
brisbaneInvoice.php
11845
0644
edit
dl
rm
class.phpmailer.php
80046
0644
edit
dl
rm
class.pop3.php
10385
0644
edit
dl
rm
class.smtp.php
24586
0644
edit
dl
rm
dispatch.php
877
0644
edit
dl
rm
driverInvoice.php
12708
0644
edit
dl
rm
driverlocation.php
14585
0644
edit
dl
rm
eCrypt.js
68424
0644
edit
dl
rm
edit.php
780
0644
edit
dl
rm
eway-rapid-php-master.zip
57270
0644
edit
dl
rm
eWay.php
42697
0644
edit
dl
rm
family-cab_small.jpg
98853
0644
edit
dl
rm
favicon.ico
1150
0644
edit
dl
rm
index.php
198358
0644
edit
dl
rm
index1apr2019.php
92844
0644
edit
dl
rm
index3.php
60677
0644
edit
dl
rm
index4.php
91500
0644
edit
dl
rm
index15thMay.php
92640
0644
edit
dl
rm
indexJune10.php
93053
0644
edit
dl
rm
indextest.php
91391
0644
edit
dl
rm
indexTraffic.php
86040
0644
edit
dl
rm
index_preSydney.php
60350
0644
edit
dl
rm
index_sydney.php
74126
0644
edit
dl
rm
melbAuditReport.php
34176
0644
edit
dl
rm
melbreport.php
7758
0644
edit
dl
rm
monthly.php
12046
0644
edit
dl
rm
perthAuditReport.php
34918
0644
edit
dl
rm
perthReport.php
7587
0644
edit
dl
rm
pre-sydneyquote.php
39158
0644
edit
dl
rm
promo.php
765
0644
edit
dl
rm
qldreport.php
7544
0644
edit
dl
rm
quote.php
52358
0644
edit
dl
rm
quote2.php
38831
0644
edit
dl
rm
quote_sydney.php
51912
0644
edit
dl
rm
report.php
10447
0644
edit
dl
rm
search.php
854
0644
edit
dl
rm
serialize.php
132
0644
edit
dl
rm
style.json
1014
0644
edit
dl
rm
sydneydispatch.php
12177
0644
edit
dl
rm
sydneyreport.php
7758
0644
edit
dl
rm
test.php
3851
0644
edit
dl
rm
thankyou.php
32003
0644
edit
dl
rm
wp-cron-cwhi.php
1659
0644
edit
dl
rm
Edit:
/home/desid573/book.familycab.com.au/index1apr2019.php
(92844B)
<?php $invoice_ref = time().rand(10,5000); $dbhost = "localhost"; $dbuser = "perthdes_famcab"; $dbpass = "C]+6wQySxov("; $dbname = "perthdes_familycab"; $conn = new mysqli($dbhost, $dbuser, $dbpass, $dbname) or die($conn->connect_error); $qcon=mysqli_connect($dbhost, $dbuser, $dbpass, $dbname); $query1 = "SELECT * FROM prices WHERE id=0"; $result = mysqli_query($conn, $query1); $row = mysqli_fetch_assoc($result); $baseSyd = $row['base']; $kmSyd = $row['km']; $timeSyd = $row['time']; $largeSyd = $row['large_km']; $minSyd = $row['min']; $min_lateSyd = $row['min_late']; $query1 = "SELECT * FROM prices WHERE id=1"; $result = mysqli_query($conn, $query1); $row = mysqli_fetch_assoc($result); $basePer = $row['base']; $kmPer = $row['km']; $timePer = $row['time']; $largePer = $row['large_km']; $minPer = $row['min']; $min_latePer = $row['min_late']; $query = "SELECT * FROM alert_area WHERE id=1"; $result = mysqli_query($conn, $query); $row = mysqli_fetch_assoc($result); $poly = $row['array']; $client_key = '4T7y1vuKPkdhRYUQdH6msueW9hqV2wpcwnSk0Qwxkvwf7TjQn40qymPW7IJb66gUC1w1505cDMkj9IR82juQEnIp4/8nd0nDhwYDSDoqROtNBWmkqtqYmF6F4qVGMUq3HpJrY3y2kdSljCFfWzWc7LIEn4G5XY2IZAPgAO5+mhwvYrricmqwLhqzV4FBUII5AwTvJZl4awrdul4vLWkS73vJuW/XrXHseGK/nqB3oSRluZ1jKp2qDgVTwrXYEbx4rwwS42X2w0C9tLKywxf27WD2CCK8ftSeQBimVqFI0r6VuRXFVaOn6SQTOD9V/TsCfPk5Zh6/PWcfapyVKS+l1w=='; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <title>FamilyCab Booking Page</title> <!-- Bootstrap --> <link async href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> <link async rel="stylesheet" href="assets/intlTelInput.css"> <link async rel="stylesheet" href="assets/css/style.css" crossorigin="anonymous"> <?php if($_GET['account']==1){echo "<link rel='stylesheet' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/themes/base/minified/jquery-ui.min.css' type='text/css' /> <link rel='stylesheet' href='https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css'>";}?> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <style> #map { height:300px; } body{ background-color: #ffffff; } .iti-flag {background-image: url("assets/flags.png");} .intl-tel-input{width: 100%;} @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min--moz-device-pixel-ratio: 2), only screen and (-o-min-device-pixel-ratio: 2 / 1), only screen and (min-device-pixel-ratio: 2), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx) { .iti-flag {background-image: url("assets/flags@2x.png");} } .intl-tel-input { display: table-cell; width: 100%; } .intl-tel-input .flag-container { z-index: 4; } .input-group .intl-tel-input .form-control { border-top-left-radius: 4px; border-top-right-radius: 0; border-bottom-left-radius: 4px; border-bottom-right-radius: 0; } .help-tip{ top: 0; } .help-tip:hover p{ z-index: 2; } .lat_error_pickup, .lat2_error_pickup, .lat3_error_pickup, .lat4_error_pickup { display:none; color:#a94442; margin-bottom: 0px; margin-top: -5px; } .phone_error { display:none; color:#a94442; margin-bottom: 2px; margin-top: 5px; } .flight_time, .return_flight_time { display:none; color:#000000; margin-bottom: 1px; margin-top: 1px; } .invalidcc { display:none; color:#a94442; margin-bottom: 10px; margin-top: 5px; } .accountName { display:none; } .btn { background: #f26f18; padding-top:5px; padding-bottom:5px; } .btn-primary.active{ background: #000080; } .orangeButton:focus { background: #000080; } .btn-primary.active{ background: #000080; } .btn-primary.active:hover{ background: #000080; } .btn-primary.active:focus{ background: #000080; } .btn-success.active:focus{ background: #000080; } .btn:hover{ background: #000080; } .btn:focus{ background: #000080; } .blueButton { background: #000080; padding-top:5px; padding-bottom:5px; } .buttonText { //display: block; min-height: 20px; //background: #f26f18 ; color:#fff; font-weight:bold; } .ui-autocomplete{ z-index:50; background-color:#FFFFFF; } ul.ui-autocomplete li.ui-menu-item{text-align:left;} @media (max-width:980px) { .small-pad-top{padding-top:5px;} } @media (max-width: 768px) { .orangeButton{min-height: 30px; padding-top:2px; padding-bottom:2px;} .buttonText{font-size:11px; font-weight: normal; min-height: 15px;} } .bgloader { display: none; position: fixed; width: 100%; height: 100%; background-color:#f26f18; opacity : 0.4; z-index: 100; } .loader { display: none; position: fixed; left: 50%; top: 50%; z-index: 101; margin: -60px 0 0 -60px; border: 16px solid #f3f3f3; /* Light grey */ border-top: 16px solid #000080; /* Blue */ border-radius: 50%; width: 120px; height: 120px; animation: spin 2s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .error-class { color:red; z-index:0; position:relative; display:block; text-align: left; } </style> <script type="text/javascript"> function setDecimal(input) { input.value = parseFloat(input.value).toFixed(2); } </script> </head> <body> <div class="loader"></div> <div class="bgloader"></div> <div class="container"> <div class="row"> <div class="col-xs-12 "> </div> </div> </div> <div class="container"> <form role="search" id="form1" onSubmit="myButton.disabled = true; $('#buttontext').text('Processing...'); return true;" method="POST" action="thankyou.php" data-eway-encrypt-key="<?=$client_key?>"> <input type="hidden" name="hidden_ref" value="<?=$invoice_ref?>"> <input type="hidden" id="job_city" name="job_city" value="perth"> <input type="hidden" id="lat1_value" name="lat1_value" value="" required data-validation="required"> <input type="hidden" id="lat2_value" name="lat2_value" value="" required data-validation="required"> <input type="hidden" id="lng1_value" name="lng1_value" value="" required data-validation="required"> <input type="hidden" id="lng2_value" name="lng2_value" value="" required data-validation="required"> <input type="hidden" id="lat3_value" name="lat3_value" value="" > <input type="hidden" id="lat4_value" name="lat4_value" value="" > <input type="hidden" id="lng3_value" name="lng3_value" value="" > <input type="hidden" id="lng4_value" name="lng4_value" value="" > <input type="hidden" id="account" name="account" value="<?=$_GET['account']?>"> <input type="hidden" id="km_est" name="km_est" value=""> <input type="hidden" id="time_est" name="time_est" value=""> <input type="hidden" id="return_km_est" name="return_km_est" value=""> <input type="hidden" id="return_time_est" name="return_time_est" value=""> <input type="hidden" id="onewayPrice" name="onewayPrice" value=""> <input type="hidden" id="returnPrice" name="returnPrice" value=""> <input type="hidden" id="promoCode" name="promoCode" value=""> <input type="hidden" id="promoValue" name="promoValue" value=""> <input type="hidden" id="intphone" name="intphone" value=""> <input type="hidden" id="admin" name="admin" value="<?=$_GET['admin']?>"> <input type="hidden" id="tollAmount" name="tollAmount" value="0"> <input type="hidden" id="tollDescription" name="tollDescription" value=""> <input type="hidden" id="returnTollAmount" name="returntollAmount" value="0"> <input type="hidden" id="returnTollDescription" name="returntollDescription" value=""> <div class="row"> <div id="city" class="btn-group col-xs-12 col-md-6" style="padding-bottom:10px;" data-toggle="buttons"> <label class="col-xs-6 col-md-3 btn btn-primary active"> <input type="radio" name="cityType" id="perth" value="perth" autocomplete="off" checked>Perth </label> <label class="col-xs-6 col-md-3 btn btn-primary"> <input type="radio" name="cityType" id="sydney" value="sydney" autocomplete="off">Sydney </label> </div> </div> <div class="row"> <div id="journey" class="btn-group col-xs-12 col-md-6" style="padding-bottom:10px;" data-toggle="buttons"> <label class="col-xs-6 col-md-3 btn btn-primary active"> <input type="radio" name="journeyType" id="oneway" value="oneway" autocomplete="off" checked>One Way </label> <label class="col-xs-6 col-md-3 btn btn-primary"> <input type="radio" name="journeyType" id="return" value="return" autocomplete="off">Return </label> </div> </div> <div class="row"> <div class="col-xs-6 col-md-3 no-padding newName"> <input type="text" required data-validation="required" class="form-control" placeholder="First Name" name="First_Name" id="First_Name"> </div> <div class="col-xs-6 col-md-3 no-padding newName"> <input type="text" required data-validation="required" class="form-control" placeholder="Last Name" name="Last_Name" id="Last_Name"> </div> </div> <div class="row"> <div class="col-xs-12 col-md-6 no-padding accountName"> <div class="form-group"> <div class="input-group"> <input type="text" data-validation="required" class="form-control" placeholder="Name" name="name" id="name"> <span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span> </div> </div> </div> </div> <div class="row" style="margin-top: 10px"> <div class="col-xs-12 col-md-6 no-padding"> <div class="form-group"> <div class="input-group"> <input type="tel" class="form-control" placeholder="Mobile Number" name="phone" id="phone"> <span class="input-group-addon"><i class="glyphicon glyphicon-phone"></i></span> </div></div> <div class="phone_error">Invalid phone number format</div> </div> </div> <div class="row" style="margin-top: 10px"> <div class="col-xs-12 col-md-6"> <div class="input-group"> <input type="email" class="form-control" name="email" id="email" placeholder="Email"> <span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span> </div> </div> </div> <div class="row" style="margin-top: 10px"> <h4 style="margin-left:15px;">Pick Up Details</h4> </div> <div class="row" style="margin-top: 10px;"> <div class="btn-group col-xs-12 col-md-6" id="type1" data-toggle="buttons"> <label class="col-xs-6 col-md-3 btn btn-primary active"> <input type="radio" name="pickupType" id="search1" value="search1" autocomplete="off" checked>Search </label> <label class="col-xs-6 col-md-3 btn btn-primary"> <input type="radio" name="pickupType" id="airport1" value="airport1" autocomplete="off">Airport </label> </div> </div> <div class="row" style="margin-top: 10px;"> <div id="termPerth1" class="btn-group col-xs-12 col-md-6" data-toggle="buttons"> <label class="col-xs-4 col-md-2 btn btn-primary active"> <input type="radio" name="perthTerminals" id="t1" value="t1" autocomplete="off" checked>T1 Int </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="perthTerminals" id="t2" value="t2" autocomplete="off">T2 </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="perthTerminals" id="t3" value="t3" autocomplete="off">T3/T4 </label> </div> <div id="termSyd1" class="btn-group col-xs-12 col-md-6" data-toggle="buttons"> <label class="col-xs-4 col-md-2 btn btn-primary active"> <input type="radio" name="sydTerminals" id="t1" value="t1" autocomplete="off" checked> T1 Int </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="sydTerminals" id="t2" value="t2" autocomplete="off"> T2 </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="sydTerminals" id="t3" value="t3" autocomplete="off"> T3 </label> </div> </div> <div class="row" style="margin-top: 5px;"> <div id="searchDiv1" class="col-xs-12 col-md-6" > <div class="form-group"> <div class="input-group"> <input type="text" id="pickup" name="pickup" autocomplete="off" required class="form-control" placeholder="Pickup Address"> <span class="input-group-addon"><i class="glyphicon glyphicon-map-marker"></i></span> </div> <div class="lat_error_pickup col-xs-12 col-md-6"><br>Please select address from Google</div> </div> </div> </div> <div class="row" style="margin-top: 10px;"> <div class="btn-group col-xs-12 col-md-6" id="type2" data-toggle="buttons"> <label class="col-xs-6 col-md-3 btn btn-primary active"> <input type="radio" name="dropoffType" id="search2" value="search2" autocomplete="off" checked>Search </label> <label class="col-xs-6 col-md-3 btn btn-primary"> <input type="radio" name="dropoffType" id="airport2" value="airport2" autocomplete="off">Airport </label> </div> </div> <div class="row" style="margin-top: 10px;"> <div id="termPerth2" class="btn-group col-xs-12 col-md-6" data-toggle="buttons"> <label class="col-xs-4 col-md-2 btn btn-primary active"> <input type="radio" name="perthTerminals" id="t1" value="t1" autocomplete="off" checked> T1 Int </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="perthTerminals" id="t2" value="t2" autocomplete="off"> T2 </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="perthTerminals" id="t3" value="t3" autocomplete="off"> T3/T4 </label> </div> <div id="termSyd2" class="btn-group col-xs-12 col-md-6" data-toggle="buttons"> <label class="col-xs-4 col-md-2 btn btn-primary active"> <input type="radio" name="sydTerminals" id="t1" value="t1" autocomplete="off" checked> T1 Int </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="sydTerminals" id="t2" value="t2" autocomplete="off"> T2 </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="sydTerminals" id="t3" value="t3" autocomplete="off"> T3 </label> </div> </div> <div class="row" > <div id="searchDiv2" class="col-xs-12 col-md-6" > <div class="form-group"> <div class="input-group"> <input type="text" id="dropoff" name="dropoff" autocomplete="off" required class="form-control" placeholder="Drop off Address"> <span class="input-group-addon"><i class="glyphicon glyphicon-map-marker"></i></span> </div> </div> <div class="lat2_error_pickup"><br>Please select address from Google</div> </div> </div> <div class="row" style="margin-top: 10px"> <div class="col-xs-6 col-md-3"> <div class="form-group"> <div class='input-group date' id="date-group"> <input type="text" required class="form-control" name="date" id="date" placeholder="Date" autocomplete="off"> <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span> </div> </div> <div class="flight_time">  Flight Arrival Date</div> </div> <div class="col-xs-6 col-md-3"> <div class="form-group"> <div class="input-group bootstrap-timepicker timepicker"> <input id="time" type="text" name="time" required class="form-control input-small"> <span class="input-group-addon"><i class="glyphicon glyphicon-time"></i></span> </div> </div> <div class="flight_time">  Flight Arrival Time</div> </div> </div> <div class="pickup_div_t" style="margin-top: 0px;display:none;"> <div class="row"> <div class="col-xs-12 col-md-12 col-lg-12" style="margin-top:5px; margin-left:5px;" > We will track your flight number an adjust your pick up time accordingly.<br> Please select time for pickup after your flight arrives:  <br> (usually 20-30 mins for domestic, 45-60 mins for international)<br> </div> <div id="pickupMins" class="btn-group col-xs-12 col-md-4 col-lg-4" data-toggle="buttons"> <label class="col-xs-3 col-md-3 col-lg-3 btn btn-primary active"> <input type="radio" class="" value="20" name="pickup_time" id="pickup_time" checked> 20m </label> <label class="col-xs-3 col-md-3 col-lg-3 btn btn-primary"> <input type="radio" class="" value="30" name="pickup_time" id="pickup_time"> 30m </label> <label class="col-xs-3 col-md-3 col-lg-3 btn btn-primary"> <input type="radio" class="" value="45" name="pickup_time" id="pickup_time"> 45m </label> <label class="col-xs-3 col-md-3 col-lg-3 btn btn-primary"> <input type="radio" class="" value="60" name="pickup_time" id="pickup_time"> 60m </label> </div> <div class="col-xs-12 col-md-2 col-lg-2 small-pad-top" > <div class="form-group"> <div class="input-group"> <input type="text" id="flight_number" name="flight_number" value="N/A" autocomplete="off" class="form-control" placeholder="Flight Number"><span class="input-group-addon"><i class="glyphicon glyphicon-plane"></i></span> </div></div> </div> </div> </div> <div class="return_rows" style="display:none;"> <div class="row" style="margin-top: 10px"> <h4 style="margin-left:15px;">Return Details</h4> </div> <div class="row" style="margin-top: 10px;"> <div class="btn-group col-xs-12 col-md-6" id="type3" data-toggle="buttons"> <label class="col-xs-6 col-md-3 btn btn-primary active"> <input type="radio" name="returnPickupType" id="search3" value="search3" autocomplete="off" checked>Search </label> <label class="col-xs-6 col-md-3 btn btn-primary"> <input type="radio" name="returnPickupType" id="airport3" value="airport3" autocomplete="off">Airport </label> </div> </div> <div class="row" style="margin-top: 5px;"> <div id="termPerth3" class="btn-group col-xs-12 col-md-6" data-toggle="buttons"> <label class="col-xs-4 col-md-2 btn btn-primary active"> <input type="radio" name="perthTerminals" id="t1" value="t1" autocomplete="off" checked>T1 Int </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="perthTerminals" id="t2" value="t2" autocomplete="off">T2 </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="perthTerminals" id="t3" value="t3" autocomplete="off">T3/T4 </label> </div> <div id="termSyd3" class="btn-group col-xs-12 col-md-6" data-toggle="buttons"> <label class="col-xs-4 col-md-2 btn btn-primary active"> <input type="radio" name="sydTerminals" id="t1" value="t1" autocomplete="off" checked> T1 Int </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="sydTerminals" id="t2" value="t2" autocomplete="off"> T2 </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="sydTerminals" id="t3" value="t3" autocomplete="off"> T3 </label> </div> </div> <div class="row" style="padding-top: 5px;"> <div id="searchDiv3" class="col-xs-12 col-md-6" > <div class="form-group"><div class="input-group"><input type="text" id="return_pickup" name="return_pickup" autocomplete="off" class="form-control" placeholder="Return Pickup Address"><span class="input-group-addon glyphicon glyphicon-map-marker"></span> </div><div class="lat3_error_pickup"><br>Please select address from Google</div> </div></div> </div> <div class="row" style="margin-top: 10px;"> <div class="btn-group col-xs-12 col-md-6" id="type4" data-toggle="buttons"> <label class="col-xs-6 col-md-3 btn btn-primary active"> <input type="radio" name="returnDropoffType" id="search4" value="search4" autocomplete="off" checked>Search </label> <label class="col-xs-6 col-md-3 btn btn-primary"> <input type="radio" name="returnDropoffType" id="airport4" value="airport4" autocomplete="off">Airport </label> </div> </div> <div class="row" style="margin-top: 5px;"> <div id="termPerth4" class="btn-group col-xs-12 col-md-6" data-toggle="buttons"> <label class="col-xs-4 col-md-2 btn btn-primary active"> <input type="radio" name="perthTerminals" id="t1" value="t1" autocomplete="off" checked>T1 Int </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="perthTerminals" id="t2" value="t2" autocomplete="off">T2 </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="perthTerminals" id="t3" value="t3" autocomplete="off">T3/T4 </label> </div> <div id="termSyd4" class="btn-group col-xs-12 col-md-6" data-toggle="buttons"> <label class="col-xs-4 col-md-2 btn btn-primary active"> <input type="radio" name="sydTerminals" id="t1" value="t1" autocomplete="off" checked> T1 Int </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="sydTerminals" id="t2" value="t2" autocomplete="off"> T2 </label> <label class="col-xs-4 col-md-2 btn btn-primary"> <input type="radio" name="sydTerminals" id="t3" value="t3" autocomplete="off"> T3 </label> </div> </div> <div class="row" style="margin-top: 5px;"> <div id="searchDiv4" class="col-xs-12 col-md-6"> <div class="form-group"><div class="input-group"><input type="text" id="return_dropoff" name="return_dropoff" autocomplete="off" class="form-control" placeholder="Drop off Address"><span class="input-group-addon glyphicon glyphicon-map-marker"></span> </div><div class="lat4_error_pickup"><br>Please select address from Google</div> </div></div> </div> <div class="row" style="margin-top: 10px"> <div class="col-xs-6 col-md-3"> <div class="form-group"> <div class='input-group date'> <input type="text" required class="datepicker form-control" name="return_date" id="return_date" placeholder="Return Date"> <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span> </div> </div> <div class="return_flight_time">  Flight Arrival Date</div> </div> <div class="col-xs-6 col-md-3"> <div class="form-group"> <div class="input-group bootstrap-timepicker timepicker"> <input id="return_time" type="text" name="return_time" required class="form-control input-small"> <span class="input-group-addon"><i class="glyphicon glyphicon-time"></i></span> </div> </div> <div class="return_flight_time">  Flight Arrival Time</div> </div> </div> <div class="return_pickup_div_t" style="margin-top: 0px;display:none;"> <div class="row"> <div class="col-xs-12 col-md-12 col-lg-12" style="margin-top:5px; margin-left:5px;" > We will track your flight number an adjust your pick up time accordingly.<br> Please select time for pickup after your flight arrives:  <br> (usually 20-30 mins for domestic, 45-60 mins for international)<br> </div> <div id="returnPickupMins" class="btn-group col-xs-12 col-md-4 col-lg-4" data-toggle="buttons"> <label class="col-xs-3 col-md-3 col-lg-3 btn btn-primary active"> <input type="radio" class="" value="20" name="return_pickup_time" id="pickup_time" checked> 20m </label> <label class="col-xs-3 col-md-3 col-lg-3 btn btn-primary"> <input type="radio" class="" value="30" name="return_pickup_time" id="pickup_time"> 30m </label> <label class="col-xs-3 col-md-3 col-lg-3 btn btn-primary"> <input type="radio" class="" value="45" name="return_pickup_time" id="pickup_time"> 45m </label> <label class="col-xs-3 col-md-3 col-lg-3 btn btn-primary"> <input type="radio" class="" value="60" name="return_pickup_time" id="pickup_time"> 60m </label> </div> <div class="col-xs-12 col-md-2 col-lg-2 small-pad-top" > <div class="form-group"> <div class="input-group"> <input type="text" id="return_flight_number" name="return_flight_number" value="N/A" autocomplete="off" class="form-control" placeholder="Flight Number"><span class="input-group-addon"><i class="glyphicon glyphicon-plane"></i></span> </div></div> </div> </div> </div> </div> <div class="other_rows"> <div class="row" style="margin-top: 10px"> <h4 style="margin-left:15px;">Passenger Details</h4> </div> <div class="row" > <div class="col-xs-12 col-md-6"> <div class="row" style="margin-top: 10px"> <div class="col-xs-10 col-md-10"> Total Number of Passengers including Children <br> </div> <div class="col-xs-2 col-md-1"> <select id="passenger_count" name="passenger_count"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> </select> </div> </div> <div class="row" style="margin-top: 10px"> <div class="col-xs-10 col-md-10"> Number of children requiring rearward facing car seats / capsule <span class="help-tip"><p>Rearward Facing child seats are a legal requirement in Western Australia between birth and 6 months. Our rearward facing seats can be used up to 36 months.</p></span><br></div> <div class="col-xs-2 col-md-1"> <select id="car_seat" name="car_seat"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> </div></div> <div class="row" style="margin-top: 10px"> <div class="col-xs-10 col-md-10"> Number of children requiring forward facing car seats <span class="help-tip"><p>Forward Facing child seats are a legal requirement in Western Australia between 6 months and 4 years. Our forward facing seats can be used up to 8 years.</p></span><br></div> <div class="col-xs-2 col-md-1"> <select id="ff_count" name="ff_count"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> </div></div> <div class="row" style="margin-top: 10px"> <div class="col-xs-10 col-md-10"> Number of children requiring booster seats <span class="help-tip"><p>Booster seats are the minimun legal requirement between 4-7 years. Our forward facing seats can be used up to 8 years but if your child is used to having a booster seat you can select this option.</p></span><br></div> <div class="col-xs-2 col-md-1"> <select id="booster_count" name="booster_count"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> </select> </div></div> </div></div> <div class="row" style="margin-top: 10px"> <div class="col-xs-12 col-md-6"> Describe your luggage<br><textarea placeholder="eg: 3 large suitcases and 2 carry on / 2 large suitcases and a pram" style="width:100%;height:70px;" name="luggage" id="luggage" class="form-control"></textarea> </div></div> </div> <div class="row" style="margin-top: 10px"> <h4 style="margin-left:15px;">Payment Details</h4> </div> <div class="newName"> <div class="row" style="margin-top: 10px"> <div class="col-xs-12 col-md-6"> <div class="form-group"> <div class="input-group"> <input type="text" required class=" form-control" id="EWAY_CARDNUMBER" placeholder="Credit Card Number" maxlength="20" autocomplete="off" name="EWAY_CARDNUMBER" data-eway-encrypt-name="EWAY_CARDNUMBER" maxlength="20" onblur=" cc_number_saved = this.value; this.value = this.value.replace(/[^\d]/g, ''); if(!checkLuhn(this.value)) { this.placeholder='Invalid Credit Card Number'; this.style='background:#FF0000'; this.value = ''; } else { this.placeholder='Credit Card Number'; this.style='background:#FFFFFF'; }" onfocus=" // restore saved string if(this.value != cc_number_saved) this.value = cc_number_saved;"> <span class="input-group-addon"><i class="glyphicon glyphicon-credit-card"></i></span> </div> </div> <div class="invalidcc">Invalid Card Number</div></div></div> <div class="row" style="margin-top: 10px"> <div class="col-xs-5 col-md-2"><input class="form-control" type="text" required id="EWAY_CARDCVN" placeholder="CVC" maxlength="4" autocomplete="off" name="EWAY_CARDCVN" data-eway-encrypt-name="EWAY_CARDCVN"></div> <div class="col-xs-7 col-md-4" style="margin-top: 5px"> <span id="dd" class="pull-right" > <select id="EWAY_CARDEXPIRYMONTH" name="EWAY_CARDEXPIRYMONTH"> <option value="" selected hidden>Month</option> <option value="01">Jan</option> <option value="02">Feb</option> <option value="03">Mar</option> <option value="04">Apr</option> <option value="05">May</option> <option value="06">Jun</option> <option value="07">Jul</option> <option value="08">Aug</option> <option value="09">Sep</option> <option value="10">Oct</option> <option value="11">Nov</option> <option value="12">Dec</option> </select> <select id="EWAY_CARDEXPIRYYEAR" name="EWAY_CARDEXPIRYYEAR"> <option value="" selected hidden>Year</option> <option value="18">2018</option> <option value="19">2019</option> <option value="20">2020</option> <option value="21">2021</option> <option value="22">2022</option> <option value="23">2023</option> <option value="24">2024</option> <option value="25">2025</option> <option value="26">2026</option> <option value="27">2027</option> </select> </span> </div> </div> </div> <div class="row" style="margin-top: 10px"> <div class="col-xs-12 col-md-6 accountName"> <input type="text" id="token" name="token" autocomplete="off" class="form-control" placeholder="Token"> </div> </div> <div class="row" style="margin-top: 10px"> <div class="col-xs-6 col-md-3"> <h4 >Quote </h4> </div> <div class="col-xs-6 col-md-3 no-padding"> <h4 >Promo Code </h4> </div> </div> <div class="row" style="margin-top: 10px"> <div class="col-xs-6 col-md-3"> <h5><span id="tripdesc">One Way</span>: $<span id="totalPrice"><strong>0</strong></span></h5> <div class="return_rows" style="display:none;"><h5 >Return Journey: $<span id="totalPrice2"><strong>0</strong></span></h5> <h5 >Total (First + Return): $<span id="totalPrice3"><strong>0</strong></span></h5></div> <button type="button" onclick="return false;" name="quoteButton" class="btn btn-primary btn-block" id="quoteButton"><span id="quoteButtonText" >Get Quote</span></button> </div> <div class="col-xs-6 col-md-3 no-padding"> <input type="text" class="form-control col-xs-3 col-md-2" placeholder="Promo Code" name="promo_code" id="promo_code"> <br> <button type="button" onclick="return false;" name="promoButton" style="background: #FFFFFF;padding-top:5px; padding-bottom:5px;" class="btn-block" id="promoButton"><span id="promoText" style="display: block; color: #000000;">Check</span></button> </div> </div> <div class="row" style="margin-top: 10px"> <div class="col-xs-12 col-md-6 "> <button type="button" data-toggle="button" aria-pressed="false" name="myButton" class="btn btn-primary btn-block" id="myButton"><span id="buttontext">Make Booking</span></button> </div> </div> <div class="row" style="margin-top: 10px"> <div class="col-xs-12 col-md-6"> <div id="map"></div> </div> </div> </form> <script src="https://secure.ewaypayments.com/scripts/eCrypt.min.js"></script> </div> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <!-- Bootstrap Date-Picker Plugin --> <? if($_GET['account']==1){echo "<script type='text/javascript' src='assets/jquery-ui.js'></script>";}?> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/css/bootstrap-datepicker3.css"/> <link type="text/css" href="assets/css/bootstrap-timepicker.min.css" /> <script src="assets/js/bootstrap-timepicker.min.js"></script> <script src="assets/intlTelInput.js"></script> <script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script> <script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script> <script type="text/javascript"> $("#phone").intlTelInput({ //allowDropdown: true, autoHideDialCode: true, // autoPlaceholder: "off", //dropdownContainer: "body", // excludeCountries: ["us"], formatOnDisplay: true, geoIpLookup: function(callback) { $.get("http://ipinfo.io", function() {}, "jsonp").always(function(resp) { var countryCode = (resp && resp.country) ? resp.country : ""; callback(countryCode); }); }, initialCountry: "au", nationalMode: false, // onlyCountries: ['us', 'gb', 'ch', 'ca', 'do'], placeholderNumberType: "Mobile", preferredCountries: ['au', 'nz', 'gb', 'cn', 'id'], separateDialCode: true, utilsScript: "assets/utils.js" }); $airport_pickup = 0; $return_airport_pickup = 0; var price1 = 0; var discount = 1; var setCity = "perth"; var tolls = 0; var return_tolls = 0; var airportPoly = null; var parent = this; var mapStyle $.getJSON("style.json", function(json) { console.log(json); // this will show the info it in firebug console mapStyle = json; }); $(document).ready(function(){ $('#termPerth1').hide(); $('#termSyd1').hide(); $('#searchDiv1').show(); $('#termPerth2').hide(); $('#termSyd2').hide(); $('#searchDiv2').show(); $('#termPerth3').hide(); $('#termSyd3').hide(); $('#searchDiv3').show(); $('#termPerth4').hide(); $('#termSyd4').hide(); $('#searchDiv4').show(); if($('#account').val() == 1){ $('.newName').hide(); $('.accountName').show(); $("#First_Name, #Last_Name, #EWAY_CARDNUMBER, #EWAY_CARDCVN").removeAttr('required'); $("#name").attr('required', 'required'); $(function() { $("#name").autocomplete({ source: 'search.php', minLength: 1 }); }); $("#name").on("blur", function(){ var id = $("#name").val(); var data = 'name=' + id; $.ajax({ type: "POST", url: "a_name_address.php", data: data, dataType: 'json', success: function (data) { $("#phone").val(data.mobile); $("#email").val(data.email); $("#token").val(data.token); if($("#phone").intlTelInput("isValidNumber") == true) { var intlNumber = $("#phone").intlTelInput("getNumber"); $('#intphone').val( intlNumber ); } else { $('#intphone').val( data.mobile ); } } // success }); // ajax }); } // $("#name").on("keyup", function(){ // var id = $("#name").val(); // var data = 'name=' + id; // $.ajax({ // type: "POST", // url: "a_name_address.php", // data: data, // dataType: 'json', // success: function (data) { // $("#phone").val(data.mobile); // $("#dropoff").val(data.pickup); // $("#email").val(data.email); // } // success // }); // ajax // }); var date_input=$("#date, #return_date"); //our date input has the name "date" var container=$('.bootstrap-iso form').length>0 ? $('.bootstrap-iso form').parent() : "body"; date_input.datepicker({ startDate: new Date(), format: 'd M, yyyy', container: container, todayHighlight: true, autoclose: true, datesDisabled: '25/12/2018', onSelect: function () { $("#form1").valid(); } }) $('#time, #return_time').timepicker(); $("#return_pickup, #return_dropoff, #return_date, #return_time").removeAttr('required'); $("#journey").change(function(){ var radioValue = $("input[name='journeyType']:checked").val(); if(radioValue == 'oneway'){ $(".return_rows").hide(); $("#tripdesc").text("One Way"); $("#return_pickup, #return_dropoff, #return_date, #return_time").removeAttr('required'); } if(radioValue=='return'){ $(".return_rows").show(); $("#tripdesc").text("First Journey"); $("#return_pickup, #return_dropoff, #return_date, #return_time").attr('required', 'required'); } }) $("#city").change(function(){ var radioValue = $("input[name='cityType']:checked").val(); $('#job_city').val(radioValue); if(radioValue == 'perth'){ setCity = "perth"; $('#pickup, #dropoff, #return_pickup, #return_dropoff').val(""); $('#termSyd1, #termSyd2, #termSyd3, #termSyd4').hide(); } if(radioValue=='sydney'){ setCity = "sydney"; $('#pickup, #dropoff, #return_pickup, #return_dropoff').val(""); $('#termPerth1, #termPerth2, #termPerth3, #termPerth4').hide(); } initAutocomplete() }) $("#type1").change(function(){ var radioValue = $("input[name='pickupType']:checked").val(); if(radioValue == 'airport1'){ if(setCity=="perth"){ $('#termPerth1').show(); $('#termSyd1').hide(); perthTerminal1("#pickup", "#lat1_value", "#lng1_value"); pickupAirport(); $airport_pickup = 5; } else if(setCity=="sydney"){ $('#termPerth1').hide(); $('#termSyd1').show(); sydTerminal1("#pickup", "#lat1_value", "#lng1_value"); pickupAirport(); $airport_pickup = 5; } } else if(radioValue=='search1'){ $('#termPerth1').hide(); $('#termSyd1').hide(); $airport_pickup = 0; $('#pickup').val(""); $(".pickup_div_t, .flight_time").hide(); } }) $("#type2").change(function(){ var radioValue = $("input[name='dropoffType']:checked").val(); if(radioValue == 'airport2'){ if(setCity=="perth") { $('#termPerth2').show(); $('#termSyd2').hide(); perthTerminal1("#dropoff", "#lat2_value", "#lng2_value"); } else if(setCity="sydney") { sydTerminal1("#dropoff", "#lat2_value", "#lng2_value"); $('#termPerth2').hide(); $('#termSyd2').show(); } } else if(radioValue=='search2') { $('#termPerth2').hide(); $('#termSyd2').hide(); $airport_pickup = 0; $('#dropoff').val(""); } }) $("#termPerth1").change(function(){ var radioValue = $("input[name='perthTerminals']:checked").val(); if(radioValue == 't1'){ perthTerminal1("#pickup", "#lat1_value", "#lng1_value"); pickupAirport(); $airport_pickup = 5; } if(radioValue == 't2'){ perthTerminal2("#pickup", "#lat1_value", "#lng1_value"); pickupAirport(); $airport_pickup = 5; } if(radioValue == 't3'){ perthTerminal3("#pickup", "#lat1_value", "#lng1_value"); pickupAirport(); $airport_pickup = 5; } }) $("#termPerth2").change(function(){ var radioValue = $("input[name='perthTerminals']:checked").val(); if(radioValue == 't1'){ perthTerminal1("#dropoff", "#lat2_value", "#lng2_value"); } if(radioValue == 't2'){ perthTerminal2("#dropoff", "#lat2_value", "#lng2_value"); } if(radioValue == 't3'){ perthTerminal3("#dropoff", "#lat2_value", "#lng2_value"); } }) $("#termSyd1").change(function(){ var radioValue = $("input[name='sydTerminals']:checked").val(); if(radioValue == 't1'){ sydTerminal1("#pickup", "#lat1_value", "#lng1_value"); pickupAirport(); $airport_pickup = 5; } if(radioValue == 't2'){ sydTerminal2("#pickup", "#lat1_value", "#lng1_value"); pickupAirport(); $airport_pickup = 5; } if(radioValue == 't3'){ sydTerminal3("#pickup", "#lat1_value", "#lng1_value"); pickupAirport(); $airport_pickup = 5; } }) $("#termSyd2").change(function(){ var radioValue = $("input[name='sydTerminals']:checked").val(); if(radioValue == 't1'){ sydTerminal1("#dropoff", "#lat2_value", "#lng2_value"); } if(radioValue == 't2'){ sydTerminal2("#dropoff", "#lat2_value", "#lng2_value"); } if(radioValue == 't3'){ sydTerminal3("#dropoff", "#lat2_value", "#lng2_value"); } }) $("#type3").change(function(){ var radioValue = $("input[name='returnPickupType']:checked").val(); if(radioValue == 'airport3'){ if(setCity=="perth"){ $('#termPerth3').show(); $('#termSyd3').hide(); perthTerminal1("#return_pickup", "#lat3_value", "#lng3_value"); pickupReturnAirport() $return_airport_pickup = 5; } else if(setCity=="sydney"){ $('#termPerth3').hide(); $('#termSyd3').show(); sydTerminal1("#return_pickup", "#lat3_value", "#lng3_value"); pickupReturnAirport() $return_airport_pickup = 5; } } else if(radioValue == 'search3') { $('#termPerth3').hide(); $('#termSyd3').hide(); $return_airport_pickup = 0; $('#return_pickup').val(""); $(".return_pickup_div_t, .return_flight_time").hide(); } }) $("#type4").change(function(){ var radioValue = $("input[name='returnDropoffType']:checked").val(); if(radioValue == 'airport4'){ if(setCity=="perth") { $('#termPerth4').show(); $('#termSyd4').hide(); perthTerminal1("#return_dropoff", "#lat4_value", "#lng4_value"); } else if(setCity="sydney") { sydTerminal1("#return_dropoff", "#lat4_value", "#lng4_value"); $('#termPerth4').hide(); $('#termSyd4').show(); } } else if(radioValue == 'search4'){ $('#termPerth4').hide(); $('#termSyd4').hide(); $return_airport_pickup = 0; $('#return_dropoff').val(""); } }) $("#termPerth3").change(function(){ $return_airport_pickup = 5; var radioValue = $("input[name='perthTerminals']:checked").val(); if(radioValue == 't1'){ perthTerminal1("#return_pickup", "#lat3_value", "#lng3_value"); returnPickupAirport(); } if(radioValue == 't2'){ perthTerminal2("#return_pickup", "#lat3_value", "#lng3_value"); returnPickupAirport(); } if(radioValue == 't3'){ perthTerminal3("#return_pickup", "#lat3_value", "#lng3_value"); returnPickupAirport(); } }) $("#termPerth4").change(function(){ var radioValue = $("input[name='perthTerminals']:checked").val(); if(radioValue == 't1'){ perthTerminal1("#return_dropoff", "#lat4_value", "#lng4_value"); } if(radioValue == 't2'){ perthTerminal2("#return_dropoff", "#lat4_value", "#lng4_value"); } if(radioValue == 't3'){ perthTerminal3("#return_dropoff", "#lat4_value", "#lng4_value"); } }) $("#termSyd3").change(function(){ $return_airport_pickup = 5; var radioValue = $("input[name='sydTerminals']:checked").val(); if(radioValue == 't1'){ sydTerminal1("#return_pickup", "#lat3_value", "#lng3_value"); pickupAirport(); } if(radioValue == 't2'){ sydTerminal2("#return_pickup", "#lat3_value", "#lng3_value"); pickupAirport(); } if(radioValue == 't3'){ sydTerminal3("#return_pickup", "#lat3_value", "#lng3_value"); pickupAirport(); } }) $("#termSyd4").change(function(){ var radioValue = $("input[name='sydTerminals']:checked").val(); if(radioValue == 't1'){ sydTerminal1("#return_dropoff", "#lat4_value", "#lng4_value"); } if(radioValue == 't2'){ sydTerminal2("#return_dropoff", "#lat4_value", "#lng4_value"); } if(radioValue == 't3'){ sydTerminal3("#return_dropoff", "#lat4_value", "#lng4_value"); } }) }); $('#promoButton').on('click', function () { console.log(discount); var dataString = "promo=" + $('#promo_code').val(); $.ajax({ type: "POST", url: "promo.php", data: dataString, dataType: 'json', success: function (data) { console.log(data); if(data.response == "no"){ $('#promoButton').attr('style', 'background:#FF0000;padding-top:5px; padding-bottom:5px;'); $('#promoButton').text("Incorrect"); $('#promoCode').val(""); $('#promoValue').val(""); discount = 1; } else { if(data.expired == "") { $('#promoButton').attr('style', 'background: #00FF00;padding-top:5px; padding-bottom:5px;'); $('#promoButton').text("Valid!"); $('#promoCode').val(data.code); $('#promoValue').val(data.value); discount = data.value; console.log(discount); distance(); returndistance(); console.log($('#promoCode').val()); } else { $('#promoButton').attr('style', 'background:#FF0000;padding-top:5px; padding-bottom:5px;'); $('#promoButton').text("Invalid!"); $('#promoCode').val(""); $('#promoValue').val(""); discount = 1; } } } }) }) // $('.datepicker').pickadate({ // editable: true // }); // $('.timepicker').pickatime({ // interval:15, // editable: true, // }); $('#lng1_value, #lng2_value, #lng3_value, #lng4_value').on('change', function() { initMap(); }) $('#pickup').on('blur', function () { $(this).delay(2000).queue(function() { }) }) $('#lat1_value').on('change', function () { $('.lat_error_pickup').hide(); }) $('#pickup').on('change', function () { $("#lat1_value").val(''); $("#lng1_value").val(''); $('.lat_error_pickup').hide(); $('#totalPrice').text( "" ); oneway_directions_set = 0; }) $('#dropoff').on('blur', function () { $(this).delay(2000).queue(function() { }) }) $('#dropoff').on('change', function () { $("#lat2_value").val(''); $("#lng2_value").val(''); $('.lat2_error_pickup').hide(); $('#totalPrice').text( "" ); oneway_directions_set = 0; }) $('#lat2_value').on('change', function () { $('.lat2_error_pickup').hide(); }) $('#return_pickup').on('blur', function () { $(this).delay(2000).queue(function() { }) }) $('#return_pickup').on('change', function () { $("#lat3_value").val(''); $("#lng3_value").val(''); $('#totalPrice2').text( "" ); $('.lat3_error_pickup').hide(); return_directions_set = 0; }) $('#lat3_value').on('change', function () { $('.lat3_error_pickup').hide(); }) $('#return_dropoff').on('blur', function () { $(this).delay(2000).queue(function() { }) }) $('#return_dropoff').on('change', function () { $("#lat4_value").val(''); $("#lng4_value").val(''); $('.lat4_error_pickup').hide(); $('#totalPrice2').text( "" ); return_directions_set = 0; }) $('#lat4_value').on('change', function () { $('.lat4_error_pickup').hide(); }) $('#pickup, #dropoff, .datepicker, .timepicker, #first_name, #phone, #email, #passenger_count, #car_seat, #ff_count, #booster_count').on('blur', function () { $('totalPrice').val(""); }) $('#return_pickup, #return_dropoff, .datepicker, .timepicker, #email, #luggage, #passenger_count, #car_seat, #ff_count, #booster_count, #onewayPrice, #returnPrice, #EWAY_CARDNUMBER, #EWAY_CARDCVN, #EWAY_CARDEXPIRYMONTH, #EWAY_CARDEXPIRYYEAR, #luggage').on('blur', function () { $('totalPrice2').val(""); $('totalPrice3').val(""); }) $('#quoteButton').on("click", function () { if ($('#lat1_value').val() == "") { $(".lat_error_pickup").show(); return; } else if ($('#lat2_value').val() == "") { $(".lat2_error_pickup").show(); return; } else if ($('#lat3_value').val() == "" && $("input[name='journeyType']:checked").val() == "Return") { $(".lat3_error_pickup").show(); return; } else if ($('#lat4_value').val() == "" && $("input[name='journeyType']:checked").val() == "Return") { $(".lat4_error_pickup").show(); return; } else { $(".loader, .bgloader").show(); distance(); returndistance(); } }) jQuery.validator.setDefaults({ success: "valid", modules: 'html5, logic, security', onfocusout: function(element) { // "eager" validation this.element(element); }, highlight: function(element) { $(element).closest('.form-group').addClass('has-error'); }, unhighlight: function(element) { $(element).closest('.form-group').removeClass('has-error'); }, errorElement: 'span', errorClass: 'help-block', errorPlacement: function(error, element) { if(element.parent('.input-group').length) { error.insertAfter(element.parent()); } else { error.insertAfter(element); } }, submitHandler: function(form) { $(".loader, .bgloader").show(); eCrypt.submitForm(); }, invalidHandler: function(event, validator) { this.onsubmit = null; }, }); $('#myButton').on("click", function () { var phoneCheck = $("#phone").val(); if(phoneCheck == "") { $(".phone_error").show(); var offset = $("#phone").offset(); $('html, body').animate({ scrollTop: offset.top - 20, scrollLeft: offset.left }); } else { $("#form1").validate(); if($("#form1").valid() == true) { if($('#onewayPrice').val() == "") { console.log('onewayPrice found none'); $('#buttontext').text("Getting Quote..."); $(".loader, .bgloader").show(); distance().done(function () { if($('#onewayPrice').val() != "") { if($("input[name='journeyType']:checked").val() == "return") { if($('#returnPrice').val() == "") { returnDistance().done(function () { if($('#returnPrice').val() != "") { $(".loader, .bgloader").show(); $( "#form1" ).submit(); } else { alert("Form incomplete"); $('#buttontext').text("Make Booking"); } }) } else { $(".loader, .bgloader").show(); $( "#form1" ).submit(); } } else { $(".loader, .bgloader").show(); $( "#form1" ).submit(); } } else { $(".loader, .bgloader").hide(); alert("Form incomplete"); $('#buttontext').text("Make Booking"); } }) } else { $(".loader, .bgloader").show(); $( "#form1" ).submit(); } } else { console.log("not valid"); $('#buttontext').text("Incomplete fields.."); var input = $('.has-error:first'); console.log(input); var offset = input.offset(); $('html, body').animate({ scrollTop: offset.top - 20, scrollLeft: offset.left }); setTimeout(function() { $('#buttontext').text("Make Booking"); }, 2000); } } }) $('#phone').on('change', function () { if($("#phone").intlTelInput("isValidNumber") == true) { var intlNumber = $("#phone").intlTelInput("getNumber"); $('#intphone').val( intlNumber ); $('.phone_error').hide(); return true;; } else { $("#phone").val(""); $('.phone_error').show(); return false;; } }) map = null ; pickUp = null ; dropOff = null; return_pickUp = null; return_dropOff= null; directionsDisplay = null ; directionsDisplay_return = null; directionsService = null ; directionsService_return = null ; var oneway_directions_set = 0; var return_directions_set = 0; var pickupState = ""; var dropoffState = ""; var returnPickupState = ""; var returnDropoffState = ""; var googleRoute = ""; var googleReturnRoute = ""; function initMap() { if(map == null) { map = new google.maps.Map(document.getElementById('map'), { zoom: 12, center: {lat: -31.9535959, lng: 115.8570118}, styles: mapStyle }); } var geocoder = new google.maps.Geocoder(); if($('#pickup').val() != "") geocodeAddress(geocoder, map); if($('#dropoff').val() != "") geocodeAddress2(geocoder, map); if($('#return_pickup').val() != "") geocodeAddress3(geocoder, map); if($('#return_dropoff').val() != "") geocodeAddress4(geocoder, map); if(directionsDisplay != null) directionsDisplay.setDirections({routes: []}); if(directionsDisplay_return != null) directionsDisplay_return.setDirections({routes: []}); directionsService = new google.maps.DirectionsService; directionsService_return = new google.maps.DirectionsService; directionsDisplay = new google.maps.DirectionsRenderer; directionsDisplay.setOptions({ suppressMarkers: true }); directionsDisplay_return = new google.maps.DirectionsRenderer; directionsDisplay_return.setOptions({ suppressMarkers: true }); directionsDisplay.setMap(map); directionsDisplay_return.setMap(map); calculateAndDisplayRoute(directionsService, directionsDisplay); var airportCoords = unpackLatlng(<?=$poly ?>); airportPoly = new google.maps.Polygon({ paths: airportCoords, strokeColor: '#0000FF', strokeOpacity: 0.8, strokeWeight: 1, fillColor: '#0000FF', fillOpacity: 0.1 }); //airportPoly.setMap(map); } function geocodeAddress(geocoder, resultsMap) { var address = document.getElementById('pickup').value; geocoder.geocode({'address': address}, function(results, status) { if (status === google.maps.GeocoderStatus.OK) {resultsMap.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({map: resultsMap,position: results[0].geometry.location}); $('#lat1_value').val(results[0].geometry.location.lat()); $('#lng1_value').val(results[0].geometry.location.lng()) .trigger('change'); if(google.maps.geometry.poly.containsLocation(results[0].geometry.location, airportPoly) == true) { console.log("found"); var radioValue = $("input[name='pickupType']:checked").val(); if(radioValue == "search1") { if(setCity=="perth"){ $('input[name="pickupType"][value="airport1"]').click(); //$('$pickupType').val("search1"); //$('#termPerth1').show(); //$('#termSyd1').hide(); //perthTerminal1("#pickup", "#lat1_value", "#lng1_value"); // pickupAirport(); // $airport_pickup = 5; } else if(setCity=="sydney"){ $('#termPerth1').hide(); $('#termSyd1').show(); sydTerminal1("#pickup", "#lat1_value", "#lng1_value"); pickupAirport(); $airport_pickup = 5; } } } } else { //console.log("not found"); } }); } function geocodeAddress2(geocoder, resultsMap) { var address = document.getElementById('dropoff').value; geocoder.geocode({'address': address}, function(results, status) { if (status === google.maps.GeocoderStatus.OK) {resultsMap.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({map: resultsMap,position: results[0].geometry.location}); $('#lat2_value').val(results[0].geometry.location.lat()); $('#lng2_value').val(results[0].geometry.location.lng()) .trigger('change'); if(google.maps.geometry.poly.containsLocation(results[0].geometry.location, airportPoly) == true) { var radioValue = $("input[name='dropoffType']:checked").val(); if (radioValue == "search2") { if(setCity=="perth") { $('input[name="dropoffType"][value="airport2"]').click(); perthTerminal1("#dropoff", "#lat2_value", "#lng2_value"); } else if(setCity="sydney") { sydTerminal1("#dropoff", "#lat2_value", "#lng2_value"); $('#termPerth2').hide(); $('#termSyd2').show(); } } } } }); } function geocodeAddress3(geocoder, resultsMap) { var address = document.getElementById('return_pickup').value; geocoder.geocode({'address': address}, function(results, status) { if (status === google.maps.GeocoderStatus.OK) {resultsMap.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({map: resultsMap,position: results[0].geometry.location}); $('#lat3_value').val(results[0].geometry.location.lat()); $('#lng3_value').val(results[0].geometry.location.lng()) .trigger('change'); if(google.maps.geometry.poly.containsLocation(results[0].geometry.location, airportPoly) == true) { var radioValue = $("input[name='returnPickupType']:checked").val(); if (radioValue == "search3") { if(setCity=="perth"){ $('input[name="returnPickupType"][value="airport3"]').click(); } else if(setCity=="sydney"){ $('#termPerth3').hide(); $('#termSyd3').show(); sydTerminal1("#return_pickup", "#lat3_value", "#lng3_value"); pickupReturnAirport() $return_airport_pickup = 5; } } } } }); } function geocodeAddress4(geocoder, resultsMap) { var address = document.getElementById('return_dropoff').value; geocoder.geocode({'address': address}, function(results, status) { if (status === google.maps.GeocoderStatus.OK) {resultsMap.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({map: resultsMap,position: results[0].geometry.location}); $('#lat4_value').val(results[0].geometry.location.lat()); $('#lng4_value').val(results[0].geometry.location.lng()) .trigger('change'); if(google.maps.geometry.poly.containsLocation(results[0].geometry.location, airportPoly) == true) { var radioValue = $("input[name='returnDropoffType']:checked").val(); if (radioValue == "search4") { if(setCity=="perth") { $('input[name="returnDropoffType"][value="airport4"]').click(); } else if(setCity="sydney") { sydTerminal1("#return_dropoff", "#lat4_value", "#lng4_value"); $('#termPerth4').hide(); $('#termSyd4').show(); } } } } }); } function calculateAndDisplayRoute(directionsService, directionsDisplay) { if(oneway_directions_set != 1) { if($('#lat1_value').val() != "" && $('#lat2_value').val() != "") { directionsService.route({ origin: $('#lat1_value').val()+","+$('#lng1_value').val(), destination: $('#lat2_value').val()+","+$('#lng2_value').val(), travelMode: google.maps.TravelMode.DRIVING }, function(response, status) { console.log(response); if (status === google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); googleRoute = response; oneway_directions_set = 1; } else { //window.alert('Directions request failed due to ' + status); } }); } } if(return_directions_set != 1){ if($('#lat3_value').val() != "" && $('#lat4_value').val() != "") { directionsService_return.route({ origin: $('#lat3_value').val()+","+$('#lng3_value').val(), destination: $('#lat4_value').val()+","+$('#lng4_value').val(), travelMode: google.maps.TravelMode.DRIVING }, function(response, status) { if (status === google.maps.DirectionsStatus.OK) { directionsDisplay_return.setDirections(response); googleReturnRoute = response; return_directions_set = 1; } else { //window.alert('Directions request failed due to ' + status); } }); } } } function containsWord(string, word) { return new RegExp('(?:[^.\w]|^|^\\W+)' + word + '(?:[^.\w]|\\W(?=\\W+|$)|$)').test(string); } function computeTotalDistance(result, returnTrip) { var dfrd1 = $.Deferred(); var total = 0; var myroute = result.routes[0]; var totalTolls=0; var funcTolls = 0; var tollsDesc = ""; var returnTollDesc = ""; for (var i = 0; i < myroute.legs.length; i++) { //console.log(myroute.legs[i].steps); for(var j=0;j<myroute.legs[i].steps.length;j++){ //console.log(myroute.legs[i].steps[j].instructions); if(containsWord(myroute.legs[i].steps[j].instructions.toLowerCase(), 'toll road')){ totalTolls+=1; } } //total += myroute.legs[i].distance.value; } total = total / 1000; //console.log(total + ' km'); //console.log("tolls: " + totalTolls); if(totalTolls > 0) { if(returnTrip != "yes") { var pickup = $('#lat1_value').val()+","+$('#lng1_value').val(); var dropoff = $('#lat2_value').val()+","+$('#lng2_value').val(); tolls = 0; } else { var pickup = $('#lat3_value').val()+","+$('#lng3_value').val(); var dropoff = $('#lat4_value').val()+","+$('#lng4_value').val(); return_tolls = 0; } if(pickup != "," + dropoff != ",") { console.log("api called 1 " + pickupState + " 2 " + dropoffState); $.ajax({ type: "POST", url: "../tollster/11.php", data: {pickup: pickup, dropoff: dropoff, alternatives: "false", pickupState: pickupState, dropoffState: dropoffState, directions: JSON.stringify(result)}, dataType: 'json', success: function (data) { console.log(data); if(data.status == "OK") { var tollsData = data.tolls[0]; for (var i = 0; i < tollsData.length; i++) { funcTolls = funcTolls + + tollsData[i].cost; tollsDesc = tollsDesc + "$" + parseFloat(tollsData[i].cost).toFixed(2) + " " + tollsData[i].name + "\r\n"; } if(returnTrip == "yes") { return_tolls = funcTolls; $('#returnTollAmount').val(return_tolls); $('#returnTollDecription').val(tollsDesc); } else { tolls = funcTolls; $('#tollAmount').val(tolls); $('#tollDescription').val(tollsDesc); } dfrd1.resolve(); } else { dfrd1.resolve(); } } }) } } else { dfrd1.resolve(); } return dfrd1.promise(); } function perthTerminal1(input, latitude, longitude) { var inputtext = 'Terminal 1 (T1) International/Virgin Domestic, Perth Airport, Western Australia'; $(input).val(inputtext); var lat = -31.942232; var lng = 115.973662; $(latitude).val(lat); $(longitude).val(lng); map.setCenter({lat: lat, lng: lng}); marker = new google.maps.Marker({map: map, position: {lat: lat, lng: lng}}); directions(); initMap(); } function perthTerminal2(input, latitude, longitude){ var inputtext = 'T2 - Perth Domestic Airport, Western Australia, Australia'; $(input).val(inputtext); var lat = -31.945018; var lng = 115.972471; $(latitude).val(lat); $(longitude).val(lng); map.setCenter({lat: lat, lng: lng}); marker = new google.maps.Marker({map: map, position: {lat: lat, lng: lng}}); directions(); initMap(); } function perthTerminal3(input, latitude, longitude) { var inputtext = 'T3/T4, Perth Airport WA'; $(input).val(inputtext); var lat = -31.933487; var lng = 115.959991; $(latitude).val(lat); $(longitude).val(lng); map.setCenter({lat: lat, lng: lng}); marker = new google.maps.Marker({map: map, position: {lat: lat, lng: lng}}); directions(); initMap(); } function sydTerminal1(input, latitude, longitude) { var inputtext = 'Terminal 1 (T1) International, Sydney Airport, New South Wales'; if(input == "#pickup") { pickupState = "NSW"; } else if (input == "#dropoff") { dropoffState = "NSW"; } $(input).val(inputtext); var lat = -33.933166; var lng = 151.165806; $(latitude).val(lat); $(longitude).val(lng); map.setCenter({lat: lat, lng: lng}); marker = new google.maps.Marker({map: map, position: {lat: lat, lng: lng}}); directions(); initMap(); } function sydTerminal2(input, latitude, longitude){ var inputtext = 'T2 - Sydney Airport, New South Wales'; if(input == "pickup") { pickupState = "NSW"; } else if (input == "dropoff") { dropoffState = "NSW"; } $(input).val(inputtext); var lat = -33.933892; var lng = 151.180236; $(latitude).val(lat); $(longitude).val(lng); map.setCenter({lat: lat, lng: lng}); marker = new google.maps.Marker({map: map, position: {lat: lat, lng: lng}}); directions(); initMap(); } function sydTerminal3(input, latitude, longitude) { var inputtext = 'T3 Qantas Sydney Airport, New South Wales'; if(input == "pickup") { pickupState = "NSW"; } else if (input == "dropoff") { dropoffState = "NSW"; } $(input).val(inputtext); var lat = -33.932625; var lng = 151.178742; $(latitude).val(lat); $(longitude).val(lng); map.setCenter({lat: lat, lng: lng}); marker = new google.maps.Marker({map: map, position: {lat: lat, lng: lng}}); directions(); initMap(); } // This example displays an address form, using the autocomplete feature // of the Google Places API to help users fill in the information. var placeSearch, dropoff , pickup ; function initAutocomplete() { var perthBounds = new google.maps.LatLngBounds(new google.maps.LatLng(-32.787777, 115.556739), new google.maps.LatLng(-31.159266, 116.545509)); var sydBounds = new google.maps.LatLngBounds(new google.maps.LatLng(-34.102452, 150.203400), new google.maps.LatLng(-33.560598, 151.418768)); var useBounds = perthBounds; if(setCity=="perth"){ useBounds = perthBounds; } else if(setCity=="sydney") { useBounds = sydBounds; } pickup = new google.maps.places.Autocomplete((document.getElementById('pickup')),{types: ['geocode','establishment'], componentRestrictions:{country:"au"}, bounds: useBounds, strictBounds: true,}); pickup.addListener(); pickup.addListener('place_changed', function() { console.log(pickup.getPlace()); for (var i = 0; i < pickup.getPlace().address_components.length; i++) { var addressType = pickup.getPlace().address_components[i].types[0]; if(addressType == "administrative_area_level_1") { pickupState = pickup.getPlace().address_components[i].short_name; } } initMap(); }); dropoff = new google.maps.places.Autocomplete((document.getElementById('dropoff')),{types: ['geocode', 'establishment'], componentRestrictions:{country:"au"}, bounds: useBounds, strictBounds: true,}); dropoff.addListener(); dropoff.addListener('place_changed', function() { for (var i = 0; i < dropoff.getPlace().address_components.length; i++) { var addressType = dropoff.getPlace().address_components[i].types[0]; console.log(addressType); if(addressType == "administrative_area_level_1") { dropoffState = dropoff.getPlace().address_components[i].short_name; } } initMap(); }); return_pickup = new google.maps.places.Autocomplete((document.getElementById('return_pickup')),{types: ['geocode','establishment'], componentRestrictions:{country:"au"}, bounds: useBounds, strictBounds: true,}); return_pickup.addListener(); return_pickup.addListener('place_changed', function() { for (var i = 0; i < return_pickup.getPlace().address_components.length; i++) { var addressType = return_pickup.getPlace().address_components[i].types[0]; if(addressType == "administrative_area_level_1") { returnPickupState = return_pickup.getPlace().address_components[i].short_name; } } initMap(); }); return_dropoff = new google.maps.places.Autocomplete((document.getElementById('return_dropoff')),{types: ['geocode','establishment'], componentRestrictions:{country:"au"}, bounds: useBounds, strictBounds: true,}); return_dropoff.addListener(); return_dropoff.addListener('place_changed', function() { for (var i = 0; i < return_dropoff.getPlace().address_components.length; i++) { var addressType = return_dropoff.getPlace().address_components[i].types[0]; if(addressType == "administrative_area_level_1") { returnDropoffState = return_dropoff.getPlace().address_components[i].short_name; } } initMap(); }); initMap(); } function distance() { var dfrd1 = $.Deferred(); var pickup = $('#lat1_value').val()+","+$('#lng1_value').val(); var dropoff = $('#lat2_value').val()+","+$('#lng2_value').val(); $replacestring = ", Western Australia, Australia"; $pass = $('#passenger_count').val(); $rf = $('#car_seat').val(); $ff = $('#ff_count').val(); $boost = $('#booster_count').val(); $seats = parseFloat($rf) + parseFloat($ff) + parseFloat($boost); var bookingtime = $('#time').val(); var pass_rate = 1.3; var hours = Number(bookingtime.match(/^(\d+)/)[1]); var minutes = Number(bookingtime.match(/:(\d+)/)[1]); var AMPM = bookingtime.match(/\s(.*)$/)[1]; if(AMPM == "PM" && hours<12) hours = hours+12; if(AMPM == "AM" && hours==12) hours = hours-12; var km_rate = ""; var time_rate = ""; var base_rate = ""; var large_rate = ""; var min = ""; var min_late = ""; if($('#job_city').val() == "sydney") { var km_rate = <?=$kmSyd?>; var time_rate = <?=$timeSyd?>; var base_rate = <?=$baseSyd?>; var large_rate = <?=$largeSyd?>; var min = <?=$minSyd?>; var min_late = <?=$min_lateSyd?>; } else { var km_rate = <?=$kmPer?>; var time_rate = <?=$timePer?>; var base_rate = <?=$basePer?>; var large_rate = <?=$largePer?>; var min = <?=$minPer?>; var min_late = <?=$min_latePer?>; } if(hours <= 7 || hours >= 21) { var min = min_late; } if($pass >= 5) { pass_rate = large_rate; } else { pass_rate = km_rate; } if($seats >= 2) { $seats_charge = (parseFloat($seats) - 1) * 5; } else { $seats_charge = 0; } if($('#lat1_value').val() != "" && $('#lat2_value').val() != "") { var dataString = 'point1=' + pickup + "&point2=" + dropoff; if($('#job_city').val() == "sydney") { computeTotalDistance(googleRoute, "no").done(function() { checkPrice(); }) } else { checkPrice(); } function checkPrice() { $.ajax({ type: "POST", url: "11.php", data: dataString, dataType: 'json', success: function (data) { var distance = parseFloat(data.distance / 1000).toFixed(0); var time = parseFloat(data.time / 60).toFixed(0); console.log(distance); console.log(time); $(".loader, .bgloader").hide(); var resultr = (Math.ceil( ( distance * pass_rate) + (time * time_rate) + 15 ) + parseFloat($seats_charge) ) * discount; console.log(resultr); $('#km_est').val(distance); $('#time_est').val(time); //var radioValue = $("input[name='oneway']:checked").val(); //if(radioValue == 'return'){ // var result = result * 2; // } if(resultr >= min) { fare = resultr + parseFloat($airport_pickup); var result = parseFloat(fare).toFixed(2); if($('#job_city').val() == "sydney") { var toll_string = ""; if(tolls > 0) { toll_string = " + tolls"; if(tolls > 0) { toll_string = " + $" + parseFloat(tolls).toFixed(2) + " tolls"; } } $('#totalPrice').text( result + toll_string); } else { $('#totalPrice').text( result ); } $('#onewayPrice').val( result ); price1 = fare; } else { fare = min + parseFloat($airport_pickup); var result = parseFloat(fare).toFixed(2); if($('#job_city').val() == "sydney") { var toll_string = ""; if(tolls > 0) { toll_string = " + $" + parseFloat(tolls).toFixed(2) + " tolls"; } $('#totalPrice').text( result + toll_string); } else { $('#totalPrice').text( result ); } $('#onewayPrice').val( result ); price1 = fare; } dfrd1.resolve(); }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status); alert(thrownError); $(".loader, .bgloader").hide(); dfrd1.resolve(); } }) } } else { dfrd1.resolve(); } return dfrd1.promise(); } function returndistance() { var dfrd1 = $.Deferred(); var pickup = $('#lat3_value').val()+","+$('#lng3_value').val(); var dropoff = $('#lat4_value').val()+","+$('#lng4_value').val(); var bookingtime = $('#return_time').val(); var pass_rate = 1.3; var hours = Number(bookingtime.match(/^(\d+)/)[1]); var minutes = Number(bookingtime.match(/:(\d+)/)[1]); var AMPM = bookingtime.match(/\s(.*)$/)[1]; if(AMPM == "PM" && hours<12) hours = hours+12; if(AMPM == "AM" && hours==12) hours = hours-12; var km_rate = ""; var time_rate = ""; var base_rate = ""; var large_rate = ""; var min = ""; var min_late = ""; if($('#job_city').val() == "sydney") { var km_rate = <?=$kmSyd?>; var time_rate = <?=$timeSyd?>; var base_rate = <?=$baseSyd?>; var large_rate = <?=$largeSyd?>; var min = <?=$minSyd?>; var min_late = <?=$min_lateSyd?>; } else { var km_rate = <?=$kmPer?>; var time_rate = <?=$timePer?>; var base_rate = <?=$basePer?>; var large_rate = <?=$largePer?>; var min = <?=$minPer?>; var min_late = <?=$min_latePer?>; } if(hours <= 7 || hours >= 21) { var min = min_late; } if($pass >= 5) { pass_rate = large_rate; } else { pass_rate = km_rate; } if($seats >= 2) { $seats_charge = (parseFloat($seats) - 1) * 5; } else { $seats_charge = 0; } if($('#lat3_value').val() != "" && $('#lat4_value').val() != "") { var dataString = 'point1=' + pickup + "&point2=" + dropoff; if($('#job_city').val() == "sydney") { computeTotalDistance(googleReturnRoute, "yes").done(function() { checkPrice(); }) } else { checkPrice(); } function checkPrice() { $.ajax({ type: "POST", url: "11.php", data: dataString, dataType: 'json', success: function (data) { var distance = parseFloat(data.distance / 1000).toFixed(0); var time = parseFloat(data.time / 60).toFixed(0); $(".loader, .bgloader").hide(); console.log(time); console.log(distance); var resultr = (Math.ceil( distance * pass_rate + (time * time_rate) + 15 ) + parseFloat($seats_charge) ) * discount; $('#return_km_est').val(distance); $('#return_time_est').val(time); if(resultr >= min) { fare = resultr + parseFloat($return_airport_pickup); var result = parseFloat(fare).toFixed(2); if($('#job_city').val() == "sydney") { var toll_string = ""; if(return_tolls > 0) { toll_string = " + $" + parseFloat(return_tolls).toFixed(2) + " tolls"; } $('#totalPrice2').text( result + toll_string); } else { $('#totalPrice2').text( result ); } $('#returnPrice').val( result ); var price3 = parseFloat(fare + price1).toFixed(2); if($('#job_city').val() == "sydney") { var toll_string = ""; if(return_tolls > 0 || tolls > 0) { toll_string = " + $" + parseFloat(tolls + return_tolls).toFixed(2) + " tolls"; } $('#totalPrice3').text( result + toll_string); } else { $('#totalPrice3').text(price3); } } else { fare = min + parseFloat($return_airport_pickup); var result = parseFloat(fare).toFixed(2); if($('#job_city').val() == "sydney") { var toll_string = ""; if(return_tolls > 0) { toll_string = " + $" + parseFloat(return_tolls).toFixed(2) + " tolls"; } $('#totalPrice2').text( result + toll_string); } else { $('#totalPrice2').text( result ); } $('#returnPrice').val( result ); var price3 = parseFloat(fare + price1).toFixed(2); if($('#job_city').val() == "sydney") { var toll_string = ""; if(return_tolls > 0 || tolls > 0) { toll_string = " + $" + parseFloat(tolls + return_tolls).toFixed(2) + " tolls"; } $('#totalPrice3').text( result + toll_string); } else { $('#totalPrice3').text(price3); } } dfrd1.resolve(); }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status); alert(thrownError); $(".loader, .bgloader").hide(); dfrd1.resolve(); } }) } } else { dfrd1.resolve(); } return dfrd1.promise(); } function pickupAirport() { if($("#flight_number").val() == "N/A") { $("#flight_number").val(''); } $(".pickup_div_t, .flight_time").show(); $("#flight_number, #pickup_time").attr('required', 'required'); document.getElementsByName('time')[0].placeholder='Flight Arrival Time'; } function pickupReturnAirport() { if($("#return_flight_number").val() == "N/A") { $("#return_flight_number").val(''); } $(".return_pickup_div_t, .return_flight_time").show(); $("#return_flight_number, #return_pickup_time").attr('required', 'required'); document.getElementsByName('return_time')[0].placeholder='Flight Arrival Time'; } function directions() { if($("#lat1_value") != "" && $("#lat2_value") != "") { directionsService = new google.maps.DirectionsService; directionsDisplay = new google.maps.DirectionsRenderer; directionsDisplay.setMap(map); calculateAndDisplayRoute(directionsService, directionsDisplay); } } function isNumber(obj) { return !isNaN(parseFloat(obj)) } function checkLuhn(input) { var sum = 0; var numdigits = input.length; var parity = numdigits % 2; for(var i=0; i < numdigits; i++) { var digit = parseInt(input.charAt(i)) if(i % 2 == parity) digit *= 2; if(digit > 9) digit -= 9; sum += digit; } return (sum % 10) == 0; } function unpackLatlng(latlngarray) { var paths = []; for (var i = 0; i < latlngarray.length; i++) { paths.push(new google.maps.LatLng(latlngarray[i][0], latlngarray[i][1])); } //console.dir(paths); return paths } </script> <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCq_JZBDbrE5qma5SgF06M2dVAqbiZBZ-o&libraries=places,geometry&callback=initAutocomplete" async defer></script> <script> //submitHandler: function(form) { // $(".loader, .bgloader").show(); // eCrypt.submitForm(); // }, //invalidHandler: function(event, validator) { // this.onsubmit = null; // }, </script> </body> </html>
Save
cmd:
run