Example #1
0
 public function init()
 {
     $list = new Model_ListMaster();
     $result = $list->getMasterList();
     foreach ($result as $lst) {
         $this->_list["list_master"][''] = 'Select';
         $this->_list["list_master"][$lst->getPkId()] = $lst->getListMasterName();
     }
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "list_value":
                 $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 "description":
                 $this->addElement("textarea", $col, array("attribs" => array("class" => "form-control", "rows" => "8"), "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" => false, "required" => true, "registerInArrayValidator" => false, "multiOptions" => $this->_list[$col]));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
     }
 }
 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 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 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 Area Combo
     $list = new Model_ListDetail();
     $list->form_values = array('listMaster' => Model_ListMaster::AREA);
     $result1 = $list->getListDetail();
     //print_r($result1);
     $this->_list["area"][''] = "Select Area";
     if ($result1) {
         foreach ($result1 as $area) {
             $this->_list["area"][$area->getListValue()] = $area->getListValue();
         }
     }
     //Generate Row From Combo
     $list = new Model_ListMaster();
     $list->form_values = array('pk_id' => Model_ListMaster::ROW);
     $result2 = $list->getListDetailByType();
     $this->_list["row"][''] = "Select Row";
     if ($result2) {
         foreach ($result2 as $row) {
             $this->_list["row"][$row['pkId']] = $row['listValue'];
         }
     }
     //Generate Row To Combo
     $list = new Model_ListMaster();
     $list->form_values = array('pk_id' => Model_ListMaster::ROW);
     $list->form_values['order'] = "desc";
     $result3 = $list->getListDetailByType();
     $this->_list["row_to"][''] = "Select Row To";
     if ($result3) {
         foreach ($result3 as $row) {
             $this->_list["row_to"][$row['pkId']] = $row['listValue'];
         }
     }
     //Generate Rack Combo
     $list = new Model_ListMaster();
     $list->form_values = array('pk_id' => Model_ListMaster::RACK);
     $result7 = $list->getListDetailByType();
     $this->_list["rack"][''] = "Select Rack";
     if ($result7) {
         foreach ($result7 as $rack) {
             $this->_list["rack"][$rack['pkId']] = $rack['listValue'];
         }
     }
     //Generate Rack To Combo
     $list = new Model_ListDetail();
     $list->form_values = array('listMaster' => Model_ListMaster::RACK);
     $result3 = $list->getListDetail();
     $this->_list["rack_to"][''] = "Select Rack To";
     if ($result3) {
         foreach ($result3 as $rack) {
             $this->_list["rack_to"][$rack->getListValue()] = $rack->getListValue();
         }
     }
     //Generate Rack Type Combo
     $rack_information = new Model_RackInformation();
     $result4 = $rack_information->getRackInformation();
     $this->_list["rack_information_id"][''] = "Select Rack Type";
     if ($result4) {
         foreach ($result4 as $rackinformation) {
             $this->_list["rack_information_id"][$rackinformation['pkId']] = $rackinformation['dimType'];
         }
     }
     //Generate Pallet Combo
     $list = new Model_ListDetail();
     $list->form_values = array('listMaster' => Model_ListMaster::PALLET);
     $result5 = $list->getListDetail();
     $this->_list["pallet"][''] = "Select Pallet";
     if ($result5) {
         foreach ($result5 as $pallet) {
             $this->_list["pallet"][$pallet->getListValue()] = $pallet->getListValue();
         }
     }
     //Generate Pallet To Combo
     $list = new Model_ListDetail();
     $list->form_values = array('listMaster' => Model_ListMaster::PALLET);
     $result5 = $list->getListDetail();
     $this->_list["pallet_to"][''] = "Select Pallet To";
     if ($result5) {
         foreach ($result5 as $pallet) {
             $this->_list["pallet_to"][$pallet->getListValue()] = $pallet->getListValue();
         }
     }
     //Generate Level Combo
     $list = new Model_ListDetail();
     $list->form_values = array('listMaster' => Model_ListMaster::LEVEL);
     $result6 = $list->getListDetail();
     $this->_list["level"][''] = "Select Level";
     if ($result6) {
         foreach ($result6 as $level) {
             $this->_list["level"][$level->getListValue()] = $level->getListValue();
         }
     }
     //Generate Level To Combo
     $list = new Model_ListDetail();
     $list->form_values = array('listMaster' => Model_ListMaster::LEVEL);
     $result6 = $list->getListDetail();
     $this->_list["level_to"][''] = "Select Level To";
     if ($result6) {
         foreach ($result6 as $level) {
             $this->_list["level_to"][$level->getListValue()] = $level->getListValue();
         }
     }
     foreach ($this->_hidden as $col => $name) {
         switch ($col) {
             case "placement_area_id":
                 $this->addElement("hidden", $col);
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
     }
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "area":
             case "row":
             case "row_to":
             case "rack":
             case "rack_to":
             case "rack_information_id":
             case "pallet":
             case "pallet_to":
             case "level":
             case "level_to":
             case "location_name":
                 $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;
             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");
         }
     }
 }