コード例 #1
0
 public function indexAction()
 {
     $form = new Form_Cadmin_ModelsSearch();
     $form_add = new Form_Cadmin_ModelsAdd();
     $models = new Model_CcmModels();
     if ($this->_request->isPost()) {
         if ($form->isValid($this->_request->getPost())) {
             $models->form_values = $form->getValues();
         }
         //$form->ccm_asset_type_id_popup->setValue($ccm_asset_type_id_popup);
         //$form->ccm_asset_sub_type->setValue($ccm_asset_sub_type);
     }
     $sort = $this->_getParam("sort", "desc");
     $order = $this->_getParam("order", "pk_id");
     $result = $models->getModelsBySearch($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);
     $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;
     $base_url = Zend_Registry::get('baseurl');
     $this->view->inlineScript()->appendFile($base_url . '/js/records_per_page.js');
 }
コード例 #2
0
 public function init()
 {
     //Generate Asset Id Equipment Code Combo
     $models = new Model_CcmModels();
     $models->form_values['asset_type'] = Model_CcmAssetTypes::VOLTAGEREGULATOR;
     $result0 = $models->getAllAssetsByType();
     $this->_list["catalogue_id"][''] = "Select asset";
     foreach ($result0 as $row) {
         $this->_list["catalogue_id"][$row['pkId']] = $row['catalogueId'] . ' - ' . $row['ccmMakeName'] . ' - ' . $row['ccmModelName'];
     }
     //Generate Makes Combo
     $make = new Model_CcmMakes();
     $make->form_values = array('type_id' => Model_CcmAssetTypes::VOLTAGEREGULATOR);
     $result1 = $make->getAllMakesByAssetType();
     $this->_list["ccm_make_id"][''] = "Select Makes";
     foreach ($result1 as $make) {
         $this->_list["ccm_make_id"][$make['pkId']] = $make['ccmMakeName'];
     }
     //Generate Models Combo
     $this->_list["ccm_model_id"][''] = "Select Make First";
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "ccm_make_popup":
             case "ccm_model_popup":
             case "catalogue_id_popup":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "quantity":
             case "nominal_voltage":
             case "continous_power":
             case "frequency":
             case "product_price":
             case "input_voltage_range":
             case "output_voltage_range":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
         if (in_array($col, array_keys($this->_radio))) {
             $this->addElement("radio", $col, array("attribs" => array(), "allowEmpty" => true, 'separator' => '', "filters" => array("StringTrim", "StripTags"), "validators" => array(), "multiOptions" => $this->_radio[$col]));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
         if ($col == "catalogue_id") {
             $attribute_class = "col-md-2 form-control input-small form-group";
         } else {
             $attribute_class = "form-control";
         }
         if (in_array($col, array_keys($this->_list))) {
             $this->addElement("select", $col, array("attribs" => array("class" => $attribute_class), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col], "validators" => array()));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
     }
 }
コード例 #3
0
 public function init()
 {
     //Generate Asset Id Equipment Code Combo
     $models = new Model_CcmModels();
     $models->form_values['asset_type'] = Model_CcmAssetTypes::ICEPACKS;
     $result0 = $models->getAllAssetsByType();
     $this->_list["catalogue_id"][''] = "Select asset";
     foreach ($result0 as $row) {
         $this->_list["catalogue_id"][$row['catalogueId']] = $row['catalogueId'] . ' - ' . $row['ccmMakeName'] . ' - ' . $row['ccmModelName'];
     }
     //Generate Makes Combo
     $make = new Model_CcmMakes();
     $make->form_values = array('type_id' => Model_CcmAssetTypes::ICEPACKS);
     $result1 = $make->getAllMakesByAssetType();
     $this->_list["ccm_make_id"][''] = "Select Makes";
     foreach ($result1 as $make) {
         $this->_list["ccm_make_id"][$make['pkId']] = $make['ccmMakeName'];
     }
     //Generate Models Combo
     $this->_list["ccm_model_id"][''] = "Select Make First";
     foreach ($this->_hidden as $col => $name) {
         switch ($col) {
             case "office_id":
             case "combo1_id":
             case "warehouse_id":
             case "model_id":
                 $this->addElement("hidden", $col);
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
     }
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             default:
                 break;
         }
         if (in_array($col, array_keys($this->_radio))) {
             $this->addElement("radio", $col, array("attribs" => array(), "allowEmpty" => true, 'separator' => '', "filters" => array("StringTrim", "StripTags"), "validators" => array(), "multiOptions" => $this->_radio[$col]));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag")->removeDecorator("<br>");
         }
         if ($col == "catalogue_id") {
             $attribute_class = "form-control";
         } else {
             $attribute_class = "form-control";
         }
         if (in_array($col, array_keys($this->_list))) {
             $this->addElement("select", $col, array("attribs" => array("class" => $attribute_class), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col], "validators" => array(array("validator" => "Float", "breakChainOnFailure" => false, "options" => array("messages" => array("notFloat" => $name . " must be a valid option"))))));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
     }
 }
