public function underPerformingDistrictsAction() { //campaigns 4.3.2 $this->_helper->layout->setLayout('reports'); $data_arr = array(); $search_form = new Form_ReportsSearch(); $campaign_data = new Model_CampaignData(); $form_values['office'] = $this->_request->getParam('office', ''); $form_values['combo1'] = $this->_request->getParam('combo1', ''); $form_values['combo2'] = $this->_request->getParam('combo2', ''); $campaign = $form_values['campaign_id'] = $this->_request->getParam('campaign', ''); if ($this->_request->isPost()) { $province = $this->_request->getParam('combo1', ''); $campaign_data->form_values = $form_values; $search_form->combo1->setValue($this->_request->getParam('combo1', '')); $data_arr = $campaign_data->getUnderPerformingDistricts(); $campaigns = new Model_Campaigns(); $campaigns->form_values['province_id'] = $province; $campaign_data = $campaigns->getCampaignsByProvince(); } $xmlstore = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; $xmlstore .= "<rows>"; foreach ($data_arr as $sub_arr) { $xmlstore .= "<row>"; $xmlstore .= "<cell><![CDATA[" . $sub_arr['location_name'] . "]]></cell>"; $xmlstore .= "<cell>" . number_format($sub_arr['totalTarget']) . "</cell>"; $xmlstore .= "<cell>" . number_format($sub_arr['vaccinated']) . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['vaccinatedPer'] . "</cell>"; $xmlstore .= "</row>"; } $xmlstore .= "</rows>"; $this->view->main_heading = "Under-performing Districts by Province"; $this->view->report_title = "Under-performing Districts by Province"; $this->view->headers = 'District/ agency / town,Total Target population for the campaaign,No. of Children Vaccinated,% children vaccinated'; $this->view->rspan = ''; $this->view->cspan = '#cspan,#cspan,#cspan'; $this->view->width = '*,150,150,150'; $this->view->ro = 'ro,ro,ro,ro,ro,ro,ro,ro,ro,ro'; $this->view->xmlstore = $xmlstore; $this->view->data = $data_arr; $this->view->search_form = $search_form; $this->view->form_values = $form_values; $this->view->campaign_data = $campaign_data; $this->view->campaign = $campaign; $this->view->inlineScript()->appendFile(Zend_Registry::get('baseurl') . '/js/all_level_area_combo_report_graph.js'); }