function __construct($db_conn) { $this->db_conn = $db_conn; $this->template_dir = HTML_ROOT_PATH . "templates/"; $this->compile_dir = HTML_ROOT_PATH . "cache/"; $c = new Category($this->db_conn); $cat_lists = $c->getListArray(array()); $this->assign('cat_lists', $cat_lists); $this->assign('html_root', "/V2"); //$this->assign('header_page', $this->template."/admin/header.tpl"); //$this->assign('footer_page', $this->template."/admin/footer.tpl"); $this->assign('menu_page', $this->template . "/admin/menu.tpl"); //$this->assign('welcome_page', $this->template."/admin/welcome.tpl"); $this->assign('tab_panel', ",{ defaultPanel: 0 }"); }
function browse($p, $pagesize, $pos) { $c = new Category($this->db_conn); $rows = $c->getList($p); $total = mysql_num_rows($rows); $limit_str = $this->limit($total, $pagesize, $pos); $lists = $c->getListArray($p, $limit_str); $query_str = ""; $this->assign('p', $p); $this->assign('data', $c); $this->assign('lists', $lists); $this->assign('content_page', $this->template . $this->list_tpl); $this->pager($lists, $query_str); $this->output(); }
if ($_SESSION['charset'] != "") { $language = $_SESSION['charset']; } if ($language == "") { $language = "tw"; } if ($template == "") { $template = "default"; } $id = $_GET['id']; $cat_id = $_GET['cat_id']; $sub_id = $_GET['sub_id']; /*--------------------------------左列表-------------------------------------*/ $category = new Category(); $p1 = array(); $cat_lists = $category->getListArray($p1); //all category content $subclass = new Subclass(); foreach ($cat_lists as $value) { $pp['cat_id'] = $value['id']; $subcontent[$pp['cat_id']] = $subclass->getListArray($pp); //include cat_id all subclass content //print_r($subcontent[0]['name_cht']); return; } #print_r($subcontent['44']); /*---------------------------------------------------------------------------*/ /*$b = new Category(); $p = array(); $clists = $b->getListArray($p); $s = new Subclass();