public function campaignsAction() { $form = new Form_Iadmin_Stores(); $warehouses = new Model_Warehouses(); $params = array(); if ($this->_request->isPost()) { $form_values = $this->_request->getPost(); $this->view->combos = $this->_request->getPost(); // App_Controller_Functions::pr($this->_request->getPost()); $form->province_id->setValue($form_values['combo1']); $form->district_id->setValue($form_values['combo2']); $form->tehsil_id->setValue($form_values['combo3']); $form->parent_id->setValue($form_values['combo4']); $params['office_type'] = '6'; $params['stakeholder'] = '10'; if (!empty($form_values['combo1'])) { $params['combo1'] = $form_values['combo1']; } if (!empty($form_values['combo2'])) { $params['combo2'] = $form_values['combo2']; } if (!empty($form_values['combo3'])) { $params['combo3'] = $form_values['combo3']; } if (!empty($form_values['combo4'])) { $params['combo4'] = $form_values['combo4']; } $sort = $this->_getParam("sort", "asc"); $order = $this->_getParam("order", "asset_sub_type"); $warehouses->form_values = $this->_request->getPost(); $warehouses->form_values['office_type'] = '6'; $warehouses->form_values['stakeholder'] = '10'; $result = $warehouses->getAllWarehouses($order, $sort); //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->combos_1 = 'campaigns'; $this->view->form = $form; $this->view->paginator = $paginator; $this->view->sort = $sort; $this->view->order = $order; $this->view->counter = $counter; $this->view->pagination_params = $params; } else { $sort = $this->_getParam("sort", "asc"); $order = $this->_getParam("order", "store"); $warehouses->form_values = $this->_request->getParams(); $params = $this->_request->getParams(); $this->view->combos = $this->_request->getParams(); // App_Controller_Functions::pr($this->_request->getPost()); $form->province_id->setValue($this->_getParam('combo1')); $form->district_id->setValue($this->_getParam('combo2')); $form->tehsil_id->setValue($this->_getParam('combo3')); $form->parent_id->setValue($this->_getParam('combo4')); $warehouses->form_values['office_type'] = '6'; $warehouses->form_values['stakeholder'] = '10'; $result = $warehouses->getAllWarehouses($order, $sort); //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->combos_1 = 'campaigns'; $this->view->form = $form; $this->view->paginator = $paginator; $this->view->sort = $sort; $this->view->order = $order; $this->view->counter = $counter; $this->view->pagination_params = $params; } $base_url = Zend_Registry::get('baseurl'); $this->view->inlineScript()->appendFile($base_url . '/js/routine_combos.js'); $this->view->inlineScript()->appendFile($base_url . '/js/routine_add_combos.js'); $this->view->headLink()->appendStylesheet($base_url . '/common/theme/scripts/plugins/tables/DataTables/media/css/DT_bootstrap.css'); }