コード例 #4
0
 public function addNewMakeModelAction()
 {
     $this->_helper->layout->setLayout("ajax");
     $models = new Model_CcmModels();
     $models->form_values = $this->_request->getParams();
     $models->addNewMakeModel();
     $models->form_values['asset_type'] = $this->_request->getParam('model_type');
     $result = $models->getAllAssetsByType();
     $this->view->result = $result;
 }
コード例 #5
0
 public function init()
 {
     //Generate Asset Id Equipment Code Combo
     $models = new Model_CcmModels();
     $models->form_values['asset_type'] = Model_CcmAssetTypes::REFRIGERATOR;
     $result0 = $models->getAllAssetsByType();
     $this->_list["catalogue_id"][''] = "Select";
     foreach ($result0 as $row) {
         $this->_list["catalogue_id"][$row['pkId']] = $row['catalogueId'] . ' - ' . $row['ccmMakeName'] . ' - ' . $row['ccmModelName'];
     }
     //Generate Makes Combo
     $make = new Model_CcmMakes();
     $make->form_values = array('type_id' => Model_CcmAssetTypes::REFRIGERATOR);
     $result1 = $make->getAllMakesByAssetType();
     $this->_list["ccm_make_id"][''] = "Select Makes";
     foreach ($result1 as $make) {
         $this->_list["ccm_make_id"][$make['pkId']] = $make['ccmMakeName'];
     }
     //Generate Temperature Monitor  Combo
     $list_master = new Model_ListMaster();
     $list_master->form_values = array('pk_id' => Model_ListMaster::Temperature_Monitor);
     $result5 = $list_master->getListDetailByType();
     $this->_list["temperature_monitor"][''] = "Select";
     foreach ($result5 as $rs) {
         $this->_list["temperature_monitor"][$rs['pkId']] = $rs['listValue'];
     }
     //Generate Temperature Monitor  Combo
     $list_master = new Model_ListMaster();
     $list_master->form_values = array('pk_id' => Model_ListMaster::refrigerant_gas_type);
     $result5 = $list_master->getListDetailByType();
     $this->_list["refrigerator_gas_type"][''] = "Select";
     foreach ($result5 as $rs) {
         $this->_list["refrigerator_gas_type"][$rs['pkId']] = $rs['listValue'];
     }
     //Generate Temperature Monitor  Combo
     $list_master = new Model_ListMaster();
     $list_master->form_values = array('pk_id' => Model_ListMaster::power_source);
     $result5 = $list_master->getListDetailByType();
     $this->_list["power_source"][''] = "Select";
     foreach ($result5 as $rs) {
         $this->_list["power_source"][$rs['pkId']] = $rs['listValue'];
     }
     //Generate Models Combo
     $this->_list["ccm_model_id"][''] = "Select Make First";
     //Generate Asset Sub Type Combo
     $asset_types = new Model_CcmAssetTypes();
     $asset_types->form_values = array('parent_id' => 1);
     $result3 = $asset_types->getAssetSubTypes();
     $this->_list["ccm_asset_type_id"][''] = "Select";
     $this->_list["ccm_asset_type_id_popup"][''] = "Select";
     foreach ($result3 as $assetsubtype) {
         $this->_list["ccm_asset_type_id"][$assetsubtype['pkId']] = $assetsubtype['assetTypeName'];
         $this->_list["ccm_asset_type_id_popup"][$assetsubtype['pkId']] = $assetsubtype['assetTypeName'];
     }
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "gross_capacity_4":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Cap 4"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "gross_capacity_4_popup":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Cap 4"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "gross_capacity_20":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Cap -20"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "gross_capacity_20_popup":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Cap -20"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "gross_capacity_20":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Cap -20"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "net_capacity_4_popup":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Net Cap 4"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "net_capacity_4":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Net Cap 4"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "net_capacity_20":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Net Cap -20"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "net_capacity_20_popup":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Net Cap -20"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "serial_number":
             case "product_price":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "working_since":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "ccm_make_popup":
             case "ccm_model_popup":
             case "catalogue_id_popup":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "asset_dimension_length":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Length"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "asset_dimension_length_popup":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Length"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "asset_dimension_length":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Length"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "asset_dimension_width_popup":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Width"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "asset_dimension_width":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Length"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "asset_dimension_height":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Height"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "asset_dimension_height_popup":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Height"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
         if (in_array($col, array_keys($this->_radio))) {
             $this->addElement("radio", $col, array("attribs" => array(), "allowEmpty" => true, 'separator' => '', "filters" => array("StringTrim", "StripTags"), "validators" => array(), "multiOptions" => $this->_radio[$col]));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
         if ($col == "ccm_asset_type_id_popup") {
             $attribute_class = "form-control form-group";
         } elseif ($col == "catalogue_id") {
             $attribute_class = "col-md-2 form-control input-small form-group";
         } else {
             $attribute_class = "form-control form-group";
         }
         if (in_array($col, array_keys($this->_list))) {
             $this->addElement("select", $col, array("attribs" => array("class" => $attribute_class), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col]));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
     }
     foreach ($this->_hidden as $col => $name) {
         switch ($col) {
             case "ccm_id":
             case "ccm_make_id_hidden":
             case "ccm_model_id_hidden":
                 $this->addElement("hidden", $col);
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
     }
 }
コード例 #6
0
 public function ajaxStabilizersByWorkingStatusAction()
 {
     //ccem proposed list 1.13a (37)
     $this->_helper->layout->disableLayout();
     $ccm_models = new Model_CcmModels();
     $form_values['office'] = $this->_request->getParam('office', '');
     $form_values['combo1'] = $this->_request->getParam('combo1', '');
     $form_values['combo2'] = $this->_request->getParam('combo2', '');
     $ccm_models->form_values = $form_values;
     $data_arr = $ccm_models->stabilizersByWorkingStatusGraph();
     $main_heading = "Stabilizers By Working Status";
     $str_sub_heading = "";
     $number_prefix = "";
     $number_suffix = "%";
     $s_number_prefix = "";
     $xmlstore = "<?xml version=\"1.0\"?>";
     $xmlstore .= '<chart caption="' . $main_heading . '" numberprefix="' . $number_prefix . '" showvalues="0" showborder="0" exportEnabled="1" rotateValues="1" theme="fint">';
     $categories = '<categories>';
     $dataset_1 = '<dataset seriesname="Working" >';
     $dataset_2 = '<dataset seriesname="Not Working" >';
     foreach ($data_arr as $sub_arr) {
         $categories .= '<category label="' . $sub_arr['FacilityType'] . '" />';
         $dataset_1 .= '<set value="' . $sub_arr['workingQuantity'] . '" />';
         $dataset_2 .= '<set value="' . $sub_arr['notWorkingQuantity'] . '" />';
     }
     $categories .= '</categories>';
     $dataset_1 .= '</dataset>';
     $dataset_2 .= '</dataset>';
     $xmlstore .= $categories;
     $xmlstore .= $dataset_1;
     $xmlstore .= $dataset_2;
     $xmlstore .= "</chart>";
     $this->view->xmlstore = $xmlstore;
     $this->view->main_heading = $main_heading;
     $this->view->str_sub_heading = $str_sub_heading;
     $this->view->chart_type = 'StackedBar2D';
     $this->view->width = '80%';
     $this->view->height = '500';
 }
コード例 #7
0
 public function init()
 {
     //Generate Asset Id Equipment Code Combo
     $models = new Model_CcmModels();
     $models->form_values['asset_type'] = Model_CcmAssetTypes::VACCINECARRIER;
     $result0 = $models->getAllAssetsByType();
     $this->_list["catalogue_id"][''] = "Select";
     foreach ($result0 as $row) {
         $this->_list["catalogue_id"][$row['pkId']] = $row['catalogueId'] . ' - ' . $row['ccmMakeName'] . ' - ' . $row['ccmModelName'];
     }
     //Generate Makes Combo
     $make = new Model_CcmMakes();
     $make->form_values = array('type_id' => Model_CcmAssetTypes::VACCINECARRIER);
     $result1 = $make->getAllMakesByAssetType();
     $this->_list["ccm_make_id"][''] = "Select Makes";
     foreach ($result1 as $make) {
         $this->_list["ccm_make_id"][$make['pkId']] = $make['ccmMakeName'];
     }
     //Generate Asset Sub Type Combo
     $asset_types = new Model_CcmAssetTypes();
     $asset_types->form_values = array('parent_id' => 2);
     $result3 = $asset_types->getAssetSubTypes();
     $this->_list["ccm_asset_type_id_popup"][''] = "Select";
     foreach ($result3 as $assetsubtype) {
         $this->_list["ccm_asset_type_id_popup"][$assetsubtype['pkId']] = $assetsubtype['assetTypeName'];
     }
     //Generate Models Combo
     $this->_list["ccm_model_id"][''] = "Select Make First";
     foreach ($this->_hidden as $col => $name) {
         switch ($col) {
             case "ccm_make_id_hidden":
             case "ccm_model_id_hidden":
                 $this->addElement("hidden", $col);
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
     }
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "ccm_make_popup":
             case "ccm_model_popup":
             case "catalogue_id_popup":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "quantity":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control input-small"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "net_capacity_4":
             case "cold_life":
             case "product_price":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "asset_dimension_length":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Length"), "allowEmpty" => false, "required" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "asset_dimension_length_popup":
             case "internal_dimension_length_popup":
             case "storage_dimension_length_popup":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Length"), "allowEmpty" => false, "required" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "asset_dimension_width":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Width"), "allowEmpty" => false, "required" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "asset_dimension_width_popup":
             case "internal_dimension_width_popup":
             case "storage_dimension_width_popup":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Width"), "allowEmpty" => false, "required" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "asset_dimension_height":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Height"), "allowEmpty" => false, "required" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             case "asset_dimension_height_popup":
             case "internal_dimension_height_popup":
             case "storage_dimension_height_popup":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Height"), "allowEmpty" => false, "required" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
         if (in_array($col, array_keys($this->_radio))) {
             $this->addElement("radio", $col, array("attribs" => array(), "allowEmpty" => true, 'separator' => '', "filters" => array("StringTrim", "StripTags"), "validators" => array(), "multiOptions" => $this->_radio[$col]));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag")->removeDecorator("<br>");
         }
         if ($col == "catalogue_id") {
             $attribute_class = "col-md-2 form-control input-small form-group";
         } else {
             $attribute_class = "form-control";
         }
         if (in_array($col, array_keys($this->_list))) {
             $this->addElement("select", $col, array("attribs" => array("class" => $attribute_class), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col], "validators" => array()));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
     }
 }
