public function _list() { $data=array(); $category = isset($_GET['category']) ? $_GET['category'] : '開戶文件'; $where_category = "`document`.`category`=:category"; $data[':category']=$category; $sql = "SELECT `document`.* FROM `document` WHERE ({$where_category}) "; $rowPerPage = isset($_GET['_rowPerPage']) ? $_GET['_rowPerPage'] : 10; $pageNo = isset($_GET['_pageNo']) ? $_GET['_pageNo'] : 0; $arrOrderBy = isset($_GET['_orderBy']) ? $_GET['_orderBy'] : array('`document`.`ord` ASC'); $pager = $this->db->queryFetchPage( $sql, $pageNo, $rowPerPage, $arrOrderBy, $data ); // list data $smarty = $this->createSmarty(); $smarty->assign( 'pager', $pager ); $smarty->assign( 'category', $category ); $smarty->assign( 'maxOrd', JTDocument::getMaxOrd('document',array('category'=>$category)) ); $smarty->display( dirname(__FILE__).'/list.tpl.htm' ); }