public function getConsumptionAction()
 {
     $item = new Model_ItemPackSizes();
     $this->view->items = $item->getAllItems();
     $wh_data = new Model_WarehousesData();
     $params["date"] = $this->_request->getParam("date");
     $params["item"] = $this->_request->getParam("item");
     $params["province"] = $this->_request->getParam("province");
     $level = $this->_request->getParam("level");
     $province = $this->_request->getParam("province");
     $district = $this->_request->getParam("district");
     $locations = new Model_Locations();
     $locations->form_values = array('parent_id' => $district, 'geo_level_id' => 5);
     $combo = $locations->getLocationsByLevelByTehsil();
     $role_id = $this->_identity->getRoleId();
     if ($role_id == 7) {
         $params["teh_id"] = $this->_identity->getTehsilId();
     } else {
         $params["teh_id"] = $combo[0]['key'];
     }
     $wh_data->form_values = $params;
     switch ($level) {
         case 1:
             $xmlstore = $wh_data->getConsumption();
             $this->view->xmltype = "Column2D.swf";
             break;
         case 2:
             $xmlstore = $wh_data->getConsumptionByDistricts($province);
             $this->view->xmltype = "MSCombi2D.swf";
             break;
         case 6:
             $xmlstore = $wh_data->getConsumptionByUc($district);
             $this->view->xmltype = "MSCombi2D.swf";
             break;
     }
     $this->view->xmlstore = $xmlstore;
     $this->view->combo = $combo;
     $this->view->level = $level;
 }
 public function locationsCombosFourAction()
 {
     $this->_helper->layout->disableLayout();
     if (isset($this->_request->combo3) && !empty($this->_request->combo3)) {
         $tehsil_id = $this->_request->combo3;
         $location = new Model_Locations();
         $location->form_values = array('parent_id' => $tehsil_id, 'geo_level_id' => 6);
         $this->view->result = $location->getLocationsByLevelByTehsil();
         if (!empty($this->_request->uc_id)) {
             $this->view->uc_id = $this->_request->uc_id;
         }
     }
 }
 function prov2distAction()
 {
     $this->_helper->layout->disableLayout();
     $type = $this->_request->combo;
     $locations = new Model_Locations();
     if ($type == '4') {
         if (isset($this->_request->dist_sel) && !empty($this->_request->dist_sel)) {
             $dist_id = $this->_request->dist_sel;
             $locations->form_values['geo_level_id'] = 5;
             $locations->form_values['district_id'] = $dist_id;
             $result = $locations->getLocationsByLevelByDistrict();
             $this->view->result = $result;
         }
     }
     if ($type == '2') {
         if (isset($this->_request->prov_sel) && !empty($this->_request->prov_sel)) {
             $prov_id = $this->_request->prov_sel;
             $locations->form_values['geo_level_id'] = 4;
             $locations->form_values['province_id'] = $prov_id;
             $result = $locations->getLocationsByLevelByProvince();
             $this->view->result = $result;
         }
     }
     if ($type == '5' && !empty($this->_request->teh_sel)) {
         $teh_sel = $this->_request->teh_sel;
         $locations->form_values['geo_level_id'] = 6;
         $locations->form_values['parent_id'] = $teh_sel;
         $result = $locations->getLocationsByLevelByTehsil();
         $this->view->result = $result;
     }
     if ($type == '5' && !empty($this->_request->dist_sel)) {
         $dist_sel = $this->_request->dist_sel;
         $locations->form_values['geo_level_id'] = 6;
         $locations->form_values['district_id'] = $dist_sel;
         $result = $locations->getLocationsByLevelByDistrict();
         $this->view->result = $result;
     }
 }