$record = array($ab->f("title"), $ab->f("first_name"), $ab->f("middle_name"), $ab->f("last_name"), $ab->f("initials"), $ab->f("sex"), $ab->f('birthday'), $ab->f("email"), $ab->f("country"), $ab->f("state"), $ab->f("city"), $ab->f("zip"), $ab->f("address"), $ab->f("home_phone"), $ab->f("work_phone"), $ab->f("fax"), $ab->f("work_fax"), $ab->f("cellular"), $ab->f("company"), $ab->f("department"), $ab->f("function"), $ab->f("comment"), $ab->f("group_name")); $col = 0; foreach ($record as $r) { $sheet->writeString($line, $col++, $vnconv->VnConv($r)); } $line++; } $xls->close(); // dump it out exit; } else { $headings = array($strName, $strCountry, $strState, $strCity, $strZip, $strAddress, $strEmail, $strPhone, $strFax, $strHomepage, $ab_bank_no, $ab_vat_no); $headings = $quote . implode($quote . $seperator . $quote, $headings) . $quote; echo $vnconv->VnConv($headings); echo $crlf; $ab->get_companies($_POST['addressbook_id']); while ($ab->next_record()) { $record = array($ab->f("name"), $ab->f("country"), $ab->f("state"), $ab->f("city"), $ab->f("zip"), $ab->f("address"), $ab->f("email"), $ab->f("phone"), $ab->f("fax"), $ab->f("homepage"), $ab->f("bank_no"), $ab->f('vat_no')); $record = $quote . implode($quote . $seperator . $quote, $record) . $quote; echo $vnconv->VnConv($record); echo $crlf; } } exit; } else { $addressbook = $ab->get_addressbook($addressbook_id); require $GO_CONFIG->class_path . "/phpvnconv/phpvnconv.class.inc"; $vnconv = new phpVnconv(); $vnconv->set_to("ascii"); $browser = detect_browser(); header("Content-type: text/x-csv");
$company['fax'] = isset($_REQUEST['fax']) ? smartstrip($_REQUEST['fax']) : ''; $company['homepage'] = isset($_REQUEST['homepage']) ? smartstrip($_REQUEST['homepage']) : 'http://'; $company['bank_no'] = isset($_REQUEST['bank_no']) ? smartstrip($_REQUEST['bank_no']) : ''; $company['vat_no'] = isset($_REQUEST['vat_no']) ? smartstrip($_REQUEST['vat_no']) : ''; $company['acl_write'] = 0; } $addressbook_id = isset($old_subscribed_addressbook_id) && $old_subscribed_addressbook_id > 0 ? $subscribed_addressbook_id : $company['addressbook_id']; $subscribed_addressbook_id = $addressbook_id; $cp = new addressbook(); $parent_dropbox = new dropbox(); $company['parent_id'] = 0; if ($company_id) { $cp->get_company($company_id); $company['parent_id'] = $cp->f('parent'); } $count = $cp->get_companies($addressbook_id); $parent_dropbox->add_value(0, $strNone); if ($count) { while ($cp->next_record()) { $id = $cp->f('id'); if ($id == $company_id) { continue; } $name = $cp->f('name'); $parent_dropbox->add_value($id, $name); } } $tabtable->print_head(); if ($tabtable->get_active_tab_id() > 0) { $catagory_id = $tabtable->get_active_tab_id(); $active_tab_id = 'custom_fields';