コード例 #8
0
 public function voltageStabilizersAndRegulatorsWorkingStatusAction()
 {
     //ccem proposed list 3.15 (41)
     $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->voltageStabilizersAndRegulatorsWorkingStatus();
         }
     }
     $xmlstore = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
     $xmlstore .= "<rows>";
     foreach ($data_arr as $sub_arr) {
         $xmlstore .= "<row>";
         $xmlstore .= "<cell><![CDATA[" . $sub_arr['warehouse_type_name'] . "]]></cell>";
         $xmlstore .= "<cell><![CDATA[" . $sub_arr['ccm_model_name'] . "]]></cell>";
         $xmlstore .= "<cell><![CDATA[" . $sub_arr['ccm_make_name'] . "]]></cell>";
         $xmlstore .= "<cell>" . $sub_arr['asset_type_name'] . "</cell>";
         $xmlstore .= "<cell>" . $sub_arr['total'] . "</cell>";
         $xmlstore .= "<cell>" . $sub_arr['working'] . "</cell>";
         $xmlstore .= "<cell>" . $sub_arr['working_per'] . "</cell>";
         $xmlstore .= "<cell>" . $sub_arr['needs_service'] . "</cell>";
         $xmlstore .= "<cell>" . $sub_arr['needs_service_per'] . "</cell>";
         $xmlstore .= "<cell>" . $sub_arr['not_working'] . "</cell>";
         $xmlstore .= "<cell>" . $sub_arr['not_working_per'] . "</cell>";
         $xmlstore .= "</row>";
     }
     $xmlstore .= "</rows>";
     $this->view->main_heading = "CCEM Reports";
     $this->view->report_title = "Voltage Stabilizers And Regulators Working Status";
     $this->view->headers = 'Facility Type,Model Name,Manufacturer,Equipment Type,Total,Working #,Working %,Working Needs Service #,Working Needs Service %,Not Working #,Not Working %';
     $this->view->rspan = '';
     $this->view->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';
     $this->view->xmlstore = $xmlstore;
     $this->view->search_form = $search_form;
     $this->view->data = $data_arr;
     $search_form->facility_type->setValue($form_values['facility_type']);
     $this->view->form_values = $form_values;
     $this->view->inlineScript()->appendFile(Zend_Registry::get('baseurl') . '/js/all_level_area_combo_report_graph.js');
 }