diff --git a/application/controllers/quality.php b/application/controllers/quality.php index 85072d62..61ceeeaa 100755 --- a/application/controllers/quality.php +++ b/application/controllers/quality.php @@ -106,7 +106,7 @@ class quality extends BaseController { $tostore = array('uom'=>$uom,'min'=>$min,'max'=>$max,'temp'=>$temp,'type'=>$type,'subtype'=>$sub,'updated_by'=>$createdby); - $res = $this->quality_model->updateSpecMast($tostore,$product,$customer,$name); + $res = $this->quality_model->updateSpecMast($tostore,$product,$customer,$name,$type); //echo 'u'.$res; } @@ -121,7 +121,9 @@ class quality extends BaseController $spname = $this->input->post('param1'); $product = $this->input->post('param2'); $customer = $this->input->post('param3'); - $res = $this->quality_model->deleteSpecification($spname,$product,$customer); + $type = $this->input->post('param4'); + + $res = $this->quality_model->deleteSpecification($spname,$product,$customer,$type); if($res == 1) { echo "Deleted Successfully..!"; @@ -146,7 +148,8 @@ class quality extends BaseController { $prodcutid = $this->uri->segment(3); $customerid =$this->uri->segment(4); - $data['specifications'] = $this->quality_model->getIndividualSpec($prodcutid,$customerid); + $type =$this->uri->segment(5); + $data['specifications'] = $this->quality_model->getIndividualSpec($prodcutid,$customerid,$type); $this->global['pageTitle'] = 'Siddharth : View reports Lists'; $this->loadViews("viewIndSpec", $this->global, $data, NULL); diff --git a/application/models/quality_model.php b/application/models/quality_model.php index 534c251b..d36c1c1d 100755 --- a/application/models/quality_model.php +++ b/application/models/quality_model.php @@ -65,13 +65,14 @@ class Quality_model extends CI_Model return $r; } - function updateSpecMast($data,$product,$customer,$name) + function updateSpecMast($data,$product,$customer,$name,$type) { //echo $product.$customer.$name; //print_r($data); $this->db->where('product_id',$product); $this->db->where('customer_id',$customer); $this->db->where('testtype',$name); + $this->db->where('type',$type); $this->db->update('T_Prodcut_Specification_Master',$data); $r = $this->db->affected_rows(); //echo $r;die(); @@ -84,7 +85,7 @@ class Quality_model extends CI_Model $this->db->from('T_Prodcut_Specification_Master'); $this->db->join('ip_products','T_Prodcut_Specification_Master.product_id=ip_products.product_id'); $this->db->join('ip_clients','T_Prodcut_Specification_Master.customer_id=ip_clients.client_id'); - $this->db->group_by('product_id,customer_id'); + $this->db->group_by('T_Prodcut_Specification_Master.type,product_id,customer_id'); $result = $this->db->get(); return $result->result(); } @@ -100,7 +101,7 @@ class Quality_model extends CI_Model } - function getIndividualSpec($prodcutid,$customerid) + function getIndividualSpec($prodcutid,$customerid,$type) { $this->db->select('T_Prodcut_Specification_Master.*,ip_products.product_name,ip_products.product_description,ip_clients.client_name'); $this->db->from('T_Prodcut_Specification_Master'); @@ -108,6 +109,7 @@ class Quality_model extends CI_Model $this->db->join('ip_clients','T_Prodcut_Specification_Master.customer_id=ip_clients.client_id'); $this->db->where('T_Prodcut_Specification_Master.product_id',$prodcutid); $this->db->where('T_Prodcut_Specification_Master.customer_id',$customerid); + $this->db->where('T_Prodcut_Specification_Master.type',$type); $result = $this->db->get(); //print_r($result->result()); if(empty($result->result())) @@ -119,6 +121,7 @@ class Quality_model extends CI_Model $this->db->join('T_SupplierDetailsN','T_Prodcut_Specification_Master.customer_id=T_SupplierDetailsN.SupplierID'); $this->db->where('T_Prodcut_Specification_Master.product_id',$prodcutid); $this->db->where('T_Prodcut_Specification_Master.customer_id',$customerid); + $this->db->where('T_Prodcut_Specification_Master.type',$type); $result = $this->db->get(); } @@ -127,11 +130,12 @@ class Quality_model extends CI_Model } - function deleteSpecification($spname,$product,$customer) + function deleteSpecification($spname,$product,$customer,$type) { $this->db->where("testtype", $spname); $this->db->where("product_id", $product); - $this->db->where("customer_id", $customer); + $this->db->where("customer_id", $customer); + $this->db->where("type", $type); $this->db->delete('T_Prodcut_Specification_Master'); $r = $this->db->affected_rows(); return $r; diff --git a/application/views/qualitymasterlistview.php b/application/views/qualitymasterlistview.php index 29dd1020..a51264fd 100755 --- a/application/views/qualitymasterlistview.php +++ b/application/views/qualitymasterlistview.php @@ -72,7 +72,7 @@ //print_r($data);echo ""; ?> -