function do_dl_csv($f3, $args) { if (!rStaff::_isLogin()) { return parent::_return(8001); } $rows = $this->_db->exec("SELECT * FROM `" . self::fmTbl() . "` ORDER BY insert_ts DESC "); if (!$rows) { header("Content-Type:text/html; charset=utf-8"); echo '無結果'; } else { $template = new Template(); f3()->set('rows', $rows); Outfit::_setXls("contact_" . date("YmdHis")); echo $template->render('contact.dl.html', "application/vnd.ms-excel"); } }