コード例 #1
0
    $text .= sprintf("\"%s\",,,,,,,,\"\",\"0/0/00\",", '' . $contactMethods['phone_mobile']);
    // Fields 51- 60
    if ($contact['contact_type'] != '') {
        $categories = "web2Project; " . $contact['contact_type'];
    } else {
        $categories = "web2Project;";
    }
    $text .= sprintf(",,\"%s\",\"%s\",,,\"%s\",\"%s\",\"%s\",,", $contact['contact_birthday'], $categories, $contact['contact_email'], "SMTP", $contact['contact_first_name'] . " " . $contact['contact_last_name']);
    // Fields 61- 70
    $text .= sprintf(",,,,,\"Unspecified\",,,,,");
    // Fields 71- 80
    $notes = mb_str_replace("\"", "\"\"", $contact['contact_notes']);
    $text .= sprintf("\"\",\"\",\"\",,,\"%s\",,,,\"Normal\",", $notes);
    // Fields 81- 90
    $text .= sprintf("\"False\",,,\"Normal\",,,,,,,");
    $custom_fields = w2p_Core_CustomFields::getCustomFieldByModule($AppUI, 'contacts', $contact['contact_id']);
    if (count($custom_fields) > 0) {
        foreach ($custom_fields as $f) {
            if ($f['value_intvalue']) {
                $text .= sprintf("%s", $f['list_value'] . ",");
            } else {
                $text .= sprintf("%s", "\"" . mb_str_replace("\r\n", " ", $f['value_charvalue']) . "\",");
            }
        }
    }
    $text .= sprintf("%s\r\n", '');
}
//send http-output in csv format
// BEGIN extra headers to resolve IE caching bug (JRP 9 Feb 2003)
// [http://bugs.php.net/bug.php?id=16173]
header('Pragma: ');