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"; }