/
home
/
desid573
/
public_html
/
fc_api
/
/home/desid573/public_html/fc_api
mkdir
upload
Name
Size
Mode
Actions
lib/
-
0755
rm
twilio-php-master/
-
0755
rm
vendor/
-
0755
rm
after_booking_page.php
2595
0644
edit
dl
rm
appoff.php
4782
0644
edit
dl
rm
booking.php
17680
0644
edit
dl
rm
booking_edit_request.php
10196
0644
edit
dl
rm
cancel_booking.php
6064
0644
edit
dl
rm
check_open.php
0
0644
edit
dl
rm
composer.json
65
0644
edit
dl
rm
composer.lock
2355
0644
edit
dl
rm
confirmsend.php
2983
0644
edit
dl
rm
confirm_booking_change.php
6305
0644
edit
dl
rm
confirm_booking_change_ajax.php
6696
0644
edit
dl
rm
contact_us_mail.php
890
0644
edit
dl
rm
copy_account_to_homekey.php
4338
0644
edit
dl
rm
dispatch.php
877
0644
edit
dl
rm
emailConfirmReset.php
486
0644
edit
dl
rm
error_log
30761021
0644
edit
dl
rm
family-cab_small.jpg
98853
0644
edit
dl
rm
generate_credit.php
3098
0644
edit
dl
rm
generate_referall.php
2779
0644
edit
dl
rm
getuser_byid.php
2341
0644
edit
dl
rm
getuser_bymail.php
3419
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
3246
0644
edit
dl
rm
get_completed_bookings.php
710
0644
edit
dl
rm
get_ETA.php
5013
0644
edit
dl
rm
get_lead_message.php
673
0644
edit
dl
rm
get_open_bookings.php
1537
0644
edit
dl
rm
get_payment_byuser.php
1064
0644
edit
dl
rm
get_price.php
41
0644
edit
dl
rm
get_recipes.php
6361
0644
edit
dl
rm
get_request_details.php
976
0644
edit
dl
rm
get_TE.php
1217
0644
edit
dl
rm
index.php
13722
0644
edit
dl
rm
index_backup.php
4791
0644
edit
dl
rm
lib_tr.zip
105047
0644
edit
dl
rm
login_api.php
8679
0644
edit
dl
rm
noteconfirm.php
9228
0644
edit
dl
rm
off.php
2854
0644
edit
dl
rm
passwordResetLink.php
5170
0644
edit
dl
rm
pay_file.php
7302
0644
edit
dl
rm
pay_file_back.php
5326
0644
edit
dl
rm
placehold.html
2147
0644
edit
dl
rm
reset_email.php
1755
0644
edit
dl
rm
reset_phone.php
5717
0644
edit
dl
rm
test2.php
0
0644
edit
dl
rm
test_222.php
845
0644
edit
dl
rm
update_api.php
5910
0644
edit
dl
rm
update_api_on_mail.php
4723
0644
edit
dl
rm
validatecode.php
1094
0644
edit
dl
rm
validatephone.php
1034
0644
edit
dl
rm
Edit:
/home/desid573/public_html/fc_api/booking_edit_request.php
(10196B)
<?php require("lib/config.php"); $sql = "UPDATE booking SET status = 'Requesting Changes' WHERE id = '".$_REQUEST["bid"]."'"; $result = $conn->query($sql); if($result) { $sql = "SELECT * FROM `booking` where id = '".$_REQUEST['bid']."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row_details = $result->fetch_assoc()) { $current_detail = $row_details; } } if($current_detail["type"] == "SA") { date_default_timezone_set("Australia/Sydney"); $slackurl = "https://hooks.slack.com/services/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"; } else if ($current_detail["type"] == "MA") { date_default_timezone_set("Australia/Melbourne"); $slackurl = "https://hooks.slack.com/services/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"; } else if ($current_detail["type"] == "BA") { date_default_timezone_set("Australia/Brisbane"); $slackurl = "https://hooks.slack.com/services/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"; } else if($current_detail["type"] == "GA") { $slackurl = "https://hooks.slack.com/services/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"; date_default_timezone_set("Australia/Brisbane"); } else if($current_detail["type"] == "YA") { $slackurl = "https://hooks.slack.com/services/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"; date_default_timezone_set("Australia/Brisbane"); } else { $slackurl = "https://hooks.slack.com/services/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"; date_default_timezone_set("Australia/Perth"); } $sql = "SELECT * FROM `customers` where email = '".$current_detail["email"]."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row_detail = $result->fetch_assoc()) { $cust_details = $row_detail; } } $message = $cust_details["name"]." ".$current_detail["booking_date"]." ".$current_detail["booking_time"]."\n"; $date = $_REQUEST["date"]; if($date != $current_detail["booking_date"]) { $date = str_replace("/","-",$date); $format = 'd-m-Y'; $datetime = DateTime::createFromFormat($format, $date); $bookingdate = $datetime->format('Y-m-d'); error_log($bookingdate." != ".$current_detail["booking_date"]); if($bookingdate != $current_detail["booking_date"]) { $message = $message."Date to ".$date."\n"; } else { $date = NULL; } } else { $date = NULL; } $time = date("G:i", strtotime($_REQUEST['time'])); error_log($_REQUEST['time']." != ".$current_detail["booking_time"]); if($_REQUEST['time'] != $current_detail["booking_time"]) { $message = $message."Time from ".$current_detail["booking_time"]." to ".$time."\n"; } else { $time = ""; } $pickup = ""; $pick_lat = ""; $pick_lon = ""; if(isset($_REQUEST["pickup"]) && $_REQUEST["pickup"] != $current_detail["pickup_addr"]) { $pickup = $_REQUEST["pickup"]; $pick_lat = $_REQUEST["pick_lat"]; $pick_lon = $_REQUEST["pick_lon"]; $message = $message."Pickup from ".$current_detail["pickup_addr"]." to ".$pickup."\n"; } $dropoff = ""; $drop_lat = ""; $drop_lon = ""; if(isset($_REQUEST["dropoff"]) && $_REQUEST["dropoff"] != $current_detail["pickoff_addr"]) { $dropoff = $_REQUEST["dropoff"]; $drop_lat = $_REQUEST["drop_lat"]; $drop_lon = $_REQUEST["drop_lon"]; $message = $message."Dropoff from ".$current_detail["pickoff_addr"]." to ".$dropoff."\n"; } $flight_num = ""; if($_REQUEST['flight_num'] != $current_detail["flight_num"]) { $flight_num = $_REQUEST['flight_num']; $message = $message."Flight# from .".$current_detail["flight_num"]." to ".$flight_num."\n"; } $mins_to = ""; if(isset($_REQUEST["mins_to"]) && $_REQUEST["mins_to"] != $current_detail["mins_to"]) { $mins_to = $_REQUEST["mins_to"]; $message = $message."Mins to flight from ".$current_detail["mins_to"]." now ".$mins_to."\n"; } $book_pax = ""; if($_REQUEST["book_pax"] != $current_detail["book_pax"]) { $book_pax = $_REQUEST["book_pax"]; $message = $message."Total Pax from ".$current_detail["book_pax"]." now ".$book_pax."\n"; } $book_rf = ""; if($_REQUEST["book_rf"] != $current_detail["book_rf"]) { $book_rf = $_REQUEST["book_rf"]; $message = $message."Rear Facings from ".$current_detail["book_rf"]." now ".$book_rf."\n"; } $book_ff = ""; if($_REQUEST["book_ff"] != $current_detail["book_ff"]) { $book_ff = $_REQUEST["book_ff"]; $message = $message."Forward Facings from ".$current_detail["book_ff"]." now ".$book_ff."\n"; } $book_b = ""; if($_REQUEST["book_b"] != $current_detail["book_b"]) { $book_b = $_REQUEST["book_b"]; $message = $message."Boosters from ".$current_detail["book_b"]. " now ".$book_b."\n"; } $luggage = ""; if($_REQUEST["luggage"] != $current_detail["luggage"]) { $luggage = $_REQUEST["luggage"]; $message = $message."Luggage now ".$luggage."\n"; } $quote = ""; if($_REQUEST["quote"] != $current_detail["quote"] AND $_REQUEST["quote"] != "") { $quote = $_REQUEST["quote"]; $message = $message."Quote was $".$current_detail["quote"]." now $".$quote."\n"; } $sql = "INSERT INTO `booking_edit_request`(`id`, `bid`, `date`, `time`, `pickup`, `pick_lat`, `pick_lon`, `dropoff`, `drop_lat`, `drop_lon`, `book_pax`, `book_rf`, `book_ff`, `book_b`, `new_quote`, `new_quote_km`, `new_quote_time`, `flight_num`, `mins`, `luggage`, `toll_quote`, `toll_description`, `date_requested`, `date_approved`, `approved`) VALUES (NULL,'".$_REQUEST['bid']."','".$bookingdate."','".$time."','".$pickup."','".$pick_lat."','".$pick_lon."','".$dropoff."','".$drop_lat."','".$drop_lon."','".$book_pax."', '".$book_rf."', '".$book_ff."', '".$book_b."', '".$quote."', '".$_REQUEST["quote_km"]."', '".$_REQUEST["quote_time"]."', '".$flight_num."', '".$mins_to."', '".$luggage."', '".$_REQUEST["tollQuote"]."', '".$_REQUEST["tollDescription"]."', NOW(), '', 0)"; $request = $conn->query($sql); if(!$request) { error_log("Request add error ".$conn->error); $Res["status"] = "error"; $Res["message"] = "Cannot Create Request"; } else { $request_id = $conn->insert_id; $sql = "UPDATE booking SET status = 'change' WHERE id = ".$_REQUEST['bid']; $r = $conn->query($sql); if(!$r) { error_log("update error ".$conn->error); } $message = "<https://desidrivers.com.au/fc_api/confirm_booking_change.php?request_id=$request_id | Update Request:>\n".$message; error_log($message); $curlObj = curl_init(); curl_setopt($curlObj, CURLOPT_URL, $slackurl); 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": "'.$message.'"}'); $response = curl_exec($curlObj); error_log($response); curl_close($curlObj); $Res["status"] = "OK"; $Res["message"] = "Request Sent"; } } else { $Res["status"] = "error"; $Res["message"] = "cannot find booking"; } echo json_encode($Res, true);
Save
cmd:
run