예제 #1
0
 public function levelCombosOneAction()
 {
     $this->_helper->layout->disableLayout();
     $office = $this->_request->office;
     $province_id = $this->_identity->getProvinceId();
     $district_id = $this->_identity->getDistrictId($this->_userid);
     $stakeholder_id = $this->_identity->getStakeholderId();
     $role_id = $this->_identity->getRoleId();
     if ($role_id == 7) {
         $tehsil_id = $this->_identity->getTehsilId($this->_userid);
     } else {
         $tehsil_id = '';
     }
     $location = new Model_Locations();
     $location->form_values = array('parent_id' => $province_id, 'geo_level_id' => $office);
     $warehouse = new Model_Warehouses();
     switch ($office) {
         case 1:
             break;
         case 2:
         case 3:
         case 4:
             $this->view->result = $location->getLocationsByLevel();
             break;
         case 5:
             $warehouse->form_values = array('province_id' => $province_id, 'stakeholder_id' => $stakeholder_id);
             $this->view->result = $warehouse->getProvincialWarehouses();
             break;
         case 6:
             $warehouse->form_values = array('province_id' => $province_id, 'stakeholder_id' => $stakeholder_id);
             $this->view->result = $warehouse->getDivsionalWarehousesofProvince();
             break;
         case 7:
             $warehouse->form_values = array('province_id' => $province_id, 'stakeholder_id' => $stakeholder_id);
             $this->view->result = $warehouse->getDistrictWarehousesofProvince();
             break;
         case 8:
             $warehouse->form_values = array('district_id' => $district_id, 'stakeholder_id' => $stakeholder_id);
             $this->view->result = $warehouse->getTehsilWarehousesofDistrict();
             break;
         case 9:
             $warehouse->form_values = array('district_id' => $district_id, 'stakeholder_id' => $stakeholder_id, 'role_id' => $role_id, 'tehsil_id' => $tehsil_id);
             $this->view->result = $warehouse->tehsilLocations();
             // $this->view->result = $warehouse->getUCWarehousesofDistrict();
             break;
         case 60:
             $this->view->result = $warehouse->getIHRWarehouses($office);
             break;
     }
 }