$cols = array('title', 'sku', 'size_code', 'color_name', 'qty'); $csv = new CSV_Table_Fu(); $csv->show_cols = $cols; $csv->print_csv_headers(SITE_DOMAIN_NAME . '-inventory_dump.csv'); $csv->dumpall($inv); exit; } $range = 50; $offset = isset($_GET['page']) ? ($_GET['page'] - 1) * $range : 0; /** go get im **/ $report = $prod->fetch_inventory_report($pid, $orby, $order_dir, $offset, $range, $filter_cat_id); /** list all cm_categories in one big ass dump using HTML_Table **/ $table = new fu_HTML_Table(array('width' => '90%', 'align' => 'center', 'style' => 'padding-top: 25px')); $table->setAutoGrow(true); $table->setAutoFill("-"); $xgets = $mosh->make_get_params($_GET, array('by', 'dir')); $table->addSortRow($header_row, $orby, null, 'TH', $xgets, $order_dir); $sep = strpos($_SERVER['REQUEST_URI'], '?') === false ? '?' : '&'; $csv_link = $_SERVER['REQUEST_URI'] . $sep . 'op_csv'; foreach ($report as $row) { $vals = array(); $link = null; if (isset($link_fmt)) { $args = array(); foreach ($link_vals as $v) { $args[] = $row[$v]; } $link = vsprintf($link_fmt, $args); } foreach (array_keys($header_row) as $k) { $vals[] = $row[$k];