2020-06-24 12:06:52 +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"/>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css">
|
2020-06-24 12:06:52 +00:00
|
|
|
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
|
|
|
|
|
<div class="content-wrapper">
|
|
|
|
|
<?php
|
2020-06-25 11:05:34 +00:00
|
|
|
|
|
2020-06-25 19:27:43 +00:00
|
|
|
|
use Brick\Money\Context\AutoContext;
|
2020-06-25 08:08:10 +00:00
|
|
|
|
use Brick\Money\CurrencyConverter;
|
2020-09-28 15:44:45 +00:00
|
|
|
|
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
|
2020-06-25 08:08:10 +00:00
|
|
|
|
use Brick\Money\ExchangeRateProvider\PDOProvider;
|
|
|
|
|
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
|
|
|
|
|
use Brick\Money\Money;
|
2020-09-28 15:44:45 +00:00
|
|
|
|
use Carbon\Carbon;
|
2020-06-25 08:08:10 +00:00
|
|
|
|
|
2020-09-28 15:44:45 +00:00
|
|
|
|
function toLocateDate($date , $timezone){
|
2020-06-24 12:06:52 +00:00
|
|
|
|
if($date){
|
|
|
|
|
$carbon = Carbon::createFromFormat('Y-m-d H:i:s', $date, 'UTC');
|
|
|
|
|
$carbon->setTimezone($timezone);
|
|
|
|
|
return $carbon->toDateTimeString();
|
|
|
|
|
}
|
|
|
|
|
return $date;
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<!-- Content Header (Page header) -->
|
|
|
|
|
<section class="content-header">
|
|
|
|
|
|
|
|
|
|
<h1>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
<?php echo isset($category) ? 'Wallet' : $this->lang->line('Gestion des wallets') ; echo ' '.$network.' - '.$country
|
|
|
|
|
.' :: '.$this->lang->line('Historique des transactions'); ?>
|
2020-06-24 12:06:52 +00:00
|
|
|
|
<!-- <input type="button" class="btn btn-primary pull-right" id="Bactiver"-->
|
|
|
|
|
<!-- value="Activer/Désactiver le(s) réseau(x)" />-->
|
|
|
|
|
</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>
|
|
|
|
|
<?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
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-06-25 08:08:10 +00:00
|
|
|
|
// 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);
|
2020-06-25 19:27:43 +00:00
|
|
|
|
$context = new AutoContext();
|
2020-06-24 12:06:52 +00:00
|
|
|
|
?>
|
|
|
|
|
</section>
|
|
|
|
|
<section class="content">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-4 col-sm-6 col-xs-12">
|
|
|
|
|
<div class="info-box">
|
|
|
|
|
<span class="info-box-icon bg-aqua"><i class="ion ion-android-time"></i></span>
|
|
|
|
|
<div class="info-box-content">
|
|
|
|
|
<span class="info-box-text"><?php echo $this->lang->line('Période') ?> </span>
|
|
|
|
|
<span class="info-box-number">
|
|
|
|
|
<input id="picker"
|
2020-07-29 17:50:46 +00:00
|
|
|
|
style="background: #fff; cursor: pointer; padding: 1px 1px; border: 1px solid #ccc; width: 100%"
|
|
|
|
|
data-category="<?php echo isset($category) ? $category : null ?>"
|
|
|
|
|
type="text" name="daterange"
|
|
|
|
|
data-lang="<?php echo $this->session->userdata('site_lang') ?>"
|
|
|
|
|
value="<?php echo ($startDate != null & $endDate != null) ? $startDate . ' - ' . $endDate : '' ?>"/>
|
2020-06-24 12:06:52 +00:00
|
|
|
|
|
|
|
|
|
</span>
|
2020-07-29 17:50:46 +00:00
|
|
|
|
<span> Format : <?php echo $this->session->userdata('site_lang') === 'french' ? 'Jour - Mois - Année ' : 'Year - Month - Day' ?> </span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-lg-2 col-xs-6">
|
|
|
|
|
<div class="small-box bg-red-active">
|
|
|
|
|
<div class="inner">
|
|
|
|
|
<h4>
|
2020-08-31 16:34:03 +00:00
|
|
|
|
<strong> <?php echo $this->session->userdata('currency_code') ? $this->session->userdata('currency_code') : $currency_code
|
|
|
|
|
. ' - ' . $currency_name_fr; ?> </strong>
|
2020-07-29 17:50:46 +00:00
|
|
|
|
</h4>
|
|
|
|
|
<p><?php echo $this->lang->line('currency') ?></p>
|
2020-06-24 12:06:52 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-xs-12">
|
|
|
|
|
<div class="box">
|
|
|
|
|
<div class="box-header">
|
2020-07-10 18:19:15 +00:00
|
|
|
|
<h3 class="box-title"><?php echo $this->lang->line('export_transaction_history') ?></h3>
|
2020-06-24 12:06:52 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="box-body" style="overflow-x:auto;">
|
|
|
|
|
<?php
|
|
|
|
|
if($transactions){
|
|
|
|
|
$numrows = $transactions->num_rows();
|
|
|
|
|
$num = 0;
|
|
|
|
|
if ($numrows > 0) {
|
|
|
|
|
$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
|
2020-07-29 17:50:46 +00:00
|
|
|
|
?>
|
2020-06-24 12:06:52 +00:00
|
|
|
|
|
2020-07-29 17:50:46 +00:00
|
|
|
|
<table id="transactions" class="table table-bordered table-striped">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th align='center'>ID</th>
|
|
|
|
|
<th align='center'>Operation</th>
|
|
|
|
|
<th><?php echo $this->lang->line('cart_number') ?></th>
|
|
|
|
|
<th><?php echo $this->lang->line('customer_net_amount_init') ?></th>
|
|
|
|
|
<th><?php echo $this->lang->line('customer_net_amount_final') ?></th>
|
|
|
|
|
<th><?php echo $this->lang->line('commission_paying_network') ?></th>
|
2020-10-27 10:50:41 +00:00
|
|
|
|
<th><?php echo $this->lang->line('status_with_paying_network') ?></th>
|
2020-07-29 17:50:46 +00:00
|
|
|
|
<th><?php echo $this->lang->line('final_currency') ?></th>
|
|
|
|
|
<th><?php echo $this->lang->line('departure_country') ?></th>
|
|
|
|
|
<th><?php echo $this->lang->line('country_of_destination') ?></th>
|
|
|
|
|
<th><?php echo $this->lang->line('fees') ?></th>
|
|
|
|
|
<th><?php echo $this->lang->line('tax') ?></th>
|
|
|
|
|
<th><?php echo $this->lang->line('Commission de la banque') ?></th>
|
|
|
|
|
<th><?php echo $this->lang->line('Commission de l\'hyperviseur') ?></th>
|
|
|
|
|
<th><?php echo $this->lang->line('Commission du superviseur') ?></th>
|
|
|
|
|
<th><?php echo $this->lang->line('Commission de l\'agent') ?></th>
|
|
|
|
|
<th><?php echo $this->lang->line('agent_name') ?></th>
|
|
|
|
|
<th><?php echo $this->lang->line('issuer_id') ?></th>
|
2020-06-30 11:07:41 +00:00
|
|
|
|
<th><?php echo $this->lang->line('recipient_id')?></th>
|
2020-06-24 12:06:52 +00:00
|
|
|
|
<th align='center'>Date</th>
|
|
|
|
|
<?php if ($this->session->userdata('category') != 'super') { ?>
|
2020-09-28 15:44:45 +00:00
|
|
|
|
<!-- <th align='center'>Action</th>-->
|
2020-06-24 12:06:52 +00:00
|
|
|
|
<?php } ?>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
|
|
<?php
|
2020-08-27 09:37:45 +00:00
|
|
|
|
|
2020-06-24 12:06:52 +00:00
|
|
|
|
foreach ($transactions->result() as $row) {
|
|
|
|
|
$num++;
|
|
|
|
|
|
|
|
|
|
$net = 0;
|
|
|
|
|
$banque = 0;
|
2020-06-28 10:46:20 +00:00
|
|
|
|
$moneyNetInit = Money::of(round($row->montant_net ,2), $row->init_currency,$context);
|
2020-10-09 17:10:44 +00:00
|
|
|
|
$agent = $row->agent ? ( $row->agent." | ".$row->code_agent." | ".$row->phone_agent ) : "";
|
2020-06-27 17:01:38 +00:00
|
|
|
|
if($row->destinataire_phone){
|
|
|
|
|
$destinataire = $row->destinataire_phone.' | '.$row->destinataire_name;
|
|
|
|
|
}else{
|
2020-06-28 10:46:20 +00:00
|
|
|
|
$destinataire = ($row->id_destinataire ? $row->id_destinataire.' | ' : '').($row->nom_destinataire ? $row->nom_destinataire : '').(' '.$row->prenom_destinataire? $row->prenom_destinataire : '');
|
|
|
|
|
|
2020-06-27 17:01:38 +00:00
|
|
|
|
}
|
2020-07-03 17:26:59 +00:00
|
|
|
|
if($row->user_phone){
|
|
|
|
|
$emetteur = $row->user_phone.' | '.$row->user;
|
|
|
|
|
}else{
|
|
|
|
|
$emetteur = ($row->nom_emetteur? $row->nom_emetteur : '').(' '.$row->prenom_emetteur ? $row->prenom_emetteur : '');
|
|
|
|
|
}
|
2020-06-28 10:46:20 +00:00
|
|
|
|
$moneyNetFinal =Money::of(round($row->montant_net_final_country,2),$row->final_currency ? $row->final_currency : 'XAF',$context);
|
2020-06-24 12:06:52 +00:00
|
|
|
|
echo "<tr>
|
2020-06-27 17:01:38 +00:00
|
|
|
|
<td align='center' >$row->id_transaction</td>
|
2020-10-27 10:50:41 +00:00
|
|
|
|
<td>" . strtoupper($row->acteur) . ' - ' .($this->session->userdata('site_lang') === 'french' ? $row->operation_fr : $row->operation_en). "</td>
|
2020-07-29 17:50:46 +00:00
|
|
|
|
<td>" . join(" ", str_split($row->numero_carte, 4)) . "</td>
|
|
|
|
|
<td>" . $moneyNetInit->formatTo('fr_FR') . "</td>
|
|
|
|
|
<td>" . $moneyNetFinal->formatTo('fr_FR') . "</td>
|
|
|
|
|
<td>" . Money::of(round($row->part_reseau_payeur_final_country ? $row->part_reseau_payeur_final_country : 0, 2), $row->final_currency ? $row->final_currency : 'XAF', $context)->formatTo('fr_FR') . "</td>
|
2020-10-27 10:50:41 +00:00
|
|
|
|
<td>" . str_replace('_',' ',$row->status_reseau_payeur). "</td>
|
2020-07-29 17:50:46 +00:00
|
|
|
|
<td>" . $row->final_currency . "</td>
|
2020-06-27 17:01:38 +00:00
|
|
|
|
<td>".$row->pays_init."</td>
|
|
|
|
|
<td>".$row->pays_final."</td>
|
2020-06-25 16:57:44 +00:00
|
|
|
|
<td>".Money::of(round($row->frais,2), $row->init_currency,$context)->formatTo('fr_FR')."</td>
|
|
|
|
|
<td>".Money::of(round($row->taxe, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
|
|
|
|
|
<td>".Money::of(round($row->commission_banque ? $row->commission_banque : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
|
|
|
|
|
<td>".Money::of(round($row->commission_hyp ? $row->commission_hyp : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
|
|
|
|
|
<td>".Money::of(round($row->commission_sup ? $row->commission_sup : 0 , 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
|
|
|
|
|
<td>".Money::of(round($row->commission_ag ? $row->commission_ag : 0, 2),$row->init_currency,$context)->formatTo('fr_FR')."</td>
|
2020-10-09 17:10:44 +00:00
|
|
|
|
<td>".$agent."</td>
|
2020-07-03 17:26:59 +00:00
|
|
|
|
<td>".$emetteur."</td>
|
2020-06-27 17:01:38 +00:00
|
|
|
|
<td>".$destinataire."</td>
|
2020-06-24 12:06:52 +00:00
|
|
|
|
<td>".toLocateDate($row->date,$this->session->userdata('timezone'))."</td>";
|
|
|
|
|
?>
|
|
|
|
|
<?php if ($this->session->userdata('category') != 'super') { ?>
|
2020-09-28 15:44:45 +00:00
|
|
|
|
<!-- <td>-->
|
|
|
|
|
<!-- <button data-id-transaction="--><?php //echo $row->id_transaction ?><!--" id="cancel"-->
|
|
|
|
|
<!-- class="btn btn-danger btn-block" --><?php //if ($row->canceled) echo "disabled" ?><!-- >-->
|
|
|
|
|
<!-- <b>--><?php //echo $this->lang->line('cancel') ?><!--</b>-->
|
|
|
|
|
<!-- </button>-->
|
|
|
|
|
<!-- </td>-->
|
2020-06-24 12:06:52 +00:00
|
|
|
|
<?php } ?>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</tbody>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
} else {
|
|
|
|
|
echo $this->lang->line('Aucune transaction');
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
echo $this->lang->line('Aucune transaction');
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</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>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
<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>
|
2020-07-16 16:27:32 +00:00
|
|
|
|
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.colVis.min.js"></script>
|
2020-06-24 12:06:52 +00:00
|
|
|
|
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
|
|
|
|
|
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
$(function () {
|
2020-07-29 17:50:46 +00:00
|
|
|
|
const lang = $('#picker').data('lang');
|
2020-06-24 12:06:52 +00:00
|
|
|
|
const format = lang === 'french' ? 'fr' : 'en';
|
2020-07-29 17:50:46 +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-10-29 19:07:19 +00:00
|
|
|
|
"aaSorting": [[19, "desc"]],
|
2020-07-29 17:50:46 +00:00
|
|
|
|
"columnDefs": [{
|
2020-10-29 19:07:19 +00:00
|
|
|
|
targets: 19,
|
2020-07-29 13:40:25 +00:00
|
|
|
|
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
|
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-10-03 11:14:16 +00:00
|
|
|
|
title: "<?= $this->lang->line('Historique des transactions') ?>",
|
2020-10-29 19:07:19 +00:00
|
|
|
|
// exportOptions: {
|
|
|
|
|
// columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
|
|
|
|
// },
|
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];
|
2020-10-29 19:07:19 +00:00
|
|
|
|
if ([3, 4, 5, 10, 11, 12, 13, 14,15].includes(j)) {
|
2020-07-29 13:40:25 +00:00
|
|
|
|
// 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, ""));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
trim: false
|
2020-07-10 18:19:15 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
extend: 'csvHtml5',
|
2020-10-03 11:14:16 +00:00
|
|
|
|
title: "<?= $this->lang->line('Historique des transactions') ?>",
|
2020-07-16 16:27:32 +00:00
|
|
|
|
exportOptions: {
|
2020-07-29 13:40:25 +00:00
|
|
|
|
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
|
|
|
|
},
|
|
|
|
|
trim: false
|
2020-07-10 18:19:15 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
extend: 'pdfHtml5',
|
|
|
|
|
orientation: 'landscape',
|
|
|
|
|
pageSize: 'LEGAL',
|
2020-10-03 11:14:16 +00:00
|
|
|
|
title: "<?= $this->lang->line('Historique des transactions') ?>",
|
2020-07-16 16:27:32 +00:00
|
|
|
|
exportOptions: {
|
2020-07-29 13:40:25 +00:00
|
|
|
|
columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
|
|
|
|
},
|
|
|
|
|
trim: false
|
2020-07-16 16:27:32 +00:00
|
|
|
|
},
|
|
|
|
|
// 'colvis'
|
2020-07-10 18:19:15 +00:00
|
|
|
|
]
|
2020-06-24 12:06:52 +00:00
|
|
|
|
});
|
2020-07-10 18:19:15 +00:00
|
|
|
|
|
|
|
|
|
table.buttons().container()
|
2020-07-29 13:40:25 +00:00
|
|
|
|
.appendTo('#example_wrapper .col-sm-6:eq(0)');
|
2020-06-24 12:06:52 +00:00
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
var startDate;
|
|
|
|
|
var endDate;
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
|
const lang = $('#picker').data('lang');
|
|
|
|
|
const category = $('#picker').data('category');
|
2020-10-03 11:14:16 +00:00
|
|
|
|
const id_network = "<?= $id_network?>";
|
|
|
|
|
$('input[name="daterange"]').daterangepicker({
|
2020-06-24 12:06:52 +00:00
|
|
|
|
opens: 'left',
|
|
|
|
|
autoUpdateInput: false,
|
|
|
|
|
locale: {
|
|
|
|
|
format: lang === 'french' ? 'DD-MM-YYYY' : 'YYYY-MM-DD',
|
|
|
|
|
cancelLabel: 'Clear'
|
|
|
|
|
}
|
|
|
|
|
}, function (start, end, label) {
|
|
|
|
|
const debut = start.format('YYYY-MM-DD');
|
|
|
|
|
const fin = end.format('YYYY-MM-DD');
|
|
|
|
|
if(category)
|
|
|
|
|
window.location = "<?php echo current_url()?>" + "?history=transaction_ilink" + "&d=" + debut + "&f=" + fin;
|
|
|
|
|
else
|
2020-10-03 11:14:16 +00:00
|
|
|
|
window.location = "<?php echo current_url()?>" + "?id="+id_network+"&history=transaction_ilink" + "&d=" + debut + "&f=" + fin;
|
2020-06-24 12:06:52 +00:00
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('input[name="daterange"]').on('cancel.daterangepicker', function(ev, picker) {
|
|
|
|
|
//do something, like clearing an input
|
|
|
|
|
$('#daterange').val('');
|
|
|
|
|
if(category)
|
|
|
|
|
window.location = "<?php echo current_url()?>" + "?history=transaction_ilink";
|
|
|
|
|
else
|
2020-10-03 11:14:16 +00:00
|
|
|
|
window.location = "<?php echo current_url()?>" + "?id="+id_network+"&history=transaction_ilink";
|
2020-06-24 12:06:52 +00:00
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<script>
|
|
|
|
|
$(document).on("click", "#cancel", function () {
|
|
|
|
|
const id_transaction = $(this).data('id-transaction');
|
|
|
|
|
$.ajax({
|
|
|
|
|
url : '<?php echo base_url('index.php/Gestion/cancelIlinkTransation')?>',
|
|
|
|
|
type : 'POST',
|
|
|
|
|
dataType : 'json',
|
|
|
|
|
data: {"id_transaction": id_transaction},
|
|
|
|
|
async:true,
|
|
|
|
|
success : function(data){
|
|
|
|
|
if(data){
|
|
|
|
|
Swal.fire({
|
|
|
|
|
icon: 'success',
|
|
|
|
|
title: "<?php echo $this->lang->line('canceled_transaction')?>",
|
|
|
|
|
text: "<?php echo $this->lang->line('informations_updated')?>",
|
|
|
|
|
timer: 3000
|
|
|
|
|
}).then(()=>{
|
|
|
|
|
location.reload();
|
|
|
|
|
});
|
|
|
|
|
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
|
|
|
|
|
}else{
|
|
|
|
|
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
error : function(resultat, statut, erreur){
|
|
|
|
|
console.log(resultat+" "+erreur);
|
|
|
|
|
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|