diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php index 7d08038c..e61d1614 100755 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -376,12 +376,25 @@ class Hyperviseur_dash extends CI_Controller if ($this->input->get('history')) { if($this->input->get('id') !== null){ - $data['insurance_subscription_id'] = $this->input->get('id'); - $data['subscription'] = $this->nano_health_model->getInfosInsuranceSubscriptionById($this->input->get('id')); - $data['beneficiaries'] = $this->db->get_where('nh_insurances_having_rights',['insurance_subscription_id' => $data['insurance_subscription_id']]); - $data['user'] = $this->db->get_where('user_infos',['user_id' => $data['subscription']->user_id ?? null])->first_row(); - $this->load->view('header_hyp', $data); - $this->load->view('nano_health/hyper/infos_insurance_subscription'); + $history = $this->input->get('history'); + if($history == 'insurance-insured'){ + $data['active'] = "wallet_insured"; + $data['insured_id'] = $this->input->get('id'); + $data['insurance'] = $this->nano_health_model->getInfosInsuredById($this->input->get('id')); + $data['beneficiaries'] = $this->db->get_where('nh_insurances_having_rights',['insurance_subscription_id' => $data['insurance']->insurance_subscription_id ?? null]); + $data['user'] = $this->db->get_where('user_infos',['user_id' => $data['insurance']->user_id ?? null])->first_row(); + $data['transactions'] = $this->nano_health_model->getInsurancePaymentTransactions($this->input->get('id')); + + $this->load->view('header_hyp', $data); + $this->load->view('nano_health/hyper/infos_insurance'); + }else{ + $data['insurance_subscription_id'] = $this->input->get('id'); + $data['subscription'] = $this->nano_health_model->getInfosInsuranceSubscriptionById($this->input->get('id')); + $data['beneficiaries'] = $this->db->get_where('nh_insurances_having_rights',['insurance_subscription_id' => $data['insurance_subscription_id']]); + $data['user'] = $this->db->get_where('user_infos',['user_id' => $data['subscription']->user_id ?? null])->first_row(); + $this->load->view('header_hyp', $data); + $this->load->view('nano_health/hyper/infos_insurance_subscription'); + } $this->load->view('footer'); return; }else{ diff --git a/application/controllers/pagination/Insurances.php b/application/controllers/pagination/Insurances.php index 23147f9f..c8b45328 100755 --- a/application/controllers/pagination/Insurances.php +++ b/application/controllers/pagination/Insurances.php @@ -60,9 +60,9 @@ class Insurances extends CI_Controller $bonus_amount = Money::of(round($row->total_bonus_amount, 2), $row->currency_code, $this->context)->formatTo('fr_FR'); - $data[] = array($row->insurance_subscription_id, $row->insured_id , $row->lastname, $row->phone, $row->number_of_months, $row->number_of_beneficiaries, - $bonus_amount, mb_strtoupper($this->lang->line($row->state) ,'UTF-8'), $row->created_at, - ' '.$this->lang->line('Voir plus...').''); + $data[] = array($row->insured_id , $row->lastname, $row->phone, $row->number_of_months, $row->number_of_beneficiaries, + $bonus_amount, mb_strtoupper($this->lang->line($row->state) ,'UTF-8'), $row->start_at, $row->end_at, $row->created_at, + ' '.$this->lang->line('Voir plus...').''); } $output = array( diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index 973367c6..61008d44 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -747,4 +747,16 @@ $lang['more_information_subscription'] = "More information for the subscription" $lang['message_rule'] = "The message must not exceed 500 characters"; $lang['subscription_more_information'] = "Subscription awaiting additional information"; $lang['AWAITING_FURTHER_INFORMATION'] = "Awaiting further information"; +$lang['AWAITING_FURTHER_INFORMATION'] = "Awaiting further information"; +$lang['REMAINS'] = "Remaining"; +$lang['export_insured_list'] = "Export list of insureds"; +$lang['no_insured'] = "No insured"; +$lang['insurance_amount'] = "Insurance amount"; +$lang['start_at'] = "Start date"; +$lang['end_at'] = "End date"; +$lang['subscription_date'] = "Date of subscription"; +$lang['insured_detail'] = "Insured detail"; +$lang['remaining_amount'] = "Remaining amount"; +$lang['insurance_infos'] = "Insurance information"; +$lang['payment_transaction_history'] = "Payment transaction history"; ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index b248b3f1..a128a70d 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -758,5 +758,16 @@ $lang['more_information'] = "Complément d'informations"; $lang['more_information_subscription'] = "Complément d'informations pour la subscription"; $lang['message_rule'] = "Le message ne doit pas dépasser 500 caractères"; $lang['subscription_more_information'] = "Souscription en attente de complement d'informations"; -$lang['AWAITING_FURTHER_INFORMATION'] = "En attente d'informations complémentaires" +$lang['AWAITING_FURTHER_INFORMATION'] = "En attente d'informations complémentaires"; +$lang['REMAINS'] = "En reste"; +$lang['export_insured_list'] = "Exporter la liste des assurés"; +$lang['no_insured'] = "Aucun assuré"; +$lang['insurance_amount'] = "Montant de l'assurance"; +$lang['start_at'] = "Date de début"; +$lang['end_at'] = "Date de fin"; +$lang['subscription_date'] = "Date de souscription"; +$lang['insured_detail'] = "Detail sur l'assuré"; +$lang['remaining_amount'] = "Montant restant"; +$lang['insurance_infos'] = "Informations sur l'assurance"; +$lang['payment_transaction_history'] = "Historique des transactions de paiements"; ?> diff --git a/application/models/Nano_health_model.php b/application/models/Nano_health_model.php index 46764ce2..e3c0dec7 100644 --- a/application/models/Nano_health_model.php +++ b/application/models/Nano_health_model.php @@ -56,4 +56,12 @@ class Nano_health_model extends CI_Model return $this->db->from('nh_insurances_subscriptions') ->where('state', $state)->count_all_results(); } + + public function getInfosInsuredById($insuredId){ + return $this->db->get_where('nh_infos_insurances',['insured_id'=> $insuredId])->first_row(); + } + + public function getInsurancePaymentTransactions($insuredId){ + return $this->db->get_where('nh_insurances_payments',['insured_id'=> $insuredId]); + } } diff --git a/application/models/pagination/Insurances_model.php b/application/models/pagination/Insurances_model.php index 68f9a358..4785aada 100644 --- a/application/models/pagination/Insurances_model.php +++ b/application/models/pagination/Insurances_model.php @@ -8,9 +8,11 @@ class Insurances_model extends CI_Model // Set table name $this->table = 'nh_infos_insurances'; // Set orderable column fields - $this->column_order = array('insurance_subscription_id', 'insured_id', 'lastname', 'phone', 'number_of_months', 'number_of_beneficiaries', 'bonus_amount', 'state','created_at', null); + $this->column_order = array('insured_id', 'lastname', 'phone', 'number_of_months', 'number_of_beneficiaries', 'bonus_amount', 'state', 'start_at', + 'end_at','created_at', null); // Set searchable column fields - $this->column_search = array('insurance_subscription_id', 'insured_id', 'lastname', 'phone', 'number_of_months', 'number_of_beneficiaries', 'bonus_amount', 'state','created_at'); + $this->column_search = array('insured_id', 'lastname', 'phone', 'number_of_months', 'number_of_beneficiaries', 'bonus_amount', 'state', 'start_at', + 'end_at', 'created_at'); // Set default order $this->order = array('created_at' => 'desc'); } diff --git a/application/views/nano_health/hyper/infos_insurance.php b/application/views/nano_health/hyper/infos_insurance.php new file mode 100755 index 00000000..f144b0d5 --- /dev/null +++ b/application/views/nano_health/hyper/infos_insurance.php @@ -0,0 +1,452 @@ + + + + + + + + +
+
+ +

