$target = md5('salt'.$_FILES['spec_file']['name']);
$path = 'sales/upload/'.$target;
move_uploaded_file($_FILES['spec_file']['tmp_name'], $path);
$UF_CRM_1552985294 = array('fileData'=>array($_FILES['spec_file']['name'], base64_encode(file_get_contents($path))));
$CB24 = new CB24;
$cur_deal = $CB24->method('crm.deal.update.json',array(
"id" => $dealid,
"fields" => [
'UF_CRM_1552985294' => $UF_CRM_1552985294,
],
)
);
<?
add_action('wpcf7_before_send_mail', 'save_form' );
function save_form( $wpcf7 ) {
global $wpdb;
/*
Note: since version 3.9 Contact Form 7 has removed $wpcf7->posted_data
and now we use an API to get the posted data.
*/
$submission = WPCF7_Submission::get_instance();
if ( $submission ) {
$submited = array();
$submited['title'] = $wpcf7->title();
$submited['posted_data'] = $submission->get_posted_data();
}
$data = array(
'name' => $submited['posted_data']['name'],
'email' => $submited['posted_data']['email']
);
}
if(!CModule::IncludeModule('crm')) die('error');
$res = CCrmContact::GetList($arOrder = array('DATE_CREATE' => 'DESC'), $arFilter = array("NAME"=>"Имя", "LAST_NAME"=>"Фамилия"), $arSelect = array(), $nPageTop = false);
while($ob = $res->GetNext()){
$arContacts = $ob;
}
class CB24{
// выполнить метод rest api
function method($auth, $method, $params){
$c=curl_init('https://'.$auth['DOMAIN'].'/rest/'.$method);
$params["auth"]=$auth['AUTH_ID'];
curl_setopt($c,CURLOPT_RETURNTRANSFER,true);
curl_setopt($c,CURLOPT_POST,true);
curl_setopt($c,CURLOPT_POSTFIELDS,http_build_query($params));
$response=curl_exec($c);
$response=json_decode($response,true);
return $response;
}
}
$CB24 = new CB24;
$cur_deal = $CB24->method($_REQUEST,'crm.lead.add.json',array(
'fields'=>array(
"TITLE" => 'test',
)
)
);
echo "<pre>";
print_r($cur_deal);
echo "</pre>";