public function _list() { $data=array(); $category = isset($_GET['category']) ? $_GET['category'] : '銀行'; $where_category = "`saleschannel`.`category`=:category"; $data[':category']=$category; $sql = "SELECT `saleschannel`.* FROM `saleschannel` WHERE ({$where_category}) "; $rowPerPage = isset($_GET['_rowPerPage']) ? $_GET['_rowPerPage'] : 10; $pageNo = isset($_GET['_pageNo']) ? $_GET['_pageNo'] : 0; $arrOrderBy = isset($_GET['_orderBy']) ? $_GET['_orderBy'] : array('`saleschannel`.`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', JTSaleschannel::getMaxOrd('saleschannel',array('category'=>$category)) ); $smarty->display( dirname(__FILE__).'/list.tpl.htm' ); }