2020-07-06 15:56:17 +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-07-06 15:56:17 +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') ?>">
|
|
|
|
|
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
|
2022-04-15 07:47:21 +00:00
|
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="<?= base_url('bower_components/google-material-icons/google-material-icons.min.css') ?>">
|
|
|
|
|
|
|
|
|
|
|
2020-07-06 15:56:17 +00:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Brick\Money\Context\CustomContext;
|
|
|
|
|
use Brick\Money\Money;
|
|
|
|
|
|
|
|
|
|
$context = new \Brick\Money\Context\AutoContext();
|
|
|
|
|
|
|
|
|
|
$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('config_user').' - '.$this->lang->line('config_ilink_user_wallet_carte'); ?>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
</h1>
|
|
|
|
|
<?php
|
2021-10-14 14:33:02 +00:00
|
|
|
|
|
2020-07-06 15:56:17 +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>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<?= $message; ?>
|
2020-07-06 15:56:17 +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">×</button>
|
|
|
|
|
<h4><i class="icon fa fa-check"></i> Success!</h4>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<?= $message; ?>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class="content">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-lg-12">
|
|
|
|
|
<div class="margin">
|
|
|
|
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-update"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
style="width: 100%"><?= $this->lang->line('Modifier la configuration') ?></button>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row centered">
|
|
|
|
|
<div class="col-lg-2 col-lg-offset-5 col-xs-6">
|
|
|
|
|
<div class="small-box bg-aqua-active">
|
|
|
|
|
<div class="inner">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<h3><?= $taux_u_w_cart; ?><sup style="font-size: 20px">%</sup></h3>
|
|
|
|
|
<p><?= $this->lang->line('rate_com_user_wallet_cart') ?> </p>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="icon">
|
|
|
|
|
<i class="ion ion-android-arrow-up"></i>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="row">
|
|
|
|
|
<!--Taux commission wallet agent carte client et Taux commission wallet agent carte client-->
|
|
|
|
|
<div class="col-lg-2 col-lg-offset-4 col-xs-6">
|
|
|
|
|
<div class="small-box bg-light-blue-active">
|
|
|
|
|
<div class="inner">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<h3><?= $taux_hyp_s_wallet_cart_ilink; ?><sup style="font-size: 20px">%</sup></h3>
|
|
|
|
|
<p><?= $this->lang->line('rate_com_hyp_send_wallet_cart_ilink') ?> </p>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="icon">
|
|
|
|
|
<i class="ion ion-android-arrow-up"></i>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-lg-2 col-xs-6">
|
|
|
|
|
<div class="small-box bg-light-blue-active">
|
|
|
|
|
<div class="inner">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<h3><?= $taux_bq_s_wallet_cart_ilink; ?><sup style="font-size: 20px">%</sup></h3>
|
|
|
|
|
<p><?= $this->lang->line('rate_com_bq_send_wallet_cart_ilink') ?> </p>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="icon">
|
|
|
|
|
<i class="ion ion-android-arrow-up"></i>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal fade" id="modal-update">
|
|
|
|
|
<div class="modal-dialog modal-lg">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
|
|
|
<span aria-hidden="true">×</span>
|
|
|
|
|
</button>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<h3 class="modal-title"><?= $this->lang->line('Configuration du wallet'); ?></h3>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
<form id="walletForm">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-lg-6">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="taux_u_w_cart"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
class="col-form-label"><?= $this->lang->line('rate_com_user_wallet_cart') . ' (%)'; ?></label>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
<input type="number" min="0" step=".01" required class="form-control"
|
|
|
|
|
id="taux_u_w_cart"
|
|
|
|
|
name="taux_u_w_cart" value="<?= $taux_u_w_cart ?>">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="col-lg-6">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="taux_hyp_s_wallet_cart_ilink"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
class="col-form-label"><?= $this->lang->line('rate_com_hyp_send_wallet_cart_ilink') . ' (%)'; ?></label>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
<input type="number" min="0" step=".01" required class="form-control"
|
|
|
|
|
name="taux_hyp_s_wallet_cart_ilink" id="taux_hyp_s_wallet_cart_ilink"
|
|
|
|
|
value="<?= $taux_hyp_s_wallet_cart_ilink ?>">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="taux_bq_s_wallet_cart_ilink"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
class="col-form-label"><?= $this->lang->line('rate_com_bq_send_wallet_cart_ilink') . ' (%)'; ?></label>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
<input type="number" min="0" step=".01" required class="form-control"
|
|
|
|
|
name="taux_bq_s_wallet_cart_ilink" id="taux_bq_s_wallet_cart_ilink"
|
|
|
|
|
value="<?= $taux_bq_s_wallet_cart_ilink ?>">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
|
<button type="button" class="btn btn-default pull-left"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
<button type="button" id="updateWallet" data-network-id="<?= $network_id ?>"
|
|
|
|
|
data-id-config="<?= $idConfig ?>"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
class="btn btn-primary"><?= $this->lang->line('save'); ?></button>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</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-07-06 15:56:17 +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-07-06 15:56:17 +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-07-06 15:56:17 +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-07-06 15:56:17 +00:00
|
|
|
|
<!-- FastClick -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
<!-- AdminLTE App -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
<!-- AdminLTE for demo purposes -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
|
2020-07-06 15:56:17 +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>
|
|
|
|
|
<script src="<?= base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
|
|
|
|
|
<!-- ChartJS -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
|
|
|
|
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
|
|
|
|
|
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
|
2020-07-06 15:56:17 +00:00
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
var serializeArray = function (form) {
|
|
|
|
|
// Setup our serialized data
|
|
|
|
|
var serialized = [];
|
|
|
|
|
|
|
|
|
|
// Loop through each field in the form
|
|
|
|
|
var elements = document.getElementById(form).elements;
|
|
|
|
|
for (var i = 0, field; field = elements[i++];) {
|
|
|
|
|
|
|
|
|
|
// Don't serialize fields without a name, submits, buttons, file and reset inputs, and disabled fields
|
|
|
|
|
if (!field.name || field.disabled || field.type === 'file' || field.type === 'reset' || field.type === 'submit' || field.type === 'button') continue;
|
|
|
|
|
|
|
|
|
|
// If a multi-select, get all selections
|
|
|
|
|
if (field.type === 'select-multiple') {
|
|
|
|
|
for (var n = 0; n < field.options.length; n++) {
|
|
|
|
|
if (!field.options[n].selected) continue;
|
|
|
|
|
serialized.push({
|
|
|
|
|
name: field.name,
|
|
|
|
|
value: field.options[n].value
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Convert field data to a query string
|
|
|
|
|
else if ((field.type !== 'checkbox' && field.type !== 'radio') || field.checked) {
|
|
|
|
|
serialized.push({
|
|
|
|
|
name: field.name,
|
|
|
|
|
value: field.value
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return serialized;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<script>
|
|
|
|
|
toastr.options.closeButton = true;
|
|
|
|
|
toastr.options.closeMethod = 'fadeOut';
|
|
|
|
|
toastr.options.closeDuration = 5000;
|
|
|
|
|
toastr.options.closeEasing = 'swing';
|
|
|
|
|
|
|
|
|
|
$('#updateWallet').click(function () {
|
|
|
|
|
const network_id = $(this).data('network-id');
|
|
|
|
|
const id_config = $(this).data('id-config');
|
|
|
|
|
|
|
|
|
|
// total répartition commission réseau d'envoi de wallet vers carte utilisateur ilink (retrait)
|
|
|
|
|
const total6 = parseFloat($('#taux_hyp_s_wallet_cart_ilink').val()) + parseFloat($('#taux_bq_s_wallet_cart_ilink').val());
|
|
|
|
|
|
|
|
|
|
if (total6 != 100) {
|
2022-04-18 11:39:19 +00:00
|
|
|
|
toastr.error("<?= $this->lang->line('ilink_sixth_rule')?>", "<?= $this->lang->line('management_rule')?>");
|
2020-07-06 15:56:17 +00:00
|
|
|
|
} else {
|
|
|
|
|
if ($('#walletForm')[0].checkValidity()) {
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
2022-04-18 11:39:19 +00:00
|
|
|
|
url: '<?= base_url('Gestion/config_wallet/update')?>',
|
2020-07-06 15:56:17 +00:00
|
|
|
|
type: 'POST',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
data: {
|
|
|
|
|
"type": "ilink",
|
|
|
|
|
"config" : "user_wallet_carte",
|
|
|
|
|
"network_id": network_id, "id_config": id_config,
|
|
|
|
|
"fields": serializeArray('walletForm')
|
|
|
|
|
},
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data == '200') {
|
|
|
|
|
Swal.fire({
|
|
|
|
|
icon: 'success',
|
2022-04-18 11:39:19 +00:00
|
|
|
|
title: "<?= $this->lang->line('wallet_update')?>",
|
|
|
|
|
text: "<?= $this->lang->line('informations_updated')?>",
|
2020-07-06 15:56:17 +00:00
|
|
|
|
timer: 3000
|
|
|
|
|
}).then(() => {
|
|
|
|
|
location.reload();
|
|
|
|
|
});
|
|
|
|
|
// alert("Les informations ont été mises à jour.") ? "" :
|
|
|
|
|
} else {
|
2022-04-18 11:39:19 +00:00
|
|
|
|
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
|
2020-07-06 15:56:17 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
error: function (resultat, statut, error) {
|
|
|
|
|
console.log(resultat + " " + error);
|
2022-04-18 11:39:19 +00:00
|
|
|
|
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
|
2020-07-06 15:56:17 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
$('#walletForm')[0].reportValidity();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
</script>
|