コード例 #1
0
 /**
  * IndexAction for Permissions
  *
  * @return void
  */
 function indexAction()
 {
     //get the page of the table
     $page = $this->_getParam('page', 1);
     //get the dates for the table
     $model = new Supplier_Model_Resource();
     $data = $model->fetchEntries();
     //paginator
     if ($data) {
         $paginator = Zend_Paginator::factory($data);
         $supplier = Zend_Registry::get('supplier');
         $paginator->setItemCountPerPage($supplier->paginator);
         $paginator->setCurrentPageNumber($page);
         $paginator->setPageRange($supplier->paginator);
         $this->view->paginator = $paginator;
     } else {
         $this->view->paginator = null;
     }
     //send information to the view
     $this->view->title = "Resources list";
 }
コード例 #2
0
 public function consultAction()
 {
     $this->supplier = new Zend_Session_Namespace('supplier');
     if ($this->supplier->id == null) {
         return $this->_helper->_redirector->gotoSimple('consult', 'supplier', 'supplier');
     }
     //get the contacs of the supplier
     $page = $this->_getParam('page', 1);
     $models = new Supplier_Model_Contact();
     $paginator = Zend_Paginator::factory($models->fetchSupplier($this->supplier->id));
     $contact = Zend_Registry::get('supplier');
     $paginator->setItemCountPerPage($contact->paginator);
     $paginator->setCurrentPageNumber($page);
     $paginator->setPageRange($contact->paginator);
     $this->view->paginator = $paginator;
     $model = new Supplier_Model_Resource();
     $data_resource = $model->fetchEntries();
     //data resource of supplier
     if ($data_resource) {
         $paginator_resource = Zend_Paginator::factory($data_resource);
         $supplier = Zend_Registry::get('supplier');
         $paginator_resource->setItemCountPerPage($supplier->paginator);
         $paginator_resource->setCurrentPageNumber($page);
         $paginator_resource->setPageRange($supplier->paginator);
         $this->view->paginator_resource = $paginator_resource;
     } else {
         $this->view->paginator_resource = null;
     }
     //send information to the view
     $this->view->title = "Resources list";
     //get the dates for the table
     $model = new Supplier_Model_Supplier();
     $select_supplier = $model->fetchEntry($_SESSION["supplier"]["id"]);
     //Zend_Debug::dump($select_supplier);
     $this->view->select_supplier = $select_supplier;
     //send information to the view
     $this->view->title = "Supplier Consult";
 }