/**
  * The default action - show the home page
  */
 public function indexAction()
 {
     $loai = $this->_getParam('loai', 'dhsg');
     $table = Khcn_Api::_()->getDbTable('he_cao_hoc', 'default');
     $this->view->he_cao_hoc = $he_cao_hoc = $table->fetchRow($table->select()->where('name = ?', $loai));
     if (!$he_cao_hoc) {
         $this->_redirect('index');
     }
     // TODO Auto-generated {0}::indexAction() default action
     $params = array('trang_thai' => true, 'limit' => 20, 'he_cao_hoc' => $he_cao_hoc->getIdentity());
     $danhSach = Khcn_Api::_()->getDbTable('lich_hoc', 'default')->getPaginator($params);
     $paginator = Zend_Paginator::factory($danhSach);
     $currentPage = 1;
     //Check if the user is not on page 1
     $page = $this->_getParam('page');
     if (!empty($page)) {
         //Where page is the current page
         $currentPage = $this->_getParam('page');
     }
     //Set the properties for the pagination
     $paginator->setItemCountPerPage(15);
     $paginator->setPageRange(10);
     $paginator->setCurrentPageNumber($currentPage);
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml');
     $paginator->setView($this->view);
     $this->view->paginator = $paginator;
 }
    public function indexAction() {
        Zend_Paginator::setDefaultScrollingStyle('Sliding');
        Zend_View_Helper_PaginationControl::setDefaultViewPartial('controls.phtml');
        $formReg = new Application_Form_Registro();
        
        $this->view->formReg = $formReg;
        $where = array('ID_PROYECTO' => $this->me['id_usuario']);
        $this->view->reg = $this->regMP->fetchAll(null, $where);
        $attr = array('ID_CATEGORIA', 'CATEGORIA');
        $where = array('ID_PROYECTO' => $this->me["id_usuario"]);
        $catMP = new Application_Model_CategoriaMP();
        $cat = $catMP->fetchAll($attr, $where);
        $catArr = array();
        foreach ($cat as $c) {
            $catArr[$c->getIdCategoria()] = $c->getCategoria();
        }
        $this->view->catArr = $catArr;
        $paginator = Zend_Paginator::factory($this->view->reg);
        $paginator->setItemCountPerPage(20);
        $paginator->setCurrentPageNumber($this->_getParam('page', 1));
        $this->view->paginator = $paginator;

        $catMP = new Application_Model_CategoriaMP();
        $attr = array("ID_CATEGORIA", "CATEGORIA");
        $where = array('ID_PROYECTO' => $this->me['id_usuario']);
        $this->view->cat = $catMP->fetchAll($attr, $where);
    }
 public function indexAction()
 {
     // TODO Auto-generated {0}::indexAction() default action\
     $this->view->form = $form = new Admin_Form_FilterGV();
     $params = Default_Model_Functions::filterParams($this->_getAllParams());
     $_SESSION['filterGV'] = $_SERVER['QUERY_STRING'];
     if (empty($params['order'])) {
         $params['order'] = 'ho_ten';
     }
     if (empty($params['direction'])) {
         $params['direction'] = 'ASC';
     }
     $form->populate($params);
     $giangViens = $this->giang_vien->loc($params);
     if ($giangViens == null) {
         $_SESSION['msg'] = 'Không tìm thấy dữ liệu, vui lòng thử lại .';
         $_SESSION['type_msg'] = 'attention';
     }
     //Set the properties for the pagination
     $paginator = Zend_Paginator::factory($giangViens);
     $paginator->setItemCountPerPage(20);
     $paginator->setPageRange(10);
     $paginator->setCurrentPageNumber($this->_getParam('page', 1));
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml');
     $paginator->setView($this->view);
     $this->view->paginator = $paginator;
     $this->view->filterValues = $params;
     $this->view->order = $params['order'];
     $this->view->direction = $params['direction'];
 }
 public function _initPagination()
 {
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial(
         array('partials/pagination.phtml', 'default')
     );
 }
 public function indexAction()
 {
     // TODO Auto-generated {0}::indexAction() default action
     $this->view->form = $form = new Admin_Form_FilterTB();
     $table = Khcn_Api::_()->getDbTable('thong_bao', 'default');
     $select = $table->select();
     $params = Default_Model_Functions::filterParams($this->_getAllParams());
     if (empty($params['order'])) {
         $params['order'] = 'ngay_tao';
     }
     if (empty($params['direction'])) {
         $params['direction'] = 'DESC';
     }
     $form->populate($params);
     if (isset($params['loai']) && !empty($params['loai'])) {
         $select->where('loai = ?', $params['loai']);
     }
     $select->order($params['order'] . ' ' . $params['direction']);
     $thongBaos = $table->fetchAll($select);
     //Set the properties for the pagination
     $paginator = Zend_Paginator::factory($thongBaos);
     $paginator->setItemCountPerPage(20);
     $paginator->setPageRange(10);
     $paginator->setCurrentPageNumber($this->_getParam('page', 1));
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml');
     $paginator->setView($this->view);
     $this->view->paginator = $paginator;
     $this->view->filterValues = $params;
     $this->view->order = $params['order'];
     $this->view->direction = $params['direction'];
 }
 public function hinhAnhAction()
 {
     $params = $this->_getAllParams();
     $table = Khcn_Api::_()->getDbTable('hinh_anh', 'default');
     $select = $table->select();
     if (empty($params['order'])) {
         $params['order'] = 'id';
     }
     if (empty($params['direction'])) {
         $params['direction'] = 'DESC';
     }
     $select->order($params['order'] . ' ' . $params['direction']);
     $hinhAnhs = $table->fetchAll($select);
     $this->view->filterValues = $params;
     // TODO Auto-generated {0}::indexAction() default action
     $paginator = Zend_Paginator::factory($hinhAnhs);
     $currentPage = 1;
     //Check if the user is not on page 1
     $page = $this->_getParam('page');
     if (!empty($page)) {
         //Where page is the current page
         $currentPage = $this->_getParam('page');
     }
     //Set the properties for the pagination
     $paginator->setItemCountPerPage(10);
     $paginator->setPageRange(5);
     $paginator->setCurrentPageNumber($currentPage);
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml');
     $paginator->setView($this->view);
     $this->view->paginator = $paginator;
 }
 /**
  * Reescreve o metodo init()
  * @access public
  * @param void
  * @return void
  */
 public function init()
 {
     $auth = Zend_Auth::getInstance();
     // instancia da autenticação
     $this->permissoesGrupo = array();
     $this->permissoesOrgao = array();
     //Da permissao de acesso a todos os grupos do usuario logado afim de atender o UC75
     if (isset($auth->getIdentity()->usu_codigo)) {
         //Recupera todos os grupos do Usuario
         $Usuario = new Usuario();
         // objeto usuário
         $grupos = $Usuario->buscarUnidades($auth->getIdentity()->usu_codigo, 21);
         foreach ($grupos as $grupo) {
             if (!in_array($grupo->gru_codigo, $this->permissoesGrupo)) {
                 $this->permissoesGrupo[] = $grupo->gru_codigo;
             }
             if (!in_array($grupo->uog_orgao, $this->permissoesOrgao)) {
                 $this->permissoesOrgao[] = $grupo->uog_orgao;
             }
         }
     }
     isset($auth->getIdentity()->usu_codigo) ? parent::perfil(1, $this->permissoesGrupo) : parent::perfil(4, $this->permissoesGrupo);
     $this->usuarioLogado = isset($auth->getIdentity()->usu_codigo) ? $auth->getIdentity()->usu_codigo : $auth->getIdentity()->IdUsuario;
     parent::init();
     /* =============================================================================== */
     /* ==== VERIFICA PERMISSAO DE ACESSO DO PROPONENTE A PROPOSTA OU AO PROJETO ====== */
     /* =============================================================================== */
     $this->verificarPermissaoAcesso(true, false, false);
     # Paginator
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('paginacao/paginacaoMinc.phtml');
 }
 public function indexAction()
 {
     $auth = Zend_Auth::getInstance();
     $identity = $auth->getIdentity();
     $this->identity = $identity;
     switch ($this->identity->usr_permissao) {
         case 'administrador':
             $list = $this->_notificacao->fetchAll(null, "not_id DESC");
             break;
         case 'revendedor':
             $codigo = (int) $this->identity->usr_id;
             $list = $this->_notificacao->fetchAll("usr_id_fk='{$codigo}'", "not_id DESC");
             break;
         case 'vendedor':
             $codigo = (int) $this->identity->usr_id;
             $list = $this->_notificacao->fetchAll("usr_id_fk='{$codigo}'", "not_id DESC");
             break;
     }
     $paginator = Zend_Paginator::factory($list);
     $paginator->setCurrentPageNumber($this->_getParam('page'));
     $paginator->setItemCountPerPage(100);
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
     $this->view->lista = $paginator;
     $this->view->paginator = $paginator;
 }
 public function indexAction()
 {
     // TODO Auto-generated {0}::indexAction() default action
     $this->view->form = $form = new Admin_Form_FilterHT();
     $params = Default_Model_Functions::filterParams($this->_getAllParams());
     $_SESSION['filterHT'] = $_SERVER['QUERY_STRING'];
     if (empty($params)) {
         $params['nam'] = date('Y');
     }
     if (empty($params['order'])) {
         $params['order'] = 'ngay_to_chuc';
     }
     if (empty($params['direction'])) {
         $params['direction'] = 'DESC';
     }
     $form->populate($params);
     $hoiThaos = Khcn_Api::_()->getDbTable('hoi_thao', 'default')->loc($params);
     if ($hoiThaos == null) {
         $_SESSION['msg'] = 'Không tìm thấy dữ liệu, vui lòng thử lại .';
         $_SESSION['type_msg'] = 'attention';
     }
     //Set the properties for the pagination
     $paginator = Zend_Paginator::factory($hoiThaos);
     $paginator->setItemCountPerPage(20);
     $paginator->setPageRange(10);
     $paginator->setCurrentPageNumber($this->_getParam('page', 1));
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml');
     $this->view->paginator = $paginator;
     $this->view->filterValues = $params;
     $this->view->order = $params['order'];
     $this->view->direction = $params['direction'];
     $this->view->capQLs = $capQLs = Default_Model_Constraints::hoithao_capquanly();
 }
 protected function _initPaginator()
 {
     $options = $this->getOptions();
     if (array_key_exists('cache', $options) && $options['cache']) {
         // ensure the cache is initialized...
         $this->getBootstrap()->bootstrap('cachemanager');
         // get the cache manager object
         $manager = $this->getBootstrap()->getResource('cachemanager');
         // get the paginator cache object
         $cache = $manager->getCache(self::PAGINATOR_CACHE);
         if (!is_null($cache)) {
             Zend_Paginator::setCache($cache);
         }
     }
     if (!empty($options['scrollingType'])) {
         Zend_Paginator::setDefaultScrollingStyle($options['scrollingType']);
     } else {
         Zend_Paginator::setDefaultScrollingStyle(self::DEFAULT_SCROLLING_TYPE);
     }
     if (!empty($options['recordsPerPage'])) {
         Zend_Paginator::setDefaultItemCountPerPage($options['recordsPerPage']);
     } else {
         Zend_Paginator::setDefaultItemCountPerPage(self::DEFAULT_RECORDS_PER_PAGE);
     }
     if (!empty($options['viewScript'])) {
         Zend_View_Helper_PaginationControl::setDefaultViewPartial($options['viewScript']);
     }
 }
 /**
  * The default action - show the guestbook entries
  */
 public function indexAction()
 {
     $method = __METHOD__;
     $cacheid = str_replace("::", "_", $method) . intval($this->getRequest()->getParam('page', 1));
     $can_edit = false;
     if (Zoo::getService('acl')->checkAccess('edit')) {
         $cacheid .= "_edit";
         $can_edit = true;
     }
     $content = $this->checkCache($cacheid);
     if (!$content) {
         $limit = 20;
         // Offset = items per page multiplied by the page number minus 1
         $offset = ($this->getRequest()->getParam('page', 1) - 1) * $limit;
         $options = array('active' => true, 'nodetype' => 'guestbook_entry', 'order' => 'created DESC', 'render' => true);
         $select = Zoo::getService('content')->getContentSelect($options, $offset, $limit);
         $this->view->items = Zoo::getService('content')->getContent($options, $offset, $limit);
         // Pagination
         Zend_Paginator::setDefaultScrollingStyle('Elastic');
         Zend_View_Helper_PaginationControl::setDefaultViewPartial(array('pagination_control.phtml', 'zoo'));
         $adapter = new Zend_Paginator_Adapter_DbSelect($select);
         $paginator = new Zend_Paginator($adapter);
         $paginator->setItemCountPerPage($limit);
         $paginator->setCurrentPageNumber($this->getRequest()->getParam('page', 1));
         $paginator->setView($this->view);
         $this->view->assign('paginator', $paginator);
         $this->view->can_edit = $can_edit;
         $content = $this->getContent();
         $this->cache($content, $cacheid, array('nodelist', 'guestbook_list'));
     }
     $this->view->pagetitle = Zoo::_('Guestbook');
     $this->renderContent($content);
 }
 public function getSearchListPagination($word = '1', $page = '0', $lang_code)
 {
     $select = $this->_db->select()->from(array('sc' => 'site_content'))->joinLeft(array('sni' => 'site_node_item'), 'sc.content_id = sni.object_id', array('node_id'))->joinLeft(array('sn' => 'site_node'), 'sn.node_id = sni.node_id', array('page_id', 'node_title'))->where("sc.content_title LIKE '%" . mysql_escape_string($word) . "%' OR sc.content_text LIKE '%" . mysql_escape_string($word) . "%'")->where('sn.lang_code = ?', $lang_code)->order('sc.content_id DESC');
     $result = Zend_Paginator::factory($select)->setCurrentPageNumber($page)->setItemCountPerPage($this->_config->pagination->itemsPerPage)->setPageRange($this->_config->pagination->pagesInRange);
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     return $result;
 }
