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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ |
+
+
+
+
+ = $this->lang->line('insured_id'); ?> |
+ = $insured_id ?> |
+
+
+
+ = $this->lang->line('Nom'); ?> |
+ = $user->lastname ?? '' . $user->firstname ?? ''; ?> |
+
+
+
+ = $this->lang->line('Adresse')?> |
+ = $user->adresse ?> |
+
+
+ = $this->lang->line('Contact')?> |
+ = $user->phone." | ".$user->email ?> |
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+ |
+
+
+
+
+ = $this->lang->line('start_at'); ?> |
+ |
+
+
+ = $this->lang->line('end_at'); ?> |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
= Money::of(round($insurance->total_bonus_amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR') ?>
+
= $this->lang->line('bonus_amount') ?>
+
+
+
+
+
+
+
+
+
+
+
= Money::of(round($insurance->bonus_amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR') ?>
+
= $this->lang->line('insured_bonus_amount') ?>
+
+
+
+
+
+
+
+
+
+
+
= $insurance->number_of_months ?>
+
= $this->lang->line('number_of_months') ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
= $this->lang->line($insurance->state)?>
+
= $this->lang->line('Statut') ?>
+
+
+
+
+
+
+
+ state == 'REMAINS') {?>
+
+
+
+
= Money::of(round($insurance->remaining_amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR') ?>
+
= $this->lang->line('remaining_amount') ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # |
+ = $this->lang->line('Nom'); ?> |
+ = $this->lang->line('gender'); ?> |
+ = $this->lang->line('birth_date'); ?> |
+ Affiliation |
+ = $this->lang->line('bonus_amount'); ?> |
+ Images |
+
+
+
+ result() as $i => $row) {
+ $bonus_amount = Money::of(round($row->bonus_amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR');
+
+ echo "
+ " . ($i+1) . " |
+ " . $row->lastname.' '.$row->firstname . " |
+ " . $row->gender . " |
+ " . $row->birthdate . " |
+ ".$this->lang->line($row->affiliation)." |
+ " . $bonus_amount. " | ";
+ ?>
+
+
+
+ |
+
+
+
+
+
+
+ affiliation == 'CHILD') {
+
+ $birthdate_proof_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->birthdate_proof_doc;
+ $birthdate_proof_doc_file = @fopen($birthdate_proof_doc ,'r');
+
+ $justice_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->justice_doc;
+ $justice_doc_file = @fopen($justice_doc ,'r');
+
+ ?>
+
+
+
+
 ?>)
+
+
+
+
+
?>)
+
+
+
+ marriage_certificate_doc;
+ $marriage_certificate_doc_file = @fopen($marriage_certificate_doc,'r');
+
+ $id_document_front = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->id_document_front;
+ $id_document_front_file = @fopen($id_document_front ,'r');
+
+ $id_document_back = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->id_document_back;
+ $id_document_back_file = @fopen($id_document_front ,'r');
+
+ ?>
+
+
+
+
+
+
 ?>)
+
+
+
+
+
+
+
+
 ?>)
+
+
+
+
+
?>)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ # |
+ = $this->lang->line('Montant'); ?> |
+ Date |
+
+
+
+ result() as $i => $row) {
+ $amount = Money::of(round($row->amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR');
+
+ echo "
+ " . ($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 @@
= $this->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("= WALLET_SERVICE_URL.'/subscriptions_docs/'.$insurance_subscription_id.'.pdf'?>", '_blank');
- });
const format = "=$this->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 @@
- = $this->lang->line('souscription_id') ?> |
= $this->lang->line('insured_id') ?> |
= $this->lang->line('Nom') ?> |
= $this->lang->line('Contact') ?> |
@@ -57,7 +61,9 @@
= $this->lang->line('number_of_beneficiaries') ?> |
= $this->lang->line('bonus_amount') ?> |
= $this->lang->line('state') ?> |
- Date |
+ = $this->lang->line('start_at') ?> |
+ = $this->lang->line('end_at') ?> |
+ = $this->lang->line('subscription_date') ?> |
Action |
@@ -112,7 +118,7 @@
"processing": true,
"language": {
"processing": "= $this->lang->line('loading') ?>",
- "emptyTable" : "= $this->lang->line('Aucune transaction') ?>"
+ "emptyTable" : "= $this->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: "= $this->lang->line('Hsubscriptions_history') ?>",
+ title: "= $this->lang->line('subscriptions_history') ?>",
trim: false,
"action": newexportaction
},