function terbaruAction() { $time_start = microtime(true); $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $data = array(); $num_rows = $modelCatalog->getWartaCount("lt4a0a533e31979"); $limit = 50; $data['totalCount'] = $num_rows; $data['limit'] = $limit; $this->view->aData = $data; }
function indexAction() { $r = $this->getRequest(); $start = $r->getParam('start') ? $r->getParam('start') : 0; $limit = $r->getParam('limit') ? $r->getParam('limit') : 20; $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); //$rowset = $decorator->fetchFromFolderAsEntity('lt4a0a533e31979',$start,$limit,"indexklinik"); $rowset = $decorator->fetchFromFolderAsEntity('lt4a0a533e31979', $start, $limit); $a = array(); $solrNumFound = $modelCatalog->getWartaCount("lt4a0a533e31979"); $ii = 0; if ($solrNumFound == 0) { $a['terbaru'][0]['guid'] = 'XXX'; $a['terbaru'][0]['title'] = 'Kategori klinik kosong'; $a['terbaru'][0]['pertanyaan'] = ""; $a['terbaru'][0]['createdBy'] = ""; $a['terbaru'][0]['kategori'] = ''; $a['terbaru'][0]['author'] = ''; $a['terbaru'][0]['sumber'] = ''; } else { foreach ($rowset as $row) { $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $rowCatalogTitle = $modelCatalogAttribute->getCatalogAttributeValue($row->getId(), 'fixedCommentTitle'); $rowCatalogQuestion = $modelCatalogAttribute->getCatalogAttributeValue($row->getId(), 'fixedCommentQuestion'); $rowCatalogSelectCat = $modelCatalogAttribute->getCatalogAttributeValue($row->getId(), 'fixedKategoriKlinik'); $author = $modelCatalogAttribute->getCatalogAttributeValue($row->getId(), 'fixedSelectNama'); $source = $modelCatalogAttribute->getCatalogAttributeValue($row->getId(), 'fixedSelectMitra'); /* Get Category from profile clinic_category */ $findCategory = $decorator->getCatalogByGuidAsEntity($rowCatalogSelectCat); $category = $modelCatalogAttribute->getCatalogAttributeValue($findCategory->getId(), 'fixedTitle'); /* Get Author from profile author */ $findAuthor = $decorator->getCatalogByGuidAsEntity($author); $author = $modelCatalogAttribute->getCatalogAttributeValue($findAuthor->getId(), 'fixedTitle'); /* Get Source from profile partner */ $findSource = $decorator->getCatalogByGuidAsEntity($source); if ($findSource) { $source = $modelCatalogAttribute->getCatalogAttributeValue($findSource->getId(), 'fixedTitle'); } $a['terbaru'][$ii]['guid'] = $row->getId(); $a['terbaru'][$ii]['title'] = $rowCatalogTitle; $a['terbaru'][$ii]['pertanyaan'] = $rowCatalogQuestion; $a['terbaru'][$ii]['createdBy'] = 'Penanya:' . $row->getCreatedBy(); $a['terbaru'][$ii]['kategori'] = $category; $a['terbaru'][$ii]['author'] = 'Jawaban oleh : ' . $author; $a['terbaru'][$ii]['sumber'] = 'Sumber : ' . $source; $ii++; } } echo Zend_Json::encode($a); }
function detailIndexWartaWComAction() { $this->_helper->layout->disableLayout(); $folderGuid = $this->_getParam('folderGuid') ? $this->_getParam('folderGuid') : ''; $start = $this->_getParam('start') ? $this->_getParam('start') : 0; $limit = $this->_getParam('limit') ? $this->_getParam('limit') : 0; $a = array(); $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); //$rowset = $decorator->fetchFromFolderAsEntity($folderGuid,$start,$limit,'fg_'.$folderGuid.'_detail_iwarta_s_'.$start.'_e_'.$limit); $rowset = $decorator->fetchFromFolderAsEntity($folderGuid, $start, $limit); $a['folderGuid'] = $folderGuid; $a['totalCount'] = $modelCatalog->getWartaCount($folderGuid); $ii = 0; if ($a['totalCount'] != 0) { foreach ($rowset as $row) { $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $a['indexcom'][$ii]['title'] = $modelCatalogAttribute->getCatalogAttributeValue($row->getId(), 'fixedTitle'); $a['indexcom'][$ii]['shortTitle'] = $row->getShortTitle(); $a['indexcom'][$ii]['createdDate'] = date("d/m/y", strtotime($row->getCreatedDate())); $a['indexcom'][$ii]['guid'] = $row->getId(); $ii++; } } if ($a['totalCount'] == 0) { $a['indexcom'][0]['title'] = "-"; $a['indexcom'][0]['shortTitle'] = "-"; $a['indexcom'][0]['createdDate'] = "-"; $a['indexcom'][0]['guid'] = "-"; } echo Zend_Json::encode($a); }