/
home
/
desid573
/
public_html
/
angel
/
/home/desid573/public_html/angel
mkdir
upload
Name
Size
Mode
Actions
assets/
-
0755
rm
drivers/
-
0755
rm
font/
-
0755
rm
lib/
-
0755
rm
payment/
-
0755
rm
stripe/
-
0755
rm
twilio-php-master/
-
0755
rm
vendor/
-
0755
rm
after_booking_page.php
2595
0644
edit
dl
rm
angeldrivers.png
132095
0644
edit
dl
rm
a_name_address.php
1289
0644
edit
dl
rm
booking.php
9621
0644
edit
dl
rm
booking_28-04-2017.php
947
0644
edit
dl
rm
booking_29-04-2017.php
3717
0644
edit
dl
rm
cancel.php
2430
0644
edit
dl
rm
cancel_booking.php
5367
0644
edit
dl
rm
composer.json
65
0644
edit
dl
rm
composer.lock
2355
0644
edit
dl
rm
confirmsend.php
2582
0644
edit
dl
rm
contact_us_mail.php
903
0644
edit
dl
rm
dispatch.php
864
0644
edit
dl
rm
error_log
436257456
0644
edit
dl
rm
generate_credit.php
3187
0644
edit
dl
rm
generate_referall.php
2779
0644
edit
dl
rm
getPrice.php
738
0644
edit
dl
rm
getuser_byid.php
2341
0644
edit
dl
rm
getuser_bymail.php
1968
0644
edit
dl
rm
get_all_booking.php
779
0644
edit
dl
rm
get_booking_bybooking_id.php
813
0644
edit
dl
rm
get_booking_byuser.php
1057
0644
edit
dl
rm
get_booking_status.php
2219
0644
edit
dl
rm
get_completed_bookings.php
727
0644
edit
dl
rm
get_directions.php
813
0644
edit
dl
rm
get_lead_message.php
673
0644
edit
dl
rm
get_open_bookings.php
1465
0644
edit
dl
rm
get_payment_byuser.php
1064
0644
edit
dl
rm
home.php
1660
0644
edit
dl
rm
homekey_img.png
14037
0644
edit
dl
rm
hook.php
21267
0644
edit
dl
rm
hook_set_up.php
654
0644
edit
dl
rm
index.php
12007
0644
edit
dl
rm
index_backup.php
4791
0644
edit
dl
rm
jobdetails.php
12197
0644
edit
dl
rm
lib_tr.zip
105047
0644
edit
dl
rm
login_api.php
7798
0644
edit
dl
rm
login_api_old.php
5653
0644
edit
dl
rm
noteconfirm.php
9259
0644
edit
dl
rm
online_booking.php
28283
0644
edit
dl
rm
passwordResetLink.php
5195
0644
edit
dl
rm
pay_file.php
7302
0644
edit
dl
rm
pay_file_back.php
5326
0644
edit
dl
rm
placehold.html
2184
0644
edit
dl
rm
priceCheck.php
0
0644
edit
dl
rm
reset_email.php
1755
0644
edit
dl
rm
search.php
830
0644
edit
dl
rm
send_bulk_notif.php
1692
0644
edit
dl
rm
setprice.php
4429
0644
edit
dl
rm
setprice_database.php
585
0644
edit
dl
rm
smsconfirm.php
9830
0644
edit
dl
rm
smssend.php
2354
0644
edit
dl
rm
stripe-php-master.zip
254366
0644
edit
dl
rm
test1.php
159
0644
edit
dl
rm
test_222.php
845
0644
edit
dl
rm
thankyou.php
17470
0644
edit
dl
rm
update_api.php
6290
0644
edit
dl
rm
update_api_on_mail.php
4677
0644
edit
dl
rm
validatecode.php
1094
0644
edit
dl
rm
validatephone.php
1034
0644
edit
dl
rm
Edit:
/home/desid573/public_html/angel/booking.php
(9621B)
<?php require("lib/config.php"); require_once 'vendor/eway/eway-rapid-php/include_eway.php'; date_default_timezone_set("Australia/Perth"); $data = $_REQUEST; if($_REQUEST['booking_date'] == "25/12/2018" OR date("Y-m-d") == "2018-12-25") { $Res["message"] = "Apologies but we are not operating on Christmas Day"; $Res["status"] = "error"; } else { $sql = "SELECT * FROM customers where email = '".$_REQUEST["email"]."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $customer[] = $row; $sql = "SELECT * FROM `customer_details` where `cid` = '".$row["id"]."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row_details = $result->fetch_assoc()) { $cust_detail[] = $row_details; } } $sql = "SELECT * FROM `customer_tokens` where `cid` = '".$row["id"]."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row_token = $result->fetch_assoc()) { $cust_token[] = $row_token; } } } $cus = $customer[0]["name"]; $mob = str_replace(" ", "", $customer[0]["mobile"]); $cid = $customer[0]['id']; $date = $_REQUEST['booking_date']; if($date == "") { $bookingdate = date("Y-m-d"); $bookingtime = date("H:i:s"); } else { $date = str_replace("/","-",$date); $format = 'd-m-Y'; $datetime = DateTime::createFromFormat($format, $date); $bookingdate = $datetime->format('Y-m-d'); $time=$_REQUEST['booking_time']; $time24 = date("G:i", strtotime($time)); $bookingtime = $time24; $timeUTC = date("c", strtotime("$bookingdate $time24")); $timeString = '{ "key": "deliverBy", "value": "' . $timeUTC . '" },'; } $timeUpper = date("H:i:s", strtotime($_REQUEST['booking_date']." ".$_REQUEST['booking_time']) + 900); $timeLower = date("H:i:s", strtotime($_REQUEST['booking_date']." ".$_REQUEST['booking_time']) - 900); $sql = "SELECT * FROM `booking` where `cid` = '".$cid."' and `status` != 'cancelled' and `booking_date` = '".$bookingdate."' and `booking_time` between '".$timeLower."' and '".$timeUpper."'"; $result = $conn->query($sql); if (!$result) { error_log("find booking error".$conn->error); } if ($result->num_rows > 0) { error_log("found double"); $Res["message"] = "You already have a booking within 15 mins of this time, please check the Open Bookings tab"; $Res["status"] = "error"; } else { function send_mail($to, $from, $title, $message) { $headers = "MIME-Version: 1.0 \r\n"; $headers .= "From: $from \n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html;charset=ISO-8859-1 \r\n"; $headers .= "X-Priority: 3\r\n"; $headers .= "X-Mailer: smail-PHP " . phpversion() . "\r\n"; return mail($to, $title, $message, $headers); } $fullnameencode = urlencode($cus); $pickupencode = urlencode($_REQUEST["pickup_addr"]); $dropoffencode = urlencode($_REQUEST["pickoff_addr"]); $reference = time().rand(10,5000); $price = $_REQUEST['quote']; $price = str_replace("$","", "$price"); $tokencustomerid = $cust_token[0]["access_token_value"]; $type = $_REQUEST['type']; if($type == "DD") { $type = "SI"; } $longUrl = "https://desidrivers.com.au/payment/?token=$tokencustomerid&ref=$reference&amount=$price.00&name=$fullnameencode&pickup=$pickupencode&dropoff=$dropoffencode&type=$type"; $postData = array('longUrl' => $longUrl); $jsonData = json_encode($postData); $curlObj = curl_init(); curl_setopt($curlObj, CURLOPT_URL, 'https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyCq_JZBDbrE5qma5SgF06M2dVAqbiZBZ-o'); 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, $jsonData); //$response = curl_exec($curlObj); // Change the response json string to object $json = json_decode($response); curl_close($curlObj); $shortLink = get_object_vars($json); $paymentlink = $shortLink['id']; $curlObj = curl_init(); curl_setopt($curlObj, CURLOPT_URL, 'https://api.fleeteng.com.au/v2/graph/role/jobs?access_token=9olkJkrIcttN8Zlh1lgAch70KFC_nJiIpUiCeaBMswbs'); 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.' ' . $cus . '", "campaign": {"id": 5622549795}, "contact": {"name": "' . $cus . '","phone": "' .$mob . '","email": "' . $_REQUEST["email"] . '"},"tasks": [{"zone": {"name": "Pick Up","address": "' . $_REQUEST["pickup_addr"] . '","coords": {"lat": ' . $_REQUEST["pickup_lat"] . ',"lon": ' . $_REQUEST["pickup_long"] . '},"radius": 100}},{"zone": {"name": "Home","address": "' . $_REQUEST["pickoff_addr"] . '","coords": {"lat": ' . $_REQUEST["pickoff_lat"] . ',"lon": ' . $_REQUEST["pickoff_long"] . '},"radius": 100}}],"attr": ['.$timeString.'{ "key": "Payment Link", "value": "' . $paymentlink . '" }]}]'); //$response = curl_exec($curlObj); //error_log($response); $json = json_decode($response, true); curl_close($curlObj); $query = "SELECT * FROM holding_link WHERE id = 1"; $result = mysqli_query($conn, $query); if(!$result) { error_log("link error".$conn->error); } $row = mysqli_fetch_assoc($result); $link = $row["link"]; $spatulalink = $link; //$json['items'][0]['tracking']; $spatulaid = ""; //$json['items'][0]['id']; $pickupx = str_replace("'", "", $_REQUEST['pickup_addr']); $dropoffx = str_replace("'", "", $_REQUEST['pickoff_addr']); $sql = "INSERT INTO `booking` (`id`, `cid`, `email`, `booking_date`, `booking_time`, `pickup_addr`, `pickup_lat`, `pickup_long`, `pickoff_addr`, `pickoff_lat`, `pickoff_long`,`spatula_id`,`spatula_link`, `reference`, `type`, `quote`, `quote_km`, `quote_time`, `xero_inv`, `payment_eway`, `status`, `driver`) VALUES (NULL, '".$cid."', '".$_REQUEST["email"]."', '".$bookingdate."', '".$bookingtime."', '".$pickupx."', '".$_REQUEST["pickup_lat"]."', '".$_REQUEST["pickup_long"]."', '".$dropoffx."', '".$_REQUEST["pickoff_lat"]."', '".$_REQUEST["pickoff_long"]."', '".$spatulaid."', '".$spatulalink."', '".$reference."', '".$type."', '".$price."', '".$_REQUEST['dist']."', '".$_REQUEST['time']."', '', '', '', '')"; if($conn->query($sql)) { $bid = $conn->insert_id; if($time24 == "") { $time24 = "ASAP"; } $slackmessage = "<https://desidrivers.com.au/angel/noteconfirm.php?ref=$bid | Confirm Booking> for $cus \n$bookingdate $time24\n$pickupx\n$dropoffx"; error_log($slackmessage); $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); error_log($response); curl_close($curlObj); $message = '<div style ="width:725; margin:0 auto;"><p>Hi '.$cus.',</p> <p>Thanks for your booking. Please check the details below for your booking and location :</p> <p style = "font-weight:bold;";>Details:</p> <br> <table width="400" style="border:none;"> <tr> <td >Type</td> <td>'.$type.'</td> </tr> <tr> <td>Date</td> <td>'.$bookingdate.'</td> </tr> <tr> <td>Token Customer Id</td> <td>'.$cust_token[0]["access_token_value"].'</td> </tr> <tr> <td>Name</td> <td>'.$cus.'</td> </tr> <tr> <td>Phone</td> <td>'.$mob.'</td> </tr> <tr> <td>Pick Up</td> <td>'.$_REQUEST["pickup_addr"].'</td> </tr> <tr> <td>To Drop</td> <td>'.$_REQUEST["pickoff_addr"].'</td> </tr> <tr> <td>Pick up Long</td> <td>'.$_REQUEST["pickup_long"].'</td> </tr> <tr> <td>Pick up Lat</td> <td>'.$_REQUEST["pickup_lat"].'</td> </tr> <tr> <td>Drop of Long</td> <td>'.$_REQUEST["pickoff_long"].'</td> </tr> <tr> <td>Drop of Lat</td> <td>'.$_REQUEST["pickoff_lat"].'</td> </tr> <tr> <td>Reference</td> <td>'.$reference.'</td> </tr> </table> </div>'; $to = "kirsty@andgeldrivers.com.au"; $from = "booking@angeldrivers.com.au"; $title = "Booking Details"; if(send_mail($to, $from, $title, $message)) { $Res["message"] = "booking successfully done"; $Res["status"] = "ok"; $Res["bid"] = $bid; $Res["spatula_link"] = "$spatulalink"; } else { $Res["message"] = "booking successfully But email has some issue Not send"; $Res["status"] = "ok"; } } else { $Res["message"] = "booking Not done"; $Res["status"] = "error"; error_log("booking error: ".$conn->error); } } } else { $Res["message"] = "user is not found "; $Res["status"] = "error"; } } echo json_encode(new ArrayObject($Res)); //echo "<pre>"; //print_r($data); //print_r($Res); //echo "</pre>"; $conn->close(); ?>
Save
cmd:
run