+ Add Nano credit users groups
This commit is contained in:
parent
038f5cca88
commit
945db8569b
|
@ -2064,6 +2064,21 @@ class Gestion extends CI_Controller
|
|||
$data['active'] = "nano_credit";
|
||||
$data['alert'] = "";
|
||||
$data['game_pays'] = $this->user_model->getGameCountry();
|
||||
|
||||
if ($this->input->get('id')) {
|
||||
$data['network_id'] = $this->input->get('id');
|
||||
$data['groups'] = $this->user_model->getUsersGroups($data['network_id']);
|
||||
$data['configWallet'] = $this->user_model->getConfigWallet($data['network_id'])->first_row();
|
||||
$networkDetails = $this->user_model->getNetworkDetails($data['network_id']);
|
||||
if ($networkDetails) {
|
||||
$data['network'] = $networkDetails->first_row()->network;
|
||||
$data['country'] = $networkDetails->first_row()->country;
|
||||
$data['currency_code'] = $networkDetails->first_row()->currency_code;
|
||||
}
|
||||
$this->load->view('header_gestion', $data);
|
||||
$this->load->view('nano_credit/gestion_nano_credit_admin');
|
||||
$this->load->view('footer');
|
||||
} else {
|
||||
$data['networks'] = $this->user_model->getAllIlinkWorldNetworks();
|
||||
$this->load->view('header_gestion', $data);
|
||||
$this->load->view('nano_credit/gestion_nano_credits');
|
||||
|
@ -2071,6 +2086,7 @@ class Gestion extends CI_Controller
|
|||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function activate_nano_credit()
|
||||
{
|
||||
|
|
|
@ -381,8 +381,8 @@ class Hyperviseur_dash extends CI_Controller
|
|||
}
|
||||
|
||||
$row = $res->first_row();
|
||||
$data["commission"] = Money::of(round($row->balance_com,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR');
|
||||
$data["principal"] = Money::of(round($row->balance_princ,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR');
|
||||
$data["commission"] = Money::of(round($row->balance_com, 2), $this->session->userdata('currency_code'), $context)->formatTo('fr_FR');
|
||||
$data["principal"] = Money::of(round($row->balance_princ, 2), $this->session->userdata('currency_code'), $context)->formatTo('fr_FR');
|
||||
$data['wallet_id'] = $row->wallet_id;
|
||||
$data['curreny_code'] = $this->session->userdata('currency_code');
|
||||
|
||||
|
@ -390,7 +390,7 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$res = $this->user_model->getWalletPassword($id_network);
|
||||
$data['walletPassword'] = $res ? $res->first_row() : null;
|
||||
$data['alert'] = "";
|
||||
$data['active'] = "wallet";
|
||||
$data['active'] = "wallet_wallet";
|
||||
$data['token'] = $this->session->userdata('token');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
|
@ -666,7 +666,7 @@ class Hyperviseur_dash extends CI_Controller
|
|||
public function calculator()
|
||||
{
|
||||
if ($this->isLogged()) {
|
||||
$data['active'] = "calculator";
|
||||
$data['active'] = "wallet_calculator";
|
||||
$data['alert'] = "";
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
|
@ -1191,6 +1191,7 @@ class Hyperviseur_dash extends CI_Controller
|
|||
{
|
||||
if ($this->isLogged()) {
|
||||
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||
$data['groups'] = $this->user_model->getUsersGroups($this->session->userdata('network_id'));
|
||||
$data['active'] = "nano_credit";
|
||||
$data['alert'] = "";
|
||||
$data['game_pays'] = $this->user_model->getGameCountry();
|
||||
|
|
|
@ -468,4 +468,11 @@ $lang['credit_limit'] = 'Limite de crédit';
|
|||
$lang['nano_credit_removal'] = 'Suppression du nano crédit';
|
||||
$lang['set_credit_limit'] = 'Définir la limite de crédit';
|
||||
$lang['nano_credit_deleted'] = 'Nano crédit supprimé';
|
||||
$lang['users_groups'] = 'Groupes clients';
|
||||
$lang['nano_credit_history'] = 'Historique de nano credits';
|
||||
$lang['group_code'] = 'Code du groupe';
|
||||
$lang['creator'] = 'Createur';
|
||||
$lang['credit_limit'] = 'Limite de credit';
|
||||
$lang['wallet_management'] = 'Gestion du wallet';
|
||||
$lang['nano_credit_management'] = 'Gestion du nano credit';
|
||||
?>
|
||||
|
|
|
@ -2683,4 +2683,14 @@ class User_model extends CI_Model
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getUsersGroups($id_network)
|
||||
{
|
||||
$query = $this->db->query("SELECT * FROM infos_users_groups WHERE id_network = '" . $id_network . "'");
|
||||
if ($query->num_rows() > 0) {
|
||||
return $query;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -151,27 +151,35 @@
|
|||
</li>
|
||||
<?php if ($hasWallet) {
|
||||
?>
|
||||
<li class="<?php if ($active == "wallet") {
|
||||
<li class="<?= "treeview " . ((strpos($active, "wallet_") !== false) ? "active menu-open" : "") ?>"
|
||||
style="height: auto;">
|
||||
<a href="#">
|
||||
<i class="fa fa-users"></i>
|
||||
<span><?php echo $this->lang->line('wallet_management'); ?></span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu"
|
||||
style="<?= (strpos($active, "wallet_") !== false) ? "" : "display: none;" ?>">
|
||||
<li class="<?php if ($active == "wallet_wallet") {
|
||||
echo "active";
|
||||
} ?>">
|
||||
<a href="<?php echo base_url('index.php/Hyperviseur_dash/wallet') ?>">
|
||||
<i class="glyphicon glyphicon-credit-card"></i> <span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
|
||||
<i class="glyphicon glyphicon-credit-card"></i>
|
||||
<span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if($active=="wallet_password"){echo "active";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Hyperviseur_dash/walletPassword') ?>">
|
||||
<i class="glyphicon glyphicon-lock"></i> <span><?php echo $this->lang->line('menu_wallet_password'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php if($hasWallet->first_row()->type == 'ilink'){ ?>
|
||||
<li class="<?php if ($active == "nano_credit") {
|
||||
<li class="<?php if ($active == "wallet_password") {
|
||||
echo "active";
|
||||
} ?>">
|
||||
<a href="<?php echo base_url('index.php/Hyperviseur_dash/nano_credit') ?>">
|
||||
<i class="glyphicon glyphicon-credit-card"></i> <span>Nano credit</span>
|
||||
<a href="<?php echo base_url('index.php/Hyperviseur_dash/walletPassword') ?>">
|
||||
<i class="glyphicon glyphicon-lock"></i>
|
||||
<span><?php echo $this->lang->line('menu_wallet_password'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if ($active == "calculator") {
|
||||
<?php if ($hasWallet->first_row()->type == 'ilink') { ?>
|
||||
<li class="<?php if ($active == "wallet_calculator") {
|
||||
echo "active";
|
||||
} ?>">
|
||||
<a href="<?php echo base_url('index.php/Hyperviseur_dash/calculator') ?>">
|
||||
|
@ -179,6 +187,19 @@
|
|||
<span><?php echo $this->lang->line('calculator'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
<?php if ($hasWallet->first_row()->type == 'ilink') { ?>
|
||||
<li class="<?php if ($active == "nano_credit") {
|
||||
echo "active";
|
||||
} ?>">
|
||||
<a href="<?php echo base_url('index.php/Hyperviseur_dash/nano_credit') ?>">
|
||||
<i class="glyphicon glyphicon-credit-card"></i> <span>Nano credit</span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
|
|
@ -0,0 +1,339 @@
|
|||
<link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>">
|
||||
<link rel="stylesheet"
|
||||
href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>">
|
||||
<link rel="stylesheet"
|
||||
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
|
||||
|
||||
<?php
|
||||
|
||||
use Brick\Money\Money;
|
||||
|
||||
$context = new \Brick\Money\Context\AutoContext();
|
||||
?>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
|
||||
<h1>
|
||||
<?php echo $this->lang->line('nano_credit_management') . ' ' . $network . ' - ' . $country; ?>
|
||||
</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
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-xs-6">
|
||||
<div class="small-box bg-green-active">
|
||||
<div class="inner">
|
||||
<h3><?php echo Money::of(round($configWallet->limite_credit_min, 2), $currency_code, $context)->formatTo('fr_FR') ?></h3>
|
||||
<p><?php echo $this->lang->line('minimum_credit_limit') ?></p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-cash"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-xs-6">
|
||||
<div class="small-box bg-red-active">
|
||||
<div class="inner">
|
||||
<h3><?php echo Money::of(round($configWallet->limite_credit_max, 2), $currency_code, $context)->formatTo('fr_FR'); ?></h3>
|
||||
<p><?php echo $this->lang->line('maximum_credit_limit') ?></p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-cash"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">
|
||||
<?php echo $this->lang->line('users_groups') ?></h3>
|
||||
<div class="box-tools">
|
||||
<a class="btn btn-primary" href="
|
||||
<?php echo current_url() . ($network_id ? '?history=nano_credit' : '') ?>">
|
||||
<?php echo $this->lang->line('nano_credit_history'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body" style="overflow-x:auto;">
|
||||
<table id="example1" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
echo "<th>" . $this->lang->line('group_code') . "</th>
|
||||
<th>" . $this->lang->line('Nom') . "</th>
|
||||
<th>" . $this->lang->line('creator') . "</th>
|
||||
<th>" . $this->lang->line('credit_limit') . "</th>
|
||||
<th> Sponsor 1</th>
|
||||
<th> Sponsor 2</th>
|
||||
<th> Sponsor 3</th>
|
||||
<th> Status</th>
|
||||
<th>" . $this->lang->line('created_date') . "</th>";
|
||||
?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if ($groups != false) {
|
||||
foreach ($groups->result() as $row) {
|
||||
echo "<tr>
|
||||
<td>" . $row->code_groupe . "</td>
|
||||
<td>" . $row->nom . "</td>
|
||||
<td>" . $row->createur . "</td>
|
||||
<td>" . Money::of(round($row->limite_credit, 2), $row->currency_code, $context)->formatTo('fr_FR') . "</td>
|
||||
<td>" . $row->sponsor1 . "</td>
|
||||
<td>" . $row->sponsor2 . "</td>
|
||||
<td>" . $row->sponsor3 . "</td>";
|
||||
?>
|
||||
<?php
|
||||
if ($row->actif) {
|
||||
?>
|
||||
<td>
|
||||
<span class="label label-success"><?php echo $this->lang->line('Actif') ?></span>
|
||||
</td>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<td>
|
||||
<span class="label label-danger"><?php echo $this->lang->line('Inactif') ?></span>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td> <?= $row->date_creation ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="modal-limit">
|
||||
<div class="modal-dialog">
|
||||
<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>
|
||||
<h3 class="modal-title"><?php echo $this->lang->line('set_credit_limit'); ?></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="limitForm">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="form-group">
|
||||
<label for="limit_min"
|
||||
class="col-form-label"><?php echo $this->lang->line('minimum_credit_limit'); ?></label>
|
||||
<input type="number" min="0" step=".01" required class="form-control"
|
||||
id="limit_min" name="limit_min"
|
||||
value="<?= $configWallet->limite_credit_min ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="limit_max"
|
||||
class="col-form-label"><?php echo $this->lang->line('maximum_credit_limit'); ?></label>
|
||||
<input type="number" min="0" step=".01" required class="form-control"
|
||||
name="limit_max" id="limit_max"
|
||||
value="<?= $configWallet->limite_credit_max ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left"
|
||||
data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||
<button type="button" id="saveLimit" data-network-id="<?= $network_id ?>"
|
||||
class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
|
||||
</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 src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
|
||||
<!-- ChartJS -->
|
||||
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
|
||||
<script src="<?php echo base_url('dist/js/sweetalert2.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 type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.colVis.min.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
const lang = "<?php echo $this->session->userdata('site_lang') ?>";
|
||||
const format = lang === 'french' ? 'fr' : 'en';
|
||||
moment.updateLocale(moment.locale(format), {invalidDate: ""});
|
||||
|
||||
$('#example1').DataTable({
|
||||
"aaSorting": [[8, "desc"]],
|
||||
"columnDefs": [{
|
||||
targets: 8,
|
||||
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
|
||||
}]
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<script>
|
||||
var areaChartData = {
|
||||
labels: <?php echo json_encode($label_months) ?>,
|
||||
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)',
|
||||
data: <?php echo json_encode($depots_data) ?>
|
||||
},
|
||||
{
|
||||
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)',
|
||||
data: <?php echo json_encode($retraits_data) ?>
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
var Pie = '<?php echo json_encode($pieChart) ?>';
|
||||
if (Pie === '[]') {
|
||||
var select = document.getElementById('chart2');
|
||||
$(select.children).hide();
|
||||
$(select).append("<p>Aucune transaction</p>");
|
||||
} else {
|
||||
Pie = JSON.parse(Pie);
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
toastr.options.closeButton = true;
|
||||
toastr.options.closeMethod = 'fadeOut';
|
||||
toastr.options.closeDuration = 5000;
|
||||
toastr.options.closeEasing = 'swing';
|
||||
|
||||
|
||||
$('#saveLimit').click(function () {
|
||||
const limit_min = parseFloat($('#limit_min').val());
|
||||
const limit_max = parseFloat($('#limit_max').val());
|
||||
const network_id = $(this).data('network-id');
|
||||
|
||||
if (limit_max > limit_min) {
|
||||
if ($('#limitForm')[0].checkValidity()) {
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('index.php/Hyperviseur_dash/saveCreditLimit')?>',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
"limit_min": limit_min,
|
||||
"limit_max": limit_max,
|
||||
"id_network": network_id,
|
||||
},
|
||||
success: function (data) {
|
||||
if (data == '200') {
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: "<?php echo $this->lang->line('activate_nano_credit')?>",
|
||||
text: "<?php echo $this->lang->line('informations_updated')?>",
|
||||
timer: 3000
|
||||
}).then(() => {
|
||||
location.reload();
|
||||
});
|
||||
|
||||
} 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')?>");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
$('#limitForm')[0].reportValidity();
|
||||
}
|
||||
} else {
|
||||
toastr.error("<?php echo $this->lang->line('credit_limit_rule')?>", "<?php echo $this->lang->line('request_error')?>");
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
<!-- Page script -->
|
||||
<!--<script src="--><?php //echo base_url('dist/js/custom.js') ?><!--"></script>-->
|
|
@ -6,63 +6,12 @@
|
|||
<link rel="stylesheet"
|
||||
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round|Open+Sans">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
|
||||
<?php
|
||||
|
||||
use Brick\Money\Context\CustomContext;
|
||||
use Brick\Money\Money;
|
||||
|
||||
$context = new \Brick\Money\Context\AutoContext();
|
||||
function convertDate($date)
|
||||
{
|
||||
$month = null;
|
||||
switch ($date) {
|
||||
case "Jan":
|
||||
$month = 1;
|
||||
break;
|
||||
case "Feb":
|
||||
$month = 2;
|
||||
break;
|
||||
case "Mar":
|
||||
$month = 3;
|
||||
break;
|
||||
case "Apr":
|
||||
$month = 4;
|
||||
break;
|
||||
case "May":
|
||||
$month = 5;
|
||||
break;
|
||||
case "Jun":
|
||||
$month = 6;
|
||||
break;
|
||||
case "Jul":
|
||||
$month = 7;
|
||||
break;
|
||||
case "Aug":
|
||||
$month = 8;
|
||||
break;
|
||||
case "Sep":
|
||||
$month = 9;
|
||||
break;
|
||||
case "Oct":
|
||||
$month = 10;
|
||||
break;
|
||||
case "Nov":
|
||||
$month = 11;
|
||||
break;
|
||||
case "Dec":
|
||||
$month = 12;
|
||||
break;
|
||||
}
|
||||
return $month;
|
||||
}
|
||||
|
||||
|
||||
$fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||
?>
|
||||
|
||||
<div class="content-wrapper">
|
||||
|
@ -137,87 +86,78 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="row">-->
|
||||
<!-- <div class="col-xs-12">-->
|
||||
<!-- <div class="box">-->
|
||||
<!-- <div class="box-header">-->
|
||||
<!-- <h3 class="box-title">-->
|
||||
<?php //echo $this->lang->line('Commissions Superviseurs') ?><!--</h3>-->
|
||||
<!-- <div class="box-tools">-->
|
||||
<!-- <a class="btn btn-primary" href="-->
|
||||
<?php //echo current_url().($network_id ? '?history=commission_transfer' : '')?><!--">-->
|
||||
<!-- --><?php //echo $this->lang->line('commission_transfer_historic'); ?>
|
||||
<!-- </a>-->
|
||||
<!-- <a class="btn btn-success" href="-->
|
||||
<?php //echo current_url().($network_id ? '?history=balance_statement' : '')?><!--">-->
|
||||
<!-- --><?php //echo $this->lang->line('balance_statement'); ?>
|
||||
<!-- </a>-->
|
||||
<!-- </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('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($superviseurs!=false){
|
||||
// foreach($superviseurs->result() as $row) {
|
||||
// $wallet = null;
|
||||
// foreach ($agentWalletInfos->result() as $value) {
|
||||
// if ($value->agent_id == $row->agent_id) {
|
||||
// $wallet = $value;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// $com = 0;
|
||||
// $princ = 0;
|
||||
// if($wallet) {
|
||||
// $com = $wallet->balance_com;
|
||||
// $princ = $wallet->balance_princ;
|
||||
// }
|
||||
// echo "<tr>
|
||||
// <td>".$row->lastname."</td>
|
||||
// <td>".Money::of(round($princ,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR')."</td>
|
||||
// <td>".Money::of(round($com,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR')."</td>";
|
||||
// $nb_depots = 0;
|
||||
// $nb_retraits = 0;
|
||||
// $commission_banque = 0;
|
||||
// foreach($depots as $depot){
|
||||
// if($depot->code_parrain == $row->member_code) {
|
||||
// $nb_depots ++;
|
||||
// $commission_banque+= $depot->commission_banque;
|
||||
// }
|
||||
// }
|
||||
// foreach($retraits as $retrait){
|
||||
// if($retrait->code_parrain == $row->member_code) {
|
||||
// $nb_retraits ++;
|
||||
// $commission_banque+= $retrait->commission_banque;
|
||||
// }
|
||||
// }
|
||||
// echo "<td>".Money::of(round($commission_banque,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR')."</td>
|
||||
// <td>".$nb_depots."</td>
|
||||
// <td>".$nb_retraits."</td>
|
||||
// </tr>";
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// ?>
|
||||
<!-- </tbody>-->
|
||||
<!-- </table>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">
|
||||
<?php echo $this->lang->line('users_groups') ?></h3>
|
||||
<div class="box-tools">
|
||||
<a class="btn btn-primary" href="
|
||||
<?php echo current_url() . ($network_id ? '?history=nano_credit' : '') ?>">
|
||||
<?php echo $this->lang->line('nano_credit_history'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body" style="overflow-x:auto;">
|
||||
<table id="example1" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
echo "<th>" . $this->lang->line('group_code') . "</th>
|
||||
<th>" . $this->lang->line('Nom') . "</th>
|
||||
<th>" . $this->lang->line('creator') . "</th>
|
||||
<th>" . $this->lang->line('credit_limit') . "</th>
|
||||
<th> Sponsor 1</th>
|
||||
<th> Sponsor 2</th>
|
||||
<th> Sponsor 3</th>
|
||||
<th> Status</th>
|
||||
<th>" . $this->lang->line('created_date') . "</th>";
|
||||
?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if ($groups != false) {
|
||||
foreach ($groups->result() as $row) {
|
||||
echo "<tr>
|
||||
<td>" . $row->code_groupe . "</td>
|
||||
<td>" . $row->nom . "</td>
|
||||
<td>" . $row->createur . "</td>
|
||||
<td>" . Money::of(round($row->limite_credit, 2), $row->currency_code, $context)->formatTo('fr_FR') . "</td>
|
||||
<td>" . $row->sponsor1 . "</td>
|
||||
<td>" . $row->sponsor2 . "</td>
|
||||
<td>" . $row->sponsor3 . "</td>";
|
||||
?>
|
||||
<?php
|
||||
if ($row->actif) {
|
||||
?>
|
||||
<td>
|
||||
<span class="label label-success"><?php echo $this->lang->line('Actif') ?></span>
|
||||
</td>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<td>
|
||||
<span class="label label-danger"><?php echo $this->lang->line('Inactif') ?></span>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td> <?= $row->date_creation ?> </td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="modal-limit">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
@ -258,7 +198,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
</section>
|
||||
</div>
|
||||
<!-- jQuery 3 -->
|
||||
|
@ -285,9 +224,32 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|||
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
|
||||
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.5.4"></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 type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.colVis.min.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
const lang = "<?php echo $this->session->userdata('site_lang') ?>";
|
||||
const format = lang === 'french' ? 'fr' : 'en';
|
||||
moment.updateLocale(moment.locale(format), {invalidDate: ""});
|
||||
|
||||
$('#example1').DataTable({
|
||||
"aaSorting": [[8, "desc"]],
|
||||
"columnDefs": [{
|
||||
targets: 8,
|
||||
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
|
||||
}]
|
||||
});
|
||||
})
|
||||
</script>
|
||||
<script>
|
||||
var areaChartData = {
|
||||
labels: <?php echo json_encode($label_months) ?>,
|
||||
|
@ -382,4 +344,4 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|||
});
|
||||
</script>
|
||||
<!-- Page script -->
|
||||
<script src="<?php echo base_url('dist/js/custom.js') ?>"></script>
|
||||
<!--<script src="--><?php //echo base_url('dist/js/custom.js') ?><!--"></script>-->
|
||||
|
|
Loading…
Reference in New Issue