function browseAction() { /*if ($this->getRequest()->isXmlHttpRequest()) { $this->_helper->layout()->disableLayout(); }*/ $r = $this->getRequest(); $limit = $r->getParam('limit') ? $r->getParam('limit') : 10; $this->view->limit = $limit; $itemsPerPage = $limit; $this->view->itemsPerPage = $itemsPerPage; //$offset = ($r->getParam('offset'))?$r->getParam('offset'):0; //$this->view->offset = $offset; $pageIndex = $r->getParam('page', 1); $offset = $pageIndex > 0 ? ($pageIndex - 1) * $itemsPerPage : 0; $commentList = App_Model_Show_Comment::show()->fetchComment($offset, $limit); $this->view->commentList = $commentList; $numOfRows = (new App_Model_Db_Table_Comment())->fetchAll()->count(); //$totalItems = App_Model_Show_Comment::show()->getNumOfComment(); $paginator = Zend_Paginator::factory($numOfRows); $paginator->setCurrentPageNumber($pageIndex); $paginator->setItemCountPerPage($itemsPerPage); $this->view->assign('perpage', $itemsPerPage); //$this->view->assign('totalItems',$totalItems); $this->view->assign('paginator', $paginator); $this->view->assign('currentPageNumber', $paginator->getCurrentPageNumber()); //$this->_helper->layout()->headerTitle = "Comment"; }
/** * @return obj */ public function show() { if (!isset(self::$_instance)) { $show = __CLASS__; self::$_instance = new $show(); } return self::$_instance; }
function viewAction() { $r = $this->getRequest(); $catalogGuid = $r->getParam('guid'); $folderGuid = $r->getParam('node'); $rowSumComment = App_Model_Show_Comment::show()->getParentCommentCount($catalogGuid); $this->view->sumComment = $rowSumComment > 1 ? $rowSumComment . ' comments' : $rowSumComment . ' comment'; $this->view->numOfRows = $rowSumComment; $this->view->catalogGuid = $catalogGuid; $this->view->node = $folderGuid; }
function list4Action() { $catalogGuid = $this->_getParam('guid') ? $this->_getParam('guid') : ''; $page = $this->_getParam('page') ? $this->_getParam('page') : 1; $rows = App_Model_Show_Comment::show()->getCommentParentByGuidwAjax($catalogGuid); $num_rows = App_Model_Show_Comment::show()->getParentCommentCount($catalogGuid); $paginator = Zend_Paginator::factory($rows); $paginator->setItemCountPerPage(10); $paginator->setCurrentPageNumber($page); $this->view->paginator = $paginator; $this->view->rows = $rows; $this->view->numrows = $num_rows; }
function utamaAction() { $rowset = App_Model_Show_Catalog::show()->fetchFromFolder('lt4aaa29322bdbb', 0, 4); $content = 0; $data = array(); foreach ($rowset as $row) { $rowSumComment = App_Model_Show_Comment::show()->getParentCommentCount($row['guid']); $data[$content][0] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row['guid'], 'fixedTitle'); $data[$content][1] = strftime("%H:%M", strtotime($row['createdDate'])); $data[$content][2] = $row['guid']; $data[$content][3] = $row['shortTitle']; $data[$content][4] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row['guid'], 'fixedAuthor'); $data[$content][5] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row['guid'], 'fixedDescription'); $data[$content][6] = $rowSumComment; $content++; } $num_rows = count($rowset); $this->view->numberOfRows = $num_rows; $this->view->data = $data; }
function detailIndexWartaAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(TRUE); $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(); $rowset = App_Model_Show_Catalog::show()->fetchFromFolder($folderGuid, $start, $limit); $a['folderGuid'] = $folderGuid; $a['totalCount'] = App_Model_Show_Catalog::show()->getWartaCount($folderGuid); $ii = 0; if ($a['totalCount'] != 0) { foreach ($rowset as $row) { $rowSumComment = App_Model_Show_Comment::show()->getParentCommentCount($row['guid']); $a['index'][$ii]['title'] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row['guid'], 'fixedTitle'); $a['index'][$ii]['shortTitle'] = $row['shortTitle']; $a['index'][$ii]['createdDate'] = date("d/m/y", strtotime($row['createdDate'])); $a['index'][$ii]['guid'] = $row['guid']; $a['index'][$ii]['comment'] = $rowSumComment != 0 ? '(' . $rowSumComment . ' tanggapan)' : ''; $ii++; } } if ($a['totalCount'] == 0) { $a['index'][0]['title'] = "-"; $a['index'][0]['shortTitle'] = "-"; $a['index'][0]['createdDate'] = "-"; $a['index'][0]['guid'] = "-"; $a['index'][0]['comment'] = "-"; } echo Zend_Json::encode($a); }
public function getComment($parent) { $rows = App_Model_Show_Comment::show()->getParentComment($parent); return $rows; }
public function getNumOfComment($parent) { $count = App_Model_Show_Comment::show()->getCommentParentCount($parent); return $count != 0 ? $count . ' Tanggapan' : ''; }
function ijtAction() { $folderGuid = $this->_getParam('folderGuid') ? $this->_getParam('folderGuid') : ''; $ta = $this->_getParam('title') ? $this->_getParam('title') : ''; $rw = $this->_getParam('rw') ? $this->_getParam('rw') : 1; $rowset = App_Model_Show_Catalog::show()->fetchFromFolder($folderGuid, 0, $rw); $content = 0; $data = array(); foreach ($rowset as $row) { $rowSumComment = App_Model_Show_Comment::show()->getParentCommentCount($row['guid']); $data[$content][0] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row['guid'], 'fixedTitle'); $data[$content][1] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row['guid'], 'fixedAuthor'); $data[$content][2] = App_Model_Show_CatalogAttribute::show()->getCatalogAttributeValue($row['guid'], 'fixedDescription'); $data[$content][3] = $rowSumComment; $data[$content][4] = $row['guid']; $data[$content][5] = $row['shortTitle']; $content++; } $num_rows = count($rowset); $this->view->numberOfRows = $num_rows; $this->view->data = $data; $this->view->title = $ta; }
public function getParentComment($catalogGuid) { $count = App_Model_Show_Comment::show()->getParentCommentCount($catalogGuid); return $count; }