public function vaccineDropoutRateAction() { $this->_helper->layout->setLayout('reports'); // $this->view->report_id = 'SNONREPDIST'; $this->view->report_id = 'VDROPOUTRATE'; $this->view->actionpage = 'vaccine-dropout-rate'; $this->view->parameters = 'TS01IP'; $this->view->parameter_width = '100%'; $this->view->report_title = 'Vaccine Dropout Rate at'; $item_pack_sizes = new Model_ItemPackSizes(); $item = $item_pack_sizes->productsReport(); $this->view->item_id = $item; //filters if (isset($this->_request->province) && !empty($this->_request->province)) { $this->view->province = $this->_request->province; } else { $this->view->province = $province = 2; } if (isset($this->_request->district) && !empty($this->_request->district)) { $this->view->district1 = $this->_request->district; } else { $this->view->district1 = 30; } if (isset($this->_request->tehsil) && !empty($this->_request->tehsil)) { $this->view->tehsil = $this->_request->tehsil; } else { $this->view->tehsil = 1; } if (isset($this->_request->wh_type) && !empty($this->_request->wh_type)) { $this->view->wh_type = $wh_type = $this->_request->wh_type; } else { $this->view->wh_type = $wh_type = 4; } $locations = new Model_Locations(); if ($this->_request->wh_type == 4) { $locations->form_values['pk_id'] = $this->_request->district; $this->view->loc_name = "District:" . ' ' . $locations->getLocationName(); } elseif ($this->_request->wh_type == 5) { $locations->form_values['pk_id'] = $this->_request->tehsil; $this->view->loc_name = "Tehsil:" . ' ' . $locations->getLocationName(); } else { $this->view->loc_name = "District:" . ' ' . 'Bahawalpur'; } // $location->form_values['province_id'] = $province; // $location_name = $location->districtLocations(); // $this->view->location_name = $location_name; if (!empty($this->_request->from_year_sel) && !empty($this->_request->from_month_sel)) { $this->view->from_year_sel = $from_year = $this->_request->from_year_sel; $this->view->from_month_sel = $from_month = $this->_request->from_month_sel; } else { $from_year = date("Y"); $this->view->from_year_sel = $from_year; $this->view->from_month_sel = $from_month = date("m", strtotime("-3 month")); } if (!empty($this->_request->month_sel)) { $this->view->year_sel = $year = $this->_request->year_sel; $this->view->month_sel = $month = $this->_request->month_sel; } else { $year = date("Y"); $this->view->year_sel = $year; $this->view->month_sel = $month = date("m", strtotime("-1")); } $month = 12; $this->view->prov_sel = $province; if (isset($this->_request->stk_sel) && !empty($this->_request->stk_sel)) { $this->view->stk_sel = $sel_stk = $this->_request->stk_sel; } else { $this->view->stk_sel = $sel_stk = 1; } if (isset($this->_request->prod_sel) && !empty($this->_request->prod_sel)) { $this->view->sel_item = $sel_item = $this->_request->prod_sel; } else { $this->view->sel_item = $sel_item = 26; } $this->view->sel_item = $sel_item; $end_date1 = $year . '-' . $month . '-01'; // echo $end_date1; $end_date = date('Y-m-d', strtotime("-1 days", strtotime("+1 month", strtotime($end_date1)))); $start_date = date('Y-m-d', strtotime("-11 month", strtotime($end_date1))); $this->view->start_date = $start_date; $this->view->end_date = $end_date; // Start date and End date $begin = new DateTime($start_date); $end = new DateTime($end_date); $diff = $begin->diff($end); $interval = DateInterval::createFromDateString('1 month'); $period = new DatePeriod($begin, $interval, $end); $this->view->period = $period; $stakeholder = new Model_Stakeholders(); $stk = $stakeholder->nationReport(); $this->view->stk = $stk; $locations = new Model_Locations(); $lct = $locations->devisionalReport(); $this->view->location = $lct; }