Пример #1
0
$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++;
        }
    }
Пример #2
0
// 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']);
Пример #3
0
$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++;
        }
    }
Пример #4
0
// 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']);