Improve insured list

This commit is contained in:
Djery-Tom 2021-11-09 18:35:31 +01:00
parent d2a824376e
commit c16f23c4a7
9 changed files with 523 additions and 24 deletions

View File

@ -376,12 +376,25 @@ class Hyperviseur_dash extends CI_Controller
if ($this->input->get('history')) { if ($this->input->get('history')) {
if($this->input->get('id') !== null){ if($this->input->get('id') !== null){
$data['insurance_subscription_id'] = $this->input->get('id'); $history = $this->input->get('history');
$data['subscription'] = $this->nano_health_model->getInfosInsuranceSubscriptionById($this->input->get('id')); if($history == 'insurance-insured'){
$data['beneficiaries'] = $this->db->get_where('nh_insurances_having_rights',['insurance_subscription_id' => $data['insurance_subscription_id']]); $data['active'] = "wallet_insured";
$data['user'] = $this->db->get_where('user_infos',['user_id' => $data['subscription']->user_id ?? null])->first_row(); $data['insured_id'] = $this->input->get('id');
$this->load->view('header_hyp', $data); $data['insurance'] = $this->nano_health_model->getInfosInsuredById($this->input->get('id'));
$this->load->view('nano_health/hyper/infos_insurance_subscription'); $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'); $this->load->view('footer');
return; return;
}else{ }else{

View File

@ -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'); $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, $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->created_at, $bonus_amount, mb_strtoupper($this->lang->line($row->state) ,'UTF-8'), $row->start_at, $row->end_at, $row->created_at,
'<a href="'.$current_url.'?history=insurances&id='.$row->insurance_subscription_id.'" class="btn btn-primary" > '.$this->lang->line('Voir plus...').'</a>'); '<a href="'.$current_url.'?history=insurance-insured&id='.$row->insured_id.'" class="btn btn-primary" > '.$this->lang->line('Voir plus...').'</a>');
} }
$output = array( $output = array(

View File

@ -747,4 +747,16 @@ $lang['more_information_subscription'] = "More information for the subscription"
$lang['message_rule'] = "The message must not exceed 500 characters"; $lang['message_rule'] = "The message must not exceed 500 characters";
$lang['subscription_more_information'] = "Subscription awaiting additional information"; $lang['subscription_more_information'] = "Subscription awaiting additional information";
$lang['AWAITING_FURTHER_INFORMATION'] = "Awaiting further 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";
?> ?>

View File

@ -758,5 +758,16 @@ $lang['more_information'] = "Complément d'informations";
$lang['more_information_subscription'] = "Complément d'informations pour la subscription"; $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['message_rule'] = "Le message ne doit pas dépasser 500 caractères";
$lang['subscription_more_information'] = "Souscription en attente de complement d'informations"; $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";
?> ?>

View File

@ -56,4 +56,12 @@ class Nano_health_model extends CI_Model
return $this->db->from('nh_insurances_subscriptions') return $this->db->from('nh_insurances_subscriptions')
->where('state', $state)->count_all_results(); ->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]);
}
} }

View File

@ -8,9 +8,11 @@ class Insurances_model extends CI_Model
// Set table name // Set table name
$this->table = 'nh_infos_insurances'; $this->table = 'nh_infos_insurances';
// Set orderable column fields // 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 // 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 // Set default order
$this->order = array('created_at' => 'desc'); $this->order = array('created_at' => 'desc');
} }

View File

