public function nationalReportAction() { $this->_helper->layout->setLayout('reports'); $item_pack_sizes = new Model_ItemPackSizes(); $item = $item_pack_sizes->productsReport(); if (isset($this->_request->year_sel) && !empty($this->_request->month_sel)) { $stakeholder = new Model_Stakeholders(); $stk = $stakeholder->nationReport(); $locations = new Model_Locations(); $lct = $locations->nationalReport(); $year = $this->_request->year_sel; $month = $this->_request->month_sel; $this->view->year_sel = $year; $this->view->month_sel = $month; $this->view->report_id = 'SNASUM'; $this->view->report_title = 'National Report for'; $this->view->actionpage = ''; $this->view->parameters = 'T'; $this->view->parameter_width = '40%'; $this->view->location = $lct; $this->view->in_item = 1; $this->view->in_stk = 1; $this->view->in_prov = 0; $this->view->in_dist = 0; $this->view->counter = 1; $this->view->in_col = 'CABM'; $this->view->in_rg = 'N'; $this->view->in_type = 'N'; $this->view->stk = $stk; $this->view->actionpage = 'national-report'; } else { $warehouse_data = new Model_WarehousesData(); //$year = $warehouse_data->getMaxYear(); $year = date("Y"); $warehouse_data->getMaxMonth($year); // if (date('d') > 10) { // $month = date("m", strtotime("-1")); // } else { $month = date("m", strtotime("-2 month")); // } $stakeholder = new Model_Stakeholders(); $stk = $stakeholder->nationReport(); $locations = new Model_Locations(); $lct = $locations->nationalReport(); $this->view->year_sel = $year; $this->view->month_sel = $month; $this->view->report_id = 'SNASUM'; $this->view->report_title = 'National Report for'; $this->view->actionpage = 'national-report'; $this->view->parameters = 'T'; $this->view->parameter_width = '40%'; $this->view->location = $lct; $this->view->in_item = 1; $this->view->in_stk = 1; $this->view->in_prov = 0; $this->view->in_dist = 0; $this->view->counter = 1; $this->view->in_col = 'CABM'; $this->view->in_rg = 'N'; $this->view->in_type = 'N'; $this->view->stk = $stk; } $this->view->item_id = $item; $this->view->geo_level_id = 1; }