public function inventoryAction()
 {
     $form = new Form_Iadmin_Stores();
     $warehouses = new Model_Warehouses();
     if ($this->_request->isPost()) {
         $form_values = $this->_request->getPost();
         $this->view->combos = $this->_request->getPost();
         $this->view->combos_1 = 'inventory';
         // 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']);
         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", "stores");
         $warehouses->form_values = $this->_request->getParams();
         $params = $this->_request->getParams();
         $this->view->combos = $this->_request->getParams();
         // App_Controller_Functions::pr($this->_request->getPost());
         if (!empty($form_values['office_type'])) {
             $params['office_type'] = $form_values['office_type'];
         }
         $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 = $this->_request->getPost();
         $result = $warehouses->getAllWarehousesInventory($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->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'));
         $result = $warehouses->getAllWarehousesInventory($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 = 'inventory';
         $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/stores_combos.js');
     $this->view->inlineScript()->appendFile($base_url . '/js/stores_add_combos.js');
     $this->view->headLink()->appendStylesheet($base_url . '/common/theme/scripts/plugins/tables/DataTables/media/css/DT_bootstrap.css');
 }