public function fetchCommentAction() { $start = $this->_getParam('start') ? $this->_getParam('start') : 0; $end = $this->_getParam('limit') ? $this->_getParam('limit') : 10; $modelComment = new Pandamp_Modules_Extension_Comment_Model_Comment(); $decorator = new Pandamp_BeanContext_Decorator($modelComment); $rowset = $decorator->fetchCommentAsEntity($start, $end); $num_rows = $modelComment->getNumOfComment(); $gShort = new Pandamp_Controller_Action_Helper_GetCatalogShortTitle(); $a = array(); $a['totalCount'] = $num_rows; $ii = 0; if ($a['totalCount'] != 0) { foreach ($rowset as $row) { $a['comment'][$ii]['guid'] = $row->getId(); $a['comment'][$ii]['title'] = $row->getTitle(); $a['comment'][$ii]['description'] = $row->getComment(); $a['comment'][$ii]['user_email'] = $row->getEmail(); $a['comment'][$ii]['guid_article'] = $row->getobjectId(); $a['comment'][$ii]['shortarticle'] = $gShort->getCatalogShortTitle($row->getobjectId()); $a['comment'][$ii]['createdby'] = $row->getName(); $a['comment'][$ii]['ip'] = $row->getIp() != 0 ? $row->getIp() : '-'; $a['comment'][$ii]['createdDate'] = Pandamp_Lib_Formater::get_date($row->getDate()); $a['comment'][$ii]['status'] = $row->getPublished(); $ii++; } } if ($a['totalCount'] == 0) { $a['comment'][0]['guid'] = 'XXX'; $a['comment'][0]['title'] = "No Data"; $a['comment'][0]['description'] = "-"; $a['comment'][0]['createdDate'] = ''; } echo Zend_Json::encode($a); }
public function getComment($parent) { $modelComment = new Pandamp_Modules_Extension_Comment_Model_Comment(); $decorator = new Pandamp_BeanContext_Decorator($modelComment); $rows = $decorator->getParentCommentAsEntity($parent); return $rows; }
function browseAction() { $r = $this->getRequest(); $page = $r->getParam('page'); $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); //$rowset = $decorator->fetchFromFolderAsEntity($page,0,0,'fg_'.$page.'_kategori'); $rowset = $decorator->fetchFromFolderAsEntity($page, 0, 0); $content = 0; $data = array(); foreach ($rowset as $row) { $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $title = $modelCatalogAttribute->getCatalogAttributeValue($row->getId(), 'fixedTitle'); $description = $modelCatalogAttribute->getCatalogAttributeValue($row->getId(), 'fixedDescription'); $data[$content][0] = $title; $data[$content][1] = $row->getCreatedDate(); $data[$content][2] = $description; $data[$content][3] = $row->getId(); $data[$content][4] = $row->getShortTitle(); $content++; } $num_rows = count($rowset); $this->view->numberOfRows = $num_rows; $this->view->data = $data; }
public function getFotoAttributeName($catalogGuid) { $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); $rowset = $decorator->getCatalogByGuidAsEntity($catalogGuid); if (isset($rowset)) { $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); } $title = $modelCatalogAttribute->getCatalogAttributeValue($rowset->getId(), 'fixedTitle'); return $title; }
function editAction() { $catalogGuid = $this->_getParam('catalogGuid') ? $this->_getParam('catalogGuid') : ''; $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); $rowset = $decorator->getCatalogByGuidAsEntity($catalogGuid); if ($rowset->getProfile() == 'klinik') { $this->_forward('answer.clinic', 'clinic_manager', 'admin', array('catalogGuid' => $catalogGuid)); } else { $gen = new Pandamp_Form_Helper_CatalogInputGenerator(); $aRender = $gen->generateFormEdit($catalogGuid); $this->view->aRenderedAttributes = $aRender; } }
public function getCatalogAttribute($catalogGuid, $value) { $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); $rowset = $decorator->getCatalogByGuidAsEntity($catalogGuid); if ($rowset) { $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $attr = $modelCatalogAttribute->getCatalogAttributeValue($rowset->getId(), $value); if (isset($attr) && !empty($attr)) { return $attr; } else { return 'No-Title'; } } }
public function getClinicCategory($catalogGuid) { $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); $rowset = $decorator->getCatalogByGuidAsEntity($catalogGuid); if ($rowset) { $category = $modelCatalogAttribute->getCatalogAttributeValue($rowset->getId(), 'fixedKategoriKlinik'); /* Get Category from profile clinic_category */ $findCategory = $decorator->getCatalogByGuidAsEntity($category); if (isset($findCategory)) { $category = $modelCatalogAttribute->getCatalogAttributeValue($findCategory->getId(), 'fixedTitle'); } return $category; } }
function detailAction() { $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); //$rowset = $decorator->fetchFromFolderAsEntity('lt4a607b5e3c2f2',0,20,'talks'); $rowset = $decorator->fetchFromFolderAsEntity('lt4a607b5e3c2f2', 0, 20); $content = 0; $data = array(); foreach ($rowset as $row) { $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $data[$content][0] = $modelCatalogAttribute->getCatalogAttributeValue($row->getId(), 'fixedTitle'); $data[$content][1] = $row->getId(); $data[$content][2] = $row->getShortTitle(); $data[$content][3] = $modelCatalogAttribute->getCatalogAttributeValue($row->getId(), 'fixedDescription'); $content++; } $num_rows = count($rowset); $this->view->numberOfRows = $num_rows; $this->view->data = $data; }
function terbaruAction() { $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); $rowset = $decorator->fetchFromFolderAsEntity('fb16', 0, 10); $content = 0; $data = array(); foreach ($rowset as $row) { $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $data[$content][0] = $modelCatalogAttribute->getCatalogAttributeValue($row->getId(), 'fixedTitle'); $data[$content][1] = $row->getShortTitle(); $data[$content][2] = date("d/m/y", strtotime($row->getCreatedDate())); $data[$content][3] = $row->getId(); $data[$content][4] = $modelCatalogAttribute->getCatalogAttributeValue($row->getId(), 'fixedDescription'); $content++; } $num_rows = count($rowset); $this->view->numberOfRows = $num_rows; $this->view->data = $data; }
private function uvote($catalogGuid) { // get current ip address $ip = Pandamp_Lib_Formater::getRealIpAddr(); // get votes $modelVote = new Pandamp_Modules_Extension_Vote_Model_Vote(); $decorator = new Pandamp_BeanContext_Decorator($modelVote); $rowRate = $decorator->getRatingAsEntity($catalogGuid, $ip); $val = $rowRate ? $rowRate->getValue() : 0; $counter = $rowRate ? $rowRate->getCounter() : 0; if ($counter < 1) { $count = 0; } else { $count = $counter; //how many votes total } $current_rating = $val; $tense = $count == 1 ? "vote" : "votes"; //plural form votes/vote $rating = @number_format($current_rating / $count, 1); $drawrating = '(' . $count . ' ' . $tense . ', average: ' . $rating . ' out of 5)'; return $drawrating; }
private function getCatalogShortTitle($catalogGuid) { $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); $rowset = $decorator->getCatalogByGuidAsEntity($catalogGuid); $st = $rowset->getShortTitle(); return $st; }
function detailAction() { $catalogGuid = $this->_getParam('guid') ? $this->_getParam('guid') : ''; $node = $this->_getParam('node') ? $this->_getParam('node') : ''; $npts = $this->_getParam('npts') ? $this->_getParam('npts') : ''; $nprt = $this->_getParam('nprt') ? $this->_getParam('nprt') : ''; if ($node) { $fd = $node; } if ($npts) { $fd = $npts; } if ($nprt) { $fd = $nprt; } $sReturn = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $sReturn = base64_encode($sReturn); $identity = Pandamp_Application::getResource('identity'); $loginUrl = $identity->loginUrl; //$loginUrl = ROOT_URL.'/helper/synclogin/generate/?returnTo='.$sReturn; $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); $rowset = $decorator->getCatalogByGuidAsEntity($catalogGuid); if (isset($rowset)) { $modelAsset = new Pandamp_Modules_Dms_Catalog_Model_AssetSetting(); $rowAsset = $modelAsset->find($catalogGuid)->current(); if ($rowAsset) { $rowAsset->valueInt = $rowAsset->valueInt + 1; } else { $rowAsset = $modelAsset->fetchNew(); $rowAsset->guid = $catalogGuid; $rowAsset->detail = $fd; $rowAsset->application = $rowset->getProfile(); $rowAsset->part = "MOST_READABLE_DATACENTER"; $rowAsset->valueInt = 1; $rowAsset->valueText = 'pusatdata'; } $rowAsset->save(); $auth = Zend_Auth::getInstance(); if ($rowset->getProfile() == 'kutu_putusan') { if (!$auth->hasIdentity()) { $this->_redirect($loginUrl); } } $rowsetCatalogAttributeJenis = $modelCatalogAttribute->getCatalogAttributeValue($rowset->getId(), 'prtJenis'); if (!empty($rowsetCatalogAttributeJenis)) { if ($rowsetCatalogAttributeJenis == 'Undang-Undang ' || $rowsetCatalogAttributeJenis == "uu" || $rowsetCatalogAttributeJenis == "pp" || $rowsetCatalogAttributeJenis == "Peraturan Pemerintah" || $rowsetCatalogAttributeJenis == "konstitusi") { } else { if (!$auth->hasIdentity()) { $this->_redirect($loginUrl . '?returnTo=' . $sReturn); //$this->_redirect($loginUrl); } else { $username = $auth->getIdentity()->username; $acl = Pandamp_Acl::manager(); $aReturn = $acl->getUserGroupIds($username); //print_r($aReturn[1]);die; if (isset($aReturn[0])) { if ($aReturn[0] == "member_gratis") { $this->_helper->redirector('restricted', "browser", 'hold'); } } } } } $this->view->catalogGuid = $catalogGuid; $this->view->node = $node; $this->view->npts = $npts; $this->view->nprt = $nprt; } }
function pengasuhAction() { $author = $this->_getParam('guid') ? $this->_getParam('guid') : ''; $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); $rowset = $decorator->getCatalogByGuidAsEntity($author); $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $this->view->author = $modelCatalogAttribute->getCatalogAttributeValue($rowset->getId(), 'fixedTitle'); $this->view->description = $modelCatalogAttribute->getCatalogAttributeValue($rowset->getId(), 'fixedSubTitle'); }
function listcommentAction() { $catalogGuid = $this->_getParam('guid') ? $this->_getParam('guid') : ''; $page = $this->_getParam('page') ? $this->_getParam('page') : 1; $limit = 25; $start = $limit * ($page - 1); sleep(2); $tblRelatedItem = new Pandamp_Modules_Dms_Catalog_Model_RelatedItem(); $rowset = $tblRelatedItem->fetchAll("relatedGuid='{$catalogGuid}' AND relateAs='RELATED_COMMENT'"); $relatedGuid = array(); foreach ($rowset as $related) { $relatedGuid[] = $related->itemGuid; } if ($relatedGuid) { $data = Pandamp_Lib_Formater::implode_with_keys(", ", $relatedGuid, "'"); $tblCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $rowset = $tblCatalog->fetchAll("guid in({$data}) AND status=99", '', $limit, $start); $rowset1 = $tblCatalog->fetchAll("guid in({$data}) AND status=99"); $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); $row = $decorator->getCatalogByGuidAsEntity($catalogGuid); $st = $row->getShortTitle(); $num_rows = count($rowset1); $numPage = ceil($num_rows / $limit); $pagination = ''; for ($i = 1; $i <= $numPage; $i++) { $pagination .= "<li><a href='/berita/baca/{$catalogGuid}/{$st}/p/{$i}' title='Halaman {$i}' rev='{$i}'>{$i}</a></li>"; } // check is AJAX request or not if (!$this->getRequest()->isXmlHttpRequest()) { $this->view->pagination = $pagination; } $this->view->catalogGuid = $catalogGuid; $this->view->numberOfRows = $num_rows; $this->view->rows = $rowset; $this->view->limit = $limit; } }
function detailIssueAction() { $catalogGuid = $this->_getParam('guid') ? $this->_getParam('guid') : ''; $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); $rowset = $decorator->getCatalogByGuidAsEntity($catalogGuid); if ($rowset) { $title = $modelCatalogAttribute->getCatalogAttributeValue($rowset->getId(), 'fixedTitle'); $subtitle = $modelCatalogAttribute->getCatalogAttributeValue($rowset->getId(), 'fixedSubTitle'); $description = $modelCatalogAttribute->getCatalogAttributeValue($rowset->getId(), 'fixedDescription'); $this->view->title = $title; $this->view->subtitle = $subtitle; $this->view->description = $description; $array_hari = array(1 => "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu", "Minggu"); $hari = $array_hari[date("N", strtotime($rowset->getCreatedDate()))]; $this->view->date = $hari . ', ' . date("d F Y", strtotime($rowset->getCreatedDate())); $this->view->catalogGuid = $catalogGuid; } }
/** * @todo SOLR for category clinic */ function kadetAction() { $this->_helper->layout->disableLayout(); $catalogGuid = $this->_getParam('guid') ? $this->_getParam('guid') : ''; $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $decorator = new Pandamp_BeanContext_Decorator($modelCatalog); $rowset = $decorator->getCatalogByGuidAsEntity($catalogGuid); if ($rowset) { $category = $modelCatalogAttribute->getCatalogAttributeValue($rowset->getId(), 'fixedKategoriKlinik'); /* Get Category from profile clinic_category */ $findCategory = $decorator->getCatalogByGuidAsEntity($category); if (isset($findCategory)) { //$category = $modelCatalogAttribute->getCatalogAttributeValue($findCategory->getId(),'fixedTitle'); $category = $findCategory->getId(); } } //$this->view->category = $category; //$c = str_replace(' ','%',$category); //$query = "kategori:$c status:99 -id:$catalogGuid;publishedDate desc"; $query = "profile:klinik kategoriklinik:{$category} status:99 -id:{$catalogGuid};publishedDate desc"; $indexingEngine = Pandamp_Search::manager(); $hits = $indexingEngine->find($query, 0, 10); $solrNumFound = count($hits->response->docs); $content = 0; $data = array(); for ($ii = 0; $ii < $solrNumFound; $ii++) { $row = $hits->response->docs[$ii]; $data[$content][0] = $row->id; $data[$content][1] = $row->title; $content++; } $num_rows = $solrNumFound; $this->view->numberOfRows = $num_rows; $this->view->data = $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); }