Exemple #13
0
 /**
  * Constructor.
  *
  * @param Doctrine_Query $select The select query
  */
 public function __construct(Doctrine_Query $select)
 {
     $this->_select = $select;
     // Set default paginator options
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_Paginator::setDefaultItemCountPerPage(8);
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
 }
 /**
  * Set view paginator
  *
  * @param int $count
  * @param int $perPage
  * @return void
  */
 private function setViewPaginator($count, $perPage)
 {
     $adapter = new Zend_Paginator_Adapter_Null($count);
     $paginator = new Zend_Paginator($adapter);
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     $paginator->setItemCountPerPage($perPage);
     $paginator->setCurrentPageNumber($this->page);
     $this->view->paginator = $paginator->getPages();
 }
Exemple #15
0
 public function indexAction()
 {
     $params = array();
     $modul = $this->getRequest()->getParam('modul');
     $action = $this->getRequest()->getParam('actionType');
     $data_inceput = $this->getRequest()->getParam('data_inceput');
     $data_sfarsit = $this->getRequest()->getParam('data_sfarsit');
     //form cautare dupa modul/tip de actiune/data
     $form = new Default_Form_SearchLogs();
     $form->modul->setValue($modul);
     $form->actionType->setValue($action);
     $form->data_inceput->setValue($data_inceput);
     $form->data_sfarsit->setValue($data_sfarsit);
     $form->setDecorators(array('ViewScript', array('ViewScript', array('viewScript' => 'forms/logs/search.phtml'))));
     $this->view->form = $form;
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($this->getRequest()->getPost())) {
             $post = $this->getRequest()->getPost();
             $model = new Default_Model_Logs();
             $model->setOptions($form->getValues());
         }
     }
     //end form
     //fetch loguri
     $logs = new Default_Model_Logs();
     $select = $logs->getMapper()->getDbTable()->select();
     if (!empty($action)) {
         $params['actionType'] = $action;
         $select->where('actionType = ?', $action);
     }
     if (!empty($modul)) {
         $params['modul'] = $modul;
         $select->where('modul = ?', $modul);
     }
     if (!empty($data_inceput)) {
         $params['data_inceput'] = $data_inceput;
         $select->where("DATE(created) >= ?", $data_inceput);
     }
     if (!empty($data_sfarsit)) {
         $params['data_sfarsit'] = $data_sfarsit;
         $select->where("DATE(created) <= ?", $data_sfarsit);
     }
     $select->order('created DESC');
     $result = $logs->fetchAll($select);
     if (NULL != $result) {
         $paginator = Zend_Paginator::factory($result);
         $paginator->setItemCountPerPage(10);
         $paginator->setCurrentPageNumber($this->_getParam('page'));
         $paginator->setPageRange(5);
         $this->view->result = $paginator;
         $this->view->itemCountPerPage = $paginator->getItemCountPerPage();
         $this->view->totalItemCount = $paginator->getTotalItemCount();
         Zend_Paginator::setDefaultScrollingStyle('Sliding');
         Zend_View_Helper_PaginationControl::setDefaultViewPartial(array('_pagination.phtml', $params));
     }
 }
 public function indexAction()
 {
     // TODO Auto-generated {0}::indexAction() default action
     //Set the properties for the pagination
     $this->view->paginator = $paginator = Khcn_Api::_()->getDbTable('bai_bao', 'default')->getBaiBaosPaginator();
     $paginator->setItemCountPerPage(20);
     $paginator->setPageRange(10);
     $paginator->setCurrentPageNumber($this->_getParam('page', 1));
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml');
 }
