diff --git a/app/Controllers/Customer.php b/app/Controllers/Customer.php index 79c28f9..8295e38 100644 --- a/app/Controllers/Customer.php +++ b/app/Controllers/Customer.php @@ -82,6 +82,7 @@ class Customer extends BaseController $session_role = get_user_role(); $model = new CustomerModel(); $dob = $this->request->getPost('dob'); + $pan = ($this->request->getPost('pan_no') == '') ? $this->request->getPost('o_pan_no') : $this->request->getPost('pan_no'); $dob = (isset($dob) && $dob != "") ? $dob : NULL ; $data = [ 'first_name' => $this->request->getPost('cfname'), @@ -89,7 +90,7 @@ class Customer extends BaseController 'mobile_no' => $this->request->getPost('cmobile'), 'email' => $this->request->getPost('cmail'), 'date_of_birth' => $dob, - 'pan_no' => $this->request->getPost('pan_no'), + 'pan_no' => $pan, 'adhar_no' => $this->request->getPost('adhar_no'), 'donor_type' => $this->request->getPost('DonorType'), @@ -405,6 +406,8 @@ class Customer extends BaseController case 'is not null': $conditionStrings[] = "$column IS NOT NULL"; break; + case '': + throw new \Exception("Data Not Found"); } } diff --git a/app/Controllers/Invoice.php b/app/Controllers/Invoice.php index 9503c95..f4c9483 100644 --- a/app/Controllers/Invoice.php +++ b/app/Controllers/Invoice.php @@ -107,7 +107,7 @@ class Invoice extends BaseController $upt_data = $model->updateData('donations_accepted', $data, $where); } } - session()->setFlashdata('success', 'Causes has been added successfully.'); + session()->setFlashdata('success', 'Data has been added successfully.'); return redirect()->route('donations_accepted'); } catch (\Throwable $e) @@ -139,7 +139,7 @@ class Invoice extends BaseController $data['currency'] = $setting_model->select('currency')->where($where)->findAll(); $data['customers'] = $model->getData('donor', $where); // $data['causes'] = $model->getData('causes', $where); - $data['causes'] = $bmodel->select('*')->where('business_id', (int)get_business_id() )->get()->getResult(); + $data['causes'] = $bmodel->select('*')->where('business_id', (int)get_business_id() )->where('isactive',1)->get()->getResult(); $data['campaign'] = $model->getData('campaign', $where); $data['invoice_number_formatting'] = $model->getData('settings', $where); @@ -197,7 +197,7 @@ class Invoice extends BaseController $this->AuditHistoryModel->save($audit_data); /************************************* */ - if($upt_data) echo true; + if($upt_data){ session()->setFlashdata('success', 'Data has been accepted successfully.');echo true; } else echo false; } @@ -230,7 +230,7 @@ class Invoice extends BaseController ]; $this->AuditHistoryModel->save($audit_data); /************************************* */ - + session()->setFlashdata('success', 'Data has been rejected successfully.'); return redirect()->route('receipt_list'); } diff --git a/app/Models/NotificationModel.php b/app/Models/NotificationModel.php index 38d0f88..1679c64 100644 --- a/app/Models/NotificationModel.php +++ b/app/Models/NotificationModel.php @@ -97,7 +97,7 @@ public function getCampaignDetails(){ $group_names = []; $group_query = []; foreach ($group_id as $j) { - $cg_data = $this->db->table('customer_groups as CG') + $cg_data = $this->db->table('donor_groups as CG') ->select('CG.group_id, CG.group_name,CG.group_query, CG.isactive') ->where(['CG.isactive' => 1, 'CG.group_id' => $j]) ->get() @@ -135,7 +135,8 @@ public function customerGroupQueryExecution($queries){ foreach ($results as $innerArray) { foreach ($innerArray as $customer) { - $customerId = $customer->customer_id; + // echo json_encode($customer);die; + $customerId = $customer->donor_id; // Check if the customer_id already exists in $uniqueCustomers if (!isset($uniqueCustomers[$customerId])) { @@ -160,7 +161,7 @@ public function customerGroupQueryExecution($queries){ { $db = \Config\Database::connect(); - $query = "SELECT * FROM customer_groups WHERE group_name = 'EXPIRYDATE'"; + $query = "SELECT * FROM donor_groups WHERE group_name = 'EXPIRYDATE'"; $result = $db->query($query)->getResultArray(); diff --git a/app/Views/customer_form.php b/app/Views/customer_form.php index 6748a5e..51e497c 100644 --- a/app/Views/customer_form.php +++ b/app/Views/customer_form.php @@ -47,7 +47,7 @@