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 getCatalogSubTitle($catalogGuid) { $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $subTitle = $modelCatalogAttribute->getCatalogAttributeValue($catalogGuid, 'fixedSubTitle'); if (isset($subTitle) && !empty($subTitle)) { return $subTitle; } else { return 'No-Title'; } }
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; }
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 mitraKlinikAction() { $tblCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $rowset = $tblCatalog->fetchAll("guid!='lt4b1a5aadda0f1' AND profileGuid='partner'", 'createdDate DESC'); $content = 0; $data = array(); foreach ($rowset as $row) { $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $data[$content][0] = $modelCatalogAttribute->getCatalogAttributeValue($row->guid, 'fixedTitle'); $data[$content][1] = $modelCatalogAttribute->getCatalogAttributeValue($row->guid, 'fixedContent'); $data[$content][2] = $row->guid; $content++; } $num_row = count($rowset); $this->view->numberOfRows = $num_row; $this->view->aData = $data; }
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; }
function updateAction() { $catalogGuid = $this->_getParam('guid') ? $this->_getParam('guid') : ''; $value = $this->_getParam('value') ? $this->_getParam('value') : ''; $field = $this->_getParam('field') ? $this->_getParam('field') : ''; $tblCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $where2 = "catalogGuid='{$catalogGuid}' AND attributeGuid='{$field}'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if ($rowCatalogAttribute) { try { $rowCatalogAttribute->value = $value; $rowCatalogAttribute->save(); $response['success'] = true; $response['message'] = "Update successfully"; } catch (Exception $e) { $response['error'] = true; $response['message'] = $e->getMessage(); } } echo Zend_Json::encode($response); }
private function getcatalogshare($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); $title = $modelCatalogAttribute->getCatalogAttributeValue($rowset->getId(), 'fixedTitle'); $author = $modelCatalogAttribute->getCatalogAttributeValue($rowset->getId(), 'fixedAuthor'); $description = $modelCatalogAttribute->getCatalogAttributeValue($rowset->getId(), 'fixedDescription'); $array_hari = array(1 => "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu", "Minggu"); $hari = $array_hari[date("N", strtotime($rowset->getCreatedDate()))]; $publish = $hari . ', ' . date("d F Y", strtotime($rowset->getCreatedDate())); $tag = "Dipublikasikan : " . $publish . "\n"; $tag .= "Penulis : " . $author . "\n\n"; $tag .= $title . "\n\n\n"; if ($description) { $tag .= $description . "\n\n\n\n"; } return $tag; }
function _getNodes($node) { $a = array(); $tblRelatedItem = new Pandamp_Modules_Dms_Catalog_Model_RelatedItem(); $tblCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $where = "relatedGuid='{$node}' AND relateAs='RELATED_HISTORY'"; $rowsetRelatedItem = $tblRelatedItem->fetchAll($where); foreach ($rowsetRelatedItem as $row) { $aTmp2['node'] = $row->itemGuid; $aTmp2['nodeLeft'] = $row->itemGuid; $aTmp2['nodeRight'] = $node; $aTmp2['description'] = $row->description; $aTmp2['relationType'] = $row->relationType; $where2 = "catalogGuid='{$row->itemGuid}' AND attributeGuid='fixedTitle'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['title'] = $rowCatalogAttribute->value; } else { $aTmp2['title'] = 'No-Title'; } $where2 = "catalogGuid='{$row->itemGuid}' AND attributeGuid='fixedSubTitle'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['subTitle'] = $rowCatalogAttribute->value; } else { $aTmp2['subTitle'] = 'No-Title'; } $where2 = "catalogGuid='{$row->itemGuid}' AND attributeGuid='fixedDate'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['fixedDate'] = $rowCatalogAttribute->value; } else { $aTmp2['fixedDate'] = ''; } array_push($a, $aTmp2); } $where = "itemGuid='{$node}' AND relateAs='RELATED_HISTORY' AND relatedItemType >= 1"; $rowsetRelatedItem = $tblRelatedItem->fetchAll($where); foreach ($rowsetRelatedItem as $row) { $aTmp2['node'] = $row->relatedGuid; $aTmp2['nodeLeft'] = $node; $aTmp2['nodeRight'] = $row->relatedGuid; $aTmp2['description'] = $row->description; $aTmp2['relationType'] = $row->relationType; $where2 = "catalogGuid='{$row->relatedGuid}' AND attributeGuid='fixedTitle'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['title'] = $rowCatalogAttribute->value; } else { $aTmp2['title'] = 'No-Title'; } $where2 = "catalogGuid='{$row->relatedGuid}' AND attributeGuid='fixedSubTitle'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['subTitle'] = $rowCatalogAttribute->value; } else { $aTmp2['subTitle'] = 'No-Title'; } $where2 = "catalogGuid='{$row->relatedGuid}' AND attributeGuid='fixedDate'"; $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2); if (isset($rowCatalogAttribute->value)) { $aTmp2['fixedDate'] = $rowCatalogAttribute->value; } else { $aTmp2['fixedDate'] = ''; } array_push($a, $aTmp2); } return $a; }
protected function _postDelete() { $registry = Zend_Registry::getInstance(); $config = $registry->get(Pandamp_Keys::REGISTRY_APP_OBJECT); $cdn = $config->getOption('cdn'); //find related docs and delete them $tblRelatedItem = new Pandamp_Modules_Dms_Catalog_Model_RelatedItem(); $rowsetRelatedDocs = $tblRelatedItem->fetchAll("relatedGuid='{$this->guid}' AND relateAs IN ('RELATED_FILE','RELATED_IMAGE')"); if (count($rowsetRelatedDocs)) { foreach ($rowsetRelatedDocs as $rowRelatedDoc) { $tblCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $rowCatalog = $tblCatalog->find($rowRelatedDoc->itemGuid)->current(); $rowCatalog->delete(); } } if ($this->profileGuid == 'kutu_doc') { //get parentGuid $tblRelatedItem = new Pandamp_Modules_Dms_Catalog_Model_RelatedItem(); $rowsetRelatedItem = $tblRelatedItem->fetchAll("itemGuid='{$this->guid}' AND relateAs IN ('RELATED_FILE','RELATED_IMAGE')"); if (count($rowsetRelatedItem)) { foreach ($rowsetRelatedItem as $rowRelatedItem) { //must delete the physical files $rowsetCatAtt = $this->findDependentRowsetCatalogAttribute(); $systemname = $rowsetCatAtt->findByAttributeGuid('docSystemName')->value; $parentGuid = $rowRelatedItem->relatedGuid; //$sDir1 = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.$systemname; //$sDir2 = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.$parentGuid.DIRECTORY_SEPARATOR.$systemname; $sDir1 = $cdn['static']['dir']['files'] . "/" . $systemname; $sDir2 = $cdn['static']['dir']['files'] . "/" . $parentGuid . "/" . $systemname; $sDir1_Remote = $cdn['remote']['dir']['files'] . "/" . $systemname; $sDir2_Remote = $cdn['remote']['dir']['files'] . "/" . $parentGuid . "/" . $systemname; if (file_exists($sDir1)) { // delete file unlink($sDir1); // check remote file if (file_exists($sDir1_Remote)) { $this->remoteDeleteFile($sDir1_Remote); } } else { if (file_exists($sDir2)) { //delete file unlink($sDir2); // check remote file if (file_exists($sDir2_Remote)) { $this->remoteDeleteFile($sDir2_Remote); } } } $img1 = $cdn['static']['dir']['images'] . "/" . $systemname; $img2 = $cdn['static']['dir']['images'] . "/" . $parentGuid . "/" . $systemname; $img1_Remote = $cdn['remote']['dir']['images'] . "/" . $systemname; $img2_Remote = $cdn['remote']['dir']['images'] . "/" . $parentGuid . "/" . $systemname; if (file_exists($img1)) { // delete file unlink($img1); // check remote file if (file_exists($img1_Remote)) { $this->remoteDeleteFile($img1_Remote); } } else { if (file_exists($img2)) { //delete file unlink($img2); // check remote file if (file_exists($img2_Remote)) { $this->remoteDeleteFile($img2_Remote); } } } } } } //delete from table CatalogAttribute $tblCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $tblCatalogAttribute->delete("catalogGuid='{$this->guid}'"); //delete catalogGuid from table CatalogFolder $tblCatalogFolder = new Pandamp_Modules_Dms_Catalog_Model_CatalogFolder(); $tblCatalogFolder->delete("catalogGuid='{$this->guid}'"); //delete guid from table AssetSetting $tblAssetSetting = new Pandamp_Modules_Dms_Catalog_Model_AssetSetting(); $tblAssetSetting->delete("guid='{$this->guid}'"); //delete from table relatedItem $tblRelatedItem = new Pandamp_Modules_Dms_Catalog_Model_RelatedItem(); $tblRelatedItem->delete("itemGuid='{$this->guid}'"); $tblRelatedItem->delete("relatedGuid='{$this->guid}'"); $indexingEngine = Pandamp_Search::manager(); try { $hits = $indexingEngine->deleteCatalogFromIndex($this->guid); } catch (Exception $e) { } //delete physical catalog folder from uploads/files/[catalogGuid] //$sDir = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.$this->guid; $sDir = $cdn['static']['dir']['files'] . "/" . $this->guid; $sDir_Remote = $cdn['remote']['dir']['files'] . "/" . $this->guid; try { if (is_dir($sDir)) { rmdir($sDir); // check remote is_dir if (is_dir($sDir_Remote)) { $this->remoteRemoveDir($sDir_Remote); } } } catch (Exception $e) { } //$sDir = ROOT_DIR.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'images'; $sDir = $cdn['static']['dir']['images']; try { if (file_exists($sDir . "/" . $this->guid . ".gif")) { unlink($sDir . "/" . $this->guid . ".gif"); } if (file_exists($sDir . "/tn_" . $this->guid . ".gif")) { unlink($sDir . "/tn_" . $this->guid . ".gif"); } if (file_exists($sDir . "/" . $this->guid . ".jpg")) { unlink($sDir . "/" . $this->guid . ".jpg"); } if (file_exists($sDir . "/tn_" . $this->guid . ".jpg")) { unlink($sDir . "/tn_" . $this->guid . ".jpg"); } if (file_exists($sDir . "/" . $this->guid . ".jpeg")) { unlink($sDir . "/" . $this->guid . ".jpeg"); } if (file_exists($sDir . "/tn_" . $this->guid . ".jpeg")) { unlink($sDir . "/tn_" . $this->guid . ".jpeg"); } if (file_exists($sDir . "/" . $this->guid . ".png")) { unlink($sDir . "/" . $this->guid . ".png"); } if (file_exists($sDir . "/tn_" . $this->guid . ".png")) { unlink($sDir . "/tn_" . $this->guid . ".png"); } } catch (Exception $e) { } $sDir = $cdn['remote']['dir']['images']; try { if (file_exists($sDir . "/" . $this->guid . ".gif")) { $this->remoteDeleteFile($sDir . "/" . $this->guid . ".gif"); } if (file_exists($sDir . "/tn_" . $this->guid . ".gif")) { $this->remoteDeleteFile($sDir . "/tn_" . $this->guid . ".gif"); } if (file_exists($sDir . "/" . $this->guid . ".jpg")) { $this->remoteDeleteFile($sDir . "/" . $this->guid . ".jpg"); } if (file_exists($sDir . "/tn_" . $this->guid . ".jpg")) { $this->remoteDeleteFile($sDir . "/tn_" . $this->guid . ".jpg"); } if (file_exists($sDir . "/" . $this->guid . ".jpeg")) { $this->remoteDeleteFile($sDir . "/" . $this->guid . ".jpeg"); } if (file_exists($sDir . "/tn_" . $this->guid . ".jpeg")) { $this->remoteDeleteFile($sDir . "/tn_" . $this->guid . ".jpeg"); } if (file_exists($sDir . "/" . $this->guid . ".png")) { $this->remoteDeleteFile($sDir . "/" . $this->guid . ".png"); } if (file_exists($sDir . "/tn_" . $this->guid . ".png")) { $this->remoteDeleteFile($sDir . "/tn_" . $this->guid . ".png"); } } catch (Exception $e) { } }
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; } }
/** * @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 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); }
protected function _updateCatalogAttribute($rowsetCatalogAttribute, $catalogGuid, $attributeGuid, $value) { if ($rowsetCatalogAttribute->findByAttributeGuid($attributeGuid)) { $rowCatalogAttribute = $rowsetCatalogAttribute->findByAttributeGuid($attributeGuid); } else { $tblCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $rowCatalogAttribute = $tblCatalogAttribute->fetchNew(); $rowCatalogAttribute->catalogGuid = $catalogGuid; $rowCatalogAttribute->attributeGuid = $attributeGuid; } $rowCatalogAttribute->value = $value; $rowCatalogAttribute->save(); }
function saveAction() { $response = array(); $request = $this->getRequest(); $tblCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $auth = Zend_Auth::getInstance(); if ($auth->hasIdentity()) { $userName = $auth->getIdentity()->username; } $gman = new Pandamp_Core_Guid(); $catalogGuid = $request->getParam('guid') ? $request->getParam('guid') : $gman->generateGuid(); $folderGuid = $request->getParam('folderGuid') ? $request->getParam('folderGuid') : ''; //if not empty, there are 2 possibilities $where = $tblCatalog->getAdapter()->quoteInto('guid=?', $catalogGuid); if ($tblCatalog->fetchRow($where)) { $rowCatalog = $tblCatalog->find($catalogGuid)->current(); $rowCatalog->shortTitle = $request->getParam('shortTitle'); $rowCatalog->publishedDate = $request->getParam('publishedDate'); $rowCatalog->expiredDate = $request->getParam('expiredDate'); $rowCatalog->modifiedBy = $userName; $rowCatalog->modifiedDate = date("Y-m-d h:i:s"); $rowCatalog->status = $request->getParam('status'); } else { $rowCatalog = $tblCatalog->fetchNew(); $rowCatalog->shortTitle = $request->getParam('shortTitle'); $rowCatalog->profileGuid = $request->getParam('profileGuid'); $rowCatalog->publishedDate = $request->getParam('publishedDate'); $rowCatalog->expiredDate = $request->getParam('expiredDate'); $rowCatalog->createdBy = $userName; $rowCatalog->modifiedBy = $userName; $rowCatalog->createdDate = date("Y-m-d h:i:s"); $rowCatalog->modifiedDate = date("Y-m-d h:i:s"); $rowCatalog->deletedDate = '0000-00-00 00:00:00'; $rowCatalog->status = $request->getParam('status'); } $catalogGuid = $rowCatalog->save(); $tableProfileAttribute = new Pandamp_Modules_Dms_Profile_Model_ProfileAttribute(); $profileGuid = $rowCatalog->profileGuid; $where = $tableProfileAttribute->getAdapter()->quoteInto('profileGuid=?', $profileGuid); $rowsetProfileAttribute = $tableProfileAttribute->fetchAll($where, 'viewOrder ASC'); $rowsetCatalogAttribute = $rowCatalog->findDependentRowsetCatalogAttribute(); foreach ($rowsetProfileAttribute as $rowProfileAttribute) { if ($rowsetCatalogAttribute->findByAttributeGuid($rowProfileAttribute->attributeGuid)) { $rowCatalogAttribute = $rowsetCatalogAttribute->findByAttributeGuid($rowProfileAttribute->attributeGuid); } else { $tblCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $rowCatalogAttribute = $tblCatalogAttribute->fetchNew(); $rowCatalogAttribute->catalogGuid = $catalogGuid; $rowCatalogAttribute->attributeGuid = $rowProfileAttribute->attributeGuid; } $rowCatalogAttribute->value = $request->getParam($rowProfileAttribute->attributeGuid); $rowCatalogAttribute->save(); } //save to table CatalogFolder only if folderGuid is not empty if (!empty($folderGuid)) { $tblCatalogFolder = new Pandamp_Modules_Dms_Catalog_Model_CatalogFolder(); $rowsetCatalogFolder = $tblCatalogFolder->find($catalogGuid, $folderGuid); if (count($rowsetCatalogFolder) <= 0) { $rowCatalogFolder = $tblCatalogFolder->createRow(array('catalogGuid' => '', 'folderGuid' => '')); $rowCatalogFolder->catalogGuid = $catalogGuid; $rowCatalogFolder->folderGuid = $folderGuid; $rowCatalogFolder->save(); } } $response['success'] = true; echo Zend_Json::encode($response); }
public function fetchClinicAction() { $start = $this->_getParam('start') ? $this->_getParam('start') : 0; $end = $this->_getParam('limit') ? $this->_getParam('limit') : 10; $status = $this->_getParam('status') ? $this->_getParam('status') : 0; //$folderGuid = 'lt4a0a533e31979'; // Klinik $tblCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $rowset = $tblCatalog->fetchFromFolderAdminClinic($status, $start, $end); $a = array(); $a['totalCount'] = $tblCatalog->countCatalogsInFolderClinic($status); $now = date('Y-m-d H:i:s'); $ii = 0; if ($a['totalCount'] != 0) { foreach ($rowset as $row) { $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $a['clinic'][$ii]['guid'] = $row->guid; $a['clinic'][$ii]['title'] = $modelCatalogAttribute->getCatalogAttributeValue($row->guid, 'fixedCommentTitle'); $a['clinic'][$ii]['question'] = $modelCatalogAttribute->getCatalogAttributeValue($row->guid, 'fixedCommentQuestion'); $a['clinic'][$ii]['content'] = $modelCatalogAttribute->getCatalogAttributeValue($row->guid, 'fixedContent'); $findPartner = $tblCatalog->getCatalogByGuid($modelCatalogAttribute->getCatalogAttributeValue($row->guid, 'fixedSelect')); if ($findPartner) { $a['clinic'][$ii]['partner'] = $modelCatalogAttribute->getCatalogAttributeValue($findPartner->guid, 'fixedTitle'); } $a['clinic'][$ii]['createdby'] = $row->createdBy; $a['clinic'][$ii]['modifiedby'] = $row->modifiedBy; $a['clinic'][$ii]['createdDate'] = Pandamp_Lib_Formater::get_date($row->createdDate); if ($now <= $row->publishedDate && $row->status == 99) { $status = "publish_y"; } else { if (($now <= $row->expiredDate || $row->expiredDate == '0000-00-00 00:00:00') && $row->status == 99) { $status = "publish_g"; } else { if ($now > $row->expiredDate && $row->status == 99) { $status = "publish_r"; } else { if ($row->status == 0) { $status = "publish_x"; } else { if ($row->status == 1) { $status = "ruby"; } else { if ($row->status == 2) { $status = "pill"; } else { if ($row->status == -1) { $status = "disabled"; } } } } } } } $a['clinic'][$ii]['status'] = $status; $ii++; } } if ($a['totalCount'] == 0) { $a['clinic'][0]['guid'] = 'XXX'; $a['clinic'][0]['title'] = "No Data"; $a['clinic'][0]['question'] = "-"; $a['clinic'][0]['createdDate'] = ''; } echo Zend_Json::encode($a); }
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; } }
function completeorderAction() { $tblPaymentSetting = new Pandamp_Modules_Payment_Setting_Model_PaymentSetting(); $rowTaxRate = $tblPaymentSetting->fetchRow("settingKey='taxRate'"); $cart =& $_SESSION['jCart']; if (!is_object($cart)) { $cart = new jCart(); } // echo "<pre>"; // print_r($cart); // echo "</pre><br>"; if (empty($cart) || count($cart->items) == 0) { $this->_redirect(ROOT_URL . '/store/cartempty'); } $bpm = new Pandamp_Core_Hol_Catalog(); $result = array('subTotal' => 0, 'taxAmount' => 0, 'grandTotal' => 0, 'items' => array()); for ($iCart = 0; $iCart < count($cart->items); $iCart++) { $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $itemId = $cart->items[$iCart]; $qty = $cart->itemqtys[$itemId]; $itemPrice = $bpm->getPrice($itemId); $result['items'][$iCart]['itemId'] = $itemId; $result['items'][$iCart]['item_name'] = $modelCatalogAttribute->getCatalogAttributeValue($itemId, 'fixedTitle'); $result['items'][$iCart]['itemPrice'] = $itemPrice; $result['items'][$iCart]['itemTotal'] = $qty * $itemPrice; $result['items'][$iCart]['qty'] = $qty; $result['subTotal'] += $itemPrice * $qty; } $result['taxAmount'] = $result['subTotal'] * $rowTaxRate->settingValue / 100; $result['grandTotal'] = $result['subTotal'] + $result['taxAmount']; // echo "Result : <br><br><pre>"; // print_r($result); // echo "</pre><br>"; // die; $method = $this->_request->getParam('paymentMethod'); $orderId = $this->saveOrder($result, $method); // $cart = null; $data = $this->_request->getParams(); $this->view->cart = $result; $this->view->data = $data; $this->view->orderId = $orderId; $modDir = $this->getFrontController()->getModuleDirectory(); require_once $modDir . '/models/Store/Mailer.php'; $mod = new Holsite_Model_Store_Mailer(); switch (strtolower($method)) { case 'manual': case 'bank': $mod->sendBankInvoiceToUser($orderId); break; case 'paypal': $mod->sendInvoiceToUser($orderId); break; case 'postpaid': $mod->sendInvoiceToUser($orderId); break; } }
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 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); }
public function fetchCatalogsInFolderAction() { $prof = $this->_getParam('prof') ? $this->_getParam('prof') : ''; $profAuth = $this->_getParam('profAuth') ? $this->_getParam('profAuth') : ''; $startdt = $this->_getParam('startdt') ? $this->_getParam('startdt') : ''; $enddt = $this->_getParam('enddt') ? $this->_getParam('enddt') : ''; $report = $this->_getParam('report') ? $this->_getParam('report') : ''; $start = $this->_getParam('start') ? $this->_getParam('start') : 0; $end = $this->_getParam('limit') ? $this->_getParam('limit') : 10; $folderGuid = $this->_getParam('folderGuid') ? $this->_getParam('folderGuid') : ''; $modelCatalog = new Pandamp_Modules_Dms_Catalog_Model_Catalog(); $a = array(); if ($startdt && $enddt) { if ($report == 'msk') { $rowset = $modelCatalog->fetchAll("createdDate BETWEEN '{$startdt}' AND '{$enddt}'", '', $end, $start); $rowCount = $modelCatalog->countCatalogsInBetween($startdt, $enddt); } elseif ($report == 'tbt') { $rowset = $modelCatalog->fetchAll("publishedDate BETWEEN '{$startdt}' AND '{$enddt}'", '', $end, $start); $rowCount = $modelCatalog->countCatalogsPubBetween($startdt, $enddt); } elseif ($prof !== "") { $rowset = $modelCatalog->fetchAll("createdDate BETWEEN '{$startdt}' AND '{$enddt}' AND profileGuid='{$prof}'", '', $end, $start); $rowCount = $modelCatalog->countCatalogsInBetweenProfile($startdt, $enddt, $prof); } $a['totalCount'] = $rowCount; } elseif ($prof) { $rowset = $modelCatalog->fetchAll("profileGuid = '{$prof}'", '', $end, $start); $rowCount = $modelCatalog->countCatalogsProfile($prof); $a['totalCount'] = $rowCount; } elseif ($profAuth) { $rowset = $modelCatalog->fetchAll("createdBy = '{$profAuth}'", '', $end, $start); $rowCount = $modelCatalog->countCatalogsForAuthor($profAuth); $a['totalCount'] = $rowCount; } else { $rowset = $modelCatalog->fetchCatalogInFolder($folderGuid, $start, $end); $a['totalCount'] = $modelCatalog->getCountCatalogsInFolder($folderGuid); } $now = date('Y-m-d H:i:s'); $ii = 0; if ($a['totalCount'] != 0) { foreach ($rowset as $row) { $modelCatalogAttribute = new Pandamp_Modules_Dms_Catalog_Model_CatalogAttribute(); $a['catalogs'][$ii]['guid'] = $row->guid; $a['catalogs'][$ii]['title'] = $modelCatalogAttribute->getCatalogAttributeValue($row->guid, 'fixedTitle'); $a['catalogs'][$ii]['subtitle'] = $modelCatalogAttribute->getCatalogAttributeValue($row->guid, 'fixedSubTitle'); $modelProfile = new Pandamp_Modules_Dms_Profile_Model_Profile(); $p = $modelProfile->getProfileByPG($row->profileGuid); $a['catalogs'][$ii]['profile_column'] = $p->title; $a['catalogs'][$ii]['createdby'] = $row->createdBy; $a['catalogs'][$ii]['modifiedby'] = $row->modifiedBy; $a['catalogs'][$ii]['createdDate'] = Pandamp_Lib_Formater::get_date($row->createdDate); if ($now <= $row->publishedDate && $row->status == 99) { $status = "publish_y"; } else { if (($now <= $row->expiredDate || $row->expiredDate == '0000-00-00 00:00:00') && $row->status == 99) { $status = "publish_g"; } else { if ($now > $row->expiredDate && $row->status == 99) { $status = "publish_r"; } else { if ($row->status == 0) { $status = "publish_x"; } else { if ($row->status == -1) { $status = "disabled"; } } } } } $a['catalogs'][$ii]['status'] = $status; $ii++; } } if ($a['totalCount'] == 0) { $a['catalogs'][0]['guid'] = 'XXX'; $a['catalogs'][0]['title'] = "No Data"; $a['catalogs'][0]['subtitle'] = "-"; $a['catalogs'][0]['createdDate'] = ''; } echo Zend_Json::encode($a); }