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(); } } $this->_list["number"][''] = "Select Vehicle Type First"; foreach ($this->_fields as $col => $name) { switch ($col) { case "vehicle_type_id": case "gatepass_vehicle_id": case "vehicle_other": $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 "stock_master_id": $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => true, "multiple" => "multiple", "filters" => array("StringTrim", "StripTags"), "validators" => array())); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; case "date_from": case "date_to": 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; case "transaction_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 "quantity": $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 "other": $this->addElement("checkbox", $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], "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_ListSearch(); $form_add = new Form_Cadmin_List(); $params = array(); $list_detail = new Model_ListDetail(); if ($this->_request->isPost()) { if ($form->isValid($this->_request->getPost())) { $list_master = $form->getValue('list_master'); $list_value = $form->getValue('list_value'); if (!empty($list_master)) { $params['listMaster'] = $list_master; } if (!empty($list_value)) { $params['listValue'] = $list_value; } } $form->list_master->setValue($list_master); $form->list_value->setValue($list_value); } else { $list_master = $this->_getParam('list_master'); $list_value = $this->_getParam('list_value'); if (!empty($list_master)) { $params['listMaster'] = $list_master; } $form->list_master->setValue($list_master); if (!empty($list_value)) { $params['listValue'] = $list_value; $form->list_value->setValue($list_value); } } $sort = $this->_getParam("sort", "asc"); $order = $this->_getParam("order", "list_value"); $list_detail->form_values = $params; $result = $list_detail->getListDetail($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; $this->view->pagination_params = $params; }
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 Area Combo $list = new Model_ListDetail(); $list->form_values = array('listMaster' => Model_ListMaster::AREA); $result1 = $list->getListDetail(); //print_r($result1); $this->_list["area"][''] = "Select"; if ($result1) { foreach ($result1 as $area) { $this->_list["area"][$area->getPkId()] = $area->getListValue(); } } //Generate Level Combo $list = new Model_ListDetail(); $list->form_values = array('listMaster' => Model_ListMaster::ROW); $result2 = $list->getListDetail(); $this->_list["level"][''] = "Select"; if ($result2) { foreach ($result2 as $row) { $this->_list["level"][$row->getPkId()] = $row->getListValue(); } } foreach ($this->_fields as $col => $name) { switch ($col) { case "area": case "level": $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"); } } }
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 Area Combo $list = new Model_ListDetail(); $list->form_values = array('listMaster' => Model_ListMaster::AREA); $result1 = $list->getListDetail(); $this->_list["area"][''] = "Select Store"; if ($result1) { foreach ($result1 as $area) { $this->_list["area"][$area->getPkId()] = $area->getListValue(); } } //Generate Row Combo $list = new Model_ListDetail(); $list->form_values = array('listMaster' => Model_ListMaster::ROW); $result2 = $list->getListDetail(); $this->_list["row"][''] = "Select Row"; if ($result2) { foreach ($result2 as $row) { $this->_list["row"][$row->getPkId()] = $row->getListValue(); } } //Generate Rack Combo $list = new Model_ListDetail(); $list->form_values = array('listMaster' => Model_ListMaster::RACK); $result3 = $list->getListDetail(); $this->_list["rack"][''] = "Select Rack"; if ($result3) { foreach ($result3 as $rack) { $this->_list["rack"][$rack->getPkId()] = $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['rackType']; } } //Generate Pallet Combo $list = new Model_ListDetail(); $list->form_values = array('listMaster' => Model_ListMaster::PALLET); $result5 = $list->getListDetail(); $this->_list["pallet"][''] = "Select Bin"; if ($result5) { foreach ($result5 as $pallet) { $this->_list["pallet"][$pallet->getPkId()] = $pallet->getListValue(); } } //Generate Level Combo $list = new Model_ListDetail(); $list->form_values = array('listMaster' => Model_ListMaster::LEVEL); $result6 = $list->getListDetail(); $this->_list["level"][''] = "Select Shelf"; if ($result6) { foreach ($result6 as $level) { $this->_list["level"][$level->getPkId()] = $level->getListValue(); } } foreach ($this->_hidden as $col => $name) { switch ($col) { case "placement_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 "rack": case "rack_information_id": case "pallet": case "level": 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"); } } }
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; } } }