Exemple #17
0
 public function indexAction()
 {
     //Set the properties for the pagination
     $data = Khcn_Api::_()->getDbTable('download', 'default')->fetchAll(null, "ngay_tao DESC");
     $this->view->paginator = $paginator = Zend_Paginator::factory($data);
     $paginator->setItemCountPerPage(20);
     $paginator->setPageRange(10);
     $paginator->setCurrentPageNumber($this->_getParam('page', 1));
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml');
 }
Exemple #18
0
 public function indexAction()
 {
     $list = $this->_produto->fetchAll(null, "pro_nome ASC");
     $paginator = Zend_Paginator::factory($list);
     $paginator->setCurrentPageNumber($this->_getParam('page'));
     $paginator->setItemCountPerPage(50);
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
     $this->view->lista = $paginator;
     $this->view->paginator = $paginator;
 }
 public function hinhAnhAction()
 {
     $hinhAnhs = Khcn_Api::_()->getDbTable('hinh_anh', 'default')->fetchAll();
     $paginator = Zend_Paginator::factory($hinhAnhs);
     $paginator->setItemCountPerPage(21);
     $paginator->setPageRange(10);
     $paginator->setCurrentPageNumber($this->_getParam('page', 1));
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml');
     $paginator->setView($this->view);
     $this->view->paginator = $paginator;
 }
