2020-06-22 11:39:55 +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-22 11:39:55 +00:00
|
|
|
|
<link rel="stylesheet"
|
|
|
|
|
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
|
2020-06-22 11:39:55 +00:00
|
|
|
|
<div class="content-wrapper">
|
|
|
|
|
<!-- Content Header (Page header) -->
|
|
|
|
|
<section class="content-header">
|
|
|
|
|
|
|
|
|
|
<h1>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<?= $this->lang->line('edit_paying_and_transmitting_networks') . ' - ' . $country->name; ?>
|
2020-06-22 11:39:55 +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-22 11:39:55 +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-06-22 11:39:55 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class="content">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-xs-12">
|
|
|
|
|
<div class="box">
|
|
|
|
|
<div class="box-header">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<h3 class="box-title"><?= $this->lang->line('paying_networks'); ?></h3>
|
2020-06-22 11:39:55 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="box-body" style="overflow-x:auto;">
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
$sql2 = $networks;
|
2022-04-19 10:38:29 +00:00
|
|
|
|
if ($sql2) {
|
2020-06-22 11:39:55 +00:00
|
|
|
|
$numrows = sizeof($sql2);
|
|
|
|
|
$num = 0;
|
|
|
|
|
if ($numrows > 0) {
|
|
|
|
|
?>
|
|
|
|
|
<table id="validated" class="table table-bordered table-striped">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th align='center'>N°</th>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<th><?= $this->lang->line('Nom'); ?></th>
|
2020-06-23 06:41:44 +00:00
|
|
|
|
<th align='center'>Wallet</th>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<th align='center'> <?= $this->lang->line('share_rate') ?></th>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
<th align='center'> URL</th>
|
2020-06-22 11:39:55 +00:00
|
|
|
|
<th align='center'> Action</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php
|
|
|
|
|
foreach ($sql2 as $row) {
|
|
|
|
|
|
|
|
|
|
$num++;
|
|
|
|
|
//$member_code = randomString1(10);
|
|
|
|
|
echo "<tr>
|
|
|
|
|
<td align='center'>$num</td>
|
2020-06-23 06:41:44 +00:00
|
|
|
|
<td>$row->name</td>
|
2021-11-04 17:01:59 +00:00
|
|
|
|
<td><span class='label label-success'>" . mb_strtoupper($row->type,'UTF-8') . "</span></td>";
|
2020-06-22 11:39:55 +00:00
|
|
|
|
?>
|
|
|
|
|
<?php
|
2020-07-10 18:19:15 +00:00
|
|
|
|
if ($row->rate != null) {
|
2020-06-22 11:39:55 +00:00
|
|
|
|
?>
|
|
|
|
|
<td>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
<span class="label label-success"
|
|
|
|
|
style="font-size: 1.1em;"><?= $row->rate . ' %' ?></span>
|
2020-06-22 11:39:55 +00:00
|
|
|
|
</td>
|
|
|
|
|
<?php
|
|
|
|
|
} else {
|
|
|
|
|
?>
|
|
|
|
|
<td>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
<span class="label label-danger"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
style="font-size: 1em;"><?= $this->lang->line('not_defined'); ?></span>
|
2020-06-22 11:39:55 +00:00
|
|
|
|
</td>
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
?>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
<td><?= $row->url ?></td>
|
2020-06-22 11:39:55 +00:00
|
|
|
|
<td>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<button type="button" data-network-id="<?= $row->id ?>"
|
2020-10-30 11:20:54 +00:00
|
|
|
|
data-config-id="<?= $idConfig ?>" data-num="<?= $num ?>"
|
|
|
|
|
data-toggle="modal" data-target="<?= '#configureRate' . $num ?>"
|
2020-06-22 11:39:55 +00:00
|
|
|
|
class="btn btn-primary btn-block openModal">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<b><?= $this->lang->line('configure_paying_network'); ?></b>
|
2020-06-22 11:39:55 +00:00
|
|
|
|
</button>
|
|
|
|
|
</td>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
<div class="modal fade" id="<?= 'configureRate' . $num ?>" tabindex="-1"
|
|
|
|
|
role="dialog" aria-hidden="true">
|
2020-07-10 18:19:15 +00:00
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<h3 class="modal-title"><?= $this->lang->line('configure_paying_network'); ?></h3>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
2020-10-30 11:20:54 +00:00
|
|
|
|
<form id="<?= 'rateForm' . $num ?>">
|
2020-07-10 18:19:15 +00:00
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="rate"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
class="col-form-label"><?= $this->lang->line('share_rate') . ' (%)'; ?></label>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
<input type="number" min="0" step=".01" max="100"
|
|
|
|
|
required class="form-control"
|
|
|
|
|
name="rate" id="<?= 'rate' . $num ?>"
|
|
|
|
|
value="<?= $row->rate ?>">
|
2020-07-10 18:19:15 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="url"
|
|
|
|
|
class="col-form-label">URL</label>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
<input type="text" required class="form-control"
|
|
|
|
|
value="<?= $row->url ?>"
|
|
|
|
|
id="<?= 'url' . $num ?>" name="url">
|
2020-07-10 18:19:15 +00:00
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
|
<button type="button" class="btn btn-secondary"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
<button type="button" class="btn btn-primary enableRate">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<?= $this->lang->line('Valider'); ?></button>
|
2020-07-10 18:19:15 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-06-22 11:39:55 +00:00
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
echo $this->lang->line('Aucun réseau');
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
echo $this->lang->line('Aucun réseau');
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-10-29 19:07:19 +00:00
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-xs-12">
|
|
|
|
|
<div class="box">
|
|
|
|
|
<div class="box-header">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<h3 class="box-title"><?= $this->lang->line('transmitting_networks'); ?></h3>
|
2020-10-29 19:07:19 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="box-body" style="overflow-x:auto;">
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
$sql2 = $networks;
|
2022-04-19 10:38:29 +00:00
|
|
|
|
if ($sql2) {
|
2020-10-30 11:20:54 +00:00
|
|
|
|
$sql2 = array_filter($sql2, function ($val) {
|
2020-10-29 19:15:47 +00:00
|
|
|
|
return $val->type == 'autre';
|
|
|
|
|
});
|
2020-10-29 19:07:19 +00:00
|
|
|
|
$numrows = sizeof($sql2);
|
|
|
|
|
$num = 0;
|
|
|
|
|
if ($numrows > 0) {
|
|
|
|
|
?>
|
|
|
|
|
<table id="validated" class="table table-bordered table-striped">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th align='center'>N°</th>
|
|
|
|
|
<th><?= $this->lang->line('Nom'); ?></th>
|
|
|
|
|
<th align='center'>Wallet</th>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<th align='center'><?= $this->lang->line('Statut'); ?></th>
|
|
|
|
|
<th align='center'> <?= $this->lang->line('share_rate') ?></th>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
<th align='center'> URL</th>
|
2021-12-20 17:47:02 +00:00
|
|
|
|
<th style="text-align: center"> Action</th>
|
2020-10-29 19:07:19 +00:00
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<?php
|
|
|
|
|
foreach ($sql2 as $row) {
|
|
|
|
|
|
|
|
|
|
$num++;
|
|
|
|
|
//$member_code = randomString1(10);
|
|
|
|
|
echo "<tr>
|
|
|
|
|
<td align='center'>$num</td>
|
|
|
|
|
<td>$row->name</td>
|
2021-11-04 17:01:59 +00:00
|
|
|
|
<td><span class='label label-success'>" . mb_strtoupper($row->type,'UTF-8') . "</span></td>";
|
2020-10-29 19:07:19 +00:00
|
|
|
|
?>
|
|
|
|
|
<?php
|
2020-10-30 11:20:54 +00:00
|
|
|
|
if ($row->is_transmitting_network) {
|
|
|
|
|
?>
|
|
|
|
|
<td>
|
|
|
|
|
<span class="label label-success"><?= $this->lang->line('Actif'); ?></span>
|
|
|
|
|
</td>
|
|
|
|
|
<?php
|
|
|
|
|
} else {
|
|
|
|
|
?>
|
|
|
|
|
<td>
|
|
|
|
|
<span class="label label-danger"><?= $this->lang->line('Inactif'); ?></span>
|
|
|
|
|
</td>
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<?php
|
|
|
|
|
if ($row->rate_transmitting != null) {
|
2020-10-29 19:07:19 +00:00
|
|
|
|
?>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
<td>
|
|
|
|
|
<span class="label label-success"
|
|
|
|
|
style="font-size: 1.1em;"><?= $row->rate_transmitting . ' %' ?></span>
|
|
|
|
|
</td>
|
2020-10-29 19:07:19 +00:00
|
|
|
|
<?php
|
2020-10-30 11:20:54 +00:00
|
|
|
|
} else {
|
2020-10-29 19:07:19 +00:00
|
|
|
|
?>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
<td>
|
|
|
|
|
<span class="label label-danger"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
style="font-size: 1em;"><?= $this->lang->line('not_defined'); ?></span>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
</td>
|
2020-10-29 19:07:19 +00:00
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
?>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
<td><?= $row->url_transmitting ?></td>
|
|
|
|
|
<?php
|
|
|
|
|
if ($row->is_transmitting_network) {
|
|
|
|
|
?>
|
|
|
|
|
<td>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<button type="button" data-network-id="<?= $row->id ?>"
|
2020-10-30 11:20:54 +00:00
|
|
|
|
data-config-id="<?= $idConfig ?>" data-num="<?= $num ?>"
|
|
|
|
|
data-toggle="modal"
|
|
|
|
|
data-target="<?= '#configureTransmittingRate' . $num ?>"
|
|
|
|
|
class="btn btn-primary openModal">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<b><?= $this->lang->line('configure_transmitter_network'); ?></b>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
</button>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<button type="button" data-network-id="<?= $row->id ?>"
|
2020-10-30 11:20:54 +00:00
|
|
|
|
data-config-id="<?= $idConfig ?>" data-num="<?= $num ?>"
|
|
|
|
|
class="btn btn-danger openModal disableTransmitting"><?= $this->lang->line('Désactiver'); ?></button>
|
|
|
|
|
</td>
|
|
|
|
|
<?php
|
|
|
|
|
} else {
|
|
|
|
|
?>
|
|
|
|
|
<td>
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<button type="button" data-network-id="<?= $row->id ?>"
|
2020-10-30 11:20:54 +00:00
|
|
|
|
data-toggle="modal"
|
|
|
|
|
data-target="<?= '#configureTransmittingRate' . $num ?>"
|
|
|
|
|
data-config-id="<?= $idConfig ?>" data-num="<?= $num ?>"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
class="btn btn-primary openModal"><?= $this->lang->line('Activer'); ?></button>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
</td>
|
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<div class="modal fade" id="<?= 'configureTransmittingRate' . $num ?>"
|
|
|
|
|
tabindex="-1" role="dialog" aria-hidden="true">
|
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<h3 class="modal-title"><?= $this->lang->line('configure_transmitter_network'); ?></h3>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
|
|
|
|
<form id="<?= 'rateTransmittingForm' . $num ?>">
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="rate"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
class="col-form-label"><?= $this->lang->line('share_rate') . ' (%)'; ?></label>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
<input type="number" min="0" step=".01" max="100"
|
|
|
|
|
required class="form-control"
|
|
|
|
|
name="rate" id="<?= 'rateTransmitting' . $num ?>"
|
|
|
|
|
value="<?= $row->rate_transmitting ?>">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label for="url"
|
|
|
|
|
class="col-form-label">URL</label>
|
|
|
|
|
<input type="text" required class="form-control"
|
|
|
|
|
value="<?= $row->url_transmitting ?>"
|
|
|
|
|
id="<?= 'urlTransmitting' . $num ?>" name="url">
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
|
<button type="button" class="btn btn-secondary"
|
2022-04-18 11:39:19 +00:00
|
|
|
|
data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
<button type="button" data-is-transmitting-network="<?=$row->is_transmitting_network?>"
|
|
|
|
|
class="btn btn-primary enableTransmitting">
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<?= $this->lang->line('Valider'); ?></button>
|
2020-10-30 11:20:54 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-10-29 19:07:19 +00:00
|
|
|
|
<?php
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
echo $this->lang->line('Aucun réseau');
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
echo $this->lang->line('Aucun réseau');
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-06-22 11:39:55 +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-22 11:39:55 +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-22 11:39:55 +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-22 11:39:55 +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-22 11:39:55 +00:00
|
|
|
|
<!-- FastClick -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
|
2020-06-22 11:39:55 +00:00
|
|
|
|
<!-- AdminLTE App -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
|
2020-06-22 11:39:55 +00:00
|
|
|
|
<!-- AdminLTE for demo purposes -->
|
2022-04-18 11:39:19 +00:00
|
|
|
|
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
|
|
|
|
|
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
|
|
|
|
|
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
|
2020-06-22 11:39:55 +00:00
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
$(function () {
|
|
|
|
|
$('#validated').DataTable();
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
toastr.options.closeButton = true;
|
|
|
|
|
toastr.options.closeMethod = 'fadeOut';
|
|
|
|
|
toastr.options.closeDuration = 5000;
|
|
|
|
|
toastr.options.closeEasing = 'swing';
|
|
|
|
|
|
|
|
|
|
var network_id = null;
|
|
|
|
|
var config_id = null;
|
2020-07-10 18:19:15 +00:00
|
|
|
|
var num = null;
|
2020-06-22 11:39:55 +00:00
|
|
|
|
$(document).on("click", ".openModal", function () {
|
|
|
|
|
network_id = $(this).data('network-id');
|
|
|
|
|
config_id = $(this).data('config-id');
|
2020-07-10 18:19:15 +00:00
|
|
|
|
num = $(this).data('num');
|
2020-06-22 11:39:55 +00:00
|
|
|
|
})
|
|
|
|
|
|
2020-07-10 18:19:15 +00:00
|
|
|
|
$(document).on("click", ".enableRate", function () {
|
2020-10-30 11:20:54 +00:00
|
|
|
|
if ($('#rateForm' + num)[0].checkValidity()) {
|
|
|
|
|
const rate = parseFloat($('#rate' + num).val());
|
|
|
|
|
const url = $('#url' + num).val();
|
2020-06-22 11:39:55 +00:00
|
|
|
|
$.ajax({
|
2022-04-18 11:39:19 +00:00
|
|
|
|
url: '<?= base_url('Hyperviseur_dash/config_sharing_rate')?>',
|
2020-06-22 11:39:55 +00:00
|
|
|
|
type: 'POST',
|
|
|
|
|
dataType: 'json',
|
2020-07-10 18:19:15 +00:00
|
|
|
|
data: {"network_id": network_id, "rate": rate, "url": url, "config_id": config_id},
|
2020-06-22 11:39:55 +00:00
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data == '200') {
|
|
|
|
|
Swal.fire({
|
|
|
|
|
icon: 'success',
|
2022-04-18 11:39:19 +00:00
|
|
|
|
title: "<?= $this->lang->line('paying_network_updated')?>",
|
|
|
|
|
text: "<?= $this->lang->line('informations_updated')?>",
|
2020-06-22 11:39:55 +00:00
|
|
|
|
timer: 3000
|
|
|
|
|
}).then(() => {
|
|
|
|
|
location.reload();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} else {
|
2022-04-18 11:39:19 +00:00
|
|
|
|
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
|
2020-06-22 11:39:55 +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-06-22 11:39:55 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
2020-10-30 11:20:54 +00:00
|
|
|
|
$('#rateForm' + num)[0].reportValidity();
|
2020-07-10 18:19:15 +00:00
|
|
|
|
}
|
2020-09-28 15:44:45 +00:00
|
|
|
|
|
2020-06-22 11:39:55 +00:00
|
|
|
|
});
|
|
|
|
|
|
2020-10-29 19:07:19 +00:00
|
|
|
|
$(document).on("click", ".enableTransmitting", function () {
|
2020-10-30 11:20:54 +00:00
|
|
|
|
if ($('#rateTransmittingForm' + num)[0].checkValidity()) {
|
|
|
|
|
const rate = parseFloat($('#rateTransmitting' + num).val());
|
|
|
|
|
const url = $('#urlTransmitting' + num).val();
|
|
|
|
|
const is_enabled = $(this).data('is-transmitting-network');
|
|
|
|
|
$.ajax({
|
2022-04-18 11:39:19 +00:00
|
|
|
|
url: '<?= base_url('Hyperviseur_dash/active_transmitting_network')?>',
|
2020-10-30 11:20:54 +00:00
|
|
|
|
type: 'POST',
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
data: {"network_id": network_id, "config_id": config_id , "rate": rate, "url": url , 'is_enabled' : is_enabled},
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data == '200') {
|
|
|
|
|
Swal.fire({
|
|
|
|
|
icon: 'success',
|
2022-04-18 11:39:19 +00:00
|
|
|
|
title: "<?= $this->lang->line('transmitter_network_activated')?>",
|
|
|
|
|
text: "<?= $this->lang->line('informations_updated')?>",
|
2020-10-30 11:20:54 +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-10-30 11:20:54 +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-10-29 19:07:19 +00:00
|
|
|
|
}
|
2020-10-30 11:20:54 +00:00
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
$('#rateTransmittingForm' + num)[0].reportValidity();
|
|
|
|
|
}
|
2020-10-29 19:07:19 +00:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(document).on("click", ".disableTransmitting", function () {
|
|
|
|
|
$.ajax({
|
2022-04-18 11:39:19 +00:00
|
|
|
|
url: '<?= base_url('Hyperviseur_dash/deactive_transmitting_network')?>',
|
2020-10-30 11:20:54 +00:00
|
|
|
|
type: 'POST',
|
|
|
|
|
dataType: 'json',
|
2020-10-29 19:07:19 +00:00
|
|
|
|
data: {"network_id": network_id, "config_id": config_id},
|
2020-10-30 11:20:54 +00:00
|
|
|
|
success: function (data) {
|
|
|
|
|
if (data == '200') {
|
2020-10-29 19:07:19 +00:00
|
|
|
|
Swal.fire({
|
|
|
|
|
icon: 'success',
|
2022-04-18 11:39:19 +00:00
|
|
|
|
title: "<?= $this->lang->line('transmitter_network_deactivated')?>",
|
|
|
|
|
text: "<?= $this->lang->line('informations_updated')?>",
|
2020-10-29 19:07:19 +00:00
|
|
|
|
timer: 3000
|
2020-10-30 11:20:54 +00:00
|
|
|
|
}).then(() => {
|
2020-10-29 19:07:19 +00:00
|
|
|
|
location.reload();
|
|
|
|
|
});
|
|
|
|
|
// alert("Les informations ont été mises à jour.") ? "" :
|
2020-10-30 11:20:54 +00:00
|
|
|
|
} else {
|
2022-04-18 11:39:19 +00:00
|
|
|
|
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
|
2020-10-29 19:07:19 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2020-10-30 11:20:54 +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-10-29 19:07:19 +00:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
2020-06-22 11:39:55 +00:00
|
|
|
|
</script>
|