+ lang->line('insured') . ' :: ' . $this->lang->line('insured_detail') . ' - ' . $insured_id; ?> +

+ + db->hostname . ';dbname=' . $this->db->database, $this->db->username, $this->db->password); + + $configuration = new PDOProviderConfiguration(); + + $configuration->tableName = 'exchange_rate'; + $configuration->exchangeRateColumnName = 'exchange_rate'; + $configuration->targetCurrencyColumnName = 'target_currency'; + $configuration->sourceCurrencyCode = $baseCurrency; + + // this provider loads exchange rates from your database + $provider = new PDOProvider($pdo, $configuration); + + // this provider calculates exchange rates relative to the base currency + $provider = new BaseCurrencyProvider($provider, $baseCurrency); + + // this currency converter can now handle any currency pair + $this->converter = new CurrencyConverter($provider); + $this->context = new AutoContext(); + $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL); + ?> +
+ +
+
+
+

lang->line('insurance_infos')?>

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
lang->line('insured_id'); ?>
lang->line('Nom'); ?>lastname ?? '' . $user->firstname ?? ''; ?>
lang->line('Adresse')?>adresse ?>
lang->line('Contact')?>phone." | ".$user->email ?>
+
+
+ + + + + + + + + + + + + + + + + + + + + +
lang->line('start_at'); ?>
lang->line('end_at'); ?>
+
+
+
+ +
+
+
+
+

