public function refrigeratorFreezersUtilizationAction() { //ccem 4.4.13 $this->_helper->layout->setLayout('reports'); $data_arr = array(); $search_form = new Form_ReportsSearch(); $ccm_models = new Model_CcmModels(); $form_values['facility_type'] = $this->_request->getParam('facility_type', ''); $form_values['office'] = $this->_request->getParam('office', ''); $form_values['combo1'] = $this->_request->getParam('combo1', ''); $form_values['combo2'] = $this->_request->getParam('combo2', ''); if ($this->_request->isPost()) { if ($search_form->isValid($this->_request->getPost())) { $form_values = array_merge($form_values, $search_form->getValues()); $ccm_models->form_values = $form_values; $data_arr = $ccm_models->refrigeratorFreezersUtilizationReport(); } } $xmlstore = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; $xmlstore .= "<rows>"; foreach ($data_arr as $sub_arr) { //App_Controller_Functions::pr($sub_arr); $xmlstore .= "<row>"; $xmlstore .= "<cell><![CDATA[" . $sub_arr['ccm_model_name'] . "]]></cell>"; $xmlstore .= "<cell>" . $sub_arr['Total'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['inUse'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['inUsePer'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['inStore'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['inStorePer'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['notUsed'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['notUsedPer'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['unknown'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['unknownPer'] . "</cell>"; $xmlstore .= "</row>"; } $xmlstore .= "</rows>"; $this->view->main_heading = "CCEM Reports"; $this->view->report_title = "Refrigerator/Freezers Utilization"; $this->view->headers = 'Model,Total #,In Use #,In Use %,In Store #,In Store %,Not Used #,Not Used %, Unknown Status #,Unknown Status %'; $this->view->cspan = '#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan'; $this->view->width = '*,*,*,*,*,*,*,*,*,*'; $this->view->ro = 'ro,ro,ro,ro,ro,ro,ro,ro,ro,ro'; $this->view->xmlstore = $xmlstore; $this->view->search_form = $search_form; $search_form->facility_type->setValue($form_values['facility_type']); $this->view->form_values = $form_values; $this->view->data = $data_arr; $this->view->inlineScript()->appendFile(Zend_Registry::get('baseurl') . '/js/all_level_area_combo_report_graph.js'); }