public function divisionalReportAction() { $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(); $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 = 'SDISTRICTREPORT'; $this->view->report_title = 'Divisional Report'; $this->view->actionpage = ''; $this->view->parameters = 'PIT'; $this->view->parameter_width = '100%'; $this->view->in_col = 'CABM'; $this->view->in_rg = 'R'; $this->view->in_type_1 = 'V'; $this->view->in_type = 'P'; $this->view->sel_item = 1; $locations = new Model_Locations(); $this->view->sel_item = $this->_request->prod_sel; $stakeholder = new Model_Stakeholders(); $stk = $stakeholder->nationReport(); $this->view->stk = $stk; $lct = $locations->devisionalReport(); $locations->province_id = $this->_request->prov_sel; $lct2 = $locations->devisionalLocations(); $this->view->loc = $lct2; $this->view->location = $lct; $this->view->prov_sel = $this->_request->prov_sel; $this->view->in_item = 1; $this->view->in_stk = 0; $this->view->in_prov = 0; $this->view->in_dist = 0; $this->view->counter = 1; $this->view->actionpage = 'divisional-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")); } $this->view->year_sel = $year; $this->view->month_sel = $month; $this->view->report_id = 'SDISTRICTREPORT'; $this->view->report_title = 'Divisional Report'; $this->view->actionpage = 'divisional-report'; $this->view->parameters = 'PIT'; $this->view->parameter_width = '100%'; $this->view->in_col = 'CABM'; $this->view->in_rg = 'P'; $this->view->in_type_1 = 'V'; $this->view->in_type = 'P'; $this->view->sel_item = 1; $stakeholder = new Model_Stakeholders(); $stk = $stakeholder->nationReport(); $this->view->stk = $stk; $locations = new Model_Locations(); $lct = $locations->devisionalReport(); $locations->province_id = 1; $lct2 = $locations->devisionalLocations(); $this->view->loc = $lct2; $this->view->location = $lct; $this->view->prov_sel = $this->_request->prov_sel; $this->view->in_item = 1; $this->view->in_stk = 0; $this->view->in_prov = 0; $this->view->in_dist = 0; $this->view->counter = 1; } }