/home/desid573/public_html/test_api
NameSizeModeActions
lib/-0755rm
twilio-php-master/-0755rm
vendor/-0755rm
after_booking_page.php25950644editdlrm
booking.php107160644editdlrm
booking_28-04-2017.php9470644editdlrm
booking_29-04-2017.php37170644editdlrm
cancel_booking.php56210644editdlrm
checkPrice.php13060644editdlrm
composer.json650644editdlrm
composer.lock23550644editdlrm
confirmsend.php26820644editdlrm
contact_us_mail.php9030644editdlrm
dispatch.php8770644editdlrm
emailConfirmReset.php4860644editdlrm
error_log59222470644editdlrm
generate_credit.php31870644editdlrm
generate_referall.php27790644editdlrm
getuser_byid.php23410644editdlrm
getuser_bymail.php19680644editdlrm
get_all_booking.php7790644editdlrm
get_booking_bybooking_id.php8130644editdlrm
get_booking_byuser.php10570644editdlrm
get_booking_status.php22190644editdlrm
get_completed_bookings.php7270644editdlrm
get_directions.php8130644editdlrm
get_lead_message.php6730644editdlrm
get_open_bookings.php15270644editdlrm
get_payment_byuser.php10640644editdlrm
homekey_img.png140370644editdlrm
index.php142720644editdlrm
index_backup.php47910644editdlrm
lib_tr.zip1050470644editdlrm
login_api.php84050644editdlrm
login_api_old.php56530644editdlrm
noteconfirm.php92590644editdlrm
passwordResetLink.php51950644editdlrm
pay_file.php73020644editdlrm
pay_file_back.php53260644editdlrm
placehold.html21840644editdlrm
reset_email.php17550644editdlrm
send_bulk_notif.php16920644editdlrm
test_222.php8450644editdlrm
update_api.php63180644editdlrm
update_api_on_mail.php46770644editdlrm
validatecode.php10940644editdlrm
validatephone.php10340644editdlrm
Edit: /home/desid573/public_html/test_api/confirmsend.php (2682B)
query($sql); if ($result->num_rows > 0) { while($row_details = $result->fetch_assoc()) { $booking_detail[] = $row_details; } $sql = "SELECT * FROM `customers` where id = '".$booking_detail[0]['cid']."'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row_detail = $result->fetch_assoc()) { $booking_details[] = $row_detail; } } $firebase_token = $booking_details[0]['firebase_token']; $phone = $booking_details[0]['mobile']; } if($check=="check" && !empty($ref)) { if($booking_detail[0]['status'] == "") { echo "no"; } else { echo "yes"; } } if($check=="send" && !empty($ref)) { $sql = "UPDATE booking SET status='confirmed' WHERE id='".$ref."'"; $result = $conn->query($sql); $headers = array ( 'Authorization: key=AAAApaHuqGU:APA91bH3kolpY0BuK7YRH5C-ZaZnwhOlCGxc6aY04nVeYyHo2ph0U1Sn5NcgRmLYKU66srtcIdCjP8K7DeFWs6Cgcg96cHAe9-pJe6zR_frBELazSabGQni-oF30bJ5KN4RKXbiYBMxo', 'Content-Type: application/json' ); $curlObj = curl_init(); curl_setopt($curlObj, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send'); curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curlObj, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($curlObj, CURLOPT_HEADER, 0); curl_setopt($curlObj, CURLOPT_HTTPHEADER, $headers); curl_setopt($curlObj, CURLOPT_POST, 1); curl_setopt($curlObj, CURLOPT_POSTFIELDS, '{ "notification": { "title": "Booking has been confirmed", "body": "Your booking is confirmed, a driver will be dispatched shortly", "sound": "mySound" }, "to" : "'.$firebase_token.'" "data": { "status": "confirmed", "bid": '.$ref.', "spatula_link": "https://bookings.perthdesignateddrivers.com.au/test_api/placehold.html" } }'); $response = curl_exec($curlObj); curl_close($curlObj); error_log($response); $result = json_decode($response, true); if($result['failure'] == 1) { $account_sid = 'AC1b4db66d86197058950ad349a2327a85'; $auth_token = '053ae80d10eac3b60c92179d3492badf'; $client = new Client($account_sid, $auth_token); $messages = $client->messages->create("$phone", array('From' => "DesiDrivers", 'body' => 'Your booking is confirmed, you will be notified when a driver is assigned')); if($messages) { echo "yes"; } else { echo "no"; } } else { echo "yes"; } }