public function getStakeholderListAction() { $stakeholders = new Model_Stakeholders(); $result = $stakeholders->getStakholder(); echo Zend_Json::encode($result); }
public function ucReportAction() { $this->_helper->layout->setLayout('reports'); if (isset($this->_request->year_sel) && !empty($this->_request->month_sel)) { $item_pack_sizes = new Model_ItemPackSizes(); $item = $item_pack_sizes->productsReport(); $locations = new Model_Locations(); $stakeholder = new Model_Stakeholders(); $stk = $stakeholder->getStakholder(); $lct = $locations->devisionalReport(); $this->view->item_id = $item; $year = $this->_request->year_sel; $month = $this->_request->month_sel; $this->view->year_sel = $year; $this->view->month_sel = $month; $this->view->report_id = 'UCREPORT'; $this->view->report_title = 'Union Council Report'; $this->view->actionpage = ''; $this->view->parameters = 'SPIT'; $this->view->parameter_width = '90%'; $sel_item = $this->_request->prod_sel; // $sel_item = $this->_request->item_sel; $this->view->in_col = 'CABM'; $this->view->in_rg = 'U'; $this->view->in_type = 'D'; $this->view->sel_item = $this->_request->stkid; $this->view->in_type_1 = 'U'; $this->view->prov_sel = $this->_request->prov_sel; $this->view->sel_item = $this->_request->prod_sel; // $this->view->sel_item = $this->_request->item_sel; $this->view->stk = $stk; $locations->form_values['province_id'] = $this->_request->prov_sel; $locations->form_values['district_id'] = $this->_request->dist_id; $locations->form_values['tehsil_id'] = $this->_request->teh_id; $locations->form_values['uc_id'] = $this->_request->uc_id; $lct2 = $locations->ucLocations(); $this->view->loc = $lct2; $this->view->location = $lct; $locations->form_values['geo_level_id'] = '4'; $locations->form_values['province_id'] = $this->_request->prov_sel; $district = $locations->getLocationsByLevelByProvince(); $this->view->district = $district; $locations->form_values['geo_level_id'] = 5; $locations->form_values['district_id'] = $this->_request->dist_id; $tehsil = $locations->getLocationsByLevelByDistrict(); $this->view->combo_teh = $tehsil; $locations->form_values['geo_level_id'] = 6; $locations->form_values['parent_id'] = $this->_request->teh_id; $uc = $locations->getLocationsByLevelByTehsil(); $this->view->combo_uc = $uc; $this->view->in_item = $this->_request->prod_sel; $this->view->in_stk = 1; $this->view->in_prov = $this->_request->prov_sel; $this->view->in_dist = $this->_request->dist_id; $this->view->counter = 1; $this->view->sel_dist = $this->_request->dist_id; $this->view->sel_teh = $this->_request->teh_id; $this->view->sel_uc = $this->_request->uc_id; $item_pack_sizes->form_values['pk_id'] = $sel_item; $item_name = $item_pack_sizes->getProductName(); $this->view->item_name = $item_name; $locations->form_values['pk_id'] = $this->_request->dist_id; $location_name = $locations->getLocationName(); $this->view->district_name = $location_name; $locations->form_values['pk_id'] = $this->_request->prov_sel; $location_name = $locations->getLocationName(); $this->view->province_name = $location_name; $locations->form_values['pk_id'] = $this->_request->teh_id; $location_name = $locations->getLocationName(); $this->view->tehsil_name = $location_name; $this->view->actionpage = 'uc-report'; } else { $item_pack_sizes = new Model_ItemPackSizes(); $item = $item_pack_sizes->productsReport(); $this->view->item_id = $item; $warehouse_data = new Model_WarehousesData(); $year = date("Y"); // if (date('d') > 10) { // $month = date("m", strtotime("-1")); // } else { $month = date("m", strtotime("-2 month")); // } $this->view->year_sel = $year; $this->view->month_sel = $month; $this->view->report_id = 'UCREPORT'; $this->view->report_title = 'Union Council Report'; $this->view->actionpage = 'uc-report'; $this->view->parameters = 'SPIT'; $this->view->parameter_width = '90%'; $this->view->in_col = 'SPIT'; $this->view->in_rg = 'U'; $this->view->in_type = 'D'; $this->view->sel_item = 28; $this->view->in_type_1 = 'U'; $stakeholder = new Model_Stakeholders(); $stk = $stakeholder->getStakholder(); $this->view->stk = $stk; $locations = new Model_Locations(); $lct = $locations->devisionalReport(); $locations->form_values['province_id'] = ""; $locations->form_values['district_id'] = ""; $locations->form_values['tehsil_id'] = ""; $locations->form_values['uc_id'] = ""; $lct2 = $locations->ucLocations(); $this->view->loc = $lct2; $this->view->location = $lct; $locations->form_values['geo_level_id'] = '4'; $locations->form_values['province_id'] = '1'; $district = $locations->getLocationsByLevelByProvince(); $this->view->district = $district; $this->view->prov_sel = $this->_request->prov_sel; $this->view->in_item = 28; $this->view->in_stk = 0; $this->view->in_prov = 1; $this->view->in_dist = 0; $this->view->counter = 1; $item_pack_sizes->form_values['pk_id'] = 28; $item_name = $item_pack_sizes->getProductName(); $this->view->item_name = $item_name; $locations->form_values['pk_id'] = 0; $location_name = $locations->getLocationName(); $this->view->location_name = $location_name; $locations->form_values['pk_id'] = 1; $location_name = $locations->getLocationName(); $this->view->province_name = $location_name; if (empty($this->_request->dist_id)) { $this->view->district_name = "All"; } if (empty($this->_request->teh_id)) { $this->view->tehsil_name = "All"; } if (empty($this->_request->uc_id)) { $this->view->uc_name = "All"; } } $this->view->geo_level_id = 6; }