| Server IP : 138.197.176.125 / Your IP : 216.73.217.122 Web Server : Apache/2.4.41 (Ubuntu) System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/jetcounter/ |
Upload File : |
<?php
// require_once('include/database/PearDatabase.php');
// require_once('include/utils/utils.php');
// global $adb;
error_reporting(0);
$master_URL = 'https://salesadmin.saleshiker.com/webservice.php';
$MasterUsername = 'admin';
$master_Key = 'oOOcmpri28kqHMwF';
require_once 'Zend/Loader.php';
require_once 'HTTP/Client.php';
$leadData['email'] = $_REQUEST['email'];
$leadData['lastname'] = "Test"; //Not getting from visitores
$leadData['company'] = $_REQUEST['company_name'];
$leadData['website'] = $_REQUEST['domain_name'];
$leadData['lang'] = $_REQUEST['lang'];
$leadData['assigned_user_id'] = 1;
$leadData['lead_tenant_status'] = 'Pending';
Zend_Loader::loadClass(Zend_Json);
if(!function_exists('getBody'))
{
function getBody($response) {
return Zend_Json::decode($response["body"]);
}
}
$httpc = new HTTP_CLIENT();
$httpc->get("$master_URL?operation=getchallenge&username=$MasterUsername");
$response = $httpc->currentResponse();
$jsonResponse = Zend_JSON::decode($response['body']);
if($jsonResponse['success']==false)
die('getchallenge failed:'.$jsonResponse['error']['errorMsg']);
$challengeToken = $jsonResponse['result']['token'];
$generatedKey = md5($challengeToken.$master_Key);
$httpc->post("$master_URL",
array('operation'=>'login', 'username'=>$MasterUsername, 'accessKey'=>$generatedKey), true);
$response = $httpc->currentResponse();
$jsonResponse = Zend_JSON::decode($response['body']);
if($jsonResponse['success']==false)
die('login failed:'.$jsonResponse['error']['errorMsg']);
$sessionId = $jsonResponse['result']['sessionName'];
$userId = $jsonResponse['result']['userId'];
$objectJson = Zend_JSON::encode($leadData);
$moduleName = 'Leads';
$params = array("sessionName"=>$sessionId, "operation"=>'create',
"element"=>$objectJson, "elementType"=>$moduleName);
$httpc->post("$master_URL", $params, true);
$response = $httpc->currentResponse();
print_r($response);exit;
$jsonResponse = Zend_JSON::decode($response['body']);
if($jsonResponse['success']==false)
die('create failed:'.$jsonResponse['error']['errorMsg']);
$leadid = explode("x", $jsonResponse['result']['id']);
$lead_id = $leadid[1];
// $sql = "update vtiger_leaddetails set lead_tenant_status='Pending' where leadid=$lead_id";
// $adb->pquery($sql, array());
echo $lead_id;
?>