+ Update management of transmitting networks
This commit is contained in:
parent
70e78cd509
commit
3f2d7ca7c4
|
@ -1039,6 +1039,9 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$network->url = null;
|
||||
}
|
||||
$network->is_transmitting_network = $res2 ? true : false;
|
||||
$network->rate_transmitting = $res2 ? $res2->first_row()->taux_partage : null;
|
||||
$network->url_transmitting = $res2 ? $res2->first_row()->url : null;
|
||||
|
||||
$data['networks'][] = $network;
|
||||
}
|
||||
}
|
||||
|
@ -1161,6 +1164,7 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$res = $this->wallet_model->getWalletPassword($this->session->userdata('network_id'));
|
||||
$data['walletPassword'] = $res ? $res->first_row() : null;
|
||||
$data['networks'] = $this->wallet_model->getPayingNetworksByConfigWallet($data['idConfig']);
|
||||
$data['transmitting_networks'] = $this->wallet_model->getTransmittingNetworksByConfigWallet($data['idConfig']);
|
||||
|
||||
$this->load->view('header_hyp', $data);
|
||||
$this->load->view('gestion_wallet_ilink_paying_network_account');
|
||||
|
@ -1612,12 +1616,25 @@ class Hyperviseur_dash extends CI_Controller
|
|||
{
|
||||
if ($this->isLogged()) {
|
||||
if (isset($_POST)) {
|
||||
|
||||
if($this->input->post('is_enabled')){
|
||||
$data = array(
|
||||
'id_configWallet' => $this->input->post('config_id'),
|
||||
'id_network' => $this->input->post('network_id')
|
||||
'url' => $this->input->post('url'),
|
||||
'taux_partage' => $this->input->post('rate')
|
||||
);
|
||||
|
||||
$this->db->where('id_configWallet', $this->input->post('config_id'));
|
||||
$this->db->where('id_network', $this->input->post('network_id'));
|
||||
$query = $this->db->update('transmitting_networks', $data);
|
||||
}else{
|
||||
$data = array(
|
||||
'id_configWallet' => $this->input->post('config_id'),
|
||||
'id_network' => $this->input->post('network_id'),
|
||||
'url' => $this->input->post('url'),
|
||||
'taux_partage' => $this->input->post('rate')
|
||||
);
|
||||
$query = $this->db->insert('transmitting_networks', $data);
|
||||
}
|
||||
|
||||
if ($query) {
|
||||
echo json_encode("200");
|
||||
|
|
|
@ -534,4 +534,7 @@ $lang['transmitting_networks'] = "Transmitting networks";
|
|||
$lang['transmitter_network_activated'] = "Transmitter network activated";
|
||||
$lang['transmitter_network_deactivated'] = "Transmitter network deactivated";
|
||||
$lang['paying_networks'] = 'Paying networks';
|
||||
$lang['configure_transmitter_network'] = 'Configure the sending network';
|
||||
$lang['paying_and_transmitting_networks_accounts'] = "Accounts of paying and issuing networks";
|
||||
$lang['transmitting_networks_accounts'] = 'Accounts of transmitting networks';
|
||||
?>
|
||||
|
|
|
@ -403,7 +403,7 @@ $lang['ilink_third_rule'] = 'La somme des répartitions de commission sur opéra
|
|||
$lang['ilink_fourth_rule'] = 'La somme des répartitions de commission sur opération de retrait dans la carte doit etre égale à 100 %';
|
||||
$lang['ilink_fifth_rule'] = 'La somme des répartitions de commission sur opération de retrait dans la carte pour utilisateur iLink doit etre égale à 100 %';
|
||||
$lang['ilink_sixth_rule'] = 'La somme des répartitions de commission sur opération d\'envoi de wallet vers la carte pour utilisateur iLink doit etre égale à 100 %';
|
||||
$lang['edit_paying_and_transmitting_networks'] = 'Configuration des réseaux payeurs et emetteurs';
|
||||
$lang['edit_paying_and_transmitting_networks'] = 'Configuration des réseaux payeurs et émetteurs';
|
||||
$lang['configure'] = 'Configurer';
|
||||
$lang['configure_share_rate'] = 'Configurer le taux de partage';
|
||||
$lang['share_rate'] = 'Taux de partage';
|
||||
|
@ -543,8 +543,11 @@ $lang['bank_deactivation'] = "Désactivation de la banque";
|
|||
$lang['modify_bank'] = "Modifier la banque";
|
||||
$lang['assign_bank_to_country'] = "Assigner une banque à un pays";
|
||||
$lang['transmitting_networks'] = "Réseaux émetteurs";
|
||||
$lang['transmitter_network_activated'] = "Réseau emetteur activé";
|
||||
$lang['transmitter_network_deactivated'] = "Réseau emetteur desactivé";
|
||||
$lang['transmitter_network_activated'] = "Réseau émetteur activé";
|
||||
$lang['transmitter_network_deactivated'] = "Réseau émetteur desactivé";
|
||||
$lang['paying_networks'] = 'Réseaux payeurs';
|
||||
$lang['configure_transmitter_network'] = 'Configurer le réseau émetteur';
|
||||
$lang['paying_and_transmitting_networks_accounts'] = "Comptes des reseaux payeurs et émetteurs";
|
||||
$lang['transmitting_networks_accounts'] = 'Comptes des reseaux émetteurs';
|
||||
|
||||
?>
|
||||
|
|
|
@ -917,10 +917,13 @@ LEFT JOIn networks_banks nb ON nb.id_bank_country = bc.id AND nb.id_network = n.
|
|||
networks n ON n.country_id = c.id WHERE n.status = 1 AND c.id = ?
|
||||
) AND id_configWallet = ? ;";
|
||||
$query = $this->db->query($sql , array($id_country, $idConfig));
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
return $query->num_rows() > 0 ? $query : false ;
|
||||
}
|
||||
|
||||
public function getTransmittingNetworksByConfigWallet($id_config)
|
||||
{
|
||||
$query = $this->db->query("SELECT n.name , n.id , cw.type , c.name as country ,c.currency_code, pw.taux_partage as rate , pw.balance_com , pw.balance_compensation, pw.id_configWallet as config_id FROM networks n INNER JOIN countries_currencies c ON n.country_id=c.id
|
||||
INNER JOIN configWallet cw ON cw.id_network = n.id INNER JOIN transmitting_networks pw ON pw.id_network = n.id WHERE pw.id_configWallet = $id_config ");
|
||||
return $query->num_rows() > 0 ? $query : false ;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,24 +102,28 @@
|
|||
<b><?php echo $this->lang->line('configure_paying_network'); ?></b>
|
||||
</button>
|
||||
</td>
|
||||
<div class="modal fade" id="<?='configureRate'.$num?>" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal fade" id="<?= 'configureRate' . $num ?>" 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('configure_share_rate'); ?></h3>
|
||||
<h3 class="modal-title"><?php echo $this->lang->line('configure_paying_network'); ?></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="<?= 'rateForm' . $num ?>">
|
||||
<div class="form-group">
|
||||
<label for="rate"
|
||||
class="col-form-label"><?php echo $this->lang->line('share_rate') . ' (%)'; ?></label>
|
||||
<input type="number" min="0" step=".01" max="100" required class="form-control"
|
||||
name="rate" id="<?='rate'.$num?>" value="<?=$row->rate?>">
|
||||
<input type="number" min="0" step=".01" max="100"
|
||||
required class="form-control"
|
||||
name="rate" id="<?= 'rate' . $num ?>"
|
||||
value="<?= $row->rate ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url"
|
||||
class="col-form-label">URL</label>
|
||||
<input type="text" required class="form-control" value="<?=$row->url?>"
|
||||
<input type="text" required class="form-control"
|
||||
value="<?= $row->url ?>"
|
||||
id="<?= 'url' . $num ?>" name="url">
|
||||
</div>
|
||||
</form>
|
||||
|
@ -178,7 +182,9 @@
|
|||
<th><?= $this->lang->line('Nom'); ?></th>
|
||||
<th align='center'>Wallet</th>
|
||||
<th align='center'><?php echo $this->lang->line('Statut'); ?></th>
|
||||
<th align='center'> Action</th>
|
||||
<th align='center'> <?php echo $this->lang->line('share_rate') ?></th>
|
||||
<th align='center'> URL</th>
|
||||
<th align="center"> Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -195,19 +201,101 @@
|
|||
<?php
|
||||
if ($row->is_transmitting_network) {
|
||||
?>
|
||||
<td><span class="label label-success"><?= $this->lang->line('Actif'); ?></span></td>
|
||||
<td><button type="button" data-network-id="<?php echo $row->id ?>"
|
||||
data-config-id="<?= $idConfig ?>" data-num ="<?=$num?>" class="btn btn-danger openModal disableTransmitting"><?= $this->lang->line('Désactiver'); ?></button></td>
|
||||
<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>
|
||||
<td><button type="button" data-network-id="<?php echo $row->id ?>"
|
||||
data-config-id="<?= $idConfig ?>" data-num ="<?=$num?>" class="btn btn-primary openModal enableTransmitting" ><?php echo $this->lang->line('Activer'); ?></button></td>
|
||||
<td>
|
||||
<span class="label label-danger"><?= $this->lang->line('Inactif'); ?></span>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
if ($row->rate_transmitting != null) {
|
||||
?>
|
||||
<td>
|
||||
<span class="label label-success"
|
||||
style="font-size: 1.1em;"><?= $row->rate_transmitting . ' %' ?></span>
|
||||
</td>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<td>
|
||||
<span class="label label-danger"
|
||||
style="font-size: 1em;"><?php echo $this->lang->line('not_defined'); ?></span>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td><?= $row->url_transmitting ?></td>
|
||||
<?php
|
||||
if ($row->is_transmitting_network) {
|
||||
?>
|
||||
<td>
|
||||
<button type="button" data-network-id="<?php echo $row->id ?>"
|
||||
data-config-id="<?= $idConfig ?>" data-num="<?= $num ?>"
|
||||
data-toggle="modal"
|
||||
data-target="<?= '#configureTransmittingRate' . $num ?>"
|
||||
class="btn btn-primary openModal">
|
||||
<b><?php echo $this->lang->line('configure_transmitter_network'); ?></b>
|
||||
</button>
|
||||
<button type="button" data-network-id="<?php echo $row->id ?>"
|
||||
data-config-id="<?= $idConfig ?>" data-num="<?= $num ?>"
|
||||
class="btn btn-danger openModal disableTransmitting"><?= $this->lang->line('Désactiver'); ?></button>
|
||||
</td>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<td>
|
||||
<button type="button" data-network-id="<?php echo $row->id ?>"
|
||||
data-toggle="modal"
|
||||
data-target="<?= '#configureTransmittingRate' . $num ?>"
|
||||
data-config-id="<?= $idConfig ?>" data-num="<?= $num ?>"
|
||||
class="btn btn-primary openModal"><?php echo $this->lang->line('Activer'); ?></button>
|
||||
</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">
|
||||
<h3 class="modal-title"><?php echo $this->lang->line('configure_transmitter_network'); ?></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="<?= 'rateTransmittingForm' . $num ?>">
|
||||
<div class="form-group">
|
||||
<label for="rate"
|
||||
class="col-form-label"><?php echo $this->lang->line('share_rate') . ' (%)'; ?></label>
|
||||
<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"
|
||||
data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||
<button type="button" data-is-transmitting-network="<?=$row->is_transmitting_network?>"
|
||||
class="btn btn-primary enableTransmitting">
|
||||
<?php echo $this->lang->line('Valider'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
@ -304,11 +392,15 @@
|
|||
});
|
||||
|
||||
$(document).on("click", ".enableTransmitting", function () {
|
||||
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({
|
||||
url: '<?php echo base_url('index.php/Hyperviseur_dash/active_transmitting_network')?>',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {"network_id": network_id, "config_id": config_id},
|
||||
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({
|
||||
|
@ -328,7 +420,10 @@
|
|||
console.log(resultat + " " + error);
|
||||
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
|
||||
}
|
||||
})
|
||||
});
|
||||
} else {
|
||||
$('#rateTransmittingForm' + num)[0].reportValidity();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("click", ".disableTransmitting", function () {
|
||||
|
|
|
@ -403,7 +403,7 @@ $context = new \Brick\Money\Context\AutoContext();
|
|||
<h3 class="box-title"><?php echo $this->lang->line('Historique des 12 derniers mois'); ?></h3>
|
||||
<div class="box-tools">
|
||||
<a class="btn btn-success" href="<?php echo current_url().($network_id ? '?show=paying_networks' : '')?>">
|
||||
<?php echo $this->lang->line('paying_networks_accounts'); ?>
|
||||
<?php echo $this->lang->line('paying_and_transmitting_networks_accounts'); ?>
|
||||
</a>
|
||||
<a class="btn btn-primary" href="<?php echo current_url().($network_id ? '?history=transaction_ilink' : '')?>">
|
||||
<?php echo $this->lang->line('transactions_historic'); ?>
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
<section class="content-header">
|
||||
|
||||
<h1>
|
||||
<?php echo $this->lang->line('paying_networks_accounts')?>
|
||||
<?php echo $this->lang->line('paying_and_transmitting_networks_accounts')?>
|
||||
</h1>
|
||||
<?php
|
||||
|
||||
use Brick\Money\Context\CustomContext;
|
||||
use Brick\Money\Money;
|
||||
|
||||
$context = new \Brick\Money\Context\AutoContext();
|
||||
$site_url = base_url();
|
||||
|
||||
|
@ -47,7 +47,7 @@
|
|||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php echo $this->lang->line('paying_networks'); ?></h3>
|
||||
<h3 class="box-title"><?php echo $this->lang->line('paying_networks_accounts'); ?></h3>
|
||||
<div class="box-tools">
|
||||
<a class="btn btn-success" href="<?php echo current_url() . '?history=refund_history' ?>">
|
||||
<?php echo $this->lang->line('refund_history'); ?>
|
||||
|
@ -138,7 +138,92 @@
|
|||
</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('transmitting_networks_accounts'); ?></h3>
|
||||
<div class="box-tools">
|
||||
<a class="btn btn-success" href="<?php echo current_url() . '?history=refund_history' ?>">
|
||||
<?php echo $this->lang->line('refund_history'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body" style="overflow-x:auto;">
|
||||
|
||||
<?php
|
||||
$sql2 = $transmitting_networks;
|
||||
if ($sql2 != false) {
|
||||
$numrows = $networks->num_rows();
|
||||
$num = 0;
|
||||
if ($numrows > 0) {
|
||||
$fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||
?>
|
||||
<table id="validated" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align='center'>N°</th>
|
||||
<th><?php echo $this->lang->line('Nom'); ?></th>
|
||||
<th><?php echo $this->lang->line('Pays'); ?></th>
|
||||
<th align='center'>Wallet</th>
|
||||
<th align='center'> <?php echo $this->lang->line('share_rate') ?></th>
|
||||
<th><?= $this->lang->line('Solde Commission') ?></th>
|
||||
<th><?= $this->lang->line('compensation_balance') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($sql2->result() as $row) {
|
||||
|
||||
$num++;
|
||||
//$member_code = randomString1(10);
|
||||
echo "<tr>
|
||||
<td align='center'>$num</td>
|
||||
<td>$row->name</td>
|
||||
<td>$row->country</td>
|
||||
<td><span class='label label-success'>".strtoupper($row->type)."</span></td>";
|
||||
?>
|
||||
<?php
|
||||
if ($row->rate != null ) {
|
||||
?>
|
||||
<td>
|
||||
<span class="label label-success" style="font-size: 1.1em;"><?= $row->rate . ' %'?></span>
|
||||
</td>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<td>
|
||||
<span class="label label-danger"
|
||||
style="font-size: 1em;"><?php echo $this->lang->line('not_defined'); ?></span>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td>
|
||||
<?= Money::of(round($row->balance_com, 2), $row->currency_code ? $row->currency_code : 'XAF', $context)->formatTo('fr_FR') ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= Money::of(round($row->balance_compensation, 2), $row->currency_code ? $row->currency_code : 'XAF', $context)->formatTo('fr_FR') ?>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
} else {
|
||||
echo $this->lang->line('Aucun réseau');
|
||||
}
|
||||
} else {
|
||||
echo $this->lang->line('Aucun réseau');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="refundModal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
|
|
Loading…
Reference in New Issue