function browse($p, $pagesize, $pos)
 {
     $s = new Subclass($this->db_conn);
     $rows = $s->getList($p);
     $total = mysql_num_rows($rows);
     $limit_str = $this->limit($total, $pagesize, $pos);
     $lists = $s->getListArray($p, $limit_str);
     $query_str = "";
     $this->assign('p', $p);
     $this->assign('data', $s);
     $this->assign('lists', $lists);
     $this->assign('content_page', $this->template . $this->list_tpl);
     $this->pager($lists, $query_str);
     $this->output();
 }
 function selects($vars)
 {
     $vars = $_GET;
     $s_array = array();
     $c = new Subclass($this->db_conn);
     $p['cat_id'] = $vars['id'];
     $sublists = $c->getListArray($p);
     $result = count($sublists);
     $s_array[0]['id'] = "";
     $s_array[0]['name_cht'] = "[請選擇]";
     for ($i = 0; $i < $result; $i++) {
         //$s_array['id'] = $sublists[$i]['id'];
         //$s_array['name_cht'] = $sublists[$i]['name_cht'];
         $s_array[$i + 1]['id'] = $sublists[$i]['id'];
         $s_array[$i + 1]['name_cht'] = $sublists[$i]['name_cht'];
         //echo json_encode($s_array);
     }
     //$data = array("data"=>$s_array);
     //print_r($sublists[$i]['id']);return;
     echo json_encode($s_array);
 }
Ejemplo n.º 3
0
}
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();
 $p = array();
 $p['cat_id'] = '37';
 $lists = $s->getListArray($p);
 */
if ($cat_id == "") {