public function icepackFreezingCapacityAgainstRoutineRequirementsAction() { $this->_helper->layout->disableLayout(); $ccm_warehouse = new Model_CcmWarehouses(); $form_values['office'] = $this->_request->getParam('level', ''); $form_values['combo1'] = $this->_request->getParam('province', ''); $form_values['combo2'] = $this->_request->getParam('district', ''); $ccm_warehouse->form_values = $form_values; $data_arr = $ccm_warehouse->icepackFreezingCapacityAgainstSIARequirementsGraph(); $main_heading = "Icepack freezing capacity"; $str_sub_heading = ""; $number_prefix = ""; $number_suffix = "%"; $s_number_prefix = ""; $xmlstore = "<?xml version = \"1.0\"?>"; $xmlstore = "<?xml version=\"1.0\"?>"; $xmlstore .= '<chart caption="' . $main_heading . '" numberprefix="' . $number_prefix . '" showvalues="0" exportEnabled="1" rotateValues="1" theme="fint">'; $categories = '<categories>'; $dataset_1 = '<dataset seriesname="Surplus > 30%" >'; $dataset_2 = '<dataset seriesname="Surplus 10-30%" >'; $dataset_3 = '<dataset seriesname="Match +/- 30%" >'; $dataset_4 = '<dataset seriesname="Shortage 10-30%" >'; $dataset_5 = '<dataset seriesname="Shortage > 30%" >'; //App_Controller_Functions::pr($data_arr ); foreach ($data_arr as $sub_arr) { $categories .= '<category label="' . $sub_arr['FacilityType'] . '" />'; $dataset_1 .= '<set value="' . $sub_arr['surplus30'] . '" />'; $dataset_2 .= '<set value="' . $sub_arr['surplus1030'] . '" />'; $dataset_3 .= '<set value="' . $sub_arr['match10'] . '" />'; $dataset_4 .= '<set value="' . $sub_arr['shortage1030'] . '" />'; $dataset_5 .= '<set value="' . $sub_arr['shortage30'] . '" />'; } $categories .= '</categories>'; $dataset_1 .= '</dataset>'; $dataset_2 .= '</dataset>'; $dataset_3 .= '</dataset>'; $dataset_4 .= '</dataset>'; $dataset_5 .= '</dataset>'; $xmlstore .= $categories; $xmlstore .= $dataset_1; $xmlstore .= $dataset_2; $xmlstore .= $dataset_3; $xmlstore .= $dataset_4; $xmlstore .= $dataset_5; $xmlstore .= "</chart>"; $this->view->xmlstore = $xmlstore; $this->view->main_heading = $main_heading; $this->view->str_sub_heading = $str_sub_heading; $this->view->chart_type = 'StackedColumn2DLine'; $this->view->width = '100%'; $this->view->height = '400'; }
public function refrigeratorsFreezersUtilizationPieAction() { $ccm_warehouse = new Model_CcmWarehouses(); $data_arr = $ccm_warehouse->getRefrigeratorsFreezersUtilizationPie(); $search_form = new Form_ReportsSearch(); $main_heading = "Refrigerators/freezers utilization"; $str_sub_heading = ""; $number_prefix = ""; $number_suffix = "%"; $s_number_prefix = ""; //App_Controller_Functions::pr($data_arr); $xmlstore = "<?xml version=\"1.0\"?>"; $xmlstore .= '<chart caption="' . $main_heading . '" subCaption="' . $str_sub_heading . '" numberPrefix="' . $number_prefix . '" numberSuffix="' . $number_suffix . '" sformatNumberScale="1" sNumberPrefix="' . $s_number_prefix . '" syncAxisLimits="1" rotateValues="1" showSum="0" theme="fint">'; $xmlstore .= '<set label="In Use" value="' . $data_arr['<InUse'] . '"/>'; $xmlstore .= '<set label="In Store" value="' . $data_arr['InStore'] . '"/>'; $xmlstore .= '<set label="Not Used" value="' . $data_arr['NotUsed'] . '"/>'; $xmlstore .= '<set label="Unknown" value="' . $data_arr['Unknown'] . '"/>'; $xmlstore .= "</chart>"; $this->view->xmlstore = $xmlstore; $this->view->main_heading = $main_heading; $this->view->str_sub_heading = $str_sub_heading; $this->view->chart_type = 'Pie3D'; $this->view->width = '80%'; $this->view->height = '400'; $this->view->search_form = $search_form; $this->view->inlineScript()->appendFile(Zend_Registry::get('baseurl') . '/js/all_level_area_combo.js'); }
public function indexAction() { $form = new Form_Cadmin_HealthFacilitySearch(); $form_add = new Form_Cadmin_HealthFacility(); $params = array(); $ccm_wh = new Model_CcmWarehouses(); $form_values = $this->_request->getPost(); if ($this->_request->isPost()) { if ($form->isValid($this->_request->getPost())) { // App_Controller_Functions::pr($this->_request->getPost()); $form->office_id->setValue($form_values['office']); $form->combo1_id->setValue($form_values['combo1']); $form->combo2_id->setValue($form_values['combo2']); $form->warehouse_id->setValue($form_values['warehouse3']); $office = $form_values['office']; $combo1 = $form_values['combo1']; $combo2 = $form_values['combo2']; $warehouse = $form_values['warehouse3']; if (!empty($office)) { $params['office'] = $office; } if (!empty($combo1)) { $params['combo1'] = $combo1; } if (!empty($combo2)) { $params['combo2'] = $combo2; } if (!empty($warehouse)) { $params['warehouse'] = $warehouse; } } } else { $loginid = $this->_getParam('login_id'); $role_id = $this->_getParam('role'); $office = $this->_getParam('office'); $combo1 = $this->_getParam('combo1'); $combo2 = $this->_getParam('combo2'); $warehouse = $this->_getParam('warehouse3'); if (!empty($office)) { $params['office'] = $office; $form->office_id->setValue($office); } if (!empty($combo1)) { $params['combo1'] = $combo1; $form->combo1_id->setValue($combo1); } if (!empty($combo2)) { $params['combo2'] = $combo2; $form->combo2_id->setValue($combo2); } if (!empty($warehouse)) { $params['warehouse3'] = $warehouse; $form->warehouse_id->setValue($warehouse); } } $sort = $this->_getParam("sort", "asc"); $order = $this->_getParam("order", "login_id"); $ccm_wh->form_values = $params; $result = $ccm_wh->getAllHealthFacility($order, $sort); //Paginate the contest results $paginator = Zend_Paginator::factory($result); $page = $this->_getParam("page", 1); $counter = $this->_getParam("counter", 10); $paginator->setCurrentPageNumber((int) $page); $paginator->setItemCountPerPage((int) $counter); $list_detail = new Model_ListDetail(); $list_detail->form_values['master_id'] = Model_ListMaster::VACCINATION_STAFF; $result1 = $list_detail->getListDetailByMasterId(); $this->view->epi_vaccination_staff = $result1; $list_detail->form_values['master_id'] = Model_ListMaster::SOLAR_ENERGY; $result2 = $list_detail->getListDetailByMasterId(); $this->view->solar_energy = $result2; $list_detail->form_values['master_id'] = Model_ListMaster::Service_Types; $result23 = $list_detail->getListDetailByMasterId(); $this->view->services_type = $result23; $this->view->form = $form; $this->view->form_add = $form_add; $this->view->paginator = $paginator; $this->view->sort = $sort; $this->view->order = $order; $this->view->counter = $counter; $this->view->pagination_params = $params; $base_url = Zend_Registry::get('baseurl'); $this->view->inlineScript()->appendFile($base_url . '/js/all_level_combos.js'); $this->view->inlineScript()->appendFile($base_url . '/js/all_level_combos3.js'); }
public function vaccineStorageCapacityAt20Action() { //ccem proposed list 2.1b (11) $this->_helper->layout->setLayout('reports'); $data_arr = array(); $search_form = new Form_ReportsSearch(); $ccm_warehouse = new Model_CcmWarehouses(); $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_warehouse->form_values = $form_values; $data_arr = $ccm_warehouse->vaccineStorageCapacityAt20Report(); } } $xmlstore = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; $xmlstore .= "<rows>"; foreach ($data_arr as $sub_arr) { $xmlstore .= "<row>"; $xmlstore .= "<cell>" . $sub_arr['Province'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['District'] . "</cell>"; $xmlstore .= "<cell><![CDATA[" . $sub_arr['FacilityName'] . "]]></cell>"; $xmlstore .= "<cell>" . $sub_arr['FacilityType'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['ActualCap'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['Required'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['Difference'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['surplus30'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['surplus1030'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['match10'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['shortage1030'] . "</cell>"; $xmlstore .= "<cell>" . $sub_arr['shortage30'] . "</cell>"; $xmlstore .= "</row>"; } $xmlstore .= "</rows>"; $this->view->main_heading = "CCEM Reports"; $this->view->report_title = "Vaccine storage capacity at -20c against requirements"; $this->view->headers = 'Province,District,Facility Name,Facility Type,Actual Capacity (Ltr),Required Capacity (Ltr),Difference (Ltr), Surplus > 30%,Surplus 10-30%,Match +/- 10%, Shortage 10-30%, Shortage >30%'; $this->view->rspan = ''; $this->view->cspan = '#cspan,#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,ro,ro'; $this->view->aligns = 'left,left,left,left,right,right,right,right,right,right,right,right'; $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'); }