Ejemplo n.º 1
0
 public function gatepassListAction()
 {
     $form = new Form_GatepassList();
     $stock_batch = new Model_StockBatch();
     $this->view->form = $form;
     $params = array();
     if ($this->_request->isPost()) {
         if ($form->isValid($this->_request->getPost())) {
             $data = $form->getValues();
             $stock_batch->form_values = $data;
         }
     }
     $sort = $this->_getParam("sort", "asc");
     $order = $this->_getParam("order", "gpnumber");
     $result = $stock_batch->stockGatepassSearch();
     //Paginate the contest results
     $paginator = Zend_Paginator::factory($result);
     $page = $this->_getParam("page", 1);
     $counter = $this->_getParam("counter", 10);
     $paginator->setCurrentPageNumber((int) $page);
     $paginator->setItemCountPerPage((int) $counter);
     $this->view->paginator = $paginator;
     $this->view->sort = $sort;
     $this->view->order = $order;
     $this->view->counter = $counter;
     $this->view->pagination_params = $params;
 }