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"); } } }
public function ajaxGetAllMakesByAssetTypeAction() { $this->_helper->layout->disableLayout(); if (isset($this->_request->type_id) && !empty($this->_request->type_id)) { $makes = new Model_CcmMakes(); $makes->form_values['type_id'] = $this->_request->type_id; $array = $makes->getAllMakesByAssetType(); $this->view->data = $array; } }
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"); } } }
public function init() { //Generate working status Combo $ccm_status_list = new Model_CcmStatusList(); $result1 = $ccm_status_list->getStatusLists(); $this->_list["ccm_status_list_id"][''] = "Select working status"; foreach ($result1 as $row) { $this->_list["ccm_status_list_id"][$row['pkId']] = $row['ccmStatusListName']; } //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->_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) { case "catalogue_id": $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 (in_array($col, array_keys($this->_list))) { $this->addElement("select", $col, array("attribs" => array("class" => 'form-control'), "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"); } } }
public function indexAction() { $form = new Form_Cadmin_MakeSearch(); $form_add = new Form_Cadmin_MakeAdd(); $makes = new Model_CcmMakes(); if ($this->_request->isPost()) { if ($form->isValid($this->_request->getPost())) { //App_Controller_Functions::pr($this->_request->getPost()); $name = $form->getValue('name'); $status = $form->getValue('status'); if (!empty($name)) { $makes->form_values['ccmMakeName'] = $name; } if (!empty($status)) { $makes->form_values['status'] = $status; } } $form->name->setValue($name); $form->status->setValue($status); } $sort = $this->_getParam("sort", "asc"); $order = $this->_getParam("order", "make_name"); $result = $makes->getAllMakes($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/all_level_combos.js'); }
public function init() { //Generate working status Combo $ccm_status_list = new Model_CcmStatusList(); $result1 = $ccm_status_list->getStatusLists(); $this->_list["ccm_status_list_id"][''] = "Select working status"; foreach ($result1 as $row) { $this->_list["ccm_status_list_id"][$row['pkId']] = $row['ccmStatusListName']; } //Generate Make Combo $makes = new Model_CcmMakes(); $makes->form_values = array('type_id' => Model_CcmAssetTypes::GENERATOR); $result3 = $makes->getAllMakesByAssetType(); $this->_list["ccm_make_id"][''] = "Select"; if ($result3 != false) { foreach ($result3 as $wh) { $this->_list["ccm_make_id"][$wh['pkId']] = $wh['ccmMakeName']; } } //Generate source of supply Combo $stakeholder = new Model_Stakeholders(); $stakeholder->form_values['type'] = 1; $result2 = $stakeholder->getAllStakeholders(); $this->_list["source_id"][''] = "Select Source Of Supply"; foreach ($result2 as $row2) { $this->_list["source_id"][$row2['pkId']] = $row2['stakeholderName']; } 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) { case "serial_number": case "asset_id": $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_from": case "working_since_to": $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; default: break; } if (in_array($col, array_keys($this->_list))) { $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "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"); } 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 (in_array($col, array_keys($this->_checkbox))) { $this->addElement("multiCheckbox", $col, array("attribs" => array(), "allowEmpty" => true, 'separator' => '', "filters" => array("StringTrim", "StripTags"), "validators" => array(), "multiOptions" => $this->_checkbox[$col])); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag")->removeDecorator("<br>"); } } }
public function init() { //Generate Makes Combo $makes = new Model_CcmMakes(); $makes->form_values = array('type_id' => Model_CcmAssetTypes::TRANSPORT); $result1 = $makes->getAllMakesByAssetType(); $this->_list["ccm_make_id"][''] = "Select Makes"; if ($result1) { foreach ($result1 as $row) { $this->_list["ccm_make_id"][$row['pkId']] = $row['ccmMakeName']; } } //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' => Model_CcmAssetTypes::TRANSPORT); $result3 = $asset_types->getAssetSubTypes(); $this->_list["ccm_asset_sub_type_id"][''] = "Select Asset Sub Types"; if ($result3) { foreach ($result3 as $assetsubtype) { $this->_list["ccm_asset_sub_type_id"][$assetsubtype['pkId']] = $assetsubtype['assetTypeName']; } } //Generate Fuel Type Combo $list = new Model_ListDetail(); $list->form_values = array('fuel_type_id' => Model_ListMaster::FUEL_TYPE); $result4 = $list->getFuelTypes(); $this->_list["fuel_type_id"][''] = "Select Fuel Types"; if ($result4) { foreach ($result4 as $fueltype) { $this->_list["fuel_type_id"][$fueltype['pkId']] = $fueltype['listValue']; } } foreach ($this->_fields as $col => $name) { switch ($col) { case "registration_no": case "used_for_epi": case "comments": $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "manufacture_year": $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; default: break; } if (in_array($col, array_keys($this->_list))) { $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "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"); } } foreach ($this->_hidden as $col => $name) { switch ($col) { case "ccm_id": case "model_hidden": $this->addElement("hidden", $col); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; default: break; } } }
public function init() { //Generate Make Combo $makes = new Model_CcmMakes(); $makes->form_values = array('type_id' => Model_CcmAssetTypes::GENERATOR); $result3 = $makes->getAllMakesByAssetType(); $this->_list["make"][''] = "Select"; if ($result3 != false) { foreach ($result3 as $wh) { $this->_list["make"][$wh['pkId']] = $wh['ccmMakeName']; } } //Generate Power Source Combo $list_master = new Model_ListMaster(); $list_master->form_values = array('pk_id' => Model_ListMaster::FUEL_TYPE); $result1 = $list_master->getListDetailByType(); $this->_list["power_source"][''] = "Select"; if ($result1 != false) { foreach ($result1 as $rs) { $this->_list["power_source"][$rs['pkId']] = $rs['listValue']; } } //Generate Used For Combo $list_master = new Model_ListMaster(); $list_master->form_values = array('pk_id' => Model_ListMaster::USE_FOR); $result2 = $list_master->getListDetailByType(); $this->_list["use_for"][''] = "Select"; if ($result2 != false) { foreach ($result2 as $rs) { $this->_list["use_for"][$rs['pkId']] = $rs['listValue']; } } //Generate Utilizations Combo //not decided yet from which table it will populate $list_master = new Model_ListMaster(); $list_master->form_values = array('pk_id' => Model_ListMaster::USE_FOR); $result2 = $list_master->getListDetailByType(); $this->_list["equipment_utilizations"][''] = "Select"; foreach ($result2 as $rs) { $this->_list["equipment_utilizations"][$rs['pkId']] = $rs['listValue']; } foreach ($this->_fields as $col => $name) { switch ($col) { case "power_rating": case "serial_number": $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; default: break; } if (in_array($col, array_keys($this->_list))) { $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "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"); } 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 (in_array($col, array_keys($this->_checkbox))) { $this->addElement("multiCheckbox", $col, array("attribs" => array(), "allowEmpty" => true, 'separator' => '', "filters" => array("StringTrim", "StripTags"), "validators" => array(), "multiOptions" => $this->_checkbox[$col])); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag")->removeDecorator("<br>"); } } foreach ($this->_hidden as $col => $name) { switch ($col) { case "ccm_id": case "model_hidden": $this->addElement("hidden", $col); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; default: break; } } }
public function ajaxGetMakeAction() { $this->_helper->layout->disableLayout(); if (isset($this->_request->make) && !empty($this->_request->make)) { $makes = new Model_CcmMakes(); $makes->form_values['make_id'] = $this->_request->make; $array = $makes->getMakeByMakeId(); //$this->view->model_id = $this->_request->model; $this->view->data = $array; } }
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; } } }
public function init() { //Generate working status Combo $ccm_status_list = new Model_CcmStatusList(); $result1 = $ccm_status_list->getStatusLists(); $this->_list["ccm_status_list_id"][''] = "Select working status"; foreach ($result1 as $row) { $this->_list["ccm_status_list_id"][$row['pkId']] = $row['ccmStatusListName']; } //Generate Makes Combo $makes = new Model_CcmMakes(); $makes->form_values = array('type_id' => Model_CcmAssetTypes::TRANSPORT); $result1 = $makes->getAllMakesByAssetType(); $this->_list["ccm_make_id"][''] = "Select Makes"; if ($result1) { foreach ($result1 as $row) { $this->_list["ccm_make_id"][$row['pkId']] = $row['ccmMakeName']; } } //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' => Model_CcmAssetTypes::TRANSPORT); $result3 = $asset_types->getAssetSubTypes(); $this->_list["ccm_asset_sub_type_id"][''] = "Select Asset Sub Types"; if ($result3) { foreach ($result3 as $assetsubtype) { $this->_list["ccm_asset_sub_type_id"][$assetsubtype['pkId']] = $assetsubtype['assetTypeName']; } } //Generate Fuel Type Combo $list = new Model_ListDetail(); $list->form_values = array('fuel_type_id' => Model_ListMaster::FUEL_TYPE); $result4 = $list->getFuelTypes(); $this->_list["fuel_type_id"][''] = "Select Fuel Types"; if ($result4) { foreach ($result4 as $fueltype) { $this->_list["fuel_type_id"][$fueltype['pkId']] = $fueltype['listValue']; } } //Generate source of supply Combo $stakeholder = new Model_Stakeholders(); $stakeholder->form_values['type'] = 1; $result2 = $stakeholder->getAllStakeholders(); $this->_list["source_id"][''] = "Select Source Of Supply"; foreach ($result2 as $row2) { $this->_list["source_id"][$row2['pkId']] = $row2['stakeholderName']; } 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) { case "registration_no": $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "manufacture_year_from": case "manufacture_year_to": $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; default: default: break; } if (in_array($col, array_keys($this->_list))) { $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "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"); } 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>"); } } }
public function init() { //Generate Make Combo $makes = new Model_CcmMakes(); $makes->form_values = array('type_id' => Model_CcmAssetTypes::COLDROOM); $result3 = $makes->getAllMakesByAssetType(); $this->_list["make"][''] = "Select"; foreach ($result3 as $rs) { $this->_list["make"][$rs['pkId']] = $rs['ccmMakeName']; } //Generate Asset Sub Type Combo $asset_type = new Model_CcmAssetTypes(); $asset_type->form_values = array('parent_id' => Model_CcmAssetTypes::COLDROOM); $result4 = $asset_type->getAssetSubTypes(); $this->_list["ccm_asset_sub_type_id"][''] = "Select"; foreach ($result4 as $rs) { $this->_list["ccm_asset_sub_type_id"][$rs['pkId']] = $rs['assetTypeName']; } //Generate Type Rrecording System Combo $list_master = new Model_ListMaster(); $list_master->form_values = array('pk_id' => Model_ListMaster::TYPE_OF_RECORDING_SYSTEM); $result5 = $list_master->getListDetailByType(); $this->_list["type_recording_system"][''] = "Select"; foreach ($result5 as $rs) { $this->_list["type_recording_system"][$rs['pkId']] = $rs['listValue']; } //Generate Refrigerator Gas Type Combo $list_master->form_values = array('pk_id' => Model_ListMaster::REFRRIGERATOR_GAS_TYPE); $result6 = $list_master->getListDetailByType(); $this->_list["refrigerator_gas_type"][''] = "Select"; foreach ($result6 as $rs) { $this->_list["refrigerator_gas_type"][$rs['pkId']] = $rs['listValue']; } //Generate Backup Generator Combo $list_master->form_values = array('pk_id' => Model_ListMaster::HAS_WORKING_BACKUP_GENERATOR); $result7 = $list_master->getListDetailByType(); $this->_list["backup_generator"][''] = "Select"; foreach ($result7 as $rs) { $this->_list["backup_generator"][$rs['pkId']] = $rs['listValue']; } //Generate Temperature Recording System Combo $list_master->form_values = array('pk_id' => Model_ListMaster::TEMPERATURE_RECORDING_SYSTEM); $result8 = $list_master->getListDetailByType(); $this->_list["temperature_recording_system"][''] = "Select"; foreach ($result8 as $rs) { $this->_list["temperature_recording_system"][$rs['pkId']] = $rs['listValue']; } foreach ($this->_fields as $col => $name) { switch ($col) { case "cooling_system": $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 "gross_capacity_4": //case "gross_capacity_4": case "gross_capacity": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Capacity"), "allowEmpty" => true, "required" => 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, "required" => true, "filters" => array("StringTrim", "StripTags"), "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"); break; */ /* case "gross_capacity_20": $this->addElement("text", $col, array( "attribs" => array("class" => "form-control", "placeholder" => "Gross Cap 20"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "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"); break; */ case "net_capacity": //case "net_capacity_4": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Net Capacity"), "allowEmpty" => true, "required" => 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, "required" => true, "filters" => array("StringTrim", "StripTags"), "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"); break; */ /* case "net_capacity_20": $this->addElement("text", $col, array( "attribs" => array("class" => "form-control", "placeholder" => "Net Cap 20"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "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"); 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_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_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; default: break; } if (in_array($col, array_keys($this->_list))) { $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col], "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); } 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 (in_array($col, array_keys($this->_checkbox))) { $this->addElement("multiCheckbox", $col, array("attribs" => array(), "allowEmpty" => true, 'separator' => '', "filters" => array("StringTrim", "StripTags"), "validators" => array(), "multiOptions" => $this->_checkbox[$col])); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag")->removeDecorator("<br>"); } } foreach ($this->_hidden as $col => $name) { switch ($col) { case "ccm_id": case "model_hidden": $this->addElement("hidden", $col); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; default: break; } } }
public function init() { //Generate working status Combo $ccm_status_list = new Model_CcmStatusList(); $result1 = $ccm_status_list->getStatusLists(); $this->_list["ccm_status_list_id"][''] = "Select working status"; foreach ($result1 as $row) { $this->_list["ccm_status_list_id"][$row['pkId']] = $row['ccmStatusListName']; } //Generate source of supply Combo $stakeholder = new Model_Stakeholders(); $stakeholder->form_values['type'] = 1; $result2 = $stakeholder->getAllStakeholders(); $this->_list["source_id"][''] = "Select Source Of Supply"; foreach ($result2 as $row2) { $this->_list["source_id"][$row2['pkId']] = $row2['stakeholderName']; } //Generate Make Combo $makes = new Model_CcmMakes(); $makes->form_values = array('type_id' => Model_CcmAssetTypes::COLDROOM); $result3 = $makes->getAllMakesByAssetType(); $this->_list["make"][''] = "Select"; foreach ($result3 as $rs) { $this->_list["make"][$rs['pkId']] = $rs['ccmMakeName']; } //Generate Asset Sub Type Combo $asset_type = new Model_CcmAssetTypes(); $asset_type->form_values = array('parent_id' => Model_CcmAssetTypes::COLDROOM); $result4 = $asset_type->getAssetSubTypes(); $this->_list["ccm_asset_sub_type_id"][''] = "Select"; foreach ($result4 as $rs) { $this->_list["ccm_asset_sub_type_id"][$rs['pkId']] = $rs['assetTypeName']; } 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) { case "year_supply_from": case "year_supply_to": case "cooling_system": $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 "capacity_from": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Capacity"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "capacity_to": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Capacity"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "asset_id": $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "working_since_from": $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 "working_since_to": $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 "gross_capacity_4": //case "gross_capacity_4": case "gross_capacity": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Capacity"), "allowEmpty" => true, "required" => false, "filters" => array("StringTrim", "StripTags"), "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"); break; /* case "gross_capacity_20": $this->addElement("text", $col, array( "attribs" => array("class" => "form-control", "placeholder" => "Gross Cap 20"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "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"); break; */ /* case "gross_capacity_20": $this->addElement("text", $col, array( "attribs" => array("class" => "form-control", "placeholder" => "Gross Cap 20"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "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"); break; */ case "net_capacity": //case "net_capacity_4": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Net Capacity"), "allowEmpty" => true, "required" => false, "filters" => array("StringTrim", "StripTags"), "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"); break; /* case "net_capacity_20": $this->addElement("text", $col, array( "attribs" => array("class" => "form-control", "placeholder" => "Net Cap 20"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "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"); break; */ /* case "net_capacity_20": $this->addElement("text", $col, array( "attribs" => array("class" => "form-control", "placeholder" => "Net Cap 20"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "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"); 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_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_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; default: break; } if (in_array($col, array_keys($this->_list))) { $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "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"); } 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 (in_array($col, array_keys($this->_checkbox))) { $this->addElement("multiCheckbox", $col, array("attribs" => array(), "allowEmpty" => true, 'separator' => '', "filters" => array("StringTrim", "StripTags"), "validators" => array(), "multiOptions" => $this->_checkbox[$col])); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag")->removeDecorator("<br>"); } } }
public function init() { // Makes Combo $ccm_makes = new Model_CcmMakes(); $result1 = $ccm_makes->getAllMakesForAddForm(); $this->_list["ccm_make_id"][''] = "Select"; if ($result1 != false) { foreach ($result1 as $rs) { $this->_list["ccm_make_id"][$rs['pkId']] = $rs['ccmMakeName']; } } //Refrigerant Gas Type Combo /*$list_master = new Model_ListMaster(); $list_master->form_values = array('pk_id' => Model_ListMaster::REFRRIGERATOR_GAS_TYPE); $result2 = $list_master->getListDetailByType(); $this->_list["gas_type"][''] = "Select"; if ($result2 != false) { foreach ($result2 as $rs) { $this->_list["gas_type"][$rs['pkId']] = $rs['listValue']; } }*/ //Generate Asset Types Combo $asset_type = new Model_CcmAssetTypes(); // $asset_type->form_values['parent_id'] = 0; $result3 = $asset_type->getAssetSubTypes(); $this->_list["ccm_asset_type_id_popup"][''] = "Select"; $this->_list["ccm_asset_type_id_update"][''] = "Select"; foreach ($result3 as $rs) { $this->_list["ccm_asset_type_id_popup"][$rs['pkId']] = $rs['assetTypeName']; $this->_list["ccm_asset_type_id_update"][$rs['pkId']] = $rs['assetTypeName']; } //Generate Asset Sub Types Combo $asset_type2 = new Model_CcmAssetTypes(); $asset_type2->form_values['parent_id'] = 'childs'; $result4 = $asset_type2->getAssetSubTypes(); $this->_list["ccm_asset_sub_type"][''] = "Select"; foreach ($result4 as $rs) { $this->_list["ccm_asset_sub_type"][$rs['pkId']] = $rs['assetTypeName']; $this->_list["ccm_asset_sub_type_update"][$rs['pkId']] = $rs['assetTypeName']; } foreach ($this->_fields as $col => $name) { switch ($col) { case "ccm_model_name": case "catalogue_id": $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_width": $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_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 "gross_capacity_4": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Cap 4"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "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"); break; case "gross_capacity_20": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Cap 20"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "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"); break; case "gross_capacity_20": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Gross Cap 20"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "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"); break; case "net_capacity_4": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Net Cap 4"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "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"); break; case "net_capacity_20": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Net Cap 20"), "allowEmpty" => false, "required" => true, "filters" => array("StringTrim", "StripTags"), "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"); break; default: break; } if (in_array($col, array_keys($this->_list))) { $this->addElement("select", $col, array("attribs" => array("class" => 'form-control'), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col])); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); } 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"); } } }
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"); } } }