public function init() { //Generate Combos $stakeholders = new Model_Stakeholders(); $result1 = $stakeholders->getAllStakeholdersItems(); $this->_list["stakeholder"][''] = "Select"; foreach ($result1 as $rs) { $this->_list["stakeholder"][$rs['pkId']] = $rs['stakeholderName']; } foreach ($this->_fields as $col => $name) { switch ($col) { case "": $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"); } } foreach ($this->_hidden as $col => $name) { switch ($col) { case "stakeholder_id": $this->addElement("hidden", $col); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; default: break; } } }
public function init() { //Generate Asset Type Combo $geo_level = new Model_Locations(); $result1 = $geo_level->getStakeholderGeoLevel(); $this->_list["geo_level"][''] = "Select"; foreach ($result1 as $rs) { $this->_list["geo_level"][$rs['pkId']] = $rs['geoLevelName']; } $stakeholder_sectors = new Model_Stakeholders(); $result2 = $stakeholder_sectors->getAllSectors(); $this->_list["sector"][''] = "Select"; foreach ($result2 as $rs) { $this->_list["sector"][$rs['pkId']] = $rs['stakeholderSectorName']; } $stakeholder_activities = new Model_Stakeholders(); $result3 = $stakeholder_activities->getAllActivities(); $this->_list["activity"][''] = "Select"; foreach ($result3 as $rs) { $this->_list["activity"][$rs['pkId']] = $rs['activity']; } foreach ($this->_fields as $col => $name) { switch ($col) { case "stakeholder_name": case "stakeholder_activity": case "stakeholder_type": case "stakeholder_sector": $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"); } } foreach ($this->_hidden as $col => $name) { switch ($col) { case "stakeholder_id": case "stakeholder_activity_id": case "stakeholder_type_id": case "stakeholder_sector_id": $this->addElement("hidden", $col); $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag"); break; default: break; } } }
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 populateBatches($item_id, $rows) { $manufacturer = array(); $stakeholder_items = new Model_Stakeholders(); $stakeholder_items->form_values['item_id'] = $item_id; $associated = $stakeholder_items->getManufacturerByProduct(); if ($associated) { foreach ($associated as $row) { $manufacturer[$row['pkId']] = $row['stakeholderName']; } } $this->{$rows}->manufacturer_id->setMultiOptions($manufacturer); }
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 addNewManufacturerAction() { $this->_helper->layout->disableLayout(); $data = array(); $data['name'] = $this->_request->getParam('name'); $data['item_id'] = $this->_request->getParam('item_id'); $data['quantity'] = $this->_request->getParam('quantity'); $stakeholer = new Model_Stakeholders(); $stakeholer->form_values = $data; $stakeholer->addStakeholder(); $stakeholder_items = new Model_Stakeholders(); $stakeholder_items->form_values['item_id'] = $data['item_id']; $this->view->associated = $stakeholder_items->getManufacturerByProduct(); }
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 getStakeholderListAction() { $stakeholders = new Model_Stakeholders(); $result = $stakeholders->getStakholder(); echo Zend_Json::encode($result); }
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>"); } } }
public function mergeManufacturersAction() { $stakeholders = new Model_Stakeholders(); $data = $stakeholders->getAllManufacturers(); $this->view->result = $data; }
public function ajaxGetManufacturerByProductAction() { $this->_helper->layout->disableLayout(); $item_id = $this->_request->getParam('item_id', ''); $stakeholder_items = new Model_Stakeholders(); $stakeholder_items->form_values['item_id'] = $item_id; $associated = $stakeholder_items->getManufacturerByProduct(); $this->view->associated = $associated; $not_associated = $stakeholder_items->getUnaccociatedManufacturer(); $this->view->not_associated = $not_associated; }
public function checkStakeholderSectorAction() { $this->_helper->layout->disableLayout(); $form_values = $this->_request->stakeholder_sector; $stakeholders = new Model_Stakeholders(); $stakeholders->form_values = $form_values; $result = $stakeholders->checkStakeholderSector(); $this->view->result = $result; }
public function getManufacturerByProductId($item_id) { $stakeholder_items = new Model_Stakeholders(); $stakeholder_items->form_values['item_id'] = $item_id; $associated = $stakeholder_items->getManufacturerByProduct(); if ($associated) { foreach ($associated as $item) { $manufacturers[$item['pkId']] = $item['stakeholderName']; } } $this->getElement("manufacturer_id")->setMultiOptions($manufacturers); }
public function stockMovementReportAction() { $this->_helper->layout->setLayout('reports'); //$this->view->report_id = 'CENTRALWAREHOUSE'; $this->view->report_id = 'STOCKMOVEMENT'; $this->view->report_title = 'Stock Movement Report'; $this->view->actionpage = 'stock-movement-report'; $this->view->parameters = 'TS01I'; $this->view->parameter_width = '100%'; $item_pack_sizes = new Model_ItemPackSizes(); $warehouses_data = new Model_WarehousesData(); $item = $item_pack_sizes->productsReport(); $this->view->item_id = $item; if (!empty($this->_request->ending_month) && !empty($this->_request->ending_month)) { $this->view->year_sel = $year = $this->_request->year_sel; $this->view->month_sel = $month = $this->_request->ending_month; } else { $year = date("Y"); if (date('d') > 10) { $month = date("m", strtotime("-1")); } else { $month = date("m", strtotime("-2")); } $this->view->year_sel = $year; $this->view->month_sel = $month; } if (!empty($this->_request->rep_indicators)) { $this->view->sel_indicator = $sel_indicator = $this->_request->rep_indicators; } else { $this->view->sel_indicator = $sel_indicator = 1; } $this->view->prov_sel = $prov_sel = $this->_request->prov_sel; if (isset($this->_request->stk_sel) && !empty($this->_request->stk_sel)) { $this->view->stk_sel = $sel_stk = $this->_request->stk_sel; } else { $this->view->stk_sel = $sel_stk = 1; } if (isset($this->_request->wh_type) && !empty($this->_request->wh_type)) { $this->view->wh_type = $wh_type = $this->_request->wh_type; } else { $this->view->wh_type = $wh_type = 1; } if (isset($this->_request->warehouse_id) && !empty($this->_request->warehouse_id)) { $this->view->warehouse_id = $warehouse_id = $this->_request->warehouse_id; } else { $this->view->warehouse_id = $warehouse_id = 159; } if (isset($this->_request->wh_prov_sel) && !empty($this->_request->wh_prov_sel)) { $this->view->wh_prov_sel = $wh_prov_sel = $this->_request->wh_prov_sel; } else { $this->view->wh_prov_sel = $wh_prov_sel = ''; } //to warehouse if (isset($this->_request->to_wh_type) && !empty($this->_request->to_wh_type)) { $this->view->to_wh_type = $wh_type = $this->_request->to_wh_type; } else { $this->view->to_wh_type = $wh_type = 2; } if (isset($this->_request->to_warehouse_id) && !empty($this->_request->to_warehouse_id)) { $this->view->to_warehouse_id = $warehouse_id = $this->_request->to_warehouse_id; } else { $this->view->to_warehouse_id = $warehouse_id = 162; } if (isset($this->_request->to_wh_prov_sel) && !empty($this->_request->to_wh_prov_sel)) { $this->view->to_wh_prov_sel = $wh_prov_sel = $this->_request->to_wh_prov_sel; } else { $this->view->to_wh_prov_sel = $wh_prov_sel = ''; } //to warehouse end if ($sel_indicator == 1) { $str_indicator = "\\'Issue\\'"; } else { if ($sel_indicator == 2) { $str_indicator = "\\'Stock on Hand\\'"; } else { if ($sel_indicator == 3) { $str_indicator = "\\'Received\\'"; } } } $this->view->str_indicator = $str_indicator; $end_date = $year . '-' . $month . '-01'; $end_date = date('Y-m-d', strtotime("-1 days", strtotime("+1 month", strtotime($end_date)))); $start_date = date('Y-m-d', strtotime("-364 days", strtotime($end_date))); // Start date and End date $begin = new DateTime($start_date); $end = new DateTime($end_date); $diff = $begin->diff($end); $interval = DateInterval::createFromDateString('1 month'); $period = new DatePeriod($begin, $interval, $end); $this->view->period = $period; $this->view->sel_item = $this->_request->prod_sel; $stakeholder = new Model_Stakeholders(); $stk = $stakeholder->nationReport(); $this->view->stk = $stk; $locations = new Model_Locations(); $lct = $locations->nationalReport(); $this->view->location = $lct; }