Exemple #20
0
 public function indexAction()
 {
     $table = $this->getTable();
     $page = $this->_getParam('page', 1);
     $paginator = Zend_Paginator::factory($table->getRowsMapper());
     $paginator->setCurrentPageNumber($page)->setItemCountPerPage(30);
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
     $this->view->assign('paginator', $paginator);
     $this->view->title = ucfirst($this->controller);
     $this->view->controller = $this->controller;
 }
 public function indexAction()
 {
     // TODO Auto-generated {0}::indexAction() default action
     $table = Khcn_Api::_()->getDbTable('chuong_trinh', 'default');
     $chuongTrinhs = $table->fetchAll($table->select()->order('ngay_tao DESC'));
     //Set the properties for the pagination
     $this->view->paginator = $paginator = Zend_Paginator::factory($chuongTrinhs);
     $paginator->setItemCountPerPage(20);
     $paginator->setPageRange(10);
     $paginator->setCurrentPageNumber($this->_getParam('page', 1));
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml');
 }
 public function indexAction()
 {
     $this->_helper->layout->setLayout('admin');
     if ($this->_request->isPost() && !$this->_request->getParam('editid')) {
         $bannerForm = new FM_Forms_Admin_Banner();
         $formData = $this->_request->getPost();
         if ($bannerForm->isValid($formData)) {
             $uploadedData = $bannerForm->getValues();
             //Zend_Debug::dump($uploadedData, '$uploadedData');
             $fileHandler = new FM_Components_Util_UploadHandler($uploadedData['file']);
             $folder = $fileHandler->setFolder('banner');
             if ($fileHandler->move()) {
                 list($width, $height, $type, $attr) = getimagesize($_SERVER['DOCUMENT_ROOT'] . $folder . '/' . $uploadedData['file']['name']);
                 $uploadedData['width'] = $width;
                 $uploadedData['height'] = $height;
                 $uploadedData['path'] = $folder;
                 $uploadedData['medianame'] = $uploadedData['file']['name'];
                 $uploadedData['oid'] = $this->_user->getOrgId();
                 FM_Components_Banner::insertBanner($uploadedData);
                 $bannerForm = new FM_Forms_Admin_Banner();
                 $this->view->form = $bannerForm;
             }
         } else {
             $bannerForm->populate($formData);
             $this->view->form = $bannerForm;
         }
     } elseif ($this->_request->isPost() && $this->_request->getParam('editid')) {
         $bannerForm = new FM_Forms_Admin_Banner();
         $bannerForm->populate($this->_request->getPost());
         $uploadedData = $bannerForm->getValues();
         if (FM_Components_Banner::updateBanner(array('id' => $uploadedData['editid']), $uploadedData)) {
             if (array_key_exists('HTTP_REFERER', $_SERVER) && stristr($_SERVER['HTTP_REFERER'], 'admin/banner')) {
                 $this->_redirect($_SERVER['HTTP_REFERER']);
             } else {
                 $this->_redirect('/admin/banner');
             }
         }
     } else {
         $bannerForm = new FM_Forms_Admin_Banner();
         $this->view->form = $bannerForm;
     }
     $banners = FM_Components_Banner::getOrgBanners($this->_user->getOrgId());
     $paginator = Zend_Paginator::factory(array_reverse($banners));
     $paginator->setCurrentPageNumber($this->_request->getParam('page'));
     $paginator->setItemCountPerPage(5);
     $paginator->setView($this->view);
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination/default.phtml');
     $this->view->currentBanners = $this->view->partial('admin/partials/bannerdisplay.phtml', array('banners' => $paginator));
 }
 public function gopYAction()
 {
     // TODO Auto-generated {0}::indexAction() default action
     $this->view->form = $form = new Admin_Form_GopY_Filter();
     $params = Default_Model_Functions::filterParams($this->_getAllParams());
     $form->populate($params);
     $this->view->tinhTrangOptions = $tinhTrangOptions = array('initial' => 'Mới', 'pending' => 'Đang kiểm tra', 'failure' => 'Hủy bỏ', 'completed' => 'Hoàn thành');
     //Set the properties for the pagination
     $this->view->paginator = $paginator = Khcn_Api::_()->getDbTable('gop_y', 'default')->getGopYsPaginator($params);
     $paginator->setItemCountPerPage(20);
     $paginator->setPageRange(10);
     $paginator->setCurrentPageNumber($this->_getParam('page', 1));
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml');
     $this->view->filterValues = $params;
 }
