/
home
/
desid573
/
public_html
/
family
/
/home/desid573/public_html/family
mkdir
upload
Name
Size
Mode
Actions
assets/
-
0755
rm
eway-rapid-php-master/
-
0755
rm
invoice/
-
0755
rm
pdd/
-
0755
rm
10.php
1941
0644
edit
dl
rm
11.php
1176
0644
edit
dl
rm
22.php
9106
0644
edit
dl
rm
array.php
2173
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
completedReport.php
9286
0644
edit
dl
rm
confirmAll1.php
591
0644
edit
dl
rm
dispatch.php
877
0644
edit
dl
rm
driverInvoice.php
12148
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
error_log
30478123
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
fatigue.php
2295
0644
edit
dl
rm
incident_report.php
0
0644
edit
dl
rm
index.php
200204
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
10458
0644
edit
dl
rm
melbreport.php
7758
0644
edit
dl
rm
monthly.php
12046
0644
edit
dl
rm
new.php
0
0644
edit
dl
rm
perthAuditReport.php
34918
0644
edit
dl
rm
perthReport.php
7757
0644
edit
dl
rm
postcodeArray.php
1014
0644
edit
dl
rm
postcodeReport.php
21015
0644
edit
dl
rm
pre-sydneyquote.php
39158
0644
edit
dl
rm
promo.php
765
0644
edit
dl
rm
qldDriverReport.php
8568
0644
edit
dl
rm
qldreport.php
7580
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
157
0644
edit
dl
rm
style.json
1014
0644
edit
dl
rm
summaryReport.php
10212
0644
edit
dl
rm
sydneydispatch.php
12177
0644
edit
dl
rm
sydneyreport.php
7758
0644
edit
dl
rm
table.php
5087
0644
edit
dl
rm
test.php
3851
0644
edit
dl
rm
thankyou.php
31498
0644
edit
dl
rm
tmrReport.php
2431
0644
edit
dl
rm
tmr_trips.php
11287
0644
edit
dl
rm
unserialize.php
571
0644
edit
dl
rm
Edit:
/home/desid573/public_html/family/thankyou.php
(31498B)
<?php //ini_set('display_errors', '1'); //error_reporting(E_ALL); require("../urlShortener.php"); require("../vromo.php"); require_once 'eway-rapid-php-master/include_eway.php'; $return_reference = "0"; $client_key = '4T7y1vuKPkdhRYUQdH6msueW9hqV2wpcwnSk0Qwxkvwf7TjQn40qymPW7IJb66gUC1w1505cDMkj9IR82juQEnIp4/8nd0nDhwYDSDoqROtNBWmkqtqYmF6F4qVGMUq3HpJrY3y2kdSljCFfWzWc7LIEn4G5XY2IZAPgAO5+mhwvYrricmqwLhqzV4FBUII5AwTvJZl4awrdul4vLWkS73vJuW/XrXHseGK/nqB3oSRluZ1jKp2qDgVTwrXYEbx4rwwS42X2w0C9tLKywxf27WD2CCK8ftSeQBimVqFI0r6VuRXFVaOn6SQTOD9V/TsCfPk5Zh6/PWcfapyVKS+l1w=='; $apiKey = '44DD7APNUxR8/4sDLhEVT11OS00fmBo4Haxj4ZGJGHvtLBP0rC/ayqNhbVu9tEJrjlJPJm'; $apiPassword = 'y2b7QMpd'; ?> <!DOCTYPE html> <html lang="en"> <head><meta http-equiv="Content-Type" content="text/html; 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 Payment Processed</title> <!-- Bootstrap --> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> <link rel="stylesheet" href="assets/picker/default.css" crossorigin="anonymous"> <link rel="stylesheet" href="assets/picker/date.theme.css" crossorigin="anonymous"> <link rel="stylesheet" href="assets/picker/default.time.css" crossorigin="anonymous"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesnt 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; } </style> <!-- Global site tag (gtag.js) - Google Ads: 1031055197 --> <script async src="https://www.googletagmanager.com/gtag/js?id=AW-1031055197"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-1031055197'); </script> <!-- Event snippet for Makes Booking FamilyCab conversion page --> <script> gtag('event', 'conversion', { 'send_to': 'AW-1031055197/GF4UCLqSmKcBEN3O0usD', 'value': <?php echo $_POST['onewayPrice']; ?>, 'currency': 'AUD', 'transaction_id': '<?php echo $_POST['hidden_ref']; ?>' }); </script> </head> <body> <div class="container"> <div class="row"> <div class="col-lg-12 text-center"> <?php $phone= $_POST['phone']; $intphone = $_POST['intphone']; error_log("Account = ".$_POST['account']); $dbhost = "localhost"; $dbuser = "desid573_famcab"; $dbpass = "C]+6wQySxov("; $dbname = "desid573_familycab"; $conn = new mysqli($dbhost, $dbuser, $dbpass, $dbname) or die($conn->connect_error); $qcon=mysqli_connect($dbhost, $dbuser, $dbpass, $dbname); if($_POST['account']==""){ $query1 = "SELECT token FROM customers WHERE customer_mobile='".$phone."' ORDER BY token DESC LIMIT 0,1"; $result = mysqli_query($conn, $query1); $row = mysqli_fetch_assoc($result); $tokencheck = $row['token']; $success1 = $conn->query($query1); if (!$success1) { $updatetoken = 0; } $reference = $_POST['hidden_ref']; $query1 = "SELECT reference FROM jobs WHERE reference='".$reference."' ORDER BY reference DESC LIMIT 0,1"; $result = mysqli_query($conn, $query1); $row = mysqli_fetch_assoc($result); $referencecheck = $row['reference']; if($referencecheck != "") { $reference = time().rand(10,5000); } if( $tokencheck != ""){ $tokencustomerid = $tokencheck; $updatetoken = 1; }else{ $updatetoken = 0; } $errormessage = ''; $price= 1; if ($price < 1) { $errormessage.= "Invalid address.<br>\n"; $error = true; } if (!$_POST['First_Name']) { $errormessage.= "Please enter your name<br>\n"; $error = true; } $apiEndpoint = \Eway\Rapid\Client::MODE_PRODUCTION; // Use \Eway\Rapid\Client::MODE_PRODUCTION when you go live $client = \Eway\Rapid::createClient($apiKey, $apiPassword, $apiEndpoint); //create customer $firstname = trim($_POST['First_Name']); $lastname = trim($_POST['Last_Name']); $fullname = "$firstname $lastname"; if($updatetoken == 0) { $customer = [ 'Title' => 'Mr.', 'FirstName' => $firstname, 'LastName' => $lastname, 'Country' => 'au', 'Email' => trim($_POST['email']), 'CardDetails' => [ 'Name' => $fullname, 'Number' => $_POST['EWAY_CARDNUMBER'], 'ExpiryMonth' => $_POST['EWAY_CARDEXPIRYMONTH'], 'ExpiryYear' => $_POST['EWAY_CARDEXPIRYYEAR'], 'CVN' => $_POST['EWAY_CARDCVN'] ] ]; /*echo '<pre>'; print_r($customer); echo '</pre>'; exit;*/ $response = $client->createCustomer(\Eway\Rapid\Enum\ApiMethod::DIRECT, $customer); $tokencustomerid = $response->Customer->TokenCustomerID; } if($updatetoken == 1) { $customer = [ 'Email' => trim($_POST['email']), 'TokenCustomerID' => $tokencustomerid, 'CardDetails' => [ 'Name' => $fullname, 'Number' => $_POST['EWAY_CARDNUMBER'], 'ExpiryMonth' => $_POST['EWAY_CARDEXPIRYMONTH'], 'ExpiryYear' => $_POST['EWAY_CARDEXPIRYYEAR'], 'CVN' => $_POST['EWAY_CARDCVN'] ] ]; /*echo '<pre>'; print_r($customer); echo '</pre>'; exit;*/ $response = $client->updateCustomer(\Eway\Rapid\Enum\ApiMethod::DIRECT, $customer); } $cardnumber = $_POST['EWAY_CARDNUMBER']; if($cardnumber > 399999999999999) { $auth = true; } else { $auth = false; } $transaction = [ 'Customer' => [ 'TokenCustomerID' => $tokencustomerid, ], 'Payment' => [ 'TotalAmount' => $price, 'InvoiceReference' => $_POST['hidden_ref'], ], 'TransactionType' => \Eway\Rapid\Enum\TransactionType::RECURRING, 'Capture' => $auth, ]; $response = $client->createTransaction(\Eway\Rapid\Enum\ApiMethod::DIRECT, $transaction); $nameq = mysqli_real_escape_string($qcon, $fullname); $email= $_POST['email']; $query = "INSERT into customers (customer_name, customer_mobile, token, customer_email, date_added, welcomemess) VALUES ('" . $nameq . "','" . $intphone . "','" . $tokencustomerid . "','" . $email . "','" . date('Y-m-d H:i:s') . "', '') ON DUPLICATE KEY UPDATE customer_name='" . $nameq . "', customer_email='" . $email . "', token='" . $tokencustomerid . "'"; $success = $conn->query($query); if (!$success) { error_log("Couldn't enter data: ".$conn->error); } if (isset($response->TransactionStatus) && $response->TransactionStatus) { $transactionid = $response->TransactionID; $AuthorisationCode = $response->AuthorisationCode; //$tokencustomerid = $response->Customer->TokenCustomerID; $query = "SELECT * FROM customer_tokens WHERE access_token_value='".$tokencustomerid."'"; $result = $conn->query($query); if(!$result) { error_log("Token error: ".$conn->error); } else { if ($result->num_rows > 0) { $row = $result->fetch_assoc(); $tokencheck = $row['access_token_value']; $query = "UPDATE customer_tokens SET modified = NOW() WHERE access_token_value = ".$tokencheck; $result = $conn->query($query); if(!$result) { error_log("Token update error: ".$conn->error); } } else { $query = "INSERT INTO customer_tokens (`id`, `cid`, `access_token_value`, `status`, `created`, `modified`) VALUES (NULL, '', ".$tokencustomerid.", 1, NOW(), NOW())"; $result = $conn->query($query); if(!$result) { error_log("Token insert error: ".$conn->error); } } } } else { $error = true; if ($response->getErrors()) { foreach ($response->getErrors() as $error) { $errormessage.= "Error: $error (".\Eway\Rapid::getMessage($error).")<br>\n"; } } else { $errormessage.= "Sorry, your payment was declined"; } } } if($_POST['account']==1) { $tokencustomerid = $_POST['token']; $fullname = $_POST['name']; $nameq = mysqli_real_escape_string($qcon, $fullname); $query = "INSERT into customers (customer_name, customer_mobile, token, customer_email, date_added, welcomemess) VALUES ('" . $nameq . "','" . $intphone . "','" . $tokencustomerid . "','" . $email . "','" . date('Y-m-d H:i:s') . "', '') ON DUPLICATE KEY UPDATE customer_name='" . $nameq . "', customer_email='" . $email . "', token='" . $tokencustomerid . "'"; $success = $conn->query($query); if (!$success) { error_log("Couldn't enter data: ".$conn->error); } } $jobCity = $_POST['job_city']; if($jobCity == "") { $jobCity = "perth"; } if($jobCity == "sydney") { $type = "SF"; date_default_timezone_set("Australia/Sydney"); } else if($jobCity == "melbourne") { $type = "MF"; date_default_timezone_set("Australia/Melbourne"); } else if($jobCity == "queensland") { $type = "BF"; date_default_timezone_set("Australia/Brisbane"); $distGC = getDistance($_POST['lat1_value'], $_POST['lng1_value'], "GC"); $distSC = getDistance($_POST['lat1_value'], $_POST['lng1_value'], "SC"); if($distGC <= 40) { $goldCoast = true; $type = "GC"; } else if($distSC <= 50) { $sunshineCoast = true; $type = "SC"; } } else { $type = "FC"; date_default_timezone_set("Australia/Perth"); } $pickup= $_POST['pickup']; $pickupencode = $_POST['pickupencode']; $dropoff= $_POST['dropoff']; $dropoffencode= $_POST['dropoffencode']; $date= $_POST['date']; $d = date_create_from_format("jS M, Y", $date); $date24 = date_format($d, "Y-m-d"); error_log($date24); $time= $_POST['time']; $time24 = date("G:i", strtotime($time)); $timeUTC = date("c", strtotime("$date24 $time24")); $timestamp = strtotime("$date24 $time24") * 1000; $lat1= $_POST['lat1_value']; $lng1= $_POST['lng1_value']; $sql = "INSERT INTO `desid573_eway_codes`.`place_coords`(`id`, `name`, `lat`, `lon`, `date_added`) VALUES (NULL,'".$pickup."',".$lat1.",".$lng1.",NOW())"; $result = $conn->query($sql); if(!$result) { error_log($sql); error_log("Error inserting coords ".$conn->error); } $lat2= $_POST['lat2_value']; $lng2= $_POST['lng2_value']; $sql = "INSERT INTO `desid573_eway_codes`.`place_coords`(`id`, `name`, `lat`, `lon`, `date_added`) VALUES (NULL,'".$dropoff."',".$lat2.",".$lng2.",NOW())"; $result = $conn->query($sql); if(!$result) { error_log($sql); error_log("Error inserting coords ".$conn->error); } $onewayprice= $_POST['onewayPrice']; $fnum1 = $_POST['flight_number']; $ptime1 = $_POST['pickup_time']; if($_POST['pickupType'] == "search1") { $ptime1 = ""; } $passNum = $_POST['passenger_count']; $rfNum = $_POST['car_seat']; $ffNum = $_POST['ff_count']; $boostNum = $_POST['booster_count']; $luggage = $_POST['luggage']; $return_trip = $_POST['journeyType']; if(isset($_POST['oneway'])) { $return_trip = $_POST['oneway']; } $reference = $_POST['hidden_ref']; if(!$error) { $paymentlink = shortenLink($reference, $type, "payment"); $flighttext = "$fnum1 + $ptime1 mins"; if($fnum1 == ""){ $flighttext = ""; } $seats = "$passNum pax \\n$rfNum RF\\n$ffNum FF\\n$boostNum Boost"; $cityCheck = $jobCity; if($goldCoast) { $cityCheck = "goldcoast"; } if($sunshineCoast) { $cityCheck = "sunshinecoast"; } $dispatchString = ""; // $sql = "SELECT * FROM `desid573_eway_codes`.`dispatcher` WHERE `city` = '".$cityCheck."'"; // $result = $conn->query($sql); // if(!$result) { // error_log("error fetching dispatcher ".$conn->error); // } else { // $row = $result->fetch_assoc(); // if($row["active"]) { // $dispatchString = $row["string"]; // } // } $curlObj = curl_init(); curl_setopt($curlObj, CURLOPT_URL, 'https://api.vromo.io/v2/graph/role/jobs?access_token='.$vromo); curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curlObj, CURLOPT_HEADER, 0); curl_setopt($curlObj, CURLOPT_HTTPHEADER, array('Content-type:application/json')); curl_setopt($curlObj, CURLOPT_POST, 1); curl_setopt($curlObj, CURLOPT_POSTFIELDS, '[{"name": "'.$type.' ' . $fullname . '",'.$dispatchString.' "campaign": {"id": 5623765662}, "contact": {"name": "' . $fullname . '","phone": "' . $intphone . '","email": "' . $email . '"},"tasks": [{"timeframe":{"by": '.$timestamp.'}, "zone": {"name": "' . $pickup . '","address": "' . $pickup . '","coords": {"lat": ' . $lat1 . ',"lon": ' . $lng1 . '},"radius": 100}},{"zone": {"name": "' . $dropoff . '","address": "' . $dropoff . '","coords": {"lat": ' . $lat2 . ',"lon": ' . $lng2 . '},"radius": 100}}],"attr": [{ "key": "Flight", "value": "' . $flighttext . '" },{ "key": "Seats", "value": "' . $seats . '" },{ "key": "Payment Link", "value": "' . $paymentlink . '" }]}]'); // , $response = curl_exec($curlObj); error_log($response); $json = json_decode($response, true); curl_close($curlObj); $spatulalink = $json['items'][0]['tracking']; $spatulaid = $json['items'][0]['id']; $km_est = $_POST['km_est']; $time_est = $_POST['time_est']; $luggageq = mysqli_real_escape_string($qcon, $luggage); $pickupq = mysqli_real_escape_string($qcon, $pickup); $dropoffq = mysqli_real_escape_string($qcon, $dropoff); $query = "INSERT into jobs (id, reference, job_name, job_phone, job_email, job_city, job_pickup, flight_num, mins_post, job_dropoff, job_date, job_time, job_pax, job_rf, job_ff, job_boost, job_luggage, job_quote, token, quote_km, quote_time, promo_code, promo_value, date_added, spat_ref, spat_link, conf_sms_sent, xero_inv, payment_eway, driver) VALUES (NULL,'" . $reference . "','" . $nameq . "','" . $intphone . "','" . $email . "', '".$jobCity."', '" . $pickupq . "','" . $fnum1 . "','" . $ptime1 . "','" . $dropoffq . "','" . $date . "','" . $time . "','" . $passNum . "','" . $rfNum . "','" . $ffNum . "','" . $boostNum . "','" . $luggageq . "','" . $onewayprice . "', '".$tokencustomerid."', '".$km_est."', '".$time_est."', '', '','" . date('Y-m-d H:i:s') . "','" . $spatulaid . "','" . $spatulalink . "', '', '', '', '')"; $success = $conn->query($query); if (!$success) { error_log("Could not enter data: ".$conn->error); } $sql = "SELECT * FROM `desid573_eway_codes`.`ip_address` WHERE `ip` = '".$_SERVER["REMOTE_ADDR"]."'"; $ip = $conn->query($sql); if($ip->num_rows > 0) { $row = $ip->fetch_assoc(); $sql = "UPDATE `desid573_eway_codes`.`ip_address` SET booking_reference = '".$reference."', booking_date = NOW() WHERE `ip` = '".$_SERVER["REMOTE_ADDR"]."'"; $set = $conn->query($sql); if(!$set) { error_log("update ip error: ".$conn->error); } $slackmessage = "$type booking $nameq $$onewayprice was quoted ".$row["quote"]. " on ".$row["quote_date"]; $curlObj = curl_init(); curl_setopt($curlObj, CURLOPT_URL, 'https://hooks.slack.com/services/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'); curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curlObj, CURLOPT_HEADER, 0); curl_setopt($curlObj, CURLOPT_HTTPHEADER, array('Content-type:application/json')); curl_setopt($curlObj, CURLOPT_POST, 1); curl_setopt($curlObj, CURLOPT_POSTFIELDS, '{"text": "'.$slackmessage.'"}'); $response = curl_exec($curlObj); curl_close($curlObj); } if($_POST['tollAmount'] != "0") { $query = "INSERT into toll_estimates (id, reference, amount, description) VALUES (NULL, '".$reference."', '".$_POST['tollAmount']."', '".$_POST['tollDescription']."')"; $success = $conn->query($query); if (!$success) { error_log("Could not enter toll data: ".$conn->error); } } echo "<h3>Your booking has been successfully processed</h3>"; echo "<h3>You will receive an SMS confirmation from the dispatch team within 30 mins (unless you have submitted after hours)</h3>"; $message= "Type FC <br> Date $date $time24 <br> Transaction ID $transactionid <br> Token Customer ID $tokencustomerid <br> Name $fullname <br> Phone $intphone <br> Pick Up $pickup<br> Flight Number $fnum1<br> Mins post flight $ptime1<br> TO <br> Drop Off $dropoff <br> Quoted $onewayprice <br> Credit Card Authorised <br> Number of Passengers $passNum <br> Number of RF Seats $rfNum <br> Number of FF Seats $ffNum <br> Number of Boosters $boostNum <br> Luggage $luggage <br> Lat1 $lat1 <br> Long1 $lng1 <br> Lat2 $lat2 <br> Long2 $lng2 <br> Booking Type $return_trip 1st Leg<br> Reference $reference <br> Email $email<br>"; $message_sql = "Type: $type <br> Ref: $spatulaid <br> "; send_mail('lewis@perthdesignateddrivers.com.au','info@familycab.com.au','New Order From '.$email ,$message); echo "<h4>When your driver is en route you will receive an SMS with a tracking link and driver contact details. If you do not receive this SMS atleast 10 mins before your booking time please contact us on +61466062355</h4>"; echo "<h4>Trip Details</h4>"; echo "<h5><table style='margin-left: auto; margin-right: auto;'> <tr><td style = 'text-align: left; padding: 5px;'>Name </td><td style = 'text-align: left; padding: 5px;'>$fullname</td></tr> <tr><td style = 'text-align: left; padding: 5px;'>Phone </td><td style = 'text-align: left; padding: 5px;'>$phone</td></tr> <tr><td style = 'text-align: left; padding: 5px;'>Email </td><td style = 'text-align: left; padding: 5px;'>$email</td></tr> <tr><td style = 'text-align: left; padding: 5px;'>Pick Up </td><td style = 'text-align: left; padding: 5px;'>$pickup</td></tr> <tr><td style = 'text-align: left; padding: 5px;'>Drop Off </td><td style = 'text-align: left; padding: 5px;'>$dropoff</td></tr> <tr><td style = 'text-align: left; padding: 5px;'>Date/Time </td><td style = 'text-align: left; padding: 5px;'>$date $time</td></tr> <tr><td style = 'text-align: left; padding: 5px;'>Passengers </td><td style = 'text-align: left; padding: 5px;'>$passNum pax, $rfNum RF, $ffNum FF, $boostNum Boosters</td></tr> <tr><td style = 'text-align: left; padding: 5px;'>Quoted </td><td style = 'text-align: left; padding: 5px;'>$onewayprice</td></tr></table></h5>"; if($return_trip == 'return') { $return_date= $_POST['return_date']; $d = date_create_from_format("jS M, Y", $return_date); $date24 = date_format($d, "Y-m-d"); $return_time= $_POST['return_time']; $time24 = date("G:i", strtotime($return_time)); $timeUTC = date("c", strtotime("$date24 $time24")); $timestamp = strtotime("$date24 $time24") * 1000; $return_time24 = date("G:i", strtotime($return_time)); $lat3= $_POST['lat3_value']; $lng3= $_POST['lng3_value']; $lat4= $_POST['lat4_value']; $lng4= $_POST['lng4_value']; $returnprice= $_POST['returnPrice']; $return_pickup = $_POST['return_pickup']; $sql = "INSERT INTO `desid573_eway_codes`.`place_coords`(`id`, `name`, `lat`, `lon`, `date_added`) VALUES (NULL,'".$return_pickup."',".$lat3.",".$lng3.",NOW())"; $result = $conn->query($sql); if(!$result) { error_log($sql); error_log("Error inserting coords ".$conn->error); } $return_dropoff = $_POST['return_dropoff']; $sql = "INSERT INTO `desid573_eway_codes`.`place_coords`(`id`, `name`, `lat`, `lon`, `date_added`) VALUES (NULL,'".$return_dropoff."',".$lat4.",".$lng4.",NOW())"; $result = $conn->query($sql); if(!$result) { error_log($sql); error_log("Error inserting coords ".$conn->error); } $return_fnum1 = $_POST['return_flight_number']; $return_ptime1 = $_POST['return_pickup_time']; if($_POST['returnPickupType'] == "search3") { $return_ptime1 = ""; } $r_reference = $_POST['hidden_ref']; $return_reference = floatval($r_reference)+1; $paymentlink = shortenLink($return_reference, $type, "payment"); $flighttext = "$return_fnum1 + $return_ptime1 mins"; if($return_fnum1 == ""){ $flighttext = ""; } if(strpos($return_dropoff, "airport") !== false) { $destinationtext = "Airport"; } else { $destinationtext = "Destination"; } $seats = "$passNum pax \\n$rfNum RF\\n$ffNum FF\\n$boostNum Boost"; $curlObj = curl_init(); curl_setopt($curlObj, CURLOPT_URL, 'https://api.vromo.io/v2/graph/role/jobs?access_token='.$vromo); curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curlObj, CURLOPT_HEADER, 0); curl_setopt($curlObj, CURLOPT_HTTPHEADER, array('Content-type:application/json')); curl_setopt($curlObj, CURLOPT_POST, 1); curl_setopt($curlObj, CURLOPT_POSTFIELDS, '[{"name": "'.$type.' ' . $fullname . '","contact": {"name": "' . $fullname . '","phone": "' . $intphone . '","email": "' . $email . '"},"tasks": [{"timeframe":{"by": '.$timestamp.'}, "zone": {"name": "' . $return_pickup . '","address": "' . $return_pickup . '","coords": {"lat": ' . $lat3 . ',"lon": ' . $lng3 . '},"radius": 100}},{"zone": {"name": "' . $return_dropoff . '","address": "' . $return_dropoff . '","coords": {"lat": ' . $lat4 . ',"lon": ' . $lng4 . '},"radius": 100}}],"attr": [{ "key": "Flight", "value": "' . $flighttext . '" },{ "key": "Seats", "value": "' . $seats . '" },{ "key": "Payment Link", "value": "' . $paymentlink . '" }]}]'); // , $response = curl_exec($curlObj); error_log($response); $json = json_decode($response, true); curl_close($curlObj); $spatulalink = $json['items'][0]['tracking']; $spatulaid = $json['items'][0]['id']; $return_message = "Type FC<br> Date $return_date $return_time24 <br> Transaction ID $transactionid <br> Token Customer ID $tokencustomerid <br> Name $fullname <br> Phone $intphone <br> Pick Up $return_pickup<br> Flight Number $return_fnum1<br> Mins post flight $return_ptime1<br> TO <br> Drop Off $return_dropoff <br> Quoted $returnprice <br> Credit Card Authorised <br> Number of Passengers $passNum <br> Number of RF Seats $rfNum <br> Number of FF Seats $ffNum <br> Number of Boosters $boostNum <br> Luggage $luggage <br> Lat1 $lat3 <br> Long1 $lng3 <br> Lat2 $lat4 <br> Long2 $lng4 <br> Booking Type Return 2nd Leg <br> Reference $return_reference <br> Email $email <br> "; $return_km_est = $_POST['return_km_est']; $return_time_est = $_POST['return_time_est']; $returnpickupq = mysqli_real_escape_string($qcon, $return_pickup); $returndropoffq = mysqli_real_escape_string($qcon, $return_dropoff); $query = "INSERT into jobs (id, reference, job_name, job_phone, job_email, job_city, job_pickup, flight_num, mins_post, job_dropoff, job_date, job_time, job_pax, job_rf, job_ff, job_boost, job_luggage, job_quote, token, quote_km, quote_time, promo_code, promo_value, date_added, spat_ref, spat_link, conf_sms_sent, xero_inv, payment_eway, driver) VALUES (NULL,'" . $return_reference . "','" . $nameq . "','" . $intphone . "','" . $email . "', '".$jobCity."', '" . $returnpickupq . "','" . $return_fnum1 . "','" . $return_ptime1 . "','" . $returndropoffq . "','" . $return_date . "','" . $return_time . "','" . $passNum . "','" . $rfNum . "','" . $ffNum . "','" . $boostNum . "','" . $luggageq . "','" . $returnprice . "', '".$tokencustomerid."', '".$return_km_est."', '".$return_time_est."', '', '', '" . date('Y-m-d H:i:s') . "','" . $spatulaid . "','" . $spatulalink . "', '', '', '', '')"; $success = $conn->query($query); if (!$success) { die("Couldn't enter data: ".$conn->error); } if($_POST['returnTollAmount'] != "0") { $query = "INSERT into toll_estimates (id, reference, amount, description) VALUES (NULL, '".$return_reference."', '".$_POST['returnTollAmount']."', '".$_POST['returnTollDescription']."')"; $success = $conn->query($query); if (!$success) { error_log("Could not enter toll data: ".$conn->error); } } $message_sql = "Type: $type <br> Ref: $spatulaid <br> "; send_mail('lewis@perthdesignateddrivers.com.au','info@familycab.com.au','New Order From '.$email ,$return_message); $url = "https://www.bookings.perthdesignateddrivers.com.au/newJob.php?type=$type&ref=$return_reference"; echo "<h4>Return Trip Details</h4>"; echo "<h5><table style='margin-left: auto; margin-right: auto;'> <tr><td style = 'text-align: left; padding: 5px;'>Pick Up </td><td style = 'text-align: left; padding: 5px;'>$return_pickup</td></tr> <tr><td style = 'text-align: left; padding: 5px;'>Drop Off </td><td style = 'text-align: left; padding: 5px;'>$return_dropoff</td></tr> <tr><td style = 'text-align: left; padding: 5px;'>Date/Time </td><td style = 'text-align: left; padding: 5px;'>$return_date $return_time</td></tr> <tr><td style = 'text-align: left; padding: 5px;'>Passengers </td><td style = 'text-align: left; padding: 5px;'>$passNum pax, $rfNum RF, $ffNum FF, $boostNum Boosters</td></tr> <tr><td style = 'text-align: left; padding: 5px;'>Quoted </td><td style = 'text-align: left; padding: 5px;'>$returnprice</td></tr></table></h5>"; } if($_POST['admin'] == "1") { $result = $conn->query("SELECT id, driver FROM desid573_eway_codes.drivers"); echo "Dispatch to:   <select id='driver_id' name='id'>"; while ($row = $result->fetch_assoc()) { unset($id, $name); $id = $row['id']; $name = $row['driver']; echo '<option value="'.$id.'">'.$name.'</option>'; } echo '</select> <br> <div class="row" style="margin-top: 10px"> <input type="button" name="dispatch" style="background: rgb(2, 117, 216) none repeat scroll 0% 0%;padding-top:10px;color:#FFFFFF;" class="btn-block col-xs-12 col-md-6" id="dispatch" value="Dispatch"> </div> Status <span style="color:#FF0000;font-size: 150%;text-align: center;" id="test"></span><br> <br> '; } ?> </div> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ console.log("thrown") $.ajax({ type: "POST", url: "../newJob.php", data: "type=" + "<?=$type ?>" + "&ref=" + "<?=$reference ?>", dataType: 'json', success: function (data) { console.log("Success"); }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(textStatus + " " + errorThrown); } }) var return_reference = <?=$return_reference ?>; if(return_reference != "0") { $.ajax({ type: "POST", url: "../newJob.php", data: "type=" + "<?=$type ?>" + "&ref=" + "<?=$return_reference ?>", dataType: 'json', success: function (data) { console.log("Return Success"); }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log(textStatus + " " + errorThrown); } }) } $("#dispatch").click(function(){ var driver_id = $("#driver_id").val(); var spat_ref = <?php echo $spatulaid ?>; $.post("../dispatch.php", {driver_id: driver_id, spat_ref: spat_ref}, function (data) { console.log(data); if(data == "OK"){ $("#test").text("Success"); $("#test").attr('style', 'color:#00FF00;font-size: 150%;text-align: center;background-color: #ffffff;'); } else { $("#test").text("Error"); $("#test").attr('style', 'color:#FF0000;font-size: 150%;text-align: center;background-color: #ffffff;'); } }) }) }) </script> <? } else { echo "<h3>Your card has been declined</h3><br>\n"; echo "<h4><br>If the error message above says card name/number/expiry not provided and you are using Internet Explorer please try again from this <a target='_blank' href='https://desidrivers.com.au/family/indextest.php'>link</a><br></h4>"; echo $errormessage."<br>\n"; echo "<h4><a href='https://desidrivers.com.au/family/'> Refresh </a></h4>"; } ?> </div> </div> </div> </body> </html> <?php function send_mail($to, $from, $title, $message) { $headers = "From: FamilyCab Booking < info@familycab.com.au >\n"; $headers .= "X-Sender: FamilyCab Booking < info@familycab.com.au >\n"; $headers .= 'X-Mailer: PHP/' . phpversion(); $headers .= "X-Priority: 1\n"; // Urgent message! $headers .= "Return-Path: info@familycab.com.au\n"; // Return path for errors $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; return mail($to, $title, $message, $headers); } function getDistance($latitude1, $longitude1, $place) { if($place == "GC") { $latitude2 = -28.015748; $longitude2 = 153.401148;} if($place == "SC") { $latitude2 = -26.605131461675903; $longitude2 = 153.08851422485014; } $earth_radius = 6371; $dLat = deg2rad($latitude2 - $latitude1); $dLon = deg2rad($longitude2 - $longitude1); $a = sin($dLat/2) * sin($dLat/2) + cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) * sin($dLon/2) * sin($dLon/2); $c = 2 * asin(sqrt($a)); $d = $earth_radius * $c; return $d; } ?>
Save
cmd:
run