backoffice/application/views/gestion_wallet_autre.php

299 lines
10 KiB
PHP
Raw Normal View History

2020-06-23 06:41:44 +00:00
<link rel="stylesheet"
2022-04-18 11:39:19 +00:00
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') ?>">
2020-06-23 06:41:44 +00:00
<link rel="stylesheet"
2022-04-18 11:39:19 +00:00
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
2020-06-23 06:41:44 +00:00
<?php
2020-06-25 11:05:34 +00:00
2020-06-25 16:57:44 +00:00
use Brick\Money\Context\CustomContext;
2020-06-25 08:08:10 +00:00
use Brick\Money\Money;
2020-06-25 19:27:43 +00:00
$context = new \Brick\Money\Context\AutoContext();
2020-06-23 06:41:44 +00:00
$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'");
2020-06-25 08:08:10 +00:00
//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();
//}
2020-06-23 06:41:44 +00:00
$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
?>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
2022-04-18 11:39:19 +00:00
<?= $this->lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?>
<span class="label label-success pull-right"><?= mb_strtoupper(str_replace('_',' ',$type),'UTF-8') ?></span>
2020-06-23 06:41:44 +00:00
</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>
2022-04-18 11:39:19 +00:00
<?= $message; ?>
2020-06-23 06:41:44 +00:00
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
2022-04-18 11:39:19 +00:00
<?= $message; ?>
2020-06-23 06:41:44 +00:00
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="row centered">
2020-06-23 15:49:59 +00:00
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-green">
2020-06-23 06:41:44 +00:00
<div class="inner">
2022-04-18 11:39:19 +00:00
<h3><?= Money::of(round($commission,2), $currency ? $currency->code : 'XAF',$context)->formatTo('fr_FR'); ?></h3>
<p><?= $this->lang->line('Solde Commission') ?></p>
2020-06-23 06:41:44 +00:00
</div>
<div class="icon">
2020-06-23 15:49:59 +00:00
<i class="ion ion-cash"></i>
2020-06-23 06:41:44 +00:00
</div>
</div>
</div>
</div>
2020-06-23 15:49:59 +00:00
<!-- <div class="row">-->
<!-- <div class="col-xs-12">-->
<!-- <div class="box box-success">-->
<!-- <div class="box-header with-border">-->
<!-- <h3 class="box-title">-->
<!-- --><?php //echo $this->lang->line('Historique des 12 derniers mois'); ?><!--</h3>-->
<!-- <div class="box-tools">-->
<!-- <a class="btn btn-primary" href="--><?php //echo current_url().($network_id ? '?id='.$network_id . '&history=transaction' : '')?><!--">-->
<!-- --><?php //echo $this->lang->line('transactions_historic'); ?>
<!-- </a>-->
<!-- <a class="btn btn-info" href="--><?php //echo current_url().($network_id ? '?id='.$network_id . '&history=recharge' : '')?><!--">-->
<!-- --><?php //echo $this->lang->line('recharge_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 class="col-xs-6">-->
<!-- <div class="box box-danger">-->
<!-- <div class="box-header with-border">-->
<!-- <h3 class="box-title">-->
<!-- --><?php //echo $this->lang->line("Parts dépots & retraits"); ?><!--</h3>-->
<!-- </div>-->
<!-- <div class="box-body" id="chart2">-->
<!-- <canvas id="pieChart" style="height:250px"></canvas>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!---->
<!-- <div class="col-xs-6">-->
<!-- <div class="box">-->
<!-- <div class="box-header">-->
<!-- <h3 class="box-title">--><?php //echo $this->lang->line('Commission Hyperviseur') ?><!--</h3>-->
<!-- </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('Solde Principal')."</th>
// <th>".$this->lang->line('Solde Commission')."</th>
// <th>".$this->lang->line('Commission banque')."</th>
// <th>".$this->lang->line('DEPOT'). 's'."</th>
// <th>".$this->lang->line('RETRAIT').'s'."</th>";
// ?>
<!-- </tr>-->
<!-- </thead>-->
<!-- <tbody>-->
<!-- --><?php
// if ($walletHyper) {
// $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
// echo "<tr>
// <td>" . $walletHyper->first_row()->lastname . "</td>
// <td>" . $fmt->format($walletHyper->first_row()->balance_princ) . "</td>
// <td>" . $fmt->format($walletHyper->first_row()->balance_com) . "</td>
// <td>" . $fmt->format($totalCommissionBanque) . "</td>";
//
// echo "<td>" . $depots->num_rows() . "</td>
// <td>" . $retraits->num_rows() . "</td>
// </tr>";
//
// }
// ?>
<!-- </tbody>-->
<!-- </table>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!---->
<!-- </div>-->
2020-06-23 06:41:44 +00:00
</section>
</div>
<!-- jQuery 3 -->
2022-04-18 11:39:19 +00:00
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
2020-06-23 06:41:44 +00:00
<!-- Bootstrap 3.3.7 -->
2022-04-18 11:39:19 +00:00
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
2020-06-23 06:41:44 +00:00
<!-- DataTables -->
2022-04-18 11:39:19 +00:00
<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>
2020-06-23 06:41:44 +00:00
<!-- Slimscroll -->
2022-04-18 11:39:19 +00:00
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
2020-06-23 06:41:44 +00:00
<!-- FastClick -->
2022-04-18 11:39:19 +00:00
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
2020-06-23 06:41:44 +00:00
<!-- AdminLTE App -->
2022-04-18 11:39:19 +00:00
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
2020-06-23 06:41:44 +00:00
<!-- AdminLTE for demo purposes -->
2022-04-18 11:39:19 +00:00
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
2020-06-23 06:41:44 +00:00
2022-04-18 11:39:19 +00:00
<script src="<?= base_url('bower_components/moment/min/moment.min.js') ?>"></script>
<script src="<?= base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
2020-06-23 06:41:44 +00:00
<script
2022-04-18 11:39:19 +00:00
src="<?= base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
2020-06-23 06:41:44 +00:00
<scriptf
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></scriptf>
<!-- ChartJS -->
2022-04-18 11:39:19 +00:00
<script src="<?= base_url('bower_components/chart.js/Chart.js') ?>"></script>
2020-06-23 06:41:44 +00:00
<script>
$(function () {
$('#example1').DataTable();
2020-06-23 06:41:44 +00:00
})
</script>
<script>
var areaChartData = {
2022-04-18 11:39:19 +00:00
labels: <?= json_encode($label_months) ?>,
2020-06-23 06:41:44 +00:00
datasets: [
{
label: 'Electronics',
fillColor: 'rgba(255, 162, 0, 1)',
strokeColor: 'rgba(255, 162, 0, 1)',
pointColor: 'rgba(255, 162, 0, 1)',
pointStrokeColor: '#ffa200',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(220,220,220,1)',
2022-04-18 11:39:19 +00:00
data: <?= json_encode($depots_data) ?>
2020-06-23 06:41:44 +00:00
},
{
label: 'Digital Goods',
fillColor: 'rgba(0, 187, 255, 1)',
strokeColor: 'rgba(0, 187, 255, 1)',
pointColor: '#00bbff',
pointStrokeColor: 'rgba(0, 187, 255, 1)',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(0, 187, 255, 1)',
2022-04-18 11:39:19 +00:00
data: <?= json_encode($retraits_data) ?>
2020-06-23 06:41:44 +00:00
}
]
};
2022-04-18 11:39:19 +00:00
var Pie = '<?= json_encode($pieChart) ?>';
2020-06-23 06:41:44 +00:00
if (Pie === '[]') {
var select = document.getElementById('chart2');
$(select.children).hide();
$(select).append("<p>Aucune transaction</p>");
} else {
Pie = JSON.parse(Pie);
}
</script>
<!-- Page script -->
2022-04-18 11:39:19 +00:00
<script src="<?= base_url('dist/js/custom.js') ?>"></script>