Ejemplo n.º 1
0
$text .= sprintf("%s", "\"Assistant's Name\",\"Billing Information\",\"Birthday\",\"Categories\",\"Children\",");
// Fields 56 - 60
$text .= sprintf("%s", "\"Directory Server\",\"E-mail Address\",\"E-mail Type\",\"E-mail Display Name\",\"E-mail 2 Address\",");
// Fields 61 - 65
$text .= sprintf("%s", "\"E-mail 2 Type\",\"E-mail 2 Display Name\",\"E-mail 3 Address\",\"E-mail 3 Type\",\"E-mail 3 Display Name\",");
// 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(",,,,,,,,,,");