total_bonus_amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR') ?>

+

lang->line('bonus_amount') ?>

+
+
+ +
+
+
+ +
+
+
+

bonus_amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR') ?>

+

lang->line('insured_bonus_amount') ?>

+
+
+ +
+
+
+ +
+
+
+

number_of_months ?>

+

lang->line('number_of_months') ?>

+
+
+ +
+
+
+ +
+
+
+
+
+

lang->line($insurance->state)?>

+

lang->line('Statut') ?>

+
+
+ +
+
+
+ + state == 'REMAINS') {?> +
+
+
+

remaining_amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR') ?>

+

lang->line('remaining_amount') ?>

+
+
+ +
+
+
+ + +
+ +
+
+

lang->line('beneficiaries') ?>

+
+
+ + + + + + + + + + + + + + result() as $i => $row) { + $bonus_amount = Money::of(round($row->bonus_amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR'); + + echo " + + + + + + "; + ?> + + + + + + +
#lang->line('Nom'); ?>lang->line('gender'); ?>lang->line('birth_date'); ?>Affiliationlang->line('bonus_amount'); ?>Images
" . ($i+1) . "" . $row->lastname.' '.$row->firstname . "" . $row->gender . "" . $row->birthdate . "".$this->lang->line($row->affiliation)."" . $bonus_amount. " + +
+
+
+ +
+
+

lang->line('payment_transaction_history') ?>

+
+
+ + + + + + + + + + result() as $i => $row) { + $amount = Money::of(round($row->amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR'); + + echo " + + + "; + ?> + + + +
#lang->line('Montant'); ?>Date
" . ($i+1) . "" . $amount . "" . $row->created_at. "
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/application/views/nano_health/hyper/infos_insurance_subscription.php b/application/views/nano_health/hyper/infos_insurance_subscription.php index 1b04bf2f..a5205eb3 100755 --- a/application/views/nano_health/hyper/infos_insurance_subscription.php +++ b/application/views/nano_health/hyper/infos_insurance_subscription.php @@ -169,7 +169,7 @@

lang->line('Statut') ?>

- +
@@ -404,11 +404,6 @@ toastr.options.closeMethod = 'fadeOut'; toastr.options.closeDuration = 5000; toastr.options.closeEasing = 'swing'; - - $('#download-notice').click(function(e) { - e.preventDefault(); //stop the browser from following - window.open("", '_blank'); - }); const format = "session->userdata('site_lang')?>" === 'french' ? 'fr' : 'en'; moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date diff --git a/application/views/nano_health/hyper/insurances_insured.php b/application/views/nano_health/hyper/insurances_insured.php index a5a27b5b..b88c22e5 100755 --- a/application/views/nano_health/hyper/insurances_insured.php +++ b/application/views/nano_health/hyper/insurances_insured.php @@ -42,14 +42,18 @@
-

lang->line('export_transaction_history') ?>

+

lang->line('export_insured_list') ?>

+
- @@ -57,7 +61,9 @@ - + + + @@ -112,7 +118,7 @@ "processing": true, "language": { "processing": "lang->line('loading') ?>", - "emptyTable" : "lang->line('Aucune transaction') ?>" + "emptyTable" : "lang->line('no_insured') ?>" }, // DataTables server-side processing mode "serverSide": true, @@ -131,7 +137,7 @@ }, "aaSorting": [[8, "desc"]], "columnDefs": [{ - "targets": [8], + "targets": [7,8,9], // "orderable": false, render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format) }], @@ -183,7 +189,7 @@ extend: 'pdfHtml5', orientation: 'landscape', pageSize: 'LEGAL', - title: "lang->line('Hsubscriptions_history') ?>", + title: "lang->line('subscriptions_history') ?>", trim: false, "action": newexportaction },
lang->line('souscription_id') ?> lang->line('insured_id') ?> lang->line('Nom') ?> lang->line('Contact') ?>lang->line('number_of_beneficiaries') ?> lang->line('bonus_amount') ?> lang->line('state') ?>Datelang->line('start_at') ?>lang->line('end_at') ?>lang->line('subscription_date') ?> Action