'.$ab_search_for.': | ';
$_COOKIE['ab_search_type'] = isset($_COOKIE['ab_search_type']) ? $_COOKIE['ab_search_type'] : 'contacts';
$search_type = isset($_POST['search_type']) ? $_POST['search_type'] : $_COOKIE['ab_search_type'];
$dropbox = new dropbox();
$dropbox->add_value('contacts', $contacts_contacts);
$dropbox->add_value('companies', $ab_companies);
$dropbox->add_value('users', $contacts_members);
$dropbox->print_dropbox('search_type', $search_type, 'onchange="javascript:document.forms[0].submit()"');
echo ' | ';
$_COOKIE['ab_search_addressbook_id'] = isset($_COOKIE['ab_search_addressbook_id']) ? $_COOKIE['ab_search_addressbook_id'] : '0';
$search_addressbook_id = isset($_REQUEST['search_addressbook_id']) ? $_REQUEST['search_addressbook_id'] : $_COOKIE['ab_search_addressbook_id'];
if ($search_type != 'users' && $ab->get_subscribed_addressbooks($GO_SECURITY->user_id) > 1)
{
$subscribed_addressbooks = new dropbox();
$subscribed_addressbooks->add_value('0', $ab_all_your_addressbooks);
while ($ab->next_record())
{
$subscribed_addressbooks->add_value($ab->f('id'), $ab->f('name'));
}
echo ''.$ab_search_in.' | ';
$subscribed_addressbooks->print_dropbox('search_addressbook_id', $search_addressbook_id);
echo ' | ';
}else
{
echo '';
}
$_COOKIE['ab_search_companies_field'] = isset($_COOKIE['ab_search_companies_field']) ? $_COOKIE['ab_search_companies_field'] : 'name';
$_COOKIE['ab_search_contacts_field'] = isset($_COOKIE['ab_search_contacts_field']) ? $_COOKIE['ab_search_contacts_field'] : 'first_name';
$search_field = ($search_type == 'contacts' || $search_type == 'users') ? $_COOKIE['ab_search_contacts_field'] : $_COOKIE['ab_search_companies_field'];
$dropbox = new dropbox();
if ($search_type == 'companies')
{
$dropbox->add_value('name', $strName);
$dropbox->add_value('email', $strEmail);
$dropbox->add_value('address',$strAddress);
$dropbox->add_value('city', $strCity);
$dropbox->add_value('zip',$strZip);
$dropbox->add_value('state',$strState);
$dropbox->add_value('country', $strCountry);
}else
{
$dropbox->add_value('first_name', $strFirstName);
$dropbox->add_value('last_name', $strLastName);
$dropbox->add_value('email', $strEmail);
$dropbox->add_value('department',$strDepartment);
$dropbox->add_value('function',$strFunction);
$dropbox->add_value('address',$strAddress);
$dropbox->add_value('city', $strCity);
$dropbox->add_value('zip',$strZip);
$dropbox->add_value('state',$strState);
$dropbox->add_value('country', $strCountry);
$dropbox->add_value('comment', $ab_comment);
}
echo ''.$ab_search_on.' | ';
$dropbox->print_dropbox('search_field', $search_field);
echo ' |
|
';
?>