From 413ba29a9a5db02ec69744a6a2a015e4e01a45f3 Mon Sep 17 00:00:00 2001 From: gandhimathi Bharathirajan Date: Thu, 27 Apr 2017 19:48:53 +0530 Subject: [PATCH] PO Screen desing --- application/models/Purchaseorder_model.php | 73 ++++++++++------------ 1 file changed, 33 insertions(+), 40 deletions(-) diff --git a/application/models/Purchaseorder_model.php b/application/models/Purchaseorder_model.php index af90e01f..956552ed 100644 --- a/application/models/Purchaseorder_model.php +++ b/application/models/Purchaseorder_model.php @@ -107,65 +107,58 @@ class purchaseorder_model extends CI_Model { $this->db->select('MaterialCode, MaterialName'); - $this->db->from('T_RawMaterialDetailsN'); + $this->db->from('T_MaterialMaster'); + $query = $this->db->get(); return $query->result(); } + /** - * This function is used to get the Unit of Measure information + * This function is used to get the Cost center information * @return array $result : This is result of the query */ - function getUOM() + function getCostCenter() { - $ConfigID = 'C001'; - $this->db->select('ConfigValue'); - $this->db->from('T_ConfigDetails'); - $this->db->where('Config_id ',$ConfigID ); + + $this->db->select('CostName, Description'); + $this->db->from('T_CostCentre'); + $query = $this->db->get(); return $query->result(); } + + /** + * This function is used to get the Config value from configuration table + * @return array $result : This is result of the query + */ + function getConfigValue($ConfigID ,$ConfigValue = '') + { + + $this->db->select('ConfigValue'); + $this->db->from('T_ConfigDetails'); + $this->db->where('Config_id ',$ConfigID ); + if($ConfigValue != '') + { + $this->db->where('ConfigValue != ',$ConfigValue ); + } + $query = $this->db->get(); + + return $query->result(); + } + + /** * This function is used to get the Purchase order Type * @return array $result : This is result of the query */ - function getPOType() + function getAllEmployees() { - $ConfigID = 'C004'; - $this->db->select('ConfigValue'); - $this->db->from('T_ConfigDetails'); - $this->db->where('Config_id ',$ConfigID ); - $query = $this->db->get(); - - return $query->result(); - } - - /** - * This function is used to get the Purchase order Type - * @return array $result : This is result of the query - */ - function getPurchasingCategory() - { - $ConfigID = 'C007'; - $this->db->select('ConfigValue'); - $this->db->from('T_ConfigDetails'); - $this->db->where('Config_id ',$ConfigID ); - $query = $this->db->get(); - - return $query->result(); - } - - /** - * This function is used to get the Purchase order Type - * @return array $result : This is result of the query - */ - function getEmployeeList() - { - $this->db->select('EmpID,FirstName,LastName,Role,DepartmentName'); - $this->db->from('T_EmployeeDetails'); + $this->db->select('EmpID,FirstName,LastName'); + $this->db->from('T_Employee_Details'); $query = $this->db->get(); return $query->result();