Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php goto uFMB4; vfn6s: header("\x41\143\x63\x65\163\163\55\103\157\x6e\164\162\157\x6..

Decoded Output download

<?php 
goto uFMB4; 
vfn6s: 
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With"); 
goto YhNjC; 
fGnQv: 
$setmore_slot_pull_id = $rs_timestamp["setmore_slot_pull_id"]; 
goto KUCNs; 
TkXEq: 
$rs_timestamp = mysqli_query($DBConnection, $chk_timestamp) or die(mysqli_error($DBConnection)); 
goto Cghjx; 
nhDhq: 
$chk_timestamp = "SELECT * FROM setmore_slot_pull"; 
goto TkXEq; 
kk9Sz: 
$date_updated = date("Y-m-d H:i:s"); 
goto nhDhq; 
jO3M4: 
$slot_id = $data->slot_id; 
goto A5u15; 
nM7mF: 
$name = $first_name . " " . $last_name; 
goto VktI0; 
A5u15: 
$start_time = $data->start_time; 
goto VD2cU; 
S0jam: 
$curr_time = $rs_timestamp["curr_time"]; 
goto fGnQv; 
KiOxI: 
header("Access-Control-Allow-Origin: *"); 
goto WXSQ7; 
uHjLm: 
$utm_medium = str_replace("'", "`", $data->utm_medium); 
goto MvEbX; 
hmlkw: 
require_once "../database/database.php"; 
goto GH2Ph; 
Ex7qQ: 
$cell_phone = $data->cell_phone; 
goto d10oe; 
FZjvs: 
$first_name = str_replace("'", "`", $data->first_name); 
goto DuYcn; 
d10oe: 
$service_id = $data->service_key; 
goto jO3M4; 
WXSQ7: 
header("Content-Type: application/json; charset=UTF-8"); 
goto yKMtK; 
EalHt: 
$date_added = date("Y-m-d H:i:s"); 
goto kk9Sz; 
w7MlF: 
$refreshToken = "r1/cb72dbe0098HDmS_Ax0lw1FK4iDn3S0H056uWSl55q9vl"; 
goto EalHt; 
GH2Ph: 
global $DBConnection; 
goto KiOxI; 
gNFd8: 
$data = json_decode(file_get_contents("php://input")); 
goto FZjvs; 
rhyhU: 
$comment = str_replace("'", "`", $data->comment); 
goto uHjLm; 
MvEbX: 
$utm_source = str_replace("'", "`", $data->utm_source); 
goto N9qRJ; 
VD2cU: 
$end_time = $data->end_time; 
goto rhyhU; 
yKMtK: 
header("Access-Control-Allow-Methods: POST, DELETE, OPTIONS"); 
goto RdS4L; 
YhNjC: 
error_reporting(E_ALL ^ E_NOTICE); 
goto TErJq; 
McxDY: 
error_log("----- DATA RECIEVED ----- " . $str_data_receieved); 
goto dLQr1; 
N9qRJ: 
$str_data_receieved = "{
    "first_name":"" . $first_name . "",      \xa    "last_name":"" . $last_name . "",    
    "email_id":"" . $email_id . "",\xa    "service_id":"" . $service_id . "",\xa    "slot_id":"" . $slot_id . "",\xa    "start_time":"" . $start_time . "",
    "end_time":"" . $end_time . "",
    "comment":"" . $comment . "",\xa    "utm_medium":"" . $utm_medium . "",\xa    "utm_source":"" . $utm_source . "",
    "country_code":"+91",\xa    "cell_phone":"" . $cell_phone . ""
}"; 
goto McxDY; 
uFMB4: 
session_start(); 
goto hmlkw; 
TErJq: 
$refreshToken = $_REQUEST["refreshToken"]; 
goto w7MlF; 
DuYcn: 
$last_name = str_replace("'", "`", $data->last_name); 
goto nM7mF; 
KUCNs: 
if (time() - 3600 > $curr_time) { 
    $curl = curl_init(); 
    curl_setopt_array($curl, array(CURLOPT_URL => "https://developer.setmore.com/api/v1/o/oauth2/token?refreshToken={$refreshToken}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array())); 
    $response_access_token = curl_exec($curl); 
    $response_access_token = json_decode($response_access_token, true); 
    $err = curl_error($curl); 
    if ($err) { 
        $erro_when = "Trying to get access token Line No.: 52, save_appointment.php"; 
        $api_payload = "https://developer.setmore.com/api/v1/o/oauth2/token?refreshToken={$refreshToken}"; 
        $sql_insert_error_1 = "INSERT INTO setmore_errors 
                            (err_details, err_when, api_payload, date_added) VALUES \xa                            ('{$err}', '{$err_when}', '{$api_payload}', '{$date_added}')"; 
        mysqli_query($DBConnection, $sql_insert_error_1); 
        die; 
    } 
    curl_close($curl); 
    $access_token = $response_access_token["data"]["token"]["access_token"]; 
    $sql_update_timestamp = "UPDATE setmore_slot_pull SET access_token = '{$access_token}', date_updated = '{$date_added}' WHERE setmore_slot_pull_id = '{$setmore_slot_pull_id}'"; 
    mysqli_query($DBConnection, $sql_update_timestamp) or die(mysqli_error($DBConnection)); 
} else { 
    $access_token = $rs_timestamp["access_token"]; 
} 
goto gNFd8; 
VktI0: 
$email_id = $data->email_id; 
goto Ex7qQ; 
RdS4L: 
header("Access-Control-Max-Age: 3600"); 
goto vfn6s; 
dLQr1: 
if ($access_token == '' || $first_name == '' || $email_id == '' || $cell_phone == '') { 
    $json["status"] = 400; 
    $json["message"] = "access token and other basic data missing"; 
    $json["api_name"] = "save_appointment"; 
    echo json_encode($json); 
    die; 
} else { 
    $error_message = "booking data recieved"; 
    $api_payload = "setmore/api/v1/bookingapi/customer/create"; 
    $sql_insert_data_recieved = "INSERT INTO setmore_errors \xa                        (err_details, err_when, api_payload, date_added) VALUES \xa                        ('{$error_message}', '{$str_data_receieved}', '{$api_payload}', '{$date_added}')"; 
    mysqli_query($DBConnection, $sql_insert_data_recieved); 
    if ($customer_key == '') { 
        $str_payload = "{
            "first_name":"" . $first_name . "",      \xa            "last_name":"" . $last_name . "",    \xa            "email_id":"" . $email_id . "",\xa            "country_code":"+91",
            "cell_phone":"" . $cell_phone . ""
        }"; 
        $curl = curl_init(); 
        curl_setopt_array($curl, array(CURLOPT_URL => "https://developer.setmore.com/api/v1/bookingapi/customer/create", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{\xa                                "first_name":"" . $first_name . "",      
                                "last_name":"" . $last_name . "",    
                                "email_id":"" . $email_id . "",
                                "country_code":"+91",
                                "cell_phone":"" . $cell_phone . ""\xa                            }", CURLOPT_HTTPHEADER => array("Accept: application/json", "Content-Type: application/json", "Authorization: Bearer {$access_token}"))); 
        $response = curl_exec($curl); 
        $response_decoded = json_decode($response, true); 
        $err = curl_error($curl); 
        if ($err) { 
            $err_when = "Trying to create customer Line No.: 224, save_appointment.php"; 
            $api_payload = "setmore/api/v1/bookingapi/customer/create, payload: " . $str_payload; 
            $sql_insert_error_2 = "INSERT INTO setmore_errors \xa                                (err_details, err_when, api_payload, date_added) VALUES \xa                                ('{$err}', '{$err_when}', '{$api_payload}', '{$date_added}')"; 
            mysqli_query($DBConnection, $sql_insert_error_2); 
            die; 
        } 
        curl_close($curl); 
        $customer_key = $response_decoded["data"]["customer"]["key"]; 
        if ($err) { 
            echo "{"status":"400","message":"Error saving customer","details":"" . $err . ""}"; 
            die; 
        } else { 
            if ($customer_key == '') { 
                echo "{"status":"400","message":"Error identifying customer"}"; 
                die; 
            } 
        } 
    } 
    $sql_get_doc_id = "SELECT sa.doc_id 
        FROM \xa            setmore_availability sa \xa        INNER JOIN setmore_doc_mapping dm on sa.doc_id = dm.doc_id 
        WHERE \xa            sa.slot_id= '{$slot_id}' AND \xa            dm.service_id= '{$service_id}' AND 
            sa.is_available=1 
        ORDER BY rand() 
        LIMIT 1"; 
    $rs_get_doc_id = mysqli_query($DBConnection, $sql_get_doc_id) or die(mysqli_error($DBConnection)); 
    $row_get_doc_id = mysqli_fetch_assoc($rs_get_doc_id); 
    $doc_id = $row_get_doc_id["doc_id"]; 
    if ($doc_id == '') { 
        $json["status"] = 400; 
        $json["message"] = "unable to get doctor"; 
        $json["api_name"] = "save_appointment"; 
        echo json_encode($json); 
        die; 
    } else { 
        $curl = curl_init(); 
        $str_payload_2 = "{
            "staff_key": "" . $doc_id . "",\xa            "service_key": "" . $service_id . "",\xa            "customer_key": "" . $customer_key . "",
            "start_time": "" . $start_time . "",\xa            "end_time": "" . $end_time . "",\xa            "comment": "" . $comment . ""\xa        }"; 
        curl_setopt_array($curl, array(CURLOPT_URL => "https://developer.setmore.com/api/v1/bookingapi/appointment/create", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{
                                "staff_key": "" . $doc_id . "",\xa                                "service_key": "" . $service_id . "",\xa                                "customer_key": "" . $customer_key . "",
                                "start_time": "" . $start_time . "",
                                "end_time": "" . $end_time . "",\xa                                "comment": "" . $comment . ""\xa                                }", CURLOPT_HTTPHEADER => array("Accept: application/json", "Content-Type: application/json", "Authorization: Bearer {$access_token}"))); 
        $response_booking = curl_exec($curl); 
        error_log($response_booking); 
        $response_booking_decoded = json_decode($response_booking, true); 
        $err = curl_error($curl); 
        curl_close($curl); 
        if ($err || $response_booking_decoded["response"] != true) { 
            $error_message = "creating appointment"; 
            $str_data_receieved = "response: " . htmlentities($response_booking_decoded["msg"], ENT_QUOTES); 
            $sql_insert_data_recieved_ERR = "INSERT INTO setmore_errors 
                                (err_details, err_when, api_payload, date_added) VALUES \xa                                ('{$response_booking}', '{$str_payload_2}', '{$str_data_receieved}', '{$date_added}')"; 
            error_log($response_booking); 
            error_log($sql_insert_data_recieved_ERR); 
            mysqli_query($DBConnection, $sql_insert_data_recieved_ERR); 
            echo "{"status":"400","message":"" . $response_booking_decoded["msg"] . "","details":"" . $err . ""}"; 
            die; 
        } else { 
            $appointment_key = $response_booking_decoded["data"]["appointment"]["key"]; 
            $start_time = $response_booking_decoded["data"]["appointment"]["start_time"]; 
            $appointment_date_arr = explode("T", $start_time); 
            $appointment_date = $appointment_date_arr[0]; 
            $appointment_date_new = date("m/d/Y", strtotime($appointment_date)); 
            $appointment_date_db_dump = date("Y-m-d", strtotime($appointment_date)); 
            $start_time_new = date("h:i A", strtotime($start_time)); 
            $end_time = $response_booking_decoded["data"]["appointment"]["end_time"]; 
            $duration = $response_booking_decoded["data"]["appointment"]["duration"]; 
            $customer_key = $response_booking_decoded["data"]["appointment"]["customer_key"]; 
            $comment = $response_booking_decoded["data"]["appointment"]["comment"]; 
            $sql_update_is_available = "UPDATE setmore_availability SET is_available = '0' \xa                                WHERE doc_id = '{$doc_id}' AND slot_id = '{$slot_id}'"; 
            mysqli_query($DBConnection, $sql_update_is_available); 
            $sql_insert_appointment = "INSERT INTO doc_consultation 
                                            (appointment_booking_id, `booking_timestamp`, slot_id, `customer_name`, `mobile`, `email`, `consultation_date`, `consult_time`, `customer_selected_therapy`, `doc_id`, `customer_comments`, `utm_source`, `sz`, `date_added`, `date_updated`, `active_status`) VALUES 
                                            ('{$appointment_key}', '{$start_time}', '{$slot_id}', '{$name}', '{$cell_phone}', '{$email_id}', '{$appointment_date_db_dump}', '{$start_time_new}', '{$service_id}', '{$doc_id}', '{$comment}', '{$utm_source}', '{$utm_medium}', '{$date_added}', '{$date_added}', '1')"; 
            mysqli_query($DBConnection, $sql_insert_appointment); 
            $curl = curl_init(); 
            curl_setopt_array($curl, array(CURLOPT_URL => "https://api.in.webengage.com/v1/accounts/" . $WebEngageServerLicense . "/users", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{\xa                                        "userId":"" . $email_id . "",\xa                                        "email":"" . $email_id . "",\xa                                        "phone":"" . $cell_phone . "",\xa                                        "emailOptIn":true,
                                        "whatsappOptIn":true\xa                                    }", CURLOPT_HTTPHEADER => array($WebEngageAuthToken, "Content-Type: application/json", "Accept: application/json"))); 
            $response = curl_exec($curl); 
            $err = curl_error($curl); 
            curl_close($curl); 
            $str_payload_3 = "{
                    "userId":"" . $email_id . "",
                        "eventName": "dc_appointment_created",\xa                        "eventData": {\xa                                "Customer_Id":"" . $email_id . "",
                                "Phone":"" . $cell_phone . "",
                                "Email":"" . $email_id . "",\xa                                "dc_solution_category":"" . $service_id . "",
                                "dc_appointment_date":"" . $appointment_date_new . "",
                                "dc_appointment_id":"" . $appointment_key . "",\xa                                "dc_appointment_time":"" . $start_time_new . "",\xa                                "dc_doc_id":"" . $doc_id . ""\xa                    }}"; 
            $curl = curl_init(); 
            curl_setopt_array($curl, array(CURLOPT_URL => "https://api.in.webengage.com/v1/accounts/" . $WebEngageServerLicense . "/events", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{
                                        "userId":"" . $email_id . "",
                                            "eventName": "dc_appointment_created",\xa                                            "eventData": {
                                                    "Customer_Id":"" . $email_id . "",\xa                                                    "Phone":"" . $cell_phone . "",
                                                    "Email":"" . $email_id . "",
                                                    "dc_solution_category":"" . $service_id . "",\xa                                                    "dc_appointment_date":"" . $appointment_date_new . "",
                                                    "dc_appointment_id":"" . $appointment_key . "",
                                                    "dc_appointment_time":"" . $start_time_new . "",
                                                    "dc_doc_id":"" . $doc_id . ""\xa                                        }}", CURLOPT_HTTPHEADER => array($WebEngageAuthToken, "Content-Type: application/json", "Accept: application/json"))); 
            $response = curl_exec($curl); 
            $err = curl_error($curl); 
            if ($err) { 
            } 
            curl_close($curl); 
            require "google_sheet/vendor/autoload.php"; 
            $todays_datetime = gmdate("Y-m-d\TH:i:s\Z"); 
            $client = new \Google_Client(); 
            $client->setApplicationName("Google Sheets and PHP"); 
            $client->setScopes(array(\Google_Service_Sheets::SPREADSHEETS)); 
            $client->setAccessType("offline"); 
            $client->setAuthConfig(__DIR__ . "/google_sheet/credentials.json"); 
            $service = new Google_Service_Sheets($client); 
            $spreadsheetId = "1IPvtVjsS7kMxCcarV49mTCpTf_Aogf5xi7KViOOB-V8"; 
            $range = "Appointment Master!B2:J"; 
            $values = array(array($todays_datetime, $name, $cell_phone, $email_id, $appointment_date_new, $start_time_new, $service_id, $doc_id, $utm_source, $utm_medium)); 
            $ValueRange = new Google_Service_Sheets_ValueRange(); 
            $ValueRange->setValues($values); 
            $options = array("valueInputOption" => "RAW"); 
            $service->spreadsheets_values->append($spreadsheetId, $range, $ValueRange, $options); 
        } 
        $data = array("status" => "200", "message" => "Appointment created successfully", "appointment_key" => $appointment_key, "staff_key" => $doc_id, "start_time" => $start_time, "end_time" => $end_time, "duration" => $duration, "customer_key" => $customer_key, "comment" => $comment); 
        header("Content-type: application/json"); 
        echo json_encode($data); 
        die; 
    } 
} 
goto CP72v; 
Cghjx: 
$rs_timestamp = mysqli_fetch_assoc($rs_timestamp); 
goto S0jam; 
CP72v: ?>

Did this file decode correctly?

Original Code

<?php
goto uFMB4;
vfn6s:
header("\x41\143\x63\x65\163\163\55\103\157\x6e\164\162\157\x6c\x2d\x41\x6c\x6c\157\x77\55\x48\145\141\x64\145\x72\163\x3a\x20\x43\157\x6e\x74\x65\156\x74\x2d\x54\x79\x70\145\54\x20\101\143\x63\x65\163\163\x2d\103\x6f\156\164\x72\157\x6c\x2d\x41\x6c\x6c\x6f\x77\x2d\110\x65\x61\144\145\x72\163\54\40\101\165\x74\x68\157\162\x69\x7a\x61\164\151\157\x6e\54\40\x58\x2d\122\145\x71\165\145\x73\x74\x65\x64\55\x57\x69\164\x68");
goto YhNjC;
fGnQv:
$setmore_slot_pull_id = $rs_timestamp["\x73\145\x74\155\157\x72\x65\137\x73\154\x6f\x74\137\x70\x75\154\x6c\x5f\151\x64"];
goto KUCNs;
TkXEq:
$rs_timestamp = mysqli_query($DBConnection, $chk_timestamp) or die(mysqli_error($DBConnection));
goto Cghjx;
nhDhq:
$chk_timestamp = "\x53\x45\114\x45\x43\x54\x20\52\x20\x46\x52\x4f\115\x20\x73\145\x74\155\157\x72\x65\137\163\x6c\157\164\137\x70\165\154\x6c";
goto TkXEq;
kk9Sz:
$date_updated = date("\x59\55\x6d\55\x64\40\110\72\x69\x3a\163");
goto nhDhq;
jO3M4:
$slot_id = $data->slot_id;
goto A5u15;
nM7mF:
$name = $first_name . "\40" . $last_name;
goto VktI0;
A5u15:
$start_time = $data->start_time;
goto VD2cU;
S0jam:
$curr_time = $rs_timestamp["\143\x75\x72\162\137\164\151\155\145"];
goto fGnQv;
KiOxI:
header("\101\143\143\x65\x73\163\x2d\x43\x6f\x6e\164\x72\157\154\55\101\154\154\157\167\x2d\117\x72\151\x67\x69\x6e\72\40\x2a");
goto WXSQ7;
uHjLm:
$utm_medium = str_replace("\47", "\x60", $data->utm_medium);
goto MvEbX;
hmlkw:
require_once "\x2e\56\57\x64\141\x74\x61\142\141\163\x65\57\x64\141\164\x61\x62\141\x73\145\x2e\x70\x68\160";
goto GH2Ph;
Ex7qQ:
$cell_phone = $data->cell_phone;
goto d10oe;
FZjvs:
$first_name = str_replace("\47", "\140", $data->first_name);
goto DuYcn;
d10oe:
$service_id = $data->service_key;
goto jO3M4;
WXSQ7:
header("\103\157\x6e\x74\145\156\164\x2d\124\171\160\145\72\40\141\x70\x70\154\151\x63\141\164\151\x6f\x6e\57\x6a\x73\x6f\156\73\40\x63\x68\141\x72\163\x65\x74\x3d\x55\x54\x46\55\x38");
goto yKMtK;
EalHt:
$date_added = date("\131\55\x6d\55\144\x20\110\x3a\x69\72\x73");
goto kk9Sz;
w7MlF:
$refreshToken = "\162\61\57\143\142\67\62\144\142\145\60\60\71\x38\x48\104\x6d\x53\x5f\101\170\x30\154\167\x31\x46\113\64\x69\104\x6e\63\x53\x30\110\x30\x35\x36\x75\x57\123\154\x35\65\x71\71\166\154";
goto EalHt;
GH2Ph:
global $DBConnection;
goto KiOxI;
gNFd8:
$data = json_decode(file_get_contents("\160\x68\x70\72\57\57\x69\x6e\160\165\164"));
goto FZjvs;
rhyhU:
$comment = str_replace("\47", "\x60", $data->comment);
goto uHjLm;
MvEbX:
$utm_source = str_replace("\47", "\x60", $data->utm_source);
goto N9qRJ;
VD2cU:
$end_time = $data->end_time;
goto rhyhU;
yKMtK:
header("\x41\143\143\x65\x73\163\x2d\103\x6f\x6e\x74\x72\157\x6c\55\101\x6c\154\x6f\167\x2d\115\x65\x74\x68\x6f\x64\x73\72\x20\120\117\123\x54\x2c\40\x44\105\114\x45\124\105\54\40\x4f\x50\124\111\x4f\x4e\123");
goto RdS4L;
YhNjC:
error_reporting(E_ALL ^ E_NOTICE);
goto TErJq;
McxDY:
error_log("\55\x2d\x2d\55\55\40\x44\101\124\x41\x20\122\x45\x43\111\105\126\105\104\x20\55\x2d\55\x2d\x2d\40" . $str_data_receieved);
goto dLQr1;
N9qRJ:
$str_data_receieved = "\173\12\x20\40\40\x20\x22\x66\x69\162\x73\164\x5f\x6e\x61\x6d\x65\42\72\x22" . $first_name . "\42\54\x20\40\x20\40\40\x20\xa\40\40\40\x20\x22\154\x61\x73\164\137\x6e\141\155\x65\x22\x3a\x22" . $last_name . "\42\x2c\x20\40\40\x20\12\x20\40\40\x20\42\145\x6d\x61\x69\x6c\137\x69\144\42\x3a\x22" . $email_id . "\42\54\xa\x20\40\x20\40\42\163\x65\x72\x76\x69\x63\x65\x5f\151\x64\42\72\42" . $service_id . "\x22\54\xa\40\40\x20\x20\x22\163\154\x6f\164\x5f\x69\x64\42\72\42" . $slot_id . "\42\x2c\xa\x20\40\40\x20\x22\163\164\141\x72\x74\137\164\151\x6d\x65\x22\72\42" . $start_time . "\x22\x2c\12\40\x20\x20\x20\42\145\156\144\137\164\151\x6d\x65\x22\72\42" . $end_time . "\42\54\12\40\40\x20\x20\x22\x63\x6f\x6d\x6d\x65\156\x74\42\x3a\x22" . $comment . "\x22\54\xa\40\40\x20\40\x22\x75\x74\155\137\x6d\145\x64\x69\x75\155\42\x3a\42" . $utm_medium . "\x22\54\xa\x20\x20\x20\x20\x22\165\164\155\137\163\x6f\x75\x72\x63\x65\x22\72\x22" . $utm_source . "\x22\54\12\40\40\40\x20\x22\143\157\x75\x6e\x74\162\171\137\x63\157\x64\145\42\72\42\53\x39\x31\42\54\xa\x20\x20\x20\x20\42\x63\x65\x6c\154\137\160\x68\x6f\x6e\x65\x22\72\x22" . $cell_phone . "\42\12\175";
goto McxDY;
uFMB4:
session_start();
goto hmlkw;
TErJq:
$refreshToken = $_REQUEST["\162\145\146\x72\145\x73\x68\x54\157\x6b\x65\156"];
goto w7MlF;
DuYcn:
$last_name = str_replace("\47", "\x60", $data->last_name);
goto nM7mF;
KUCNs:
if (time() - 3600 > $curr_time) {
    $curl = curl_init();
    curl_setopt_array($curl, array(CURLOPT_URL => "\x68\164\164\160\163\x3a\57\57\x64\x65\x76\x65\x6c\157\x70\x65\162\56\x73\x65\164\x6d\x6f\x72\145\x2e\143\x6f\155\x2f\141\160\151\x2f\166\61\x2f\x6f\57\x6f\x61\165\x74\150\62\x2f\x74\157\153\145\x6e\77\x72\x65\x66\162\145\163\x68\124\157\153\x65\x6e\75{$refreshToken}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "\x47\105\x54", CURLOPT_HTTPHEADER => array()));
    $response_access_token = curl_exec($curl);
    $response_access_token = json_decode($response_access_token, true);
    $err = curl_error($curl);
    if ($err) {
        $erro_when = "\124\162\171\x69\156\x67\40\164\157\x20\x67\x65\164\40\141\x63\143\x65\x73\163\40\x74\x6f\x6b\x65\x6e\40\x4c\151\156\145\x20\x4e\x6f\x2e\72\40\x35\62\54\40\x73\x61\x76\145\137\x61\160\x70\157\x69\x6e\164\x6d\145\x6e\164\x2e\x70\x68\160";
        $api_payload = "\x68\x74\x74\x70\163\72\57\x2f\144\145\x76\145\x6c\157\x70\x65\162\56\163\145\164\x6d\x6f\x72\145\56\x63\x6f\x6d\57\141\x70\x69\57\166\x31\57\x6f\x2f\x6f\141\x75\164\150\x32\x2f\x74\157\153\145\x6e\77\x72\145\146\162\x65\x73\x68\x54\x6f\153\x65\x6e\x3d{$refreshToken}";
        $sql_insert_error_1 = "\x49\116\x53\x45\x52\124\x20\x49\116\x54\x4f\40\163\145\164\x6d\x6f\162\x65\137\x65\x72\x72\x6f\x72\x73\40\12\40\40\40\40\x20\x20\40\40\x20\40\x20\x20\40\x20\x20\40\40\x20\40\x20\40\x20\x20\x20\40\40\x20\40\x28\145\162\162\x5f\x64\145\x74\x61\151\154\163\54\40\x65\162\x72\137\x77\150\x65\156\54\x20\x61\x70\x69\137\160\x61\x79\x6c\x6f\x61\x64\x2c\x20\144\x61\x74\145\137\141\x64\x64\x65\144\x29\40\126\x41\114\x55\105\123\x20\xa\40\x20\40\x20\40\40\x20\x20\40\40\x20\40\x20\40\40\x20\40\40\x20\x20\x20\x20\40\40\x20\x20\40\40\50\47{$err}\47\54\x20\x27{$err_when}\47\54\40\x27{$api_payload}\47\x2c\x20\47{$date_added}\x27\x29";
        mysqli_query($DBConnection, $sql_insert_error_1);
        die;
    }
    curl_close($curl);
    $access_token = $response_access_token["\144\x61\x74\141"]["\164\x6f\x6b\145\x6e"]["\141\x63\143\145\163\163\137\x74\x6f\153\145\x6e"];
    $sql_update_timestamp = "\x55\120\104\101\x54\105\x20\x73\145\164\155\157\162\145\137\163\x6c\157\164\x5f\x70\165\154\x6c\40\x53\105\x54\40\141\x63\143\x65\163\x73\137\x74\157\x6b\145\156\x20\x3d\x20\47{$access_token}\47\54\x20\144\141\x74\145\x5f\x75\160\x64\x61\x74\145\144\40\75\x20\x27{$date_added}\x27\40\x57\x48\x45\x52\105\x20\163\x65\164\155\x6f\162\x65\x5f\163\x6c\157\x74\x5f\x70\165\154\154\x5f\x69\x64\40\x3d\x20\47{$setmore_slot_pull_id}\47";
    mysqli_query($DBConnection, $sql_update_timestamp) or die(mysqli_error($DBConnection));
} else {
    $access_token = $rs_timestamp["\x61\x63\143\x65\x73\x73\137\x74\x6f\153\x65\x6e"];
}
goto gNFd8;
VktI0:
$email_id = $data->email_id;
goto Ex7qQ;
RdS4L:
header("\101\143\x63\x65\163\163\55\103\157\156\x74\162\x6f\x6c\x2d\x4d\141\170\x2d\x41\x67\145\72\40\63\66\60\60");
goto vfn6s;
dLQr1:
if ($access_token == '' || $first_name == '' || $email_id == '' || $cell_phone == '') {
    $json["\163\164\141\164\x75\x73"] = 400;
    $json["\x6d\x65\x73\x73\141\147\145"] = "\x61\143\143\145\x73\x73\40\x74\157\153\145\156\x20\x61\x6e\144\40\x6f\164\x68\x65\162\40\142\x61\163\x69\143\40\x64\x61\x74\x61\x20\x6d\x69\x73\163\x69\156\147";
    $json["\141\160\x69\137\156\x61\155\145"] = "\163\141\x76\x65\x5f\x61\160\x70\157\x69\156\164\155\145\156\x74";
    echo json_encode($json);
    die;
} else {
    $error_message = "\x62\x6f\157\x6b\151\x6e\x67\40\x64\141\164\141\x20\162\145\x63\x69\x65\166\145\144";
    $api_payload = "\x73\x65\x74\x6d\157\162\x65\57\141\160\151\57\166\x31\x2f\x62\x6f\x6f\x6b\x69\156\147\141\160\x69\x2f\143\x75\x73\164\x6f\155\145\x72\x2f\143\162\x65\x61\164\145";
    $sql_insert_data_recieved = "\x49\x4e\x53\105\x52\124\x20\111\x4e\124\117\x20\163\x65\164\x6d\x6f\x72\145\x5f\x65\162\162\x6f\x72\163\x20\xa\x20\40\x20\40\40\40\x20\x20\40\x20\40\x20\40\x20\40\x20\x20\x20\x20\40\40\x20\40\x20\x28\x65\x72\162\x5f\x64\x65\164\x61\151\154\163\54\40\x65\162\x72\x5f\x77\150\x65\x6e\54\x20\x61\160\x69\x5f\x70\141\x79\x6c\157\x61\x64\54\x20\144\141\x74\x65\x5f\x61\x64\144\145\144\x29\x20\x56\x41\114\125\x45\123\40\xa\40\40\40\x20\x20\40\x20\40\40\40\40\40\40\40\x20\40\40\x20\x20\40\x20\x20\x20\40\50\x27{$error_message}\47\x2c\x20\47{$str_data_receieved}\x27\54\40\47{$api_payload}\47\x2c\x20\47{$date_added}\47\51";
    mysqli_query($DBConnection, $sql_insert_data_recieved);
    if ($customer_key == '') {
        $str_payload = "\173\12\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x20\42\146\151\x72\x73\x74\x5f\x6e\141\x6d\145\42\72\42" . $first_name . "\42\x2c\x20\40\40\x20\x20\x20\xa\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\40\x20\42\154\141\x73\x74\x5f\156\141\x6d\x65\42\x3a\x22" . $last_name . "\x22\x2c\x20\40\40\x20\xa\40\40\40\40\x20\40\40\x20\x20\40\40\x20\x22\x65\x6d\141\151\154\x5f\151\144\x22\x3a\42" . $email_id . "\42\54\xa\x20\x20\x20\x20\40\40\x20\x20\x20\x20\40\x20\x22\143\157\165\x6e\x74\162\171\x5f\143\x6f\x64\x65\x22\x3a\x22\x2b\71\x31\42\x2c\12\40\x20\40\40\x20\40\x20\x20\x20\x20\40\x20\x22\x63\145\154\154\137\160\x68\157\156\x65\42\72\x22" . $cell_phone . "\x22\12\x20\40\40\x20\40\40\40\x20\175";
        $curl = curl_init();
        curl_setopt_array($curl, array(CURLOPT_URL => "\x68\164\x74\x70\x73\x3a\x2f\57\144\145\166\145\x6c\x6f\x70\145\162\56\x73\145\x74\x6d\x6f\x72\145\x2e\x63\157\x6d\x2f\x61\x70\151\x2f\x76\x31\x2f\x62\x6f\x6f\x6b\151\156\147\x61\x70\x69\57\x63\165\x73\164\x6f\x6d\x65\x72\57\x63\162\x65\x61\164\x65", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "\120\x4f\123\x54", CURLOPT_POSTFIELDS => "\x7b\xa\x20\40\x20\40\40\x20\x20\40\x20\40\x20\40\40\x20\40\40\40\x20\x20\x20\40\x20\40\40\x20\x20\40\40\x20\40\x20\x20\42\146\x69\x72\x73\x74\x5f\x6e\x61\155\145\42\x3a\x22" . $first_name . "\42\54\40\x20\40\40\x20\40\12\x20\40\40\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x22\154\x61\x73\164\x5f\156\x61\155\145\42\x3a\x22" . $last_name . "\42\x2c\x20\40\40\40\12\x20\40\40\x20\40\40\40\40\40\40\40\40\40\40\x20\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\40\x20\40\40\x20\x20\x22\x65\155\x61\x69\154\137\x69\x64\42\x3a\x22" . $email_id . "\x22\x2c\12\x20\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\40\x20\40\40\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\x20\x20\40\x22\143\x6f\x75\156\164\x72\171\137\143\x6f\x64\145\42\72\42\53\x39\x31\42\54\12\x20\x20\40\40\40\40\x20\x20\40\40\x20\40\x20\40\40\40\40\40\40\40\40\40\40\40\40\40\x20\x20\x20\x20\40\x20\42\143\x65\154\154\x5f\x70\x68\x6f\156\145\42\72\42" . $cell_phone . "\x22\xa\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\x20\40\40\x20\40\40\x20\40\x20\40\40\x20\40\x7d", CURLOPT_HTTPHEADER => array("\x41\x63\143\x65\x70\x74\x3a\40\x61\160\x70\154\151\143\x61\164\x69\x6f\x6e\x2f\152\163\157\156", "\103\x6f\x6e\164\x65\x6e\x74\55\x54\x79\160\x65\72\x20\141\x70\160\x6c\151\x63\x61\x74\x69\x6f\x6e\57\x6a\163\x6f\x6e", "\101\165\x74\150\157\162\151\172\141\x74\x69\157\156\x3a\40\102\x65\x61\x72\145\162\40{$access_token}")));
        $response = curl_exec($curl);
        $response_decoded = json_decode($response, true);
        $err = curl_error($curl);
        if ($err) {
            $err_when = "\124\x72\x79\x69\156\x67\x20\164\x6f\x20\143\162\x65\x61\x74\145\40\x63\x75\163\x74\157\x6d\x65\x72\40\x4c\x69\156\145\40\116\x6f\56\x3a\40\x32\62\64\x2c\x20\163\x61\x76\145\x5f\x61\x70\x70\157\x69\x6e\x74\x6d\x65\x6e\164\x2e\x70\150\160";
            $api_payload = "\163\145\164\155\x6f\162\x65\57\141\160\x69\x2f\166\61\x2f\142\x6f\157\x6b\x69\156\147\141\160\151\57\x63\x75\163\x74\x6f\155\145\162\x2f\x63\x72\145\141\164\145\x2c\40\160\x61\171\x6c\157\141\144\x3a\40" . $str_payload;
            $sql_insert_error_2 = "\111\116\123\105\x52\124\x20\x49\x4e\124\x4f\40\163\x65\164\x6d\x6f\x72\x65\x5f\x65\162\162\x6f\x72\163\x20\xa\40\40\40\x20\x20\x20\x20\40\x20\40\40\40\40\x20\40\x20\40\40\40\40\x20\x20\40\x20\40\40\x20\x20\40\x20\x20\40\x28\x65\x72\162\137\144\145\x74\x61\x69\154\163\x2c\x20\x65\x72\162\x5f\x77\150\145\156\54\40\141\x70\151\137\x70\x61\x79\154\157\x61\144\54\x20\144\141\x74\145\x5f\x61\144\144\145\x64\51\x20\x56\x41\114\x55\105\x53\40\xa\x20\40\40\x20\x20\40\40\40\40\40\40\40\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\x20\40\40\40\40\40\40\x20\x20\x28\47{$err}\47\54\40\47{$err_when}\x27\54\40\47{$api_payload}\x27\x2c\x20\47{$date_added}\47\x29";
            mysqli_query($DBConnection, $sql_insert_error_2);
            die;
        }
        curl_close($curl);
        $customer_key = $response_decoded["\144\141\164\x61"]["\143\x75\163\164\157\x6d\x65\162"]["\153\x65\x79"];
        if ($err) {
            echo "\173\42\x73\164\141\164\165\163\x22\x3a\42\64\60\x30\x22\54\x22\x6d\145\x73\163\141\147\145\42\x3a\42\105\x72\x72\157\162\x20\x73\141\x76\151\156\147\40\x63\165\163\x74\x6f\155\145\162\x22\x2c\42\144\145\164\x61\151\x6c\163\42\72\42" . $err . "\42\x7d";
            die;
        } else {
            if ($customer_key == '') {
                echo "\173\42\x73\164\x61\x74\165\x73\42\72\x22\64\60\x30\x22\x2c\x22\155\x65\x73\163\x61\147\x65\42\72\42\x45\162\162\157\162\40\x69\x64\x65\156\164\151\146\171\x69\x6e\147\x20\x63\165\x73\x74\157\155\x65\162\x22\x7d";
                die;
            }
        }
    }
    $sql_get_doc_id = "\123\x45\114\x45\x43\x54\40\163\x61\x2e\144\157\143\x5f\x69\x64\x20\12\x20\x20\x20\40\40\40\40\40\106\122\117\115\40\xa\40\x20\40\x20\x20\40\x20\40\x20\40\x20\40\163\x65\164\x6d\157\162\x65\x5f\x61\166\141\x69\154\141\x62\x69\154\x69\164\171\40\163\141\40\xa\x20\40\x20\40\40\40\x20\40\x49\116\116\105\x52\x20\112\117\x49\x4e\x20\163\145\x74\155\x6f\162\x65\x5f\x64\157\x63\137\x6d\141\x70\x70\151\x6e\x67\40\x64\x6d\40\x6f\156\x20\163\x61\x2e\x64\x6f\143\137\151\x64\x20\75\x20\144\155\x2e\x64\x6f\143\x5f\x69\x64\x20\12\40\x20\40\x20\40\40\40\40\127\x48\105\x52\x45\40\xa\x20\x20\40\x20\40\40\40\x20\40\40\40\40\x73\x61\x2e\x73\154\157\164\x5f\x69\144\x3d\40\x27{$slot_id}\47\x20\x41\x4e\104\40\xa\40\40\40\40\40\x20\40\40\40\40\40\40\x64\155\56\163\145\162\x76\x69\143\x65\x5f\x69\144\75\x20\x27{$service_id}\x27\40\101\x4e\x44\40\12\x20\40\40\x20\40\x20\x20\x20\x20\40\40\x20\163\x61\x2e\151\x73\137\141\x76\x61\151\154\x61\142\x6c\145\75\61\x20\12\x20\x20\x20\40\x20\40\x20\40\x4f\x52\x44\x45\x52\40\102\x59\x20\162\141\x6e\144\x28\51\x20\12\x20\x20\x20\40\40\40\x20\40\114\x49\115\x49\124\x20\x31";
    $rs_get_doc_id = mysqli_query($DBConnection, $sql_get_doc_id) or die(mysqli_error($DBConnection));
    $row_get_doc_id = mysqli_fetch_assoc($rs_get_doc_id);
    $doc_id = $row_get_doc_id["\144\157\143\x5f\151\144"];
    if ($doc_id == '') {
        $json["\163\x74\141\164\165\x73"] = 400;
        $json["\x6d\145\x73\x73\141\147\145"] = "\165\x6e\141\x62\154\145\x20\164\x6f\40\x67\x65\x74\40\x64\157\x63\164\157\162";
        $json["\141\x70\x69\x5f\x6e\141\x6d\145"] = "\163\x61\166\x65\137\x61\x70\x70\x6f\x69\156\164\155\x65\x6e\x74";
        echo json_encode($json);
        die;
    } else {
        $curl = curl_init();
        $str_payload_2 = "\173\12\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\42\x73\164\141\146\x66\137\x6b\x65\171\42\x3a\40\42" . $doc_id . "\x22\54\xa\x20\40\x20\40\40\x20\40\x20\x20\40\x20\40\42\163\x65\x72\x76\x69\143\x65\x5f\x6b\x65\x79\x22\x3a\x20\42" . $service_id . "\42\x2c\xa\x20\x20\40\x20\x20\40\x20\x20\x20\x20\x20\40\x22\x63\165\163\x74\157\155\145\x72\x5f\153\145\x79\42\72\x20\42" . $customer_key . "\42\54\12\40\40\x20\x20\40\x20\40\x20\x20\x20\40\40\x22\163\x74\141\162\x74\137\x74\151\x6d\145\x22\72\40\x22" . $start_time . "\x22\54\xa\x20\40\x20\40\40\40\x20\x20\x20\40\x20\x20\x22\x65\x6e\x64\137\x74\151\155\145\42\x3a\x20\x22" . $end_time . "\x22\54\xa\x20\x20\40\x20\40\40\40\x20\40\x20\x20\40\x22\x63\x6f\155\x6d\145\156\164\x22\72\40\42" . $comment . "\42\xa\40\40\40\x20\x20\x20\40\x20\175";
        curl_setopt_array($curl, array(CURLOPT_URL => "\150\x74\x74\x70\x73\x3a\x2f\57\144\x65\166\x65\154\157\x70\x65\x72\56\x73\x65\164\155\157\x72\x65\56\143\157\155\x2f\141\160\x69\57\x76\61\x2f\142\x6f\157\153\151\156\x67\x61\160\x69\57\141\160\160\x6f\151\156\164\155\x65\x6e\164\57\x63\162\145\141\x74\x65", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "\120\x4f\x53\124", CURLOPT_POSTFIELDS => "\x7b\12\40\x20\40\x20\40\40\x20\x20\40\x20\40\x20\x20\x20\40\40\40\x20\40\40\40\x20\40\40\40\40\40\40\40\x20\40\40\x22\163\x74\x61\x66\x66\137\x6b\x65\x79\42\72\x20\42" . $doc_id . "\x22\54\xa\x20\x20\40\40\40\x20\40\x20\40\40\40\x20\40\x20\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\40\40\40\40\x20\40\x22\163\145\162\x76\151\x63\145\x5f\153\145\x79\42\72\x20\x22" . $service_id . "\42\54\xa\40\x20\x20\40\40\40\x20\x20\40\x20\x20\40\40\40\x20\40\x20\x20\x20\40\x20\40\40\40\40\40\x20\40\x20\40\x20\x20\x22\143\x75\163\164\157\x6d\x65\162\137\x6b\x65\171\x22\72\40\42" . $customer_key . "\42\54\12\x20\x20\x20\x20\40\x20\x20\40\x20\40\x20\x20\x20\40\40\40\40\x20\40\x20\40\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\x22\163\x74\x61\162\x74\137\164\x69\155\x65\x22\72\x20\x22" . $start_time . "\42\54\12\40\40\x20\x20\40\40\40\x20\x20\40\x20\40\x20\40\40\40\x20\40\x20\x20\40\40\40\x20\x20\40\40\x20\x20\x20\40\40\42\x65\156\x64\137\x74\151\x6d\x65\x22\x3a\x20\42" . $end_time . "\42\54\xa\40\40\40\40\40\x20\40\x20\x20\40\40\x20\40\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\x20\42\x63\x6f\x6d\155\145\156\164\42\x3a\40\42" . $comment . "\x22\xa\40\x20\40\x20\40\x20\x20\40\x20\x20\x20\40\x20\40\40\40\40\x20\40\40\x20\x20\40\x20\x20\x20\40\40\40\40\x20\x20\175", CURLOPT_HTTPHEADER => array("\101\x63\143\x65\x70\164\72\x20\x61\x70\160\x6c\151\143\141\164\151\157\156\57\x6a\163\157\x6e", "\103\157\x6e\x74\145\x6e\x74\x2d\x54\x79\x70\x65\x3a\x20\141\160\x70\x6c\x69\x63\141\164\151\x6f\156\57\x6a\x73\x6f\x6e", "\x41\x75\x74\150\157\x72\x69\172\x61\x74\x69\157\x6e\72\40\102\145\x61\x72\145\x72\x20{$access_token}")));
        $response_booking = curl_exec($curl);
        error_log($response_booking);
        $response_booking_decoded = json_decode($response_booking, true);
        $err = curl_error($curl);
        curl_close($curl);
        if ($err || $response_booking_decoded["\x72\x65\163\160\157\156\163\145"] != true) {
            $error_message = "\143\x72\145\141\x74\x69\x6e\x67\40\141\160\160\157\x69\x6e\164\155\145\156\x74";
            $str_data_receieved = "\x72\x65\163\160\157\x6e\163\x65\72\x20" . htmlentities($response_booking_decoded["\155\163\147"], ENT_QUOTES);
            $sql_insert_data_recieved_ERR = "\x49\x4e\x53\105\122\x54\x20\111\x4e\124\x4f\x20\x73\x65\164\155\157\162\x65\x5f\145\x72\162\157\x72\163\40\12\40\x20\40\40\40\x20\40\x20\40\40\40\40\40\40\40\x20\x20\x20\x20\x20\40\40\40\x20\x20\x20\x20\40\40\40\x20\40\50\145\x72\x72\x5f\x64\145\164\141\151\x6c\x73\54\x20\x65\x72\x72\x5f\167\150\145\156\54\40\x61\x70\x69\x5f\x70\x61\171\154\157\x61\x64\54\40\144\x61\164\145\137\141\144\x64\145\144\51\x20\x56\101\x4c\x55\105\x53\40\xa\40\x20\40\40\x20\40\x20\40\40\x20\x20\x20\40\x20\40\40\x20\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\40\50\47{$response_booking}\x27\x2c\40\x27{$str_payload_2}\47\54\40\47{$str_data_receieved}\x27\x2c\40\x27{$date_added}\47\51";
            error_log($response_booking);
            error_log($sql_insert_data_recieved_ERR);
            mysqli_query($DBConnection, $sql_insert_data_recieved_ERR);
            echo "\x7b\x22\163\x74\x61\x74\165\163\42\72\42\x34\60\60\42\x2c\42\x6d\145\163\x73\141\x67\x65\x22\x3a\42" . $response_booking_decoded["\x6d\x73\x67"] . "\x22\x2c\42\144\145\x74\x61\151\154\x73\x22\72\42" . $err . "\x22\175";
            die;
        } else {
            $appointment_key = $response_booking_decoded["\x64\141\164\141"]["\x61\x70\160\x6f\151\156\164\x6d\x65\x6e\x74"]["\153\x65\x79"];
            $start_time = $response_booking_decoded["\144\141\x74\x61"]["\141\160\x70\157\151\x6e\164\155\145\156\x74"]["\163\164\x61\x72\164\137\164\x69\x6d\145"];
            $appointment_date_arr = explode("\x54", $start_time);
            $appointment_date = $appointment_date_arr[0];
            $appointment_date_new = date("\155\x2f\x64\57\x59", strtotime($appointment_date));
            $appointment_date_db_dump = date("\131\x2d\x6d\x2d\144", strtotime($appointment_date));
            $start_time_new = date("\x68\72\151\x20\x41", strtotime($start_time));
            $end_time = $response_booking_decoded["\144\x61\164\141"]["\x61\x70\160\157\x69\x6e\x74\155\x65\x6e\164"]["\145\156\x64\x5f\164\151\x6d\x65"];
            $duration = $response_booking_decoded["\144\x61\164\x61"]["\x61\x70\160\x6f\x69\156\164\155\x65\x6e\x74"]["\x64\165\x72\x61\x74\x69\x6f\156"];
            $customer_key = $response_booking_decoded["\144\x61\164\x61"]["\x61\x70\160\157\151\x6e\x74\x6d\145\156\164"]["\143\x75\163\164\157\x6d\x65\162\x5f\153\x65\171"];
            $comment = $response_booking_decoded["\x64\x61\164\x61"]["\141\x70\160\157\x69\x6e\x74\155\x65\156\x74"]["\x63\157\x6d\x6d\145\x6e\x74"];
            $sql_update_is_available = "\x55\120\104\101\x54\105\x20\163\145\164\x6d\157\162\145\137\x61\166\x61\151\x6c\x61\x62\x69\x6c\x69\x74\171\x20\123\x45\x54\40\x69\x73\x5f\141\x76\x61\151\154\x61\x62\154\145\40\75\40\47\60\x27\x20\xa\40\x20\x20\40\40\40\x20\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\40\x20\40\40\x20\x20\40\x20\40\40\40\x57\110\x45\x52\105\40\144\157\143\x5f\151\144\x20\x3d\x20\47{$doc_id}\47\40\x41\x4e\x44\x20\x73\154\x6f\x74\137\x69\x64\40\75\x20\x27{$slot_id}\47";
            mysqli_query($DBConnection, $sql_update_is_available);
            $sql_insert_appointment = "\x49\x4e\123\105\x52\x54\x20\111\116\x54\117\x20\144\157\143\x5f\143\157\156\x73\165\154\164\x61\x74\x69\x6f\x6e\x20\12\x20\x20\x20\40\x20\x20\x20\x20\x20\x20\x20\40\x20\40\40\x20\40\40\40\40\40\x20\40\x20\40\40\x20\40\40\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\40\40\40\x20\50\141\x70\160\157\151\156\x74\x6d\145\156\x74\x5f\142\157\x6f\153\151\x6e\147\x5f\151\144\x2c\x20\140\142\157\157\x6b\151\x6e\x67\x5f\164\151\x6d\145\163\x74\x61\x6d\x70\140\54\40\163\154\x6f\x74\137\151\144\x2c\40\x60\x63\x75\163\x74\157\155\145\162\137\x6e\141\x6d\x65\140\x2c\x20\140\x6d\157\x62\x69\154\x65\x60\54\x20\140\x65\x6d\x61\x69\154\140\54\x20\x60\143\x6f\x6e\163\x75\x6c\x74\x61\164\x69\157\x6e\137\x64\x61\x74\x65\140\x2c\x20\x60\143\157\156\163\165\154\164\137\x74\151\x6d\145\140\54\40\x60\143\165\x73\x74\157\x6d\145\162\137\x73\x65\154\145\143\164\145\x64\137\164\150\145\x72\x61\x70\x79\x60\54\40\140\144\x6f\143\137\151\144\140\54\40\140\x63\165\163\164\x6f\155\x65\x72\x5f\x63\157\x6d\155\145\156\164\x73\140\x2c\x20\x60\x75\x74\x6d\x5f\163\157\165\162\143\145\140\54\x20\x60\x73\172\140\54\40\140\144\141\164\145\137\141\144\x64\x65\x64\140\54\40\140\144\141\x74\x65\137\x75\160\x64\141\164\145\x64\140\x2c\x20\140\x61\x63\164\151\x76\145\137\163\x74\x61\x74\165\x73\x60\x29\40\x56\101\x4c\x55\x45\123\x20\12\x20\x20\x20\40\x20\40\40\40\40\40\40\40\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\40\x20\40\40\40\40\x20\40\x20\40\x20\50\47{$appointment_key}\47\54\40\47{$start_time}\x27\x2c\x20\47{$slot_id}\47\x2c\x20\47{$name}\x27\54\x20\47{$cell_phone}\x27\x2c\x20\x27{$email_id}\x27\54\40\47{$appointment_date_db_dump}\47\54\40\47{$start_time_new}\47\x2c\40\47{$service_id}\x27\54\x20\47{$doc_id}\x27\x2c\x20\x27{$comment}\47\54\40\47{$utm_source}\x27\x2c\x20\x27{$utm_medium}\47\x2c\40\x27{$date_added}\x27\x2c\x20\x27{$date_added}\47\54\40\47\61\47\x29";
            mysqli_query($DBConnection, $sql_insert_appointment);
            $curl = curl_init();
            curl_setopt_array($curl, array(CURLOPT_URL => "\150\x74\x74\160\x73\72\57\x2f\x61\160\151\56\151\x6e\x2e\x77\x65\x62\145\156\x67\141\x67\x65\56\x63\157\x6d\57\x76\x31\x2f\141\x63\143\157\165\x6e\x74\x73\57" . $WebEngageServerLicense . "\57\165\x73\145\x72\x73", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "\x50\x4f\123\x54", CURLOPT_POSTFIELDS => "\x7b\xa\40\x20\x20\40\x20\x20\x20\x20\40\40\40\40\x20\x20\x20\40\40\40\40\x20\x20\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\40\40\x20\x20\40\x20\40\42\165\163\145\162\x49\144\42\72\x22" . $email_id . "\42\54\xa\x20\40\40\40\40\x20\40\40\40\x20\x20\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\40\x20\40\40\x20\40\x20\x20\40\x20\40\x20\x20\40\x20\x20\42\x65\x6d\141\151\154\x22\x3a\x22" . $email_id . "\x22\x2c\xa\40\40\x20\x20\40\40\x20\x20\40\x20\40\40\40\40\40\40\40\x20\x20\40\40\40\x20\x20\40\40\40\40\x20\40\40\40\x20\40\40\40\40\40\x20\40\x22\x70\x68\x6f\156\145\x22\72\42" . $cell_phone . "\42\54\xa\40\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\40\x20\40\40\40\40\40\40\40\x20\40\x20\x20\x20\40\40\x20\40\x20\40\40\x20\x20\x20\40\x20\x22\145\155\141\151\154\x4f\160\x74\111\x6e\x22\x3a\164\x72\x75\x65\54\12\x20\40\40\x20\x20\40\40\x20\40\40\40\x20\x20\40\40\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\40\x20\x20\x20\40\40\x20\40\40\40\x22\x77\150\141\164\x73\x61\160\160\117\x70\164\111\156\42\72\164\162\x75\x65\xa\x20\40\40\40\x20\x20\x20\40\x20\40\x20\40\x20\40\x20\40\40\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\40\x20\175", CURLOPT_HTTPHEADER => array($WebEngageAuthToken, "\103\157\156\164\x65\156\x74\x2d\x54\x79\x70\145\x3a\x20\141\160\160\x6c\151\143\x61\x74\151\157\156\57\x6a\163\x6f\156", "\101\143\x63\145\160\164\72\40\141\160\x70\x6c\151\x63\141\x74\151\157\156\57\152\x73\x6f\x6e")));
            $response = curl_exec($curl);
            $err = curl_error($curl);
            curl_close($curl);
            $str_payload_3 = "\173\12\40\40\x20\x20\x20\40\40\x20\40\40\40\40\x20\x20\40\x20\x20\40\40\40\42\165\163\x65\162\x49\144\x22\72\x22" . $email_id . "\x22\x2c\12\40\x20\x20\x20\x20\40\40\40\x20\x20\x20\40\40\x20\x20\x20\x20\40\40\x20\40\x20\x20\40\x22\x65\166\x65\x6e\x74\x4e\x61\x6d\x65\42\x3a\x20\x22\x64\143\137\x61\160\160\x6f\x69\156\x74\x6d\x65\x6e\164\137\x63\162\x65\141\x74\x65\144\42\x2c\xa\x20\40\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\40\40\40\40\x20\x20\40\40\40\x20\40\x22\145\x76\145\x6e\164\x44\x61\x74\x61\x22\x3a\x20\x7b\xa\40\40\40\40\x20\40\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\40\x20\40\x20\x20\x20\42\x43\x75\x73\x74\157\155\145\162\x5f\111\x64\x22\x3a\x22" . $email_id . "\x22\54\12\x20\x20\40\x20\x20\40\x20\x20\40\x20\x20\40\40\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\40\40\40\x20\40\x20\x20\40\42\x50\x68\x6f\156\x65\42\x3a\x22" . $cell_phone . "\x22\54\12\40\x20\x20\40\40\x20\x20\x20\40\40\40\40\x20\x20\x20\40\x20\40\x20\x20\40\40\40\40\40\x20\40\x20\40\x20\x20\40\x22\x45\155\x61\151\154\42\x3a\x22" . $email_id . "\42\x2c\xa\x20\x20\40\40\x20\x20\40\x20\40\x20\x20\40\40\x20\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\40\x20\x20\x20\40\x20\42\144\143\x5f\x73\157\154\165\164\151\x6f\156\137\x63\x61\164\x65\x67\157\x72\171\x22\x3a\x22" . $service_id . "\42\54\12\40\40\x20\40\x20\40\x20\40\40\40\40\40\x20\40\x20\x20\40\40\40\x20\40\40\40\40\x20\x20\40\40\40\x20\40\x20\42\x64\x63\137\141\x70\x70\157\x69\x6e\x74\155\145\156\x74\137\x64\x61\x74\145\42\x3a\x22" . $appointment_date_new . "\x22\54\12\x20\x20\40\x20\40\40\x20\x20\40\x20\x20\40\x20\40\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\40\40\40\40\40\x22\144\143\137\141\160\x70\157\151\x6e\x74\x6d\x65\x6e\164\137\151\144\x22\72\x22" . $appointment_key . "\42\54\xa\x20\x20\x20\x20\x20\40\x20\x20\40\x20\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\x20\40\40\x20\40\40\40\40\40\x20\40\x22\x64\x63\x5f\x61\x70\x70\x6f\x69\x6e\164\155\145\156\164\137\x74\x69\155\x65\42\72\42" . $start_time_new . "\x22\54\xa\x20\40\x20\40\x20\x20\40\x20\40\x20\40\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\x20\x20\x20\x20\x20\40\x20\x20\x20\40\x22\x64\x63\137\144\157\x63\x5f\x69\144\42\72\42" . $doc_id . "\x22\xa\x20\40\x20\40\x20\x20\x20\x20\40\40\40\40\40\40\40\x20\40\40\40\40\x7d\x7d";
            $curl = curl_init();
            curl_setopt_array($curl, array(CURLOPT_URL => "\x68\x74\164\x70\163\72\x2f\57\x61\x70\151\56\x69\x6e\x2e\167\145\x62\x65\x6e\147\141\x67\x65\x2e\x63\157\x6d\57\166\61\57\141\143\143\x6f\165\156\164\163\x2f" . $WebEngageServerLicense . "\57\145\x76\145\x6e\164\x73", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "\120\x4f\x53\x54", CURLOPT_POSTFIELDS => "\x7b\12\x20\40\x20\x20\x20\40\x20\40\40\40\40\40\40\x20\40\x20\40\40\x20\x20\x20\40\40\40\40\40\40\40\40\x20\40\40\40\40\40\40\40\40\40\x20\42\x75\163\145\162\x49\144\x22\x3a\x22" . $email_id . "\x22\54\12\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x20\x20\40\x20\x20\x20\x20\40\40\x20\x20\x20\40\40\x22\145\166\145\x6e\x74\x4e\141\155\x65\x22\x3a\x20\42\144\143\x5f\x61\x70\160\157\151\156\x74\155\x65\x6e\164\x5f\x63\x72\145\x61\x74\x65\x64\x22\54\xa\40\x20\40\40\40\40\x20\40\40\x20\x20\x20\40\40\40\40\x20\40\x20\40\40\40\40\x20\x20\x20\x20\x20\x20\40\40\40\x20\40\40\40\x20\40\x20\40\x20\x20\x20\x20\x22\x65\x76\x65\156\x74\104\141\164\141\42\x3a\x20\173\12\x20\40\x20\x20\40\x20\40\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\40\40\40\40\x20\x20\40\40\40\40\x20\x20\40\x20\x20\40\x20\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\40\x20\40\40\40\x20\x20\42\103\x75\x73\164\x6f\x6d\x65\x72\x5f\111\x64\x22\72\x22" . $email_id . "\42\54\xa\x20\x20\40\40\40\40\x20\40\40\x20\40\40\x20\x20\x20\x20\40\40\x20\x20\x20\x20\x20\40\40\x20\40\40\x20\x20\40\x20\40\40\x20\40\40\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\x20\40\40\x22\x50\x68\157\156\145\x22\x3a\42" . $cell_phone . "\42\54\12\x20\x20\x20\x20\x20\40\x20\x20\x20\40\40\40\40\40\x20\40\40\40\40\40\40\x20\40\40\40\40\40\x20\40\x20\x20\x20\x20\40\40\x20\40\x20\x20\40\40\40\x20\40\40\x20\x20\x20\x20\x20\x20\40\42\x45\155\141\x69\x6c\x22\72\x22" . $email_id . "\42\54\12\40\x20\x20\x20\40\40\40\40\40\x20\x20\x20\x20\40\x20\40\40\40\x20\x20\40\40\40\x20\40\40\40\x20\x20\x20\x20\40\x20\x20\x20\x20\x20\40\40\40\40\40\40\x20\40\x20\x20\40\40\x20\40\40\x22\144\143\137\x73\157\154\165\x74\151\x6f\156\137\x63\x61\164\x65\147\157\162\x79\42\72\42" . $service_id . "\42\54\xa\40\40\40\40\x20\x20\x20\40\x20\40\40\40\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\x20\40\x20\40\40\40\40\40\40\x20\40\x20\x20\x20\x20\x20\x20\40\40\40\40\x20\40\x20\x20\40\x22\x64\143\137\141\x70\x70\157\151\x6e\164\155\x65\156\164\x5f\144\141\164\145\x22\72\x22" . $appointment_date_new . "\x22\x2c\12\x20\x20\40\x20\x20\40\40\x20\40\40\x20\40\x20\40\40\40\x20\40\40\x20\x20\x20\x20\x20\40\x20\x20\40\40\x20\40\40\40\40\x20\x20\x20\40\x20\x20\40\40\x20\x20\40\40\x20\40\x20\40\40\40\x22\144\143\137\141\x70\160\157\151\x6e\164\x6d\145\156\164\137\x69\x64\42\x3a\x22" . $appointment_key . "\42\x2c\12\40\40\40\x20\x20\x20\40\40\40\40\40\40\x20\x20\x20\x20\x20\40\40\40\40\x20\40\x20\40\x20\x20\x20\x20\x20\40\40\x20\x20\40\x20\40\40\x20\x20\40\x20\40\x20\40\40\x20\x20\x20\x20\40\40\x22\144\x63\x5f\141\x70\160\157\x69\156\x74\155\x65\156\164\137\x74\x69\155\145\42\x3a\x22" . $start_time_new . "\42\x2c\12\x20\40\x20\40\40\40\40\x20\x20\40\40\40\x20\x20\x20\40\x20\40\x20\40\x20\40\40\x20\x20\x20\x20\40\x20\40\x20\x20\x20\40\x20\x20\40\40\40\x20\x20\x20\x20\40\40\40\40\x20\x20\40\40\40\42\x64\x63\137\x64\x6f\143\x5f\151\x64\x22\72\42" . $doc_id . "\42\xa\40\x20\x20\x20\40\40\x20\x20\40\x20\x20\40\40\40\x20\x20\40\x20\x20\x20\x20\x20\40\x20\40\40\40\40\x20\x20\40\40\40\40\40\40\x20\x20\x20\x20\175\175", CURLOPT_HTTPHEADER => array($WebEngageAuthToken, "\103\x6f\x6e\x74\145\x6e\x74\55\124\171\160\x65\72\40\141\x70\160\x6c\x69\143\141\x74\151\x6f\x6e\x2f\x6a\x73\x6f\x6e", "\x41\143\143\x65\160\x74\x3a\x20\141\160\x70\154\151\143\x61\164\x69\157\x6e\x2f\152\163\x6f\156")));
            $response = curl_exec($curl);
            $err = curl_error($curl);
            if ($err) {
            }
            curl_close($curl);
            require "\147\x6f\x6f\x67\154\145\137\163\x68\x65\x65\164\57\x76\145\156\144\x6f\162\x2f\x61\x75\x74\x6f\x6c\157\141\144\56\x70\150\x70";
            $todays_datetime = gmdate("\x59\x2d\x6d\55\x64\134\124\110\72\x69\x3a\x73\x5c\132");
            $client = new \Google_Client();
            $client->setApplicationName("\107\157\x6f\147\x6c\145\x20\x53\150\145\145\164\x73\x20\x61\x6e\x64\40\x50\x48\120");
            $client->setScopes(array(\Google_Service_Sheets::SPREADSHEETS));
            $client->setAccessType("\x6f\146\146\154\151\156\145");
            $client->setAuthConfig(__DIR__ . "\x2f\x67\157\157\x67\x6c\x65\137\163\x68\145\145\164\x2f\143\162\145\144\145\x6e\x74\151\141\x6c\x73\56\152\x73\157\156");
            $service = new Google_Service_Sheets($client);
            $spreadsheetId = "\x31\x49\x50\x76\x74\126\152\x73\123\x37\153\x4d\170\103\143\141\x72\x56\64\71\155\124\103\160\124\x66\137\x41\x6f\x67\x66\65\x78\151\67\x4b\126\x69\117\x4f\x42\55\x56\x38";
            $range = "\x41\x70\x70\x6f\151\156\164\x6d\x65\156\x74\x20\x4d\x61\x73\164\x65\162\x21\x42\x32\x3a\112";
            $values = array(array($todays_datetime, $name, $cell_phone, $email_id, $appointment_date_new, $start_time_new, $service_id, $doc_id, $utm_source, $utm_medium));
            $ValueRange = new Google_Service_Sheets_ValueRange();
            $ValueRange->setValues($values);
            $options = array("\166\x61\x6c\165\x65\x49\156\x70\x75\x74\117\160\164\151\x6f\156" => "\122\101\127");
            $service->spreadsheets_values->append($spreadsheetId, $range, $ValueRange, $options);
        }
        $data = array("\163\164\141\164\165\x73" => "\x32\x30\x30", "\155\145\x73\x73\141\x67\145" => "\101\160\160\157\x69\x6e\164\155\x65\156\164\40\143\x72\x65\x61\164\145\144\40\x73\165\x63\x63\145\x73\163\x66\165\154\x6c\171", "\x61\160\x70\157\151\x6e\164\x6d\x65\x6e\164\x5f\153\x65\x79" => $appointment_key, "\x73\164\141\146\146\x5f\x6b\145\x79" => $doc_id, "\163\164\141\162\164\137\164\151\155\145" => $start_time, "\145\x6e\144\137\164\x69\155\145" => $end_time, "\144\x75\x72\141\x74\151\157\x6e" => $duration, "\x63\165\163\x74\x6f\x6d\145\162\x5f\153\x65\x79" => $customer_key, "\143\157\155\x6d\145\156\x74" => $comment);
        header("\103\x6f\156\164\x65\x6e\164\x2d\164\171\160\145\x3a\x20\x61\160\x70\x6c\x69\x63\x61\164\x69\157\x6e\57\x6a\163\x6f\156");
        echo json_encode($data);
        die;
    }
}
goto CP72v;
Cghjx:
$rs_timestamp = mysqli_fetch_assoc($rs_timestamp);
goto S0jam;
CP72v: ?>

Function Calls

None

Variables

None

Stats

MD5 1d7a170648355c16a0ad214ec92543aa
Eval Count 0
Decode Time 73 ms