hjkhghopjkertteerterterterertertrtoirh
bnmbertsurhetertertertertertertertpdf'tdfg
/
home
/
ubuntu
/
bmse.net
/
Upload FileeE
HOME
<?php ini_set("display_errors",1); include('includes/application_includes.php'); $accessToken= '1000.9d0872b2f124eb8b33e055ce6bf10a0f.2ac0bfe6602e985497010f10b57aeaa6'; $count = $db->getOne('SELECT count(*) from `bmse_members` WHERE `status`=1 AND `remove_flag`=1 and `zoho_itempkid_status`="NO" and `updated_to_zoho`="YES" order by `id` DESC'); echo $count; echo "<br/>"; //echo "yes"; //exit; $rows = $db->getRows('SELECT `id`, `email`, `name`, `companyname`, `phone`, `referred_by` from `bmse_members` WHERE `status`=1 AND `remove_flag`=1 and `zoho_itempkid_status`="NO" and `updated_to_zoho`="YES" and `email`!="" order by rand() limit 60'); //ArrayDisplay($rows); if (!empty($rows)) { $tag=''; $rowVal=0; foreach ($rows as $row) { $itempkid=$row['email']; echo $rowVal."<br/>"; echo $row['id']."<br/>"; echo $itempkid."<br/>"; echo 'https://www.zohoapis.com/crm/v2/Contacts/search?criteria=(Email:equals:'.$itempkid.')'; $searchRecord = callAPI('GET', 'https://www.zohoapis.com/crm/v2/Contacts/search?criteria=(Email:equals:'.$itempkid.')', '', $accessToken); $searchResponse = json_decode($searchRecord, true); //ArrayDisplay($searchResponse); # zoho tag insertion code ends here $record_id=$searchResponse['data'][0]['id']; echo "<br>"; echo $record_id; echo "<br>"; echo "<br/>"; if ($record_id) { $dataArray = array( "data" => array( array( "id" => $record_id, "itempkidtwo" => "exhi".$row['id'], "itemtype" => "becomeexhibitor" )), "trigger" =>array( "approval" ) ); $updateRecord = callAPI('PUT', 'https://www.zohoapis.com/crm/v2/Contacts/'.$record_id.'', json_encode($dataArray), $accessToken); $updateRecordresp = json_decode($updateRecord, true); //ArrayDisplay($updateRecordresp); $db->query('UPDATE `bmse_members` SET `zoho_itempkid_status`="YES" WHERE `id`='.$row['id'].''); //echo $row['email']."<br/>"; $rowVal++; } } } echo "Total Records Updated are : ".$rowVal; ?>