diff --git a/app/Controllers/Complaint.php b/app/Controllers/Complaint.php index 0df4ae3..9a54a6d 100755 --- a/app/Controllers/Complaint.php +++ b/app/Controllers/Complaint.php @@ -20,10 +20,10 @@ class Complaint extends BaseController if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); } $ComplaintModel = new ComplaintModel(); $complaint = $ComplaintModel->findAll(); - $cubiccentimeter = $ComplaintModel->getCubicCentimeterName(); + $cubiccapacity = $ComplaintModel->getCubicCapacityName(); $data['complaint']=$complaint; - $data['cubiccentimeter']=$cubiccentimeter; + $data['cubiccapacity']=$cubiccapacity; return view('complaint_list',$data); } @@ -32,13 +32,13 @@ class Complaint extends BaseController if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); } try { $name = $this->request->getPost('name'); - $cubic_centimeter_id = $this->request->getPost('cubic_centimeter_id'); - // echo $cubic_centimeter_id; die; + $cubic_capacity_id = $this->request->getPost('cubic_capacity_id'); + // echo $cubic_capacity_id; die; $ComplaintModel = new ComplaintModel(); $conditions = ['name' => $name, 'isactive' => 1]; - if ($cubic_centimeter_id) { - $conditions['cubic_centimeter_id'] = $cubic_centimeter_id; + if ($cubic_capacity_id) { + $conditions['cubic_capacity_id'] = $cubic_capacity_id; } if ($complaint_id > 0) { @@ -59,7 +59,7 @@ class Complaint extends BaseController "cgst" => $this->request->getPost('tax')/2, "sgst" => $this->request->getPost('tax')/2, "tax" => $this->request->getPost('tax'), - "cubic_centimeter_id" => $this->request->getPost('cubic_centimeter_id') ? $this->request->getPost('cubic_centimeter_id') : 0, + "cubic_capacity_id" => $this->request->getPost('cubic_capacity_id') ? $this->request->getPost('cubic_capacity_id') : 0, ]; if (!$complaint_id) { diff --git a/app/Models/ComplaintModel.php b/app/Models/ComplaintModel.php index 208c69d..310f228 100755 --- a/app/Models/ComplaintModel.php +++ b/app/Models/ComplaintModel.php @@ -5,13 +5,13 @@ class ComplaintModel extends Model { protected $table = 'complaints'; protected $primaryKey = 'complaint_id'; - protected $allowedFields = ['complaint_id','business_id','name','labour_charge','cgst','sgst','tax','labour_cost_with_tax','isactive','cubic_centimeter_id']; + protected $allowedFields = ['complaint_id','business_id','name','labour_charge','cgst','sgst','tax','labour_cost_with_tax','isactive','cubic_capacity_id']; - public function getCubicCentimeterName() + public function getCubiccapacityName() { - return $this->db->table('cubic_centimeter') - ->select('cubic_centimeter.*') - ->where('cubic_centimeter.isactive', 1) + return $this->db->table('cubic_capacity') + ->select('cubic_capacity.*') + ->where('cubic_capacity.isactive', 1) ->get() ->getResultArray(); } diff --git a/app/Views/complaint_list.php b/app/Views/complaint_list.php index 96f25de..21d549a 100755 --- a/app/Views/complaint_list.php +++ b/app/Views/complaint_list.php @@ -33,16 +33,16 @@ if($value['isactive'] == 0){ $color ='red'; } - $cubiccentimeter_name = ''; // Default to empty if no match - // Loop through $cubiccentimeter to find a match - foreach ($cubiccentimeter as $cc) { - if ($cc['id'] == $value['cubic_centimeter_id']) { - $cubiccentimeter_name = ' ( '.$cc['value'].' )'; // Get the name of the matching cubiccentimeter + $cubiccapacity_name = ''; // Default to empty if no match + // Loop through $cubiccapacity to find a match + foreach ($cubiccapacity as $cc) { + if ($cc['id'] == $value['cubic_capacity_id']) { + $cubiccapacity_name = ' ( '.$cc['value'].' )'; // Get the name of the matching cubiccapacity break; } } ?> -