public function init()
 {
     $non_ccm_loc = new Model_NonCcmLocations();
     $result3 = $non_ccm_loc->getLocationsName();
     $this->_list["non_ccm_location_id"][''] = "Select Location";
     if ($result3) {
         foreach ($result3 as $row3) {
             $this->_list["non_ccm_location_id"][$row3['pkId']] = $row3['locationName'];
         }
     }
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "item_pack_size_id":
             case "stock_batch_id":
             case "totqty":
             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;
             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->getItemsByCategory();
     $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
     $stock_batch = new Model_StockBatch();
     $result = $stock_batch->getBatches();
     $this->_list["stock_batch_id"][''] = "Select Stock Batch";
     if ($result) {
         foreach ($result as $row) {
             $this->_list["stock_batch_id"][$row['pkId']] = $row['number'];
         }
     }
     //Generate Location Combo
     $non_ccm_loc = new Model_NonCcmLocations();
     $result = $non_ccm_loc->getLocationsName();
     //  print_r($result);exit;
     $this->_list["location"][''] = "Select Location";
     if ($result) {
         foreach ($result as $row) {
             $this->_list["location"][$row['pkId']] = $row['locationName'];
         }
     }
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "item_pack_size_id":
             case "stock_batch_id":
             case "number":
             case "unallocated_quantity":
             case "total_quantity":
             case "quantity":
             case "estimated_pallet_filled":
                 $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 "location":
             case "quantity1":
                 $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;
         }
         foreach ($this->_hidden as $col => $name) {
             switch ($col) {
                 case "placement_location_id":
                 case "itemId":
                 case "batchId":
                     $this->addElement("hidden", $col);
                     $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 locationStatus1Action()
 {
     $form = new Form_LocationStatus();
     $non_ccm_location = new Model_NonCcmLocations();
     if ($this->_request->getPost()) {
         $non_ccm_location->form_values = $this->_request->getPost();
         $non_ccm_location->locationStatus();
         $this->redirect("/stock/location-status?success=1");
     }
     $this->view->form = $form;
     $result = $non_ccm_location->getLocationsName();
     $this->view->result = $result;
 }
 public function ajaxGetPlacementLocationsAction()
 {
     $this->_helper->layout->disableLayout();
     $detail_id = $this->_request->id;
     $p = $this->_request->p;
     $stock_master = new Model_StockMaster();
     $stock_master->form_values['$detail_id'] = $detail_id;
     $result = $stock_master->getIssueDetail();
     $item_category_id = $result['item_category_id'];
     if ($item_category_id == 1) {
         $cold_chain_loc = new Model_ColdChain();
         $ccm_locations = $cold_chain_loc->getLocationsName();
         $this->view->locations = $ccm_locations;
     } else {
         $non_ccm_loc = new Model_NonCcmLocations();
         $non_ccm_locations = $non_ccm_loc->getLocationsName();
         $this->view->locations = $non_ccm_locations;
     }
     $this->view->item_cat_id = $item_category_id;
     $this->view->result = $result;
     $this->view->p = $p;
     $this->view->detail_id = $detail_id;
 }