public function subcategoryAction()
 {
     $this->_helper->layout()->disableLayout();
     $this->_helper->viewRenderer->setNoRender();
     $id = $this->_getParam('id');
     $model = new Admin_Model_DbTable_Category();
     $data = $model->getSubCategory($id);
     if ($data != null) {
         $jsonArray = array();
         $cat = array();
         $tot = array();
         foreach ($data as $dat) {
             array_push($cat, $dat['name']);
             array_push($tot, array("", intval($dat['poi_count']), $dat['category_id']));
         }
         $jsonArray['category'] = $cat;
         $jsonArray['title'] = 'Total Budaya Per Sub Kategori Utama';
         $jsonArray['total'] = $tot;
         $jsonArray['xLabel'] = 'Kategory';
         $jsonArray['yLabel'] = 'Jumlah';
         echo json_encode($jsonArray);
     } else {
         echo json_encode(null);
     }
 }
Exemple #2
0
 protected function setOrdering($clientid, $type, $parentid)
 {
     $i = 1;
     $categories = $this->_helper->Categories->getCategories(null, $clientid, $type, $parentid);
     foreach ($categories as $category) {
         if ($category['ordering'] != $i) {
             if (!isset($categoriesDb)) {
                 $categoriesDb = new Admin_Model_DbTable_Category();
             }
             $categoriesDb->sortCategory($category['id'], $i);
         }
         ++$i;
     }
 }