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 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; }
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'; } }
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; }
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 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; }
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'; } } }
/** * @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); }
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 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; } }
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); }
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 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 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 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); }