本文整理汇总了PHP中Accounts::get_searchbyemailid方法的典型用法代码示例。如果您正苦于以下问题:PHP Accounts::get_searchbyemailid方法的具体用法?PHP Accounts::get_searchbyemailid怎么用?PHP Accounts::get_searchbyemailid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Accounts
的用法示例。
在下文中一共展示了Accounts::get_searchbyemailid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SearchContactsByEmail
function SearchContactsByEmail($username, $session, $emailaddress)
{
if (!validateSession($username, $session)) {
return null;
}
require_once 'modules/Contacts/Contacts.php';
require_once 'modules/Leads/Leads.php';
require_once 'modules/Accounts/Accounts.php';
$seed_contact = new Contacts();
$output_list = array();
//To avoid Blind SQL injection we are validating the Email address.
if (filter_var($emailaddress, FILTER_VALIDATE_EMAIL) == false) {
return null;
}
$response = $seed_contact->get_searchbyemailid($username, $emailaddress);
$contactList = $response['list'];
// create a return array of names and email addresses.
foreach ($contactList as $contact) {
$output_list[] = array("id" => $contact[contactid], "firstname" => decode_html($contact[firstname]), "lastname" => decode_html($contact[lastname]), "accountname" => decode_html($contact[accountname]), "emailaddress" => decode_html($contact[email]), "category" => "Contact");
}
// crm-now added Lead functionality
$seed_lead = new Leads();
$response2 = $seed_lead->get_searchbyemailid($username, $emailaddress);
$leadList = $response2['list'];
foreach ($leadList as $lead) {
$output_list[] = array("id" => $lead[leadid], "firstname" => decode_html($lead[firstname]), "lastname" => decode_html($lead[lastname]), "accountname" => decode_html($lead[company]), "emailaddress" => decode_html($lead[email]), "category" => "Lead");
}
// crm-now added Accounts functionality
$acc_lead = new Accounts();
$response3 = $acc_lead->get_searchbyemailid($username, $emailaddress);
$accList = $response3['list'];
foreach ($accList as $acc) {
$output_list[] = array("id" => $acc['accountid'], "firstname" => decode_html($acc['account_no']), "lastname" => decode_html($acc['accountname']), "accountname" => '', "emailaddress" => decode_html($acc['email1']), "category" => "Account");
}
// end crm-now
//to remove an erroneous compiler warning
$seed_contact = $seed_contact;
$seed_lead = $seed_lead;
$acc_lead = $acc_lead;
return $output_list;
}