当前位置: 首页>>代码示例>>PHP>>正文


PHP CContact::searchContacts方法代码示例

本文整理汇总了PHP中CContact::searchContacts方法的典型用法代码示例。如果您正苦于以下问题:PHP CContact::searchContacts方法的具体用法?PHP CContact::searchContacts怎么用?PHP CContact::searchContacts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CContact的用法示例。


在下文中一共展示了CContact::searchContacts方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: w2PgetSysVal

$perms =& $AppUI->acl();
$countries = w2PgetSysVal('GlobalCountries');
// retrieve any state parameters
$searchString = w2PgetParam($_GET, 'search_string', '');
if ($searchString != '') {
    $AppUI->setState('ContIdxWhere', $searchString);
}
$where = $AppUI->getState('ContIdxWhere') ? $AppUI->getState('ContIdxWhere') : '%';
$orderby = 'contact_first_name';
$search_map = array($orderby, 'contact_first_name', 'contact_last_name');
// optional fields shown in the list (could be modified to allow brief and verbose, etc)
$showfields = array('contact_address1' => 'contact_address1', 'contact_address2' => 'contact_address2', 'contact_city' => 'contact_city', 'contact_state' => 'contact_state', 'contact_zip' => 'contact_zip', 'contact_country' => 'contact_country', 'contact_company' => 'contact_company', 'company_name' => 'company_name', 'dept_name' => 'dept_name', 'contact_phone' => 'contact_phone', 'contact_email' => 'contact_email', 'contact_job' => 'contact_job');
$contactMethods = array('phone_alt', 'phone_mobile', 'phone_fax');
$methodLabels = w2PgetSysVal('ContactMethods');
// assemble the sql statement
$rows = CContact::searchContacts($AppUI, $where);
$carr[] = array();
$carrWidth = 4;
$carrHeight = 4;
$rn = count($rows);
$t = ceil($rn / $carrWidth);
if ($rn < $carrWidth * $carrHeight) {
    $i = 0;
    for ($y = 0; $y < $carrWidth; $y++) {
        $x = 0;
        while ($x < $carrHeight && isset($rows[$i]) && ($row = $rows[$i])) {
            $carr[$y][] = $row;
            $x++;
            $i++;
        }
    }
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:index.php

示例2: sprintf

// Fields 66 - 70
$text .= sprintf("%s", "\"Gender\",\"Government ID Number\",\"Hobby\",\"Initials\",\"Internet Free Busy\",");
// Fields 71 - 75
$text .= sprintf("%s", "\"Keywords\",\"Language\",\"Location\",\"Manager's Name\",\"Mileage\",");
// Fields 76 - 80
$text .= sprintf("%s", "\"Notes\",\"Office Location\",\"Organizational ID Number\",\"PO Box\",\"Priority\",");
// Fields 81 - 85
$text .= sprintf("%s", "\"Private\",\"Profession\",\"Referred By\",\"Sensitivity\",\"Spouse\",");
// Fields 86 - 90
$text .= sprintf("%s", "\"User 1\",\"User 2\",\"User 3\",\"User 4\",\"Web Page\",");
$custom_fields = w2p_Core_CustomFields::getCustomFieldList('contacts');
foreach ($custom_fields as $f) {
    $text .= sprintf("%s", "\"{$f['field_description']}\",");
}
$text .= sprintf("%s\r\n", "");
$contactList = CContact::searchContacts();
foreach ($contactList as $contact) {
    $myContact = new CContact();
    $myContact->contact_id = $contact['contact_id'];
    $contactMethods = $myContact->getContactMethods();
    // Fields 1- 10
    $text .= sprintf("\"\",\"%s\",\"\",\"%s\",\"\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",", $contact['contact_first_name'], $contact['contact_last_name'], $contact['company_name'], $contact['dept_name'], $contact['contact_title'], $contact['contact_address1'], $contact['contact_address2']);
    // Fields 11- 20
    $text .= sprintf(",\"%s\",\"%s\",\"%s\",,,,,,,", $contact['contact_city'], $contact['contact_state'], $contact['contact_zip']);
    // Fields 21- 30
    $text .= sprintf(",,,,,,,,,,");
    // Fields 31- 40
    $text .= sprintf(",\"%s\",,,,,,,,,", $contact['contact_phone']);
    // Fields 41- 50
    settype($contactMethods['phone_mobile'], 'string');
    $text .= sprintf("\"%s\",,,,,,,,\"\",\"0/0/00\",", '' . $contactMethods['phone_mobile']);
开发者ID:,项目名称:,代码行数:31,代码来源:

示例3: w2PgetSysVal

$perms =& $AppUI->acl();
$countries = w2PgetSysVal('GlobalCountries');
// retrieve any state parameters
$searchString = w2PgetParam($_GET, 'search_string', '');
$AppUI->setState('ContIdxWhere', $searchString);
$where = $AppUI->getState('ContIdxWhere') ? $AppUI->getState('ContIdxWhere') : '%';
$tab = $AppUI->processIntState('ContactsIdxTab', $_GET, 'tab', 0);
$days = $tab == 0 ? 30 : 0;
$orderby = 'contact_first_name';
$search_map = array($orderby, 'contact_first_name', 'contact_last_name');
// optional fields shown in the list (could be modified to allow brief and verbose, etc)
$showfields = array('contact_address1' => 'contact_address1', 'contact_address2' => 'contact_address2', 'contact_city' => 'contact_city', 'contact_state' => 'contact_state', 'contact_zip' => 'contact_zip', 'contact_country' => 'contact_country', 'contact_company' => 'contact_company', 'company_name' => 'company_name', 'dept_name' => 'dept_name', 'contact_phone' => 'contact_phone', 'contact_email' => 'contact_email', 'contact_job' => 'contact_job');
$contactMethods = array('phone_alt', 'phone_mobile', 'phone_fax');
$methodLabels = w2PgetSysVal('ContactMethods');
// assemble the sql statement
$rows = CContact::searchContacts($AppUI, $where, '', $days);
$carr[] = array();
$carrWidth = 4;
$carrHeight = 4;
$rn = count($rows);
$t = ceil($rn / $carrWidth);
if ($rn < $carrWidth * $carrHeight) {
    $i = 0;
    for ($y = 0; $y < $carrWidth; $y++) {
        $x = 0;
        while ($x < $carrHeight && isset($rows[$i]) && ($row = $rows[$i])) {
            $carr[$y][] = $row;
            $x++;
            $i++;
        }
    }
开发者ID:,项目名称:,代码行数:31,代码来源:

示例4: sprintf

// Fields 66 - 70
$text .= sprintf("%s", "\"Gender\",\"Government ID Number\",\"Hobby\",\"Initials\",\"Internet Free Busy\",");
// Fields 71 - 75
$text .= sprintf("%s", "\"Keywords\",\"Language\",\"Location\",\"Manager's Name\",\"Mileage\",");
// Fields 76 - 80
$text .= sprintf("%s", "\"Notes\",\"Office Location\",\"Organizational ID Number\",\"PO Box\",\"Priority\",");
// Fields 81 - 85
$text .= sprintf("%s", "\"Private\",\"Profession\",\"Referred By\",\"Sensitivity\",\"Spouse\",");
// Fields 86 - 90
$text .= sprintf("%s", "\"User 1\",\"User 2\",\"User 3\",\"User 4\",\"Web Page\",");
$custom_fields = w2p_Core_CustomFields::getCustomFieldList('contacts');
foreach ($custom_fields as $f) {
    $text .= sprintf("%s", "\"{$f['field_description']}\",");
}
$text .= sprintf("%s\r\n", "");
$contactList = CContact::searchContacts($AppUI);
foreach ($contactList as $contact) {
    $myContact = new CContact();
    $myContact->contact_id = $contact['contact_id'];
    $contactMethods = $myContact->getContactMethods();
    // Fields 1- 10
    $text .= sprintf("\"\",\"%s\",\"\",\"%s\",\"\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",", $contact['contact_first_name'], $contact['contact_last_name'], $contact['company_name'], $contact['dept_name'], $contact['contact_title'], $contact['contact_address1'], $contact['contact_address2']);
    // Fields 11- 20
    $text .= sprintf(",\"%s\",\"%s\",\"%s\",,,,,,,", $contact['contact_city'], $contact['contact_state'], $contact['contact_zip']);
    // Fields 21- 30
    $text .= sprintf(",,,,,,,,,,");
    // Fields 31- 40
    $text .= sprintf(",\"%s\",,,,,,,,,", $contact['contact_phone']);
    // Fields 41- 50
    settype($contactMethods['phone_mobile'], 'string');
    $text .= sprintf("\"%s\",,,,,,,,\"\",\"0/0/00\",", '' . $contactMethods['phone_mobile']);
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:csvexport.php


注:本文中的CContact::searchContacts方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。