425 lines
14 KiB
PHP
425 lines
14 KiB
PHP
|
<link rel="stylesheet" href="<?= base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>">
|
|||
|
<link rel="stylesheet"
|
|||
|
href="<?= base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
|
|||
|
<link rel="stylesheet" href="<?= base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
|
|||
|
<link rel="stylesheet" href="<?= base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>">
|
|||
|
<link rel="stylesheet"
|
|||
|
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
|||
|
<link rel="stylesheet" href="<?= base_url('dist/css/custom/levels-table.css') ?>">
|
|||
|
|
|||
|
<?php
|
|||
|
use Brick\Money\Money;
|
|||
|
$context = new \Brick\Money\Context\AutoContext();
|
|||
|
|
|||
|
$month = time();
|
|||
|
$months[] = convertDate(date("M"));
|
|||
|
$label_months [] = date("M") . " " . date("Y");
|
|||
|
$years[] = date("Y");
|
|||
|
for ($i = 1; $i <= 11; $i++) {
|
|||
|
$month = strtotime('last month', $month);
|
|||
|
$months [] = convertDate(date("M", $month));
|
|||
|
$years[] = date("Y", $month);
|
|||
|
$label_months [] = date("M", $month) . " " . date("Y", $month);
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
** Retraits
|
|||
|
**/
|
|||
|
$date = date("Y");
|
|||
|
|
|||
|
$retraits_data[] = '';
|
|||
|
$retraits_data = array();
|
|||
|
for ($i = 1; $i <= 12; $i++) {
|
|||
|
$retraits_query_mounth = $this->db->query("SELECT id FROM infos_transaction
|
|||
|
WHERE network_id='" . $network_id . "'
|
|||
|
AND MONTH(date_created) = '" . $months[$i - 1] . "'
|
|||
|
AND YEAR(date_created) = '" . $years[$i - 1] . "'
|
|||
|
AND type_transac='debit'");
|
|||
|
$retraits_data[] = $retraits_query_mounth->num_rows();
|
|||
|
}
|
|||
|
|
|||
|
$startDate = (new DateTime('01-' . $months[11] . '-' . $years[11]))->format('Y-m-d H:i:s');
|
|||
|
$endDate = date_create_from_format('m/Y', $months[0] . '/' . $years[0])->format('Y-m-d H:i:s');
|
|||
|
|
|||
|
$retraits = $this->db->query("SELECT * FROM infos_transaction
|
|||
|
WHERE network_id='" . $network_id . "'
|
|||
|
AND date_created BETWEEN '" . $startDate . "' AND '" . $endDate . "'
|
|||
|
AND type_transac='debit'");
|
|||
|
|
|||
|
/**
|
|||
|
** Dépots
|
|||
|
**/
|
|||
|
$date = date("Y");
|
|||
|
|
|||
|
$depots_data[] = '';
|
|||
|
$depots_data = array();
|
|||
|
for ($i = 1; $i <= 12; $i++) {
|
|||
|
$depots_query_mounth = $this->db->query("SELECT id FROM infos_transaction
|
|||
|
WHERE network_id='" . $network_id . "'
|
|||
|
AND MONTH(date_created) = '" . $months[$i - 1] . "'
|
|||
|
AND YEAR(date_created) = '" . $years[$i - 1] . "'
|
|||
|
AND type_transac='credit'");
|
|||
|
$depots_data[] = $depots_query_mounth->num_rows();
|
|||
|
}
|
|||
|
$depots = $this->db->query("SELECT * FROM infos_transaction
|
|||
|
WHERE network_id='" . $network_id . "'
|
|||
|
AND date_created BETWEEN '" . $startDate . "' AND '" . $endDate . "'
|
|||
|
AND type_transac='credit'");
|
|||
|
|
|||
|
//if ($transactions != false) {
|
|||
|
// $transac = $transactions->num_rows();
|
|||
|
// $array_transac = array();
|
|||
|
// $num = 0;
|
|||
|
// if ($transac > 0) {
|
|||
|
// foreach ($transactions->result() as $row) {
|
|||
|
// $num++;
|
|||
|
// $array_transac[] = $row->type_transac;
|
|||
|
// }
|
|||
|
// $vals_transac = array_count_values($array_transac);
|
|||
|
// $pieChart = array();
|
|||
|
// foreach (array_keys($vals_transac) as $paramName) {
|
|||
|
// $color = dechex(rand(0x000000, 0xFFFFFF));
|
|||
|
// $trash = array("value" => $vals_transac[$paramName],
|
|||
|
// "color" => "#" . $color,
|
|||
|
// "highlight" => "#" . $color,
|
|||
|
// "label" => $paramName);
|
|||
|
//
|
|||
|
// $pieChart[] = $trash;
|
|||
|
// }
|
|||
|
// }
|
|||
|
//} else {
|
|||
|
$pieChart = array();
|
|||
|
//}
|
|||
|
|
|||
|
?>
|
|||
|
|
|||
|
<div class="content-wrapper">
|
|||
|
<!-- Content Header (Page header) -->
|
|||
|
<section class="content-header">
|
|||
|
|
|||
|
<h1>
|
|||
|
<?= $this->lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?>
|
|||
|
<span class="label label-success pull-right"><?= strtoupper(str_replace('_',' ',$type)) ?></span>
|
|||
|
</h1>
|
|||
|
<?php
|
|||
|
$site_url = base_url();
|
|||
|
|
|||
|
if ($alert == "ok") {
|
|||
|
|
|||
|
if (!$success == "ok") {
|
|||
|
?>
|
|||
|
<div class='alert alert-danger alert-dismissible col-xs-6'>
|
|||
|
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
|
|||
|
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
|
|||
|
<?= $message; ?>
|
|||
|
</div>
|
|||
|
|
|||
|
<?php
|
|||
|
} else {
|
|||
|
?>
|
|||
|
<div class="alert alert-success alert-dismissible col-xs-6">
|
|||
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
|||
|
<h4><i class="icon fa fa-check"></i> Success!</h4>
|
|||
|
<?= $message; ?>
|
|||
|
</div>
|
|||
|
|
|||
|
<?php
|
|||
|
}
|
|||
|
}
|
|||
|
?>
|
|||
|
|
|||
|
</section>
|
|||
|
|
|||
|
<section class="content">
|
|||
|
<div class="row centered">
|
|||
|
<div class="col-lg-3 col-xs-6">
|
|||
|
<div class="small-box bg-red-active">
|
|||
|
<div class="inner">
|
|||
|
<h3><?= $this->lang->line($nh_config->provider_billing_period ?? ''); ?></h3>
|
|||
|
<p><?= $this->lang->line('provider_billing_period') ?></p>
|
|||
|
</div>
|
|||
|
<div class="icon">
|
|||
|
<i class="ion ion-ios-timer"></i>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="col-lg-3 col-xs-6">
|
|||
|
<div class="small-box bg-aqua-active">
|
|||
|
<div class="inner">
|
|||
|
<h3><?= $nh_config->max_number_of_beneficiaries ?? ''; ?></h3>
|
|||
|
<p><?= $this->lang->line('max_number_of_beneficiaries') ?> </p>
|
|||
|
</div>
|
|||
|
<div class="icon">
|
|||
|
<i class="fa fa-sort-numeric-desc"></i>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="col-lg-3 col-xs-6">
|
|||
|
<div class="small-box bg-aqua-active">
|
|||
|
<div class="inner">
|
|||
|
<h3><?= $nh_config->age_limit_of_child_beneficiary ?? ''; ?></h3>
|
|||
|
<p><?= $this->lang->line('age_limit_of_child_beneficiary') ?> </p>
|
|||
|
</div>
|
|||
|
<div class="icon">
|
|||
|
<i class="ion ion-android-calendar"></i>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="col-lg-3 col-xs-6">
|
|||
|
<div class="small-box bg-orange">
|
|||
|
<div class="inner">
|
|||
|
<h3><?= Money::of(round($nh_config->coverage_limit_per_insured_per_year ?? 0, 2), $currency->code, $context)->formatTo('fr_FR'); ?></h3>
|
|||
|
<p><?= $this->lang->line('coverage_limit_per_insured_per_year') ?> </p>
|
|||
|
</div>
|
|||
|
<div class="icon">
|
|||
|
<i class="ion ion-cash"></i>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="row">
|
|||
|
<div class="col-lg-2 col-xs-6">
|
|||
|
<div class="small-box bg-green-active">
|
|||
|
<div class="inner">
|
|||
|
<h3><?= $nh_config->current_affection_percentage_insurer ?? ''; ?><sup style="font-size: 20px">%</sup></h3>
|
|||
|
<p><?= $this->lang->line('current_affection').' : '.$this->lang->line('percentage_insurer') ?></p>
|
|||
|
</div>
|
|||
|
<div class="icon">
|
|||
|
<i class="ion ion-pie-graph"></i>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="col-lg-2 col-xs-6">
|
|||
|
<div class="small-box bg-green-active">
|
|||
|
<div class="inner">
|
|||
|
<h3><?= $nh_config->current_affection_percentage_insured ?? ''; ?><sup style="font-size: 20px">%</sup></h3>
|
|||
|
<p><?= $this->lang->line('current_affection').' : '.$this->lang->line('percentage_insured') ?></p>
|
|||
|
</div>
|
|||
|
<div class="icon">
|
|||
|
<i class="ion ion-pie-graph"></i>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="col-lg-2 col-xs-6">
|
|||
|
<div class="small-box bg-light-blue-active">
|
|||
|
<div class="inner">
|
|||
|
<h3><?= $nh_config->long_term_affection_percentage_insurer ?? ''; ?><sup style="font-size: 20px">%</sup></h3>
|
|||
|
<p><?= $this->lang->line('long_term_affection').' : '.$this->lang->line('percentage_insurer') ?></p>
|
|||
|
</div>
|
|||
|
<div class="icon">
|
|||
|
<i class="ion ion-pie-graph"></i>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="col-lg-2 col-xs-6">
|
|||
|
<div class="small-box bg-light-blue-active">
|
|||
|
<div class="inner">
|
|||
|
<h3><?= $nh_config->long_term_affection_percentage_insured ?? ''; ?><sup style="font-size: 20px">%</sup></h3>
|
|||
|
<p><?= $this->lang->line('long_term_affection').' : '.$this->lang->line('percentage_insured') ?></p>
|
|||
|
</div>
|
|||
|
<div class="icon">
|
|||
|
<i class="ion ion-pie-graph"></i>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="col-lg-2 col-xs-6">
|
|||
|
<div class="small-box bg-aqua">
|
|||
|
<div class="inner">
|
|||
|
<h3><?= $nh_config->exoneration_percentage_insurer ?? ''; ?><sup style="font-size: 20px">%</sup></h3>
|
|||
|
<p><?= $this->lang->line('exoneration').' : '.$this->lang->line('percentage_insurer') ?></p>
|
|||
|
</div>
|
|||
|
<div class="icon">
|
|||
|
<i class="ion ion-pie-graph"></i>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="col-lg-2 col-xs-6">
|
|||
|
<div class="small-box bg-aqua">
|
|||
|
<div class="inner">
|
|||
|
<h3><?= $nh_config->exoneration_percentage_insured ?? ''; ?><sup style="font-size: 20px">%</sup></h3>
|
|||
|
<p><?= $this->lang->line('exoneration').' : '.$this->lang->line('percentage_insured') ?></p>
|
|||
|
</div>
|
|||
|
<div class="icon">
|
|||
|
<i class="ion ion-pie-graph"></i>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="row centered">
|
|||
|
<div class="col-lg-6 col-xs-12">
|
|||
|
<div class="box">
|
|||
|
<div class="box-header">
|
|||
|
<h3 class="box-title"><?= $this->lang->line('years_price_grid') ?></h3>
|
|||
|
</div>
|
|||
|
<div class="box-body" style="overflow-x:auto;">
|
|||
|
<table class="table table-bordered" >
|
|||
|
<thead>
|
|||
|
<tr>
|
|||
|
<th width="20"><?= $this->lang->line('min_age')?></th>
|
|||
|
<th width="20"><?= $this->lang->line('max_age') ?> </th>
|
|||
|
<th><?= $this->lang->line('markup_percentage') ; ?></th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody>
|
|||
|
<?php
|
|||
|
if(isset($years_prices_grid)){
|
|||
|
foreach($years_prices_grid->result() as $i => $row) { ?>
|
|||
|
<tr>
|
|||
|
<td><?= $row->min_age ?></td>
|
|||
|
<td><?= $row->max_age ?></td>
|
|||
|
<td><?= $row->markup_percentage.'%' ?></td>
|
|||
|
</tr>
|
|||
|
<?php
|
|||
|
}
|
|||
|
}
|
|||
|
?>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="col-lg-6 col-xs-12">
|
|||
|
<div class="box">
|
|||
|
<div class="box-header">
|
|||
|
<h3 class="box-title"><?= $this->lang->line('months_price_grid') ?></h3>
|
|||
|
</div>
|
|||
|
<div class="box-body" style="overflow-x:auto;">
|
|||
|
<table class="table table-bordered" >
|
|||
|
<thead>
|
|||
|
<tr>
|
|||
|
<th width="50"><?= $this->lang->line('number_of_months') ?> </th>
|
|||
|
<th><?= $this->lang->line('min_amount') ?> </th>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody>
|
|||
|
<?php
|
|||
|
if(isset($months_prices_grid)){
|
|||
|
foreach($months_prices_grid->result() as $i => $row) { ?>
|
|||
|
<tr>
|
|||
|
<td><?= $row->number_of_months ?></td>
|
|||
|
<td><?= Money::of(round($row->min_amount, 2), $currency->code, $context)->formatTo('fr_FR'); ?></td>
|
|||
|
</tr>
|
|||
|
<?php
|
|||
|
}
|
|||
|
}
|
|||
|
?>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="row">
|
|||
|
<div class="col-xs-12">
|
|||
|
<div class="box box-success">
|
|||
|
<div class="box-header with-border">
|
|||
|
<h3 class="box-title">
|
|||
|
<?= $this->lang->line('subscriptions_of_the_last_12_months'); ?></h3>
|
|||
|
<div class="box-tools">
|
|||
|
<a class="btn btn-primary" href="<?= current_url().($network_id ? '?id='.$network_id . '&history=subscriptions' : '')?>">
|
|||
|
<?= $this->lang->line('subscriptions_historic'); ?>
|
|||
|
</a>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="box-body">
|
|||
|
<div class="chart" id="chart">
|
|||
|
<canvas id="barChart" style="height:230px"></canvas>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
|
|||
|
<div class="row">
|
|||
|
<div class="col-lg-8">
|
|||
|
<div class="box">
|
|||
|
<div class="box-header">
|
|||
|
<h3 class="box-title"><?= $this->lang->line('list_of_acts') ?></h3>
|
|||
|
<div class="box-tools">
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
<div class="box-body" style="overflow-x:auto;">
|
|||
|
<table id="example1" class="table table-bordered table-hover">
|
|||
|
<thead>
|
|||
|
<tr>
|
|||
|
<?php
|
|||
|
echo "<th>".$this->lang->line('Nom')."</th>
|
|||
|
<th>".$this->lang->line('billing_type')."</th>
|
|||
|
<th>".$this->lang->line('authorization_type')."</th>";
|
|||
|
?>
|
|||
|
</tr>
|
|||
|
</thead>
|
|||
|
<tbody>
|
|||
|
<?php
|
|||
|
if(isset($acts)){
|
|||
|
foreach($acts->result() as $i => $row) { ?>
|
|||
|
<tr>
|
|||
|
<td><?= $row->name ?></td>
|
|||
|
<td><?= $this->lang->line($row->billing_type); ?></td>
|
|||
|
<td><?= $this->lang->line($row->authorization_type); ?></td>
|
|||
|
</tr>
|
|||
|
<?php
|
|||
|
}
|
|||
|
}
|
|||
|
?>
|
|||
|
</tbody>
|
|||
|
</table>
|
|||
|
</div>
|
|||
|
</div>
|
|||
|
</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/moment/min/moment.min.js') ?>"></script>
|
|||
|
<script src="<?= base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
|
|||
|
<script
|
|||
|
src="<?= base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
|
|||
|
<scriptf
|
|||
|
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></scriptf>
|
|||
|
<!-- ChartJS -->
|
|||
|
<script src="<?= base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
<script>
|
|||
|
$(function () {
|
|||
|
$('#example1').DataTable();
|
|||
|
// $('#example1').DataTable({
|
|||
|
// "aLengthMenu": [[5, 10, 15, -1], [5, 10, 5, "All"]],
|
|||
|
// "iDisplayLength": 5
|
|||
|
// });
|
|||
|
// $('#example2').DataTable({
|
|||
|
// 'paging' : true,
|
|||
|
// 'lengthChange': false,
|
|||
|
// 'searching' : false,
|
|||
|
// 'ordering' : true,
|
|||
|
// 'info' : true,
|
|||
|
// 'autoWidth' : false
|
|||
|
// })
|
|||
|
})
|
|||
|
</script>
|
|||
|
<!-- Page script -->
|
|||
|
<script src="<?= base_url('dist/js/custom.js') ?>"></script>
|