2020-07-10 18:19:15 +00:00
|
|
|
|
<!-- DataTables -->
|
|
|
|
|
<link rel="stylesheet"
|
|
|
|
|
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.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="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
|
|
|
|
|
<div class="content-wrapper">
|
2020-07-16 16:27:32 +00:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Brick\Money\Context\AutoContext;
|
|
|
|
|
use Brick\Money\CurrencyConverter;
|
2020-10-03 11:14:16 +00:00
|
|
|
|
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
|
2020-07-16 16:27:32 +00:00
|
|
|
|
use Brick\Money\ExchangeRateProvider\PDOProvider;
|
|
|
|
|
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
|
|
|
|
|
use Brick\Money\Money;
|
|
|
|
|
|
|
|
|
|
?>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
<!-- Content Header (Page header) -->
|
|
|
|
|
<section class="content-header">
|
|
|
|
|
|
|
|
|
|
<h1>
|
2020-07-16 16:27:32 +00:00
|
|
|
|
<?php echo isset($category) ? 'Wallet' : $this->lang->line('Gestion des wallets');
|
|
|
|
|
echo ' ' . $network . ' - ' . $country
|
|
|
|
|
. ' :: ' . $this->lang->line('balance_statement'); ?>
|
|
|
|
|
<!-- <input type="button" class="btn btn-primary pull-right" id="Bactiver"-->
|
|
|
|
|
<!-- value="Activer/Désactiver le(s) réseau(x)" />-->
|
2020-07-10 18:19:15 +00:00
|
|
|
|
</h1>
|
|
|
|
|
<?php
|
2021-10-14 14:33:02 +00:00
|
|
|
|
|
2020-07-10 18:19:15 +00:00
|
|
|
|
|
|
|
|
|
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>
|
|
|
|
|
<?php echo $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>
|
|
|
|
|
<?php echo $message; ?>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 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
|
|
|
|
|
$converter = new CurrencyConverter($provider);
|
|
|
|
|
$context = new AutoContext();
|
|
|
|
|
?>
|
|
|
|
|
</section>
|
|
|
|
|
<section class="content">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-xs-12">
|
|
|
|
|
<div class="box">
|
|
|
|
|
<div class="box-header">
|
|
|
|
|
<h3 class="box-title"><?php echo $this->lang->line('export_balance_statement') ?></h3>
|
2021-04-22 15:34:32 +00:00
|
|
|
|
<div class="box-tools">
|
|
|
|
|
<a class="btn btn-primary" href="<?php echo current_url().('?history=commission_payments')?>">
|
|
|
|
|
<?php echo $this->lang->line('commission_payments_history'); ?>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="box-body" style="overflow-x:auto;">
|
|
|
|
|
<?php
|
2020-07-16 16:27:32 +00:00
|
|
|
|
if ($wallets){
|
|
|
|
|
$numrows = $wallets->num_rows();
|
|
|
|
|
$num = 0;
|
|
|
|
|
if ($numrows > 0) {
|
|
|
|
|
$fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|
|
|
|
?>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
|
2020-07-16 16:27:32 +00:00
|
|
|
|
<table id="transactions" class="table table-bordered table-striped"
|
|
|
|
|
data-lang="<?php echo $this->session->userdata('site_lang') ?>"
|
|
|
|
|
data-rows="<?= $numrows ?>"
|
|
|
|
|
data-currency="<?= $this->session->userdata('currency_code') ?>">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th align='center'>ID</th>
|
|
|
|
|
<th><?= $this->lang->line('Solde Principal') ?></th>
|
|
|
|
|
<th><?= $this->lang->line('Solde Commission') ?></th>
|
|
|
|
|
<th><?= $this->lang->line('Telephone') ?></th>
|
|
|
|
|
<th><?= $this->lang->line('code membre') ?></th>
|
|
|
|
|
<th>Agent</th>
|
2021-08-11 11:23:50 +00:00
|
|
|
|
<th><?=$this->lang->line('sponsor')?></th>
|
2021-04-22 15:34:32 +00:00
|
|
|
|
<?php if ($this->session->userdata('category') != 'super') { ?>
|
|
|
|
|
<th align='center'>Action</th>
|
|
|
|
|
<?php } ?>
|
2021-08-11 11:23:50 +00:00
|
|
|
|
<th><?=$this->lang->line('registration_date')?></th>
|
2020-07-16 16:27:32 +00:00
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
|
2020-07-16 16:27:32 +00:00
|
|
|
|
<?php
|
|
|
|
|
foreach ($wallets->result() as $row) {
|
2021-06-25 08:46:48 +00:00
|
|
|
|
$parrain = $row->parrain;
|
|
|
|
|
if($row->codeMembre == $row->codeParrain)
|
|
|
|
|
$parrain ='';
|
|
|
|
|
else if($row->codeParrain == $this->session->userdata('member_code'))
|
|
|
|
|
$parrain = $this->lang->line('Vous');
|
|
|
|
|
|
2020-07-16 16:27:32 +00:00
|
|
|
|
$num++;
|
|
|
|
|
echo "<tr>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
<td align='center' >$num</td>
|
2020-07-16 16:27:32 +00:00
|
|
|
|
<td>" . Money::of(round($row->balance_princ, 2), $row->currency_code, $context)->formatTo('fr_FR') . "</td>
|
|
|
|
|
<td>" . Money::of(round($row->balance_com, 2), $row->currency_code, $context)->formatTo('fr_FR') . "</td>
|
|
|
|
|
<td>" . $row->transactionNumber . "</td>
|
|
|
|
|
<td>" . $row->codeMembre . "</td>
|
2021-06-25 08:46:48 +00:00
|
|
|
|
<td>" . $row->lastname . "</td>
|
|
|
|
|
<td>" . $parrain . "</td>";
|
2020-07-10 18:19:15 +00:00
|
|
|
|
?>
|
2021-04-22 15:34:32 +00:00
|
|
|
|
<?php if ($this->session->userdata('category') != 'super') { ?>
|
|
|
|
|
<td>
|
|
|
|
|
<button data-toggle="modal" data-target="#payCommission" class="btn btn-danger payCommissionBtn"
|
|
|
|
|
data-id_wallet_agent="<?=$row->wallet_id?>" <?php if($row->category != 'super') echo "style = 'display:none'"?> >
|
|
|
|
|
<?= $this->lang->line('pay_commission_in_cash')?>
|
|
|
|
|
</button>
|
|
|
|
|
</td>
|
|
|
|
|
<?php } ?>
|
2021-08-11 11:23:50 +00:00
|
|
|
|
<td><?= $row->agent_registration_date?></td>
|
2020-07-16 16:27:32 +00:00
|
|
|
|
</tr>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
|
|
|
|
|
<?php
|
2020-07-16 16:27:32 +00:00
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</tbody>
|
2021-08-11 11:23:50 +00:00
|
|
|
|
</table>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
|
2020-07-16 16:27:32 +00:00
|
|
|
|
<?php
|
|
|
|
|
} else {
|
|
|
|
|
echo $this->lang->line('Aucune transaction');
|
2020-07-10 18:19:15 +00:00
|
|
|
|
}
|
2020-07-16 16:27:32 +00:00
|
|
|
|
} else {
|
|
|
|
|
echo $this->lang->line('Aucune transaction');
|
|
|
|
|
}
|
|
|
|
|
?>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-04-22 15:34:32 +00:00
|
|
|
|
<div class="modal fade" id="payCommission" tabindex="-1" role="dialog" aria-hidden="true">
|
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<h3 class="modal-title"><?php echo $this->lang->line('pay_commission_in_cash'); ?></h3>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
<?php if ($walletPassword != null) { ?>
|
|
|
|
|
<form id="payCommissionForm">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="montant" class="col-form-label"><?php echo $this->lang->line('Montant') ?></label>
|
|
|
|
|
<input type="text" required class="form-control" id="montant" name="montant" >
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label><?php echo $this->lang->line('mot de passe') ?></label>
|
|
|
|
|
<div class="input-group" id="show_hide_password">
|
|
|
|
|
<input class="form-control" name="password" id="password" type="password">
|
|
|
|
|
<div class="input-group-addon">
|
|
|
|
|
<a href=""><i class="fa fa-eye-slash" aria-hidden="true"></i></a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="clearfix">
|
|
|
|
|
<a href="#" id="resetPassword" class="pull-right forgot-password" data-wallet_password_id="<?php echo $walletPassword->id ?>" data-network="<?php echo $network ?>" data-country="<?php echo $country ?>"
|
|
|
|
|
data-email="<?php echo $walletPassword->email ?>">
|
|
|
|
|
<?php echo $this->lang->line('i_forgot_password') ?>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
<?php }else{ ?>
|
|
|
|
|
<div class="text-center">
|
|
|
|
|
<h4> <?php echo $this->lang->line('no_wallet_password') ?></h4>
|
2021-10-14 14:33:02 +00:00
|
|
|
|
<a href="<?php echo base_url('Hyperviseur_dash/walletPassword') ?>" alt="" class="btn btn-primary"><?php echo $this->lang->line('click_here') ?></a>
|
2021-04-22 15:34:32 +00:00
|
|
|
|
</div>
|
|
|
|
|
<?php } ?>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
|
|
|
|
<?php if ($walletPassword != null) { ?>
|
|
|
|
|
<button type="button" class="btn btn-primary" data-salt="<?php echo $walletPassword->salt ?>" data-encrypted_password="<?php echo $walletPassword->encrypted_password ?>" id="pay" >
|
|
|
|
|
<?php echo $this->lang->line('recharge'); ?>
|
|
|
|
|
</button>
|
|
|
|
|
<?php }?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<!-- jQuery 3 -->
|
|
|
|
|
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
|
|
|
|
|
<!-- Bootstrap 3.3.7 -->
|
|
|
|
|
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
|
|
|
|
|
<!-- DataTables -->
|
|
|
|
|
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
|
|
|
|
|
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
|
|
|
|
|
<!-- SlimScroll -->
|
|
|
|
|
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
|
|
|
|
|
<!-- FastClick -->
|
|
|
|
|
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
|
|
|
|
|
<!-- AdminLTE App -->
|
|
|
|
|
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
|
|
|
|
|
<!-- AdminLTE for demo purposes -->
|
|
|
|
|
<script src="<?php echo base_url('dist/js/demo.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 src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
|
|
|
|
|
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
|
2021-04-22 15:34:32 +00:00
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.5.4"></script>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
$(function () {
|
2021-04-22 15:34:32 +00:00
|
|
|
|
|
|
|
|
|
anElement = new AutoNumeric('#montant', '', {digitGroupSeparator: ' ', decimalPlaces:'0', minimumValue : '1' , maximumValue: '99999999999999999999999999'});
|
|
|
|
|
$("#show_hide_password a").on('click', function(event) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
if($('#show_hide_password input').attr("type") == "text"){
|
|
|
|
|
$('#show_hide_password input').attr('type', 'password');
|
|
|
|
|
$('#show_hide_password i').addClass( "fa-eye-slash" );
|
|
|
|
|
$('#show_hide_password i').removeClass( "fa-eye" );
|
|
|
|
|
}else if($('#show_hide_password input').attr("type") == "password"){
|
|
|
|
|
$('#show_hide_password input').attr('type', 'text');
|
|
|
|
|
$('#show_hide_password i').removeClass( "fa-eye-slash" );
|
|
|
|
|
$('#show_hide_password i').addClass( "fa-eye" );
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2020-07-16 16:27:32 +00:00
|
|
|
|
const lang = $('table').data('lang');
|
|
|
|
|
var rows = $('table').data('rows');
|
|
|
|
|
var currency = $('table').data('currency');
|
2020-07-10 18:19:15 +00:00
|
|
|
|
const format = lang === 'french' ? 'fr' : 'en';
|
2020-07-16 16:27:32 +00:00
|
|
|
|
moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date
|
2020-07-10 18:19:15 +00:00
|
|
|
|
var table = $('#transactions').DataTable({
|
2020-07-16 16:27:32 +00:00
|
|
|
|
"aaSorting": [[0, "asc"]],
|
2021-08-11 11:23:50 +00:00
|
|
|
|
"columnDefs": [
|
|
|
|
|
{
|
|
|
|
|
targets: [8],
|
|
|
|
|
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"targets": [8],
|
|
|
|
|
"visible": false
|
|
|
|
|
}
|
|
|
|
|
],
|
2020-07-10 18:19:15 +00:00
|
|
|
|
dom: 'Bfrtip',
|
|
|
|
|
"buttons": [
|
2020-07-16 16:27:32 +00:00
|
|
|
|
'pageLength',
|
2020-07-10 18:19:15 +00:00
|
|
|
|
{
|
|
|
|
|
extend: 'excelHtml5',
|
2020-07-29 13:40:25 +00:00
|
|
|
|
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 ([1, 2].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, ""));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2020-07-16 16:27:32 +00:00
|
|
|
|
customize: function (xlsx) {
|
|
|
|
|
var sheet = xlsx.xl.worksheets['sheet1.xml'],
|
|
|
|
|
sum = 0;
|
|
|
|
|
var sumCom = 0;
|
|
|
|
|
|
|
|
|
|
// read each row
|
|
|
|
|
// Loop over the cells in column `B`
|
|
|
|
|
$('row c[r^="B"]', sheet).each(function () {
|
|
|
|
|
|
|
|
|
|
// Get the value and strip the non numeric characters
|
|
|
|
|
var value = $(this).text();
|
|
|
|
|
value = value.replace(',', ".")
|
|
|
|
|
sum += Number(value.replace(/[^0-9\.-]+/g, ""));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Total commission
|
|
|
|
|
$('row c[r^="C"]', sheet).each(function () {
|
|
|
|
|
|
|
|
|
|
// Get the value and strip the non numeric characters
|
|
|
|
|
var value = $(this).text();
|
|
|
|
|
value = value.replace(',', ".")
|
|
|
|
|
sumCom += Number(value.replace(/[^0-9\.-]+/g, ""));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Create our number formatter.
|
|
|
|
|
var formatter = new Intl.NumberFormat('en-US', {
|
|
|
|
|
style: 'currency',
|
|
|
|
|
currency: currency,
|
|
|
|
|
|
|
|
|
|
// the default value for minimumFractionDigits depends on the currency
|
|
|
|
|
// and is usually already 2
|
|
|
|
|
minimumFractionDigits: 2,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function addTotal(index, data , sum , column) {
|
|
|
|
|
msg = '<row r="' + index + '">';
|
|
|
|
|
for (i = 0; i < data.length; i++) {
|
|
|
|
|
var key = data[i].k;
|
|
|
|
|
var value = data[i].v;
|
|
|
|
|
msg += '<c t="inlineStr" r="' + column + (rows + 3) + '" s="42">';
|
|
|
|
|
msg += '<is>';
|
|
|
|
|
msg += '<t>' + formatter.format(sum) + '</t>';
|
|
|
|
|
msg += '</is>';
|
|
|
|
|
msg += '</c>';
|
|
|
|
|
}
|
|
|
|
|
msg += '</row>';
|
|
|
|
|
return msg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//insert
|
|
|
|
|
var r1 = addTotal(1, [{
|
|
|
|
|
k: 'A',
|
|
|
|
|
v: 'ColA'
|
|
|
|
|
}],sum ,'B');
|
|
|
|
|
|
|
|
|
|
var r2 = addTotal(1, [{
|
|
|
|
|
k: 'A',
|
|
|
|
|
v: 'ColA'
|
|
|
|
|
}],sumCom,'C');
|
|
|
|
|
|
|
|
|
|
sheet.childNodes[0].childNodes[1].innerHTML = r1 + r2+ sheet.childNodes[0].childNodes[1].innerHTML;
|
|
|
|
|
},
|
2020-10-03 11:14:16 +00:00
|
|
|
|
title: "<?= $this->lang->line('balance_statement') ?>"+' - Date : ' + moment().format("dddd, Do MMMM YYYY, h:mm:ss")
|
2020-07-10 18:19:15 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
extend: 'csvHtml5',
|
2020-10-03 11:14:16 +00:00
|
|
|
|
title: "<?= $this->lang->line('balance_statement') ?>"+' - Date : ' + moment().format("dddd, Do MMMM YYYY, h:mm:ss")
|
2020-07-10 18:19:15 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
extend: 'pdfHtml5',
|
|
|
|
|
orientation: 'portrait',
|
|
|
|
|
pageSize: 'LEGAL',
|
2020-10-03 11:14:16 +00:00
|
|
|
|
title: "<?= $this->lang->line('balance_statement') ?>"+' - Date : ' + moment().format("dddd, Do MMMM YYYY, h:mm:ss")
|
2020-07-10 18:19:15 +00:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
table.buttons().container()
|
2020-07-16 16:27:32 +00:00
|
|
|
|
.appendTo('#example_wrapper .col-sm-6:eq(0)');
|
2020-07-10 18:19:15 +00:00
|
|
|
|
});
|
2021-04-22 15:34:32 +00:00
|
|
|
|
|
|
|
|
|
var id_wallet_agent = null;
|
|
|
|
|
|
|
|
|
|
$('.payCommissionBtn').click(function () {
|
|
|
|
|
id_wallet_agent = $(this).data('id_wallet_agent');
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
$('#resetPassword').click(function () {
|
|
|
|
|
const wallet_password_id = $(this).data('wallet_password_id');
|
|
|
|
|
const network = $(this).data('network');
|
|
|
|
|
const country = $(this).data('country');
|
|
|
|
|
const email = $(this).data('email');
|
2021-08-20 16:43:52 +00:00
|
|
|
|
let button = $(this)
|
|
|
|
|
button.prop("disabled",true);
|
2021-04-22 15:34:32 +00:00
|
|
|
|
$.ajax({
|
2021-10-14 14:33:02 +00:00
|
|
|
|
url: '<?php echo base_url('Hyperviseur_dash/resetWalletPassword')?>',
|
2021-04-22 15:34:32 +00:00
|
|
|
|
type: 'POST',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
data: {
|
|
|
|
|
"wallet_password_id": wallet_password_id,
|
|
|
|
|
"email": email,
|
|
|
|
|
"network" : network ,
|
|
|
|
|
"country" : country
|
|
|
|
|
},
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if(data=='200'){
|
|
|
|
|
Swal.fire({
|
|
|
|
|
icon: 'success',
|
|
|
|
|
title: "<?php echo $this->lang->line('password_has_been_reset')?>",
|
|
|
|
|
text:"<?php echo $this->lang->line('informations_updated')?>",
|
|
|
|
|
timer: 3000
|
|
|
|
|
}).then(()=>{
|
|
|
|
|
location.reload();
|
|
|
|
|
});
|
|
|
|
|
// alert("Les informations ont été mises à jour.") ? "" :
|
|
|
|
|
}else{
|
|
|
|
|
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
error: function (resultat, statut, error) {
|
|
|
|
|
console.log(resultat + " " + error);
|
|
|
|
|
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
2021-08-20 16:43:52 +00:00
|
|
|
|
},
|
|
|
|
|
complete: function (){
|
|
|
|
|
button.prop("disabled",false);
|
2021-04-22 15:34:32 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#pay').click(function () {
|
|
|
|
|
|
|
|
|
|
const salt = $(this).data('salt');
|
|
|
|
|
const encrypted_password = $(this).data('encrypted_password');
|
2021-08-20 16:43:52 +00:00
|
|
|
|
let button = $(this);
|
2021-04-22 15:34:32 +00:00
|
|
|
|
|
|
|
|
|
if ($('#payCommissionForm')[0].checkValidity()) {
|
|
|
|
|
const montant = anElement.getNumber(); //parseFloat($('#montant').val());
|
|
|
|
|
const password = $('#password').val();
|
|
|
|
|
|
2021-08-20 16:43:52 +00:00
|
|
|
|
button.prop("disabled",true);
|
2021-04-22 15:34:32 +00:00
|
|
|
|
$.ajax({
|
2021-10-14 14:33:02 +00:00
|
|
|
|
url: '<?php echo base_url('Hyperviseur_dash/pay_commission_in_cash')?>',
|
2021-04-22 15:34:32 +00:00
|
|
|
|
type: 'POST',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
data: {
|
|
|
|
|
"id_wallet_agent" : id_wallet_agent,
|
|
|
|
|
"montant": montant ,
|
|
|
|
|
"password": password,
|
|
|
|
|
"salt" : salt,
|
|
|
|
|
"encrypted_password" : encrypted_password
|
|
|
|
|
},
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if(data=='200'){
|
|
|
|
|
Swal.fire({
|
|
|
|
|
icon: 'success',
|
|
|
|
|
title: "<?php echo $this->lang->line('payment_done')?>",
|
|
|
|
|
text: "<?php echo $this->lang->line('informations_updated')?>",
|
|
|
|
|
timer: 3000
|
|
|
|
|
}).then(()=>{
|
|
|
|
|
location.reload();
|
|
|
|
|
});
|
|
|
|
|
// alert("Les informations ont été mises à jour.") ? "" :
|
|
|
|
|
}else if(data == '400'){
|
|
|
|
|
toastr.error("<?php echo $this->lang->line('incorrect_password')?>" , "<?php echo $this->lang->line('request_error')?>");
|
|
|
|
|
}else{
|
|
|
|
|
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
error: function (resultat, statut, error) {
|
|
|
|
|
console.log(resultat + " " + error);
|
|
|
|
|
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
2021-08-20 16:43:52 +00:00
|
|
|
|
},
|
|
|
|
|
complete : function () {
|
|
|
|
|
button.prop("disabled",false);
|
2021-04-22 15:34:32 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
$('#payCommissionForm')[0].reportValidity();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
2020-07-10 18:19:15 +00:00
|
|
|
|
</script>
|