From 71f4bb2b197abeb88e21d3f3e9a8c1a0d8539acf Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Thu, 5 May 2022 10:01:27 +0100 Subject: [PATCH] Add profile image to beneficiary images --- application/controllers/Hyperviseur_dash.php | 4 +- application/language/english/message_lang.php | 3 + application/language/french/message_lang.php | 3 + application/models/Nano_health_model.php | 11 +- .../nano_health/hyper/infos_insurance.php | 158 +----------------- .../hyper/infos_insurance_subscription.php | 79 +-------- .../modals/beneficiary_images_modal.php | 97 +++++++++++ 7 files changed, 115 insertions(+), 240 deletions(-) create mode 100644 application/views/nano_health/modals/beneficiary_images_modal.php diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php index 34e9915e..821c5fe3 100755 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -408,8 +408,8 @@ class Hyperviseur_dash extends CI_Controller $data['user'] = $this->db->get_where('user_infos',['user_id' => $data['insurance']->user_id ?? null])->first_row(); $data['payments'] = $this->nano_health_model->getInsurancePaymentTransactions($data['insurance']->id ?? null); // Le montant payé de toutes les factures de l'assurance - $data['insurance_invoices_total_paid_amount'] = $this->nano_health_model->getInsuranceInvoiceTotalPaidAmount($data['insurance']->id ?? null) ?? 0; - $data['insurance_invoices_total_amount'] = $this->nano_health_model->getInsuranceInvoiceTotalAmount($data['insurance']->id ?? null) ?? 0; + $data['insurance_invoices_total_paid_amount'] = $this->nano_health_model->getInsuranceInvoiceTotalPaidAmount($data['insurance']->id ?? null); + $data['insurance_invoices_total_amount'] = $this->nano_health_model->getInsuranceInvoiceTotalAmount($data['insurance']->id ?? null); $data['invoices'] = $this->nano_health_model->getInsuranceInvoices($this->input->get('id')); $data['deletion_of_beneficiaries'] = $this->nano_health_model->getBeneficiariesDeletionHistory($data['insurance']->id ?? null); diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index aac8f746..b6684ec2 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -942,4 +942,7 @@ $lang['billed_quantity'] = "Billed quantity"; $lang['ceiling'] = "Ceiling"; $lang['note_config_wallet_agent_remove_cash'] = "The hypervisor's commission is the amount remaining in the client's commission once the agent's and supervisor's commissions are removed"; $lang['UNPAID'] = "Unpaid"; +$lang['UNDER_RENEW'] = "Under renew"; +$lang['STOPPED'] = "Stopped"; +$lang['profile_image'] = "Profile image"; ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index 6750cde0..287fdbbc 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -951,4 +951,7 @@ $lang['billed_quantity'] = "Quantité facturée"; $lang['ceiling'] = "Plafond"; $lang['note_config_wallet_agent_remove_cash'] = "La commission de l'hyperviseur est le montant restant de la commission client une fois qu'on a retiré les commissions de l'agent et du superviseur"; $lang['UNPAID'] = "Non Payée"; +$lang['UNDER_RENEW'] = "En cours de renouvellement"; +$lang['STOPPED'] = "Arretée"; +$lang['profile_image'] = "Photo de profil"; ?> diff --git a/application/models/Nano_health_model.php b/application/models/Nano_health_model.php index 4b0de147..5b18512a 100644 --- a/application/models/Nano_health_model.php +++ b/application/models/Nano_health_model.php @@ -84,16 +84,19 @@ class Nano_health_model extends CI_Model } public function getInsuranceInvoiceTotalPaidAmount($insuredId){ - return $this->db->select('SUM(p.amount) as total_paid_amount') + $amount = $this->db->select('SUM(p.amount) as total_paid_amount') ->from('nh_insurances_invoices i')->join('nh_insurances in', 'in.id = i.insurance_id') ->join('nh_insurances_payments p', 'i.id = p.invoice_id') - ->where('i.insurance_id',$insuredId)->group_by('i.id')->get()->row_array()['total_paid_amount']; + ->where('i.insurance_id',$insuredId)->group_by('i.id')->get()->row_array(); + + return isset($amount) ? $amount['total_paid_amount'] : 0; } public function getInsuranceInvoiceTotalAmount($insuredId){ - return $this->db->select('SUM(i.amount) as total_amount') + $amount = $this->db->select('SUM(i.amount) as total_amount') ->from('nh_insurances_invoices i')->join('nh_insurances in', 'in.id = i.insurance_id') - ->where('i.insurance_id',$insuredId)->group_by('i.id')->get()->row_array()['total_amount']; + ->where('i.insurance_id',$insuredId)->group_by('i.id')->get()->row_array(); + return isset($amount) ? $amount['total_amount'] : 0; } public function getSubscriptionBeneficiaries($subscriptionId){ diff --git a/application/views/nano_health/hyper/infos_insurance.php b/application/views/nano_health/hyper/infos_insurance.php index d809f60d..b811b33a 100755 --- a/application/views/nano_health/hyper/infos_insurance.php +++ b/application/views/nano_health/hyper/infos_insurance.php @@ -244,84 +244,7 @@ - + load->view('nano_health/modals/beneficiary_images_modal',['i' => $i, 'row' => $row]) ?> - + load->view('nano_health/modals/beneficiary_images_modal',['i' => $i, 'row' => $row]) ?> - + load->view('nano_health/modals/beneficiary_images_modal',['i' => $i, 'row' => $row]) ?> "> + +