/
home
/
desid573
/
public_html
/
app
/
/home/desid573/public_html/app
mkdir
upload
Name
Size
Mode
Actions
braintree/
-
0755
rm
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
9655
0644
edit
dl
rm
cancel_booking.php
4925
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
contact_us_mail.php
890
0644
edit
dl
rm
copy_account_to_homekey.php
4334
0644
edit
dl
rm
dispatch.php
877
0644
edit
dl
rm
emailConfirmReset.php
401
0644
edit
dl
rm
error_log
586874
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
2183
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
2170
0644
edit
dl
rm
get_completed_bookings.php
710
0644
edit
dl
rm
get_ETA.php
6332
0644
edit
dl
rm
get_lead_message.php
673
0644
edit
dl
rm
get_open_bookings.php
1399
0644
edit
dl
rm
get_payment_byuser.php
1064
0644
edit
dl
rm
get_price.php
760
0644
edit
dl
rm
get_recipes.php
6361
0644
edit
dl
rm
get_TE.php
1217
0644
edit
dl
rm
index.php
10411
0644
edit
dl
rm
index_backup.php
4791
0644
edit
dl
rm
lib_tr.zip
105047
0644
edit
dl
rm
login_api.php
5789
0644
edit
dl
rm
noteconfirm.php
8208
0644
edit
dl
rm
off.php
2854
0644
edit
dl
rm
passwordResetLink.php
5190
0644
edit
dl
rm
pay_file.php
7302
0644
edit
dl
rm
pay_file_back.php
5326
0644
edit
dl
rm
placehold.html
2141
0644
edit
dl
rm
post.php
2535
0644
edit
dl
rm
reset_email.php
1775
0644
edit
dl
rm
reset_phone.php
5717
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
1055
0644
edit
dl
rm
Edit:
/home/desid573/public_html/app/cancel_booking.php
(4925B)
<?php require("lib/config.php"); require_once 'vendor/eway/eway-rapid-php/include_eway.php'; // =============== Get customer user api =================================== $data = $_REQUEST; $sql = "SELECT * FROM `booking` where id = '".$_REQUEST['bid']."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row_details = $result->fetch_assoc()) { $booking_detail[] = $row_details; } $sql = "SELECT * FROM `customers` where email = '".$booking_detail[0]["email"]."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row_detail = $result->fetch_assoc()) { $booking_details[] = $row_detail; } } $Res["data"] = $booking_detail; $Res["user-data"] = $booking_details; $Res["message"] = "Booking successfully cancelled"; $Res["status"] = "OK"; $name= $Res["data"][0]["spatula_id"]; $url = "https://api.fleeteng.com.au/v2/graph/role/jobs/$name?access_token=KX53ZweKgbbVIhD0_411iNWI9cQurfxbygZH9vpfsyX7"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_setopt($ch, CURLOPT_POSTFIELDS, $json); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch); $name = $booking_details[0]['name']; $date = $booking_detail[0]['booking_date']; $time = $booking_detail[0]['booking_time']; $type = $booking_detail[0]['type']; $id = $booking_detail[0]['spatula_id']; $reference = $booking_detail[0]['reference']; if($Res["data"][0]["status"] == ""){ $status = "cancelled"; $slackmessage = "$name for $date $time has cancelled - no charge"; } else { $status = "cancelled"; $nameencode = urlencode($name); $slackmessage = "$name for $date $bookingtime has cancelled"; } $result = mysqli_query($conn, "UPDATE booking SET status='".$status."' WHERE id='".$_REQUEST['bid']."'"); //send slack message $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); //delete job $url = "https://desidrivers.com.au/cancelJob.php?ref=$reference&type=$type"; $curlObj = curl_init(); curl_setopt($curlObj, CURLOPT_URL, $url); 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')); //$response = curl_exec($curlObj); curl_close($curlObj); //echo "<pre>"; //print_r($Res); //echo "</pre>"; $message = '<div style ="width:725; margin:0 auto;"><p>Hi,</p> <p>Hi, Please cancel My booking ,Please check the detail below:</p> <p>Booking was '.$status.'</p> <p style = "font-weight:bold;";>Details:</p> <table width="400" style="border:none;"> <tr> <td>Booking Id</td> <td>'.$Res["data"][0]["id"].'</td> </tr> <tr> <td>Name</td> <td>'.$Res["user-data"][0]["name"].'</td> </tr> <tr> <td>Mobile</td> <td>'.$Res["user-data"][0]["mobile"].'</td> </tr> <tr> <td>email Id</td> <td>'.$Res["data"][0]["email"].'</td> </tr> <tr> <td>Booking Date</td> <td>'.$Res["data"][0]["booking_date"].'</td> </tr> <tr> <td>Booking Time</td> <td>'.$Res["data"][0]["booking_time"].'</td> </tr> <tr> <td>Booking Time</td> <td>'.$Res["data"][0]["booking_time"].'</td> </tr> <tr> <td>Pickup address</td> <td>'.$Res["data"][0]["pickup_addr"].'</td> </tr> <tr> <td>Drop Address</td> <td>'.$Res["data"][0]["pickoff_addr"].'</td> </tr> <tr> <td>Spatula ID</td> <td>'.$Res["data"][0]["spatula_id"].'</td> </tr> </table> </div>'; $to = "lwscann@gmail.com" ; //$to = "chandan10n@gmail.com" ; $from = "booking@magicride.ng"; $title = "Cancel Booking"; $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"; mail($to, $title, $message, $headers); echo json_encode(new ArrayObject($Res)); } else { $Res["message"] = "no such result present in booking"; $Res["status"] = "ok"; echo json_encode(new ArrayObject($Res)); }
Save
cmd:
run