public function mergeStakeholderItemPackSizeAction() { $item_pack_sizes = new Model_ItemPackSizes(); $items = $item_pack_sizes->getAllManageItems(); $this->view->items = $items; $this->view->role_id = $this->_identity->getRoleId(); }
public function init() { $item_pack_sizes = new Model_ItemPackSizes(); $result1 = $item_pack_sizes->getAllManageItems(); $this->_list["product"][''] = 'Select'; if ($result1 && count($result1) > 0) { foreach ($result1 as $whs) { $this->_list["product"][$whs['pkId']] = $whs['itemName']; } } $physical_stock_taking = new Model_PhysicalStockTaking(); $result2 = $physical_stock_taking->getAllDescripiton(); $this->_list["description"][''] = 'Select'; if ($result2 && count($result2) > 0) { foreach ($result2 as $whs) { $this->_list["description"][$whs->getPkId()] = $whs->getDescription() . " - " . $whs->getFromDate()->format("d M Y") . " - " . $whs->getToDate()->format("d M Y"); } } foreach ($this->_fields as $col => $name) { switch ($col) { case "from_date": case "to_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])); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); } } }
public function init() { $item_pack_sizes = new Model_ItemPackSizes(); $result1 = $item_pack_sizes->getAllManageItems(); $this->_list["product"][''] = 'Select'; if ($result1 && count($result1) > 0) { foreach ($result1 as $whs) { $this->_list["product"][$whs['pkId']] = $whs['itemName']; } } foreach ($this->_fields as $col => $name) { switch ($col) { case "from_date": case "to_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])); $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 VVM Type Combo $vvmtypes = new Model_VvmTypes(); $result3 = $vvmtypes->getAll(); $this->_list["vvm_type_id"][''] = 'Select'; foreach ($result3 as $vvmtype) { $this->_list["vvm_type_id"][$vvmtype['pk_id']] = $vvmtype['vvm_type_name']; } $item_pack_sizes = new Model_ItemPackSizes(); $result1 = $item_pack_sizes->getAllManageItems(); $this->_list["product_id"][''] = 'Select'; if ($result1 && count($result1) > 0) { foreach ($result1 as $whs) { $this->_list["product_id"][$whs['pkId']] = $whs['itemName']; } } foreach ($this->_fields as $col => $name) { switch ($col) { case "batch": case "production_date": case "expiry_date": case "unit_price": $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())); $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']; } $item_pack_sizes = new Model_ItemPackSizes(); $result1 = $item_pack_sizes->getAllManageItems(); $this->_list["product"][''] = 'Select'; if ($result1 && count($result1) > 0) { foreach ($result1 as $whs) { $this->_list["product"][$whs['pkId']] = $whs['itemName']; } } $this->_list["vvm_stage"][""] = "NA"; $this->_list["old_vvm"][""] = "NA"; foreach ($this->_hidden as $col => $name) { switch ($col) { case "item_unit_id": $this->addElement("hidden", $col); break; default: break; } } 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; default: break; case "available": case "quantity": 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; 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"); } } }
public function init() { //Generate Products(items) Combo $item_pack_sizes = new Model_ItemPackSizes(); $result2 = $item_pack_sizes->getAllManageItems(); $this->_list["product"][''] = "Select"; foreach ($result2 as $item) { $this->_list["product"][$item['pkId']] = $item['itemName']; } foreach ($this->_fields as $col => $name) { 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"); } } }
public function init() { //Generate Products(items) Combo $item_pack_sizes = new Model_ItemPackSizes(); $result2 = $item_pack_sizes->getAllManageItems(); foreach ($result2 as $item) { $this->_list["product"][''] = 'Select'; $this->_list["product"][$item['pkId']] = $item['itemName']; } $warehouses = new Model_Warehouses(); $result3 = $warehouses->getUserIssueToWarehouse(); foreach ($result3 as $whs) { $this->_list["warehouses"][''] = 'Select'; $this->_list["warehouses"][$whs['pkId']] = $whs['warehouseName']; } foreach ($this->_fields as $col => $name) { $date_from = date('01/' . 'm/Y'); $date_to = date('d/m/Y'); switch ($col) { case "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 "date_from": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "readonly" => "true", "style" => "position: relative; z-index: 100000;"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array(), "value" => $date_from)); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "date_to": $this->addElement("text", $col, array("attribs" => array("class" => "form-control", "readonly" => "true", "style" => "position: relative; z-index: 100000;"), "allowEmpty" => false, "filters" => array("StringTrim", "StripTags"), "validators" => array(), "value" => $date_to)); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); 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"); } //Generate Purpose(activity_id) combo $stk_activities = new Model_StakeholderActivities(); $result1 = $stk_activities->getAllStakeholderActivities(); foreach ($result1 as $stk_activity) { $this->_list["activity_id"][''] = "Select"; $this->_list["activity_id"][$stk_activity['pkId']] = $stk_activity['activity']; } } }
public function mergeBatchAction() { $item_pack_sizes = new Model_ItemPackSizes(); $items = $item_pack_sizes->getAllManageItems(); $this->view->items = $items; $base_url = Zend_Registry::get('baseurl'); $this->view->inlineScript()->appendFile($base_url . '/js/all_level_combos.js'); $this->view->role_id = $this->_identity->getRoleId(); }
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']; } $item_pack_sizes = new Model_ItemPackSizes(); $result1 = $item_pack_sizes->getAllManageItems(); $this->_list["product"][''] = 'Select'; if ($result1 && count($result1) > 0) { foreach ($result1 as $whs) { $this->_list["product"][$whs['pkId']] = $whs['itemName']; } } $quarter = array(1 => '1st Quarter', 2 => '2nd Quarter', 3 => '3rd Quarter', 4 => '4th Quarter'); $this->_list["issue_period"][""] = "Select Period"; for ($y = 2015; $y <= date("Y"); $y++) { for ($q = 1; $q <= 4; $q++) { switch ($q) { case 1: $key = "01/01/{$y}-01/03/{$y}"; break; case 2: $key = "01/04/{$y}-01/06/{$y}"; break; case 3: $key = "01/07/{$y}-01/09/{$y}"; break; case 4: $key = "01/10/{$y}-01/12/{$y}"; break; } $this->_list["issue_period"][$key] = $quarter[$q] . " - " . $y; } } $this->_list["issue_period"]["custom"] = "Custom"; //Generate Products(items) Combo //$item_pack_sizes = new Model_ItemPackSizes(); //$items = $item_pack_sizes->getAllWarehouseProducts(); $this->_list["item_id"][''] = "Select"; /* if ($items && count($items) > 0) { foreach ($items as $item) { $this->_list["item_id"][$item['pk_id']] = $item['item_name']; } } */ //Generate Purpose(activity_id) combo $stk_activities = new Model_StakeholderActivities(); $result1 = $stk_activities->getAllStakeholderActivities(); foreach ($result1 as $stk_activity) { $this->_list["activity_id"][''] = "Select"; $this->_list["activity_id"][$stk_activity['pkId']] = $stk_activity['activity']; } foreach ($this->_hidden as $col => $name) { switch ($col) { case "hdn_transaction_number": case "hdn_stock_id": case "hdn_province_id": case "hdn_district_id": case "hdn_warehouse_id": case "hdn_available_quantity": case "hdn_to_warehouse_id": case "hdn_master_id": case "hdn_activity_id": case "hdn_campaign_id": case "hdn_transaction_date": $this->addElement("hidden", $col); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; default: break; } } foreach ($this->_fields as $col => $name) { switch ($col) { case "transaction_reference": case "quantity": case "dispatch_by": case "issue_from": case "issue_to": $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 "expiry_date": case "transaction_date": case "available_quantity": case "transaction_number": case "warehouse_name": $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 "comments": $this->addElement("textarea", $col, array("attribs" => array("class" => "form-control", "rows" => "2"), "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())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); } } }