Esempio n. 1
0
 /**
  * Wyświetlenie użytkowników
  */
 public function indexAction()
 {
     $model = new Feedback();
     $select = $model->select()->from('feedback');
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'created_at');
     $order = $request->getParam('order', 'desc');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('created_at', 'message_content');
 }
Esempio n. 2
0
 public function indexAction()
 {
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'id');
     $order = $request->getParam('order', 'asc');
     $announcementModel = new Announcement();
     $select = $announcementModel->select()->where('ghost = false');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('created_at', 'title', 'created_by', 'valid_since', 'valid_until', 'id_branch');
 }
Esempio n. 3
0
 public function indexAction()
 {
     $model = new Message();
     $select = $model->select()->from('message');
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'id');
     $order = $request->getParam('order', 'asc');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('message', 'is_important');
 }
Esempio n. 4
0
 public function indexAction()
 {
     $model = new GroupMain();
     $select = $model->select();
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'group_main_name');
     $order = $request->getParam('order', 'asc');
     $select->where('ghost = false');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('group_main_name');
 }
Esempio n. 5
0
 public function blockadehistoryAction()
 {
     $model = new Blockade();
     $this->view->data = $model->getLast();
     $select = $model->select();
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'created_at');
     $order = $request->getParam('order', 'desc');
     $select->where('ghost = false');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('created_by', 'created_at', 'is_blocked');
 }
Esempio n. 6
0
 /**
  * indexAction() - pokazuje listę wszystkich filtrów
  *
  * @todo prawodpodobnie do zmiany (będzie w ogóle lista wszystkich filtrów?)
  */
 public function indexAction()
 {
     $model = new Filter();
     $select = $model->select()->from('filter')->where('ghost = false');
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'id');
     $order = $request->getParam('order', 'asc');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     //$logic = new Logic_Kontakt();
     //$table =  $this->addStandardActions($paginator, $logic->getTableActions());
     //$this->view->headerMappings  = $logic->getHeaderMappings();
     //        debug($paginator->getCurrentItems());die;
     $this->view->paginator = $paginator;
     $this->view->headers = array('filter_name', 'form_name', 'is_public');
 }
Esempio n. 7
0
 public function indexAction()
 {
     $request = $this->getRequest();
     $model = new Role();
     $searchForm = new Logic_Role_Form_Filter();
     $this->view->form = $searchForm;
     $filter = $request->getParam('filter_is_deleted', false);
     $ghost = "false";
     if ($filter) {
         $searchForm->getElement('filter_is_active')->setChecked(false);
         $searchForm->getElement('filter_is_deleted')->setChecked(true);
         $ghost = "true";
     }
     $select = $model->select()->from('role')->where('ghost = ' . $ghost);
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'id');
     $order = $request->getParam('order', 'asc');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('role_name');
     $this->view->headScript()->appendFile('/static/js/filtr_active.js');
 }
Esempio n. 8
0
 public function showAction()
 {
     $request = $this->getRequest();
     $id = $this->_helper->IdConvert->hexToStr($request->getParam('id'));
     $logic = new Logic_Dictionary();
     $data = array();
     try {
         list($data, $entries) = $logic->showDictionary($id);
     } catch (Logic_Branch_Exception $e) {
         $this->_helper->messenger->error();
         $this->_helper->redirector('index');
         return;
     }
     $entries->order($request->getParam('sort', 'id') . ' ' . $request->getParam('order', 'asc'));
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($entries));
     $paginator->setCurrentPageNumber($request->getParam('page', 1));
     $this->view->data = $data;
     $this->view->entries = $paginator;
     $this->view->headers = array('id_entry', 'entry');
 }
Esempio n. 9
0
 public function listgroupsAction()
 {
     $options = $this->getFrontController()->getParam('bootstrap')->getApplication()->getOptions();
     $model = new BranchGroup();
     $select = $model->select();
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'branch_group_name');
     $order = $request->getParam('order', 'asc');
     $select->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('branch_group_name', 'description');
 }
Esempio n. 10
0
 public function baseinterestAction()
 {
     $request = $this->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', null);
     $order = $request->getParam('order', null);
     $baseInterest = new BaseInterest();
     $select = $baseInterest->select();
     if ($sort === null && $order === null) {
         $select->order(array('created_at desc', 'period asc'));
     } else {
         if ($sort == 'created_at') {
             $select->order(array($sort . ' ' . $order, 'period asc'));
         } else {
             $select->order($sort . ' ' . $order);
         }
     }
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('created_at', 'code', 'value');
 }
Esempio n. 11
0
 public function showuserhistoryAction()
 {
     $request = $this->getRequest();
     $id = $this->_helper->IdConvert->hexToStr($request->getParam('id'));
     $logic = new Logic_User();
     $select = $logic->getSqlToUserHistory($id);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($select));
     $paginator->setCurrentPageNumber($request->getParam('page', 1));
     $model = new User();
     $userRow = $model->findOne($id);
     $back = new Zend_Session_Namespace('back');
     $back->referer = '/user/showuserhistory/id/' . $request->getParam('id');
     $this->view->user = $userRow;
     $this->view->paginator = $paginator;
     $this->view->headers = array('id_user', 'created_at', 'message', 'description');
 }
Esempio n. 12
0
 /**
  * Pobranie listy delegacji i zwrócenie paginatora
  * @param Zend_Db_Table_Select $statement - warunki dla których ma być pobrana lista
  * @return Zend_Paginator - lista delegacji
  */
 private function get_items_list_paginator(Zend_Db_Table_Select $statement)
 {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'id');
     $order = $request->getParam('order', 'asc');
     $statement->order("{$sort} {$order}");
     $adapter = new Zend_Paginator_Adapter_DbTableSelect($statement);
     $paginator = new Base_Paginator($adapter);
     $paginator->setCurrentPageNumber($page);
     return $paginator;
 }
Esempio n. 13
0
 public function indextooltipAction()
 {
     $request = $this->getRequest();
     $tooltipModel = new Tooltip();
     $tooltips = $tooltipModel->select();
     $page = $request->getParam('page', 1);
     $sort = $request->getParam('sort', 'id');
     $order = $request->getParam('order', 'asc');
     $tooltips->order($sort . ' ' . $order);
     $paginator = new Base_Paginator(new Zend_Paginator_Adapter_DbTableSelect($tooltips));
     $paginator->setCurrentPageNumber($page);
     $this->view->paginator = $paginator;
     $this->view->headers = array('label', 'description');
 }
Esempio n. 14
0
 public function paginator($namespace = null, $moreActions = array())
 {
     $this->getFilterData($namespace);
     if (!$this->paginator) {
         $db = $this->dbModelTable;
         $expr = new Zend_Db_Expr('(' . $this->getSql() . ')');
         $select = $db->select()->from($expr)->setIntegrityCheck(false);
         if (isset($this->sort) && isset($this->order)) {
             $select->order($this->sort . ' ' . $this->order);
         }
         $adapter = new Zend_Paginator_Adapter_DbTableSelect($select);
         if ($this->getCountSql()) {
             $adapter->setRowCount($db->select()->from(new Zend_Db_Expr('(' . $this->getCountSql() . ')'), array(Zend_Paginator_Adapter_DbSelect::ROW_COUNT_COLUMN => 'zend_paginator_row_count'))->setIntegrityCheck(false));
         }
         $paginator = new Base_Paginator($adapter, $moreActions);
         $paginator->setCurrentPageNumber(isset($this->page) ? $this->page : 1);
         if ($this->page_size) {
             $paginator->setItemCountPerPage($this->page_size);
         }
         $this->paginator = $paginator;
     }
     return $this->paginator;
 }