public function init() { $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 Asset Id Equipment Code Combo //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 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")->removeDecorator("<br>"); } 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 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 Utilizations Combo $ccm_status_list1 = new Model_CcmStatusList(); $data = $ccm_status_list1->getAllUtilizations(); $this->_list["utilization"][''] = "Select "; foreach ($data as $utilization) { $this->_list["utilization"][$utilization['pkId']] = $utilization['ccmStatusListName']; } foreach ($this->_fields as $col => $name) { switch ($col) { 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; default: break; } /* if ($col == "reason" || $col == "utilization") { $str_style_hidden = "hidden"; } */ if (in_array($col, array_keys($this->_list))) { $this->addElement("select", $col, array("attribs" => array("class" => "form-control form-group"), "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>"); } } }
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 updateWorkingStatusAction() { $warehouse_id = $this->_request->getParam('id', ''); $status_list = new Model_CcmStatusList(); $result1 = $status_list->getStatusLists(); $this->view->working_list = $result1; $result2 = $status_list->getAllReasons(); $this->view->reason_list = $result2; $result3 = $status_list->getAllUtilizations(); $this->view->utilization_list = $result3; $this->view->warehouse_id = $warehouse_id; if ($this->_request->isPost()) { $ccm_status_histroy = new Model_CcmStatusHistory(); $data = $this->_request->getPost(); $ccm_status_histroy->form_values = $data; $ccm_status_histroy->updateColdChainStatus(); $role_id = $this->_identity->getRoleId(); if ($role_id == 7) { $this->redirect("/stock/monthly-consumption2"); } else { $this->redirect("/cold-chain/status-working-update?success=1"); } } }
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 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>"); } } }