HEX
Server: Apache/2.4.46 (Ubuntu)
System: Linux localhost 5.11.0-49-generic #55-Ubuntu SMP Wed Jan 12 17:36:34 UTC 2022 x86_64
User: root (0)
PHP: 7.4.16
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/sarvodayahospital/public/services/behealthy/online-doctor-consultation/processing.php
<?php
include('send-mail.php');
if(!empty($_POST))
{  
    // echo ('<pre>');
    // print_r($_POST);exit; 
    $pagename = isset($_POST['pagename']) ? $_POST['pagename'] : '';
    $name = isset($_POST['name']) ? $_POST['name'] : '' ;
    $mobile = isset($_POST['phone']) ? $_POST['phone'] : '' ;
    $email = isset($_POST['email']) ? $_POST['email'] : '' ;
    $message = isset($_POST['message']) ? $_POST['message'] : '' ;

    sendMail($pagename,$name,$mobile,$email,$message);
    sendUserMail($email,$name);

// API CRM Integration Start

$CenterName = "Grnow";
$source = "Landing Page";
$location = "Delhi-NCR";

$postdata = '[ 
            {
            "Attribute": "FirstName",
            "Value": "'.$name.'"
            }, 
            {
                "Attribute": "Source",
                "Value": "'.$source.'"
            },

            {
                "Attribute": "Phone",
                "Value": "'.$mobile.'"
            }, 
            {
                "Attribute": "Email",
                "Value": "'.$email.'"
            }, 
            {
                "Attribute": "mx_Department",
                "Value": "'.$pagename.'"
            },

            {
                "Attribute": "SearchBy",
                "Value": "Phone"
            }, 
            {
                "Attribute": "mx_Location",
                "Value": "'.$location.'"
            }, 
            {
                "Attribute": "Notes",
                "Value": "'.$message.'"
            }, 
            {
                "Attribute": "mx_Center_Name",
                "Value": "'.$CenterName.'"
            }, 
            {
                "Attribute": "mx_Sub_Source1",
                "Value": "'.$source.'"
            }
    ]';

if($postdata)
{
    // $data = json_encode($postdata);
    // print_r($postdata);die;
    $curl = curl_init();
    curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api-in21.leadsquared.com/v2/LeadManagement.svc/Lead.Capture?accesskey=u%24rd1ee5420d38698d2bcbba763efc36146&secretkey=dd27a1402a82e9e2ffd239b8a815a4f47e9ac1a7&LeadUpdateBehavior=DoNotUpdate',
    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 => $postdata,
    CURLOPT_HTTPHEADER => array(
        'Content-Type: application/json',
    ),
    ));

    $response = curl_exec($curl);

    $responseArray = json_decode($response,true);

    $postdataArray = json_decode($postdata,true);

    
    curl_close($curl);
    $responseRt = array();
    $responseRt['response'] = $responseArray;
    $responseRt['payload'] = $postdataArray;
    $responseRtjson = json_encode($responseRt);
    echo $responseRtjson;die;
} 

// API CRM Integration End 
}