@ -0,0 +1,452 @@
<link rel="stylesheet"
href="<?= base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
<link rel="stylesheet"
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
<link rel="stylesheet" href="https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css">
<link rel="stylesheet"
href="<?= base_url('bower_components/jquery-ui/themes/base/jquery-ui.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
<div class="content-wrapper">
<section class="content-header">
<h1 style="margin-bottom: 20px">
<?= $this->lang->line('insured') . ' :: ' . $this->lang->line('insured_detail') . ' - ' . $insured_id; ?>
</h1>
<?php
use Brick\Money\Context\AutoContext;
use Brick\Money\CurrencyConverter;
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
use Brick\Money\ExchangeRateProvider\PDOProvider;
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
use Brick\Money\Money;
// set to whatever your rates are relative to
$baseCurrency = 'USD';
// use your own credentials, or re-use your existing PDO connection
$pdo = new PDO('mysql:host=' . $this->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);
?>
</section>
<section class="content">
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title"><?= $this->lang->line('insurance_infos')?></h3>
</div>
<div class="box-body row" style="overflow-x:auto;">
<div class="col-lg-6" style="padding-left: 25px;">
<table style="width: 100%">
<colgroup>
<col span="1" style="width: 30%;">
<col span="1" style="width: 70%;">
</colgroup>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><?= $this->lang->line('insured_id'); ?></td>
<td align="center"><strong><?= $insured_id ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('Nom'); ?></td>
<td align="center"><strong><?= $user->lastname ?? '' . $user->firstname ?? ''; ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('Adresse')?></td>
<td align="center"><strong><?= $user->adresse ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('Contact')?></td>
<td align="center"><strong><?= $user->phone." | ".$user->email ?></strong></td>
</tr>
</tbody>
</table>
</div>
<div class="col-lg-6" style="padding-left: 25px;">
<table style="width: 100%">
<colgroup>
<col span="1" style="width: 30%;">
<col span="1" style="width: 70%;">
</colgroup>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><?= $this->lang->line('start_at'); ?></td>
<td><strong id="start_at"></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('end_at'); ?></td>
<td><strong id="end_at"></strong></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-green-active">
<div class="inner">
<h3><?= Money::of(round($insurance->total_bonus_amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR') ?></h3>
<p><?= $this->lang->line('bonus_amount') ?></p>
</div>
<div class="icon">
<i class="ion ion-cash"></i>
</div>
</div>
</div>
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-red">
<div class="inner">
<h3><?= Money::of(round($insurance->bonus_amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR') ?></h3>
<p><?= $this->lang->line('insured_bonus_amount') ?></p>
</div>
<div class="icon">
<i class="ion ion-cash"></i>
</div>
</div>
</div>
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-light-blue">
<div class="inner">
<h3> <?= $insurance->number_of_months ?> </h3>
<p><?= $this->lang->line('number_of_months') ?></p>
</div>
<div class="icon">
<i class="fa fa-clock-o"></i>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-blue-active">
<div class="inner">
<h3 style="white-space: pre-wrap"><?= $this->lang->line($insurance->state)?> </h3>
<p><?= $this->lang->line('Statut') ?></p>
</div>
<div class="icon">
<i class="fa fa-info"></i>
</div>
</div>
</div>
<?php if($insurance->state == 'REMAINS') {?>
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-blue-active">
<div class="inner">
<h3 style="white-space: pre-wrap;"><?= Money::of(round($insurance->remaining_amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR') ?> </h3>
<p><?= $this->lang->line('remaining_amount') ?></p>
</div>
<div class="icon">
<i class="fa fa-money"></i>
</div>
</div>
</div>
<?php } ?>
</div>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><?= $this->lang->line('beneficiaries') ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<table id="example1" class="table table-bordered table-hover">
<thead>
<tr>
<th>#</th>
<th><?= $this->lang->line('Nom'); ?></th>
<th><?= $this->lang->line('gender'); ?></th>
<th><?= $this->lang->line('birth_date'); ?></th>
<th>Affiliation</th>
<th><?= $this->lang->line('bonus_amount'); ?></th>
<th>Images</th>
</tr>
</thead>
<tbody>
<?php
if (isset($beneficiaries)) {
foreach ($beneficiaries->result() as $i => $row) {
$bonus_amount = Money::of(round($row->bonus_amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR');
echo "<tr>
<td>" . ($i+1) . "</td>
<td>" . $row->lastname.' '.$row->firstname . "</td>
<td>" . $row->gender . "</td>
<td>" . $row->birthdate . "</td>
<td>".$this->lang->line($row->affiliation)."</td>
<td>" . $bonus_amount. "</td>";
?>
<td>
<button class="btn btn-primary" data-target="<?= '#images-modal'.$i ?>" data-toggle="modal">
<?= $this->lang->line('show'); ?>
</button>
</td>
</tr>
<div class="modal fade" id="<?= 'images-modal'.$i ?>">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Images des documents</h3>
</div>
<div class="modal-body">
<?php if($row->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');
?>
<div class="row" style="margin-top: 10px">
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('birthdate_proof_doc') ?></label>
<img src="<?= $birthdate_proof_doc_file ? $birthdate_proof_doc : base_url('images/broken.png') ?>"
alt="document_front" style="width: 100%;"/>
</div>
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('justice_doc') ?></label>
<img src="<?= $justice_doc_file ? $justice_doc : base_url('images/broken.png')?>"
alt="document_back" style="width: 100%;"/>
</div>
</div>
<?php } else {
$marriage_certificate_doc = NANO_SANTE_SERVICE_URL . '/insurances-subscriptions-docs/'.$row->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');
?>
<div class="row text-center" style="justify-content: center; display: flex;">
<div class="col-sm-6">
<label><?= $this->lang->line('marriage_certificate_doc') ?></label>
<div>
<img src="<?= $marriage_certificate_doc_file ? $marriage_certificate_doc : base_url('images/broken.png') ?>"
alt="user_image" width="100%"/>
</div>
</div>
</div>
<div class="row" style="margin-top: 10px">
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('id_document_image_front') ?></label>
<img src="<?= $id_document_front_file ? $id_document_front : base_url('images/broken.png') ?>"
alt="document_front" style="width: 100%;"/>
</div>
<div class="col-sm-6 text-center">
<label><?= $this->lang->line('id_document_image_back') ?></label>
<img src="<?= $id_document_back_file ? $id_document_back : base_url('images/broken.png')?>"
alt="document_back" style="width: 100%;"/>
</div>
</div>
<?php } ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
</div>
</div>
</div>
</div>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title"><?= $this->lang->line('payment_transaction_history') ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<table id="transactions" class="table table-bordered table-hover">
<thead>
<tr>
<th>#</th>
<th><?= $this->lang->line('Montant'); ?></th>
<th>Date</th>
</tr>
</thead>
<tbody>
<?php
if (isset($transactions)) {
foreach ($transactions->result() as $i => $row) {
$amount = Money::of(round($row->amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR');
echo "<tr>
<td>" . ($i+1) . "</td>
<td>" . $amount . "</td>
<td>" . $row->created_at. "</td>";
?>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?= base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?= base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
<script src="<?= base_url('bower_components/jquery-ui/jquery-ui.js') ?>"></script>
<script src="<?= base_url('bower_components/moment/min/moment.min.js') ?>"></script>
<script src="https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js"></script>
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment-with-locales.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.19/sorting/datetime-moment.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.20/dataRender/datetime.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.html5.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.colVis.min.js"></script>
<script type="text/javascript">
toastr.options.closeButton = true;
toastr.options.closeMethod = 'fadeOut';
toastr.options.closeDuration = 5000;
toastr.options.closeEasing = 'swing';
$(document).ready(function () {
$('#start_at').text(moment("<?=$insurance->start_at?>", 'YYYY-MM-DD HH:mm:ss').format('D MMMM YYYY HH:mm:s'));
$('#end_at').text(moment("<?=$insurance->end_at?>", 'YYYY-MM-DD HH:mm:ss').format('D MMMM YYYY HH:mm:s'));
});
const format = "<?=$this->session->userdata('site_lang')?>" === 'french' ? 'fr' : 'en';
moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date
$('#example1').DataTable(
{
order: [[1, 'asc']],
dom: 'Bfrtip',
"buttons": [
'pageLength',
{
"extend": 'excelHtml5',
title: "<?= $this->lang->line('beneficiaries') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insured_id?>",
// exportOptions: {
// columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
// },
customizeData: function (data) {
for (var i = 0; i < data.body.length; i++) {
for (var j = 0; j < data.body[i].length; j++) {
// data.body[i][j] = '\u200C' + data.body[i][j];
if ([5].includes(j)) {
// Get the value and strip the non numeric characters
// var value = $(this).text();
value = data.body[i][j].replace(',', ".")
data.body[i][j] = Number(value.replace(/[^0-9\.-]+/g, ""));
}
}
}
},
},
{
extend: 'csvHtml5',
title: "<?= $this->lang->line('beneficiaries') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insured_id?>",
},
{
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'LEGAL',
title: "<?= $this->lang->line('beneficiaries') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insured_id?>",
},
// 'colvis'
]
}
);
$('#transactions').DataTable(
{
order: [[1, 'asc']],
"columnDefs": [{
"targets": [2],
// "orderable": false,
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
}],
}
);
</script>

View File

@ -169,7 +169,7 @@
<p><?= $this->lang->line('Statut') ?></p> <p><?= $this->lang->line('Statut') ?></p>
</div> </div>
<div class="icon"> <div class="icon">
<i class="fa fa-calendar"></i> <i class="fa fa-info"></i>
</div> </div>
</div> </div>
</div> </div>
@ -404,11 +404,6 @@
toastr.options.closeMethod = 'fadeOut'; toastr.options.closeMethod = 'fadeOut';
toastr.options.closeDuration = 5000; toastr.options.closeDuration = 5000;
toastr.options.closeEasing = 'swing'; 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'; const format = "<?=$this->session->userdata('site_lang')?>" === 'french' ? 'fr' : 'en';
moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date

View File

@ -42,14 +42,18 @@
<div class="col-xs-12"> <div class="col-xs-12">
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
<h3 class="box-title"><?= $this->lang->line('export_transaction_history') ?></h3> <h3 class="box-title"><?= $this->lang->line('export_insured_list') ?></h3>
<div class="box-tools">
<a class="btn btn-primary" href="<?= current_url().('?history=insurance-payment-transactions')?>">
<?= $this->lang->line('payment_transaction_history'); ?>
</a>
</div>
</div> </div>
<div class="box-body" style="overflow-x:auto;"> <div class="box-body" style="overflow-x:auto;">
<table id="subscriptions" class="table table-bordered table-striped"> <table id="subscriptions" class="table table-bordered table-striped">
<thead> <thead>
<tr> <tr>
<th align='center'><?= $this->lang->line('souscription_id') ?></th>
<th align='center'><?= $this->lang->line('insured_id') ?></th> <th align='center'><?= $this->lang->line('insured_id') ?></th>
<th><?= $this->lang->line('Nom') ?></th> <th><?= $this->lang->line('Nom') ?></th>
<th><?= $this->lang->line('Contact') ?></th> <th><?= $this->lang->line('Contact') ?></th>
@ -57,7 +61,9 @@
<th><?= $this->lang->line('number_of_beneficiaries') ?></th> <th><?= $this->lang->line('number_of_beneficiaries') ?></th>
<th><?= $this->lang->line('bonus_amount') ?></th> <th><?= $this->lang->line('bonus_amount') ?></th>
<th><?= $this->lang->line('state') ?></th> <th><?= $this->lang->line('state') ?></th>
<th align='center'>Date</th> <th><?= $this->lang->line('start_at') ?></th>
<th><?= $this->lang->line('end_at') ?></th>
<th align='center'><?= $this->lang->line('subscription_date') ?></th>
<th align='center'>Action</th> <th align='center'>Action</th>
</tr> </tr>
</thead> </thead>
@ -112,7 +118,7 @@
"processing": true, "processing": true,
"language": { "language": {
"processing": "<?= $this->lang->line('loading') ?>", "processing": "<?= $this->lang->line('loading') ?>",
"emptyTable" : "<?= $this->lang->line('Aucune transaction') ?>" "emptyTable" : "<?= $this->lang->line('no_insured') ?>"
}, },
// DataTables server-side processing mode // DataTables server-side processing mode
"serverSide": true, "serverSide": true,
@ -131,7 +137,7 @@
}, },
"aaSorting": [[8, "desc"]], "aaSorting": [[8, "desc"]],
"columnDefs": [{ "columnDefs": [{
"targets": [8], "targets": [7,8,9],
// "orderable": false, // "orderable": false,
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format) render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
}], }],
@ -183,7 +189,7 @@
extend: 'pdfHtml5', extend: 'pdfHtml5',
orientation: 'landscape', orientation: 'landscape',
pageSize: 'LEGAL', pageSize: 'LEGAL',
title: "<?= $this->lang->line('Hsubscriptions_history') ?>", title: "<?= $this->lang->line('subscriptions_history') ?>",
trim: false, trim: false,
"action": newexportaction "action": newexportaction
}, },