Exemple #24
0
 public function indexAction()
 {
     $this->view->headLink()->appendStylesheet('/crm700/public/plugins/switch/dist/css/bootstrap3/switch.css');
     $this->view->headLink()->appendStylesheet('/crm700/public/plugins/alertifyjs/css/alertify.min.css');
     $this->view->headScript()->appendFile($this->_baseUrl . '/plugins/alertifyjs/alertify.min.js');
     $this->view->headScript()->appendFile($this->_baseUrl . '/plugins/switch/dist/js/switch.js');
     $this->view->headScript()->appendFile($this->_baseUrl . '/files_js/controllers/usuarios/usuarios.js');
     $id = $this->_identity->usr_id;
     $list = $this->_usuarios->fetchAll("usr_id_fk_agregado={$id}", "usr_id DESC");
     $paginator = Zend_Paginator::factory($list);
     $paginator->setCurrentPageNumber($this->_getParam('page'));
     $paginator->setItemCountPerPage(200);
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
     $this->view->lista = $paginator;
     $this->view->paginator = $paginator;
 }
Exemple #25
0
 public function indexAction()
 {
     $model = new Default_Model_Comments();
     $select = $model->getMapper()->getDbTable()->select()->from(array('c' => 'comment'), array('c.*'))->where("NOT c.deleted")->where("c.idParent IS NULL")->order(array('c.created DESC'));
     $result = $model->fetchAll($select);
     if (NULL != $result) {
         $paginator = Zend_Paginator::factory($result);
         $paginator->setItemCountPerPage(25);
         $paginator->setCurrentPageNumber($this->_getParam('page'));
         $paginator->setPageRange(5);
         $this->view->result = $paginator;
         $this->view->itemCountPerPage = $paginator->getItemCountPerPage();
         $this->view->totalItemCount = $paginator->getTotalItemCount();
         Zend_Paginator::setDefaultScrollingStyle('Sliding');
         Zend_View_Helper_PaginationControl::setDefaultViewPartial('_pagination.phtml');
     }
 }
 public function indexAction()
 {
     $userId = null;
     $auth = Zend_Auth::getInstance();
     $authAccount = $auth->getStorage()->read();
     if (null != $authAccount) {
         if (null != $authAccount->getId()) {
             $userId = $authAccount->getId();
         }
     }
     $model = new Default_Model_NotificationMessages();
     $notification = new Default_Model_NotificationTo();
     $params = array();
     $subject = $this->getRequest()->getParam('subject');
     $message = $this->getRequest()->getParam('message');
     $select = $notification->getMapper()->getDbTable()->select()->from(array('n' => 'notification_to'), array('n.*'))->where("NOT n.deleted")->where("n.status=?", '1')->where("n.idUserTo=?", $userId);
     $result = $notification->fetchAll($select);
     $notifications = count($result) != 0 ? count($result) : 0;
     $select2 = $model->getMapper()->getDbTable()->select()->from(array('nm' => 'notification_messages'), array('nm.*'))->joinLeft(array('n' => 'notification_to'), 'nm.`id` = n.`idNotification`', array('nid' => 'n.id', 'status' => 'n.status'))->where("NOT n.deleted")->where("n.idUserTo=?", $userId);
     if (!empty($subject)) {
         $params['subject'] = $subject;
         $select2->where('subject LIKE ?', '%' . $subject . '%');
     }
     if (!empty($message)) {
         $params['message'] = $message;
         $select2->where('message LIKE ?', '%' . $message . '%');
     }
     $select2->order(array('n.status desc', 'n.created desc'))->setIntegrityCheck(false);
     $form = new Default_Form_NotificationsSearch();
     $form->setDecorators(array('ViewScript', array('ViewScript', array('viewScript' => 'forms/notifications/notifications-search.phtml'))));
     $this->view->form = $form;
     $this->view->search = $params;
     $result2 = $model->fetchAll($select2);
     if (NULL != $result2) {
         $paginator = Zend_Paginator::factory($result2);
         $paginator->setItemCountPerPage(25);
         $paginator->setCurrentPageNumber($this->_getParam('page'));
         $paginator->setPageRange(5);
         $this->view->result = $paginator;
         $this->view->itemCountPerPage = $paginator->getItemCountPerPage();
         $this->view->totalItemCount = $notifications;
         Zend_Paginator::setDefaultScrollingStyle('Sliding');
         Zend_View_Helper_PaginationControl::setDefaultViewPartial('_pagination.phtml');
     }
 }
 /**
  * The default action - show the home page
  */
 public function indexAction()
 {
     $lichCTs = Khcn_Api::_()->getDbTable('lich_cong_tac', 'default')->getLichCTs();
     $paginator = Zend_Paginator::factory($lichCTs);
     $currentPage = 1;
     //Check if the user is not on page 1
     $page = $this->_getParam('page');
     if (!empty($page)) {
         //Where page is the current page
         $currentPage = $this->_getParam('page');
     }
     //Set the properties for the pagination
     $paginator->setItemCountPerPage(15);
     $paginator->setPageRange(10);
     $paginator->setCurrentPageNumber($currentPage);
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml');
     $paginator->setView($this->view);
     $this->view->paginator = $paginator;
 }
