public function init() { //Generate WareHouses Combo $warehouse = new Model_Warehouses(); $result1 = $warehouse->getSupplierWarehouses(); foreach ($result1 as $wh) { $this->_list["from_warehouse_id"][$wh['pk_id']] = $wh['warehouse_name']; } //Generate Item Combo $item_pack_size = new Model_ItemPackSizes(); $result = $item_pack_size->getItemsAll(); $this->_childlist["item_pack_size_id"][''] = "Select"; if ($result) { $item_id = $result[0]->getPkId(); foreach ($result as $row) { $this->_childlist["item_pack_size_id"][$row->getPkId()] = $row->getItemName(); } } //Generate VVM Type Combo $vvmtypes = new Model_VvmTypes(); $result3 = $vvmtypes->getAll(); $this->_childlist["vvm_type_id"][''] = 'Select'; foreach ($result3 as $vvmtype) { $this->_childlist["vvm_type_id"][$vvmtype['pk_id']] = $vvmtype['vvm_type_name']; } //Generate Purpose(activity_id) combo $stk_activities = new Model_StakeholderActivities(); $result4 = $stk_activities->getAllStakeholderActivitiesIssues(); if ($result4) { $stakeholder_id = $result4[0]['pkId']; foreach ($result4 as $stk_activity) { $this->_list["stakeholder_activity_id"][$stk_activity['pkId']] = $stk_activity['activity']; } } foreach ($this->_fields as $col => $name) { switch ($col) { case "reference_number": case "description": $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 "expected_arrival_date": $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 "transaction_number": $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"); } } }
public function init() { $transaction_types = new Model_TransactionTypes(); $result = $transaction_types->getAdjusmentTypes(); foreach ($result as $trans) { $this->_list["adjustment_type"][''] = 'Select'; $this->_list["adjustment_type"][$trans['pkId']] = $trans['transactionTypeName']; } //Generate Item Combo $item_pack_size = new Model_ItemPackSizes(); $result = $item_pack_size->getItemsAll(); $this->_childlist["item_id"][''] = "Select"; if ($result) { $item_id = $result[0]->getPkId(); foreach ($result as $row) { $this->_childlist["item_id"][$row->getPkId()] = $row->getItemName(); } } //Generate Purpose(activity_id) combo $stk_activities = new Model_StakeholderActivities(); $result4 = $stk_activities->getAllStakeholderActivitiesIssues(); if ($result4) { $stakeholder_id = $result4[0]['pkId']; foreach ($result4 as $stk_activity) { $this->_list["stakeholder_activity_id"][$stk_activity['pkId']] = $stk_activity['activity']; } } foreach ($this->_fields as $col => $name) { switch ($col) { case "adjustment_date": $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array(), "value" => date("d/m/Y"))); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "ref_no": case "transaction_reference": case "comments": $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 "reference_number": case "description": $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 "transaction_date": $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"); } } }
public function init() { //Generate Vehicle Type Combo $list = new Model_ListDetail(); $list->form_values = array('listMaster' => Model_ListMaster::VEHICLE_TYPE); $result1 = $list->getListDetail(); $this->_list["vehicle_type_id"][''] = "Select Vehicle Type"; if ($result1) { foreach ($result1 as $row) { $this->_list["vehicle_type_id"][$row->getPkId()] = $row->getListValue(); } } //Generate Item Combo $item_pack_size = new Model_ItemPackSizes(); $result = $item_pack_size->getItemsAll(); $this->_list["item_pack_size_id"][''] = "Select Product"; if ($result) { foreach ($result as $row) { $this->_list["item_pack_size_id"][$row->getPkId()] = $row->getItemName(); } } //Generate Batch Number Combo $this->_list["stock_batch_id"][''] = "Select Item First"; //$date_from = date('Y-m' . '-01'); //$date_to = date('Y-m-d'); foreach ($this->_fields as $col => $name) { switch ($col) { case "vehicle_type_id": case "item_pack_size_id": case "stock_batch_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 "date_from": case "date_to": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "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"); } } }
public function init() { //Generate WareHouses Combo $pc = new Model_PipelineConsignments(); $result1 = $pc->getPipelineToWarehouses(); $this->_list["to_warehouse_id"][""] = 'Select'; foreach ($result1 as $wh) { $this->_list["to_warehouse_id"][$wh['pkId']] = $wh['warehouseName']; } //Generate Item Combo $item_pack_size = new Model_ItemPackSizes(); $result = $item_pack_size->getItemsAll(); $this->_list["item_pack_size_id"][''] = "Select"; if ($result) { $item_id = $result[0]->getPkId(); foreach ($result as $row) { $this->_list["item_pack_size_id"][$row->getPkId()] = $row->getItemName(); } } $date_from = date('01/m/Y'); $date_to = date('d/m/Y'); foreach ($this->_fields as $col => $name) { switch ($col) { case "from_date": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array(), "value" => $date_from)); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "to_date": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", 'readonly' => 'true'), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array(), "value" => $date_to)); $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"); } } }
public function init() { //Generate Item Combo $item_pack_size = new Model_ItemPackSizes(); $result = $item_pack_size->getItemsAll(); $this->_list["item_pack_size_id"][''] = "Select Product"; $this->_list["item_pack_size_id_update"][''] = "Select Product"; if ($result) { foreach ($result as $row) { $this->_list["item_pack_size_id"][$row->getPkId()] = $row->getItemName(); $this->_list["item_pack_size_id_update"][$row->getPkId()] = $row->getItemName(); } } //Generate Pack type combo $list = new Model_ListDetail(); $list->form_values = array('listMaster' => Model_ListMaster::packaging_level); $result2 = $list->getListDetail(); $this->_list["packaging_level"][''] = "Select Packaging Level"; $this->_list["packaging_level_update"][''] = "Select Packaging Level"; if ($result2) { foreach ($result2 as $packagingLevel) { $this->_list["packaging_level"][$packagingLevel->getPkId()] = $packagingLevel->getListValue(); $this->_list["packaging_level_update"][$packagingLevel->getPkId()] = $packagingLevel->getListValue(); } } foreach ($this->_hidden as $col => $name) { switch ($col) { case "barcode_id": $this->addElement("hidden", $col); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "barcode_ty_id": $this->addElement("hidden", $col); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; default: break; } } foreach ($this->_fields as $col => $name) { switch ($col) { case "item_gtin": case "quantity_per_pack": case "volum_per_vial": $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 "pack_size_description": $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 "length": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Length"), "allowEmpty" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "width": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Width"), "allowEmpty" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "height": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Height"), "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"); } } foreach ($this->_hidden as $col => $name) { switch ($col) { case "item_pack_size_id_hidden": case "stakeholder_id_update_hidden": $this->addElement("hidden", $col); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; default: break; } } }
public function init() { //Generate Item Combo $item_pack_size = new Model_ItemPackSizes(); $result = $item_pack_size->getItemsAll(); $this->_list["item_pack_size_id"][''] = "Select Product"; $this->_list["item_pack_size_id_update"][''] = "Select Product"; if ($result) { foreach ($result as $row) { $this->_list["item_pack_size_id"][$row->getPkId()] = $row->getItemName(); $this->_list["item_pack_size_id_update"][$row->getPkId()] = $row->getItemName(); } } //Generate Manufacturer Combo /* $stakeholder = new Model_Stakeholders(); $result1 = $stakeholder->getManufacturer(); $this->_list["stakeholder_id"][''] = "Select Manufacturer"; if ($result1) { foreach ($result1 as $manufacturer) { $this->_list["stakeholder_id"][$manufacturer['pkId']] = $manufacturer['stakeholderName']; } } */ //Generate Batch Type Combo $list = new Model_ListDetail(); $list->form_values = array('listMaster' => Model_ListMaster::packaging_level); $result2 = $list->getListDetail(); $this->_list["packaging_level"][''] = "Select Packaging Level"; $this->_list["packaging_level_update"][''] = "Select Packaging Level"; if ($result2) { foreach ($result2 as $packagingLevel) { $this->_list["packaging_level"][$packagingLevel->getPkId()] = $packagingLevel->getListValue(); $this->_list["packaging_level_update"][$packagingLevel->getPkId()] = $packagingLevel->getListValue(); } } /* /Generate Expiry Date Format Combo $list = new Model_ListDetail(); $list->form_values = array('listMaster' => Model_ListMaster::EXPIRY_DATE_FORMAT); $result3 = $list->getListDetail(); $this->_list["expiry_date_format"][''] = "Select Expiry Date Format"; if ($result3) { foreach ($result3 as $expirydateformat) { $this->_list["expiry_date_format"][$expirydateformat->getPkId()] = $expirydateformat->getListValue(); } } */ foreach ($this->_hidden as $col => $name) { switch ($col) { case "barcode_id": $this->addElement("hidden", $col); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "barcode_ty_id": $this->addElement("hidden", $col); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; default: break; } } foreach ($this->_fields as $col => $name) { switch ($col) { case "item_gtin": case "batch_length": case "gtin_start_position": case "batch_no_start_position": case "expiry_date_start_position": case "gtin_end_position": case "batch_no_end_position": case "expiry_date_end_position": //case "expiry_date_format"; //case "expiry_date_format"; case "quantity_per_pack": case "volume_per_unit_net": $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 "expiry_date_format": $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"); $this->getElement($col)->setValue("YYMMDD"); break; */ /* case "expiry_date_format": $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"); $this->getElement($col)->setValue("YYMMDD"); break; */ case "pack_size_description": $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 "gtin": case "batch": case "expiry": $this->addElement("checkbox", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "length": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Length"), "allowEmpty" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "width": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Width"), "allowEmpty" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "height": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "placeholder" => "Height"), "allowEmpty" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "pre_printed_barcode": $this->addElement("checkbox", $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"); } } foreach ($this->_hidden as $col => $name) { switch ($col) { case "item_pack_size_id_hidden": case "stakeholder_id_update_hidden": $this->addElement("hidden", $col); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; default: break; } } }