Exemple #28
0
 public function listarAction()
 {
     $db = new Album();
     $albuns = $db->getAlbuns();
     //Paginador
     $page = $this->_request->getParam('page', 1);
     #Parametro GET, Valor Padrão
     $paginator = Zend_Paginator::factory($albuns);
     #Variável com resultado da consulta
     $paginator->setCurrentPageNumber($page)->setItemCountPerPage(15);
     #Itens por Página
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     #Estilo de Paginação (Não Alterar)
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('paginador.phtml');
     #Layout do Paginador (source: module/views/paginator.phtml)
     $this->view->assign('paginator', $paginator);
     #Variável enviada para View (paginator) Acessar: $this->paginator;
     //Paginador Fim
     $this->render();
 }
Exemple #29
0
 public function indexAction()
 {
     // action body
     $this->view->categories = Khcn_Api::_()->getDbTable('loai_su_diep', 'default')->getParentListAssoc(false);
     $this->view->category_id = $category_id = $this->_getParam('category_id', null);
     $this->view->category = $category = null;
     // Check is parent
     if ($category_id && ($category = Khcn_Api::_()->getItem('default_loai_su_diep', $category_id)) == null) {
         return $this->_forward('notfound', 'error', 'default');
     }
     if (!$category || $category && $category->parent_id == 0) {
         $this->view->is_parent = true;
     } else {
         $this->view->is_parent = false;
         $this->view->parentCat = Khcn_Api::_()->getItem('default_loai_su_diep', $category->parent_id);
     }
     $values = array("loai_su_diep_id" => $category_id, "limit" => 5);
     $this->view->recentlyData = $recentlyData = Khcn_Api::_()->getDbTable('su_diep', 'default')->getDanhSachSuDiep($values);
     $not_ids = array();
     foreach ($recentlyData as $data) {
         $not_ids[] = $data->getIdentity();
     }
     $values = array("loai_su_diep_id" => $category_id, "not_ids" => $not_ids);
     $remainData = Khcn_Api::_()->getDbTable('su_diep', 'default')->getDanhSachSuDiep($values);
     $paginator = Zend_Paginator::factory($remainData);
     $currentPage = 1;
     //Check if the user is not on page 1
     $page = $this->_getParam('page');
     if (!empty($page)) {
         //Where page is the current page
         $currentPage = $this->_getParam('page');
     }
     //Set the properties for the pagination
     $paginator->setItemCountPerPage(20);
     $paginator->setPageRange(10);
     $paginator->setCurrentPageNumber($currentPage);
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml');
     $paginator->setView($this->view);
     $this->view->paginator = $paginator;
 }
 public function dsViPhamAction()
 {
     // TODO Auto-generated {0}::indexAction() default action
     $nguoiDungs = $this->nguoi_dung->getDSViPham();
     $paginator = Zend_Paginator::factory($nguoiDungs);
     $currentPage = 1;
     //Check if the user is not on page 1
     $page = $this->_getParam('page');
     if (!empty($page)) {
         //Where page is the current page
         $currentPage = $this->_getParam('page');
     }
     //Set the properties for the pagination
     $paginator->setItemCountPerPage(15);
     $paginator->setPageRange(10);
     $paginator->setCurrentPageNumber($currentPage);
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('includes/pagination.phtml');
     $paginator->setView($this->view);
     $this->view->paginator = $paginator;
 }