Improve wallet commissions settings

This commit is contained in:
Djery-Tom 2022-04-20 17:07:10 +01:00
parent 5427e66ac1
commit 8fa2a897b1
7 changed files with 210 additions and 549 deletions

View File

@ -446,8 +446,8 @@ class Admin_dash extends CI_Controller
$data['plr_sup_wallet_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("sup_wallet_cash_national", $data['idConfig']);
$data['plr_sup_wallet_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("sup_wallet_cash_international", $data['idConfig']);
$data['plr_hyp_wallet_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("hyp_wallet_cash_national", $data['idConfig']);
$data['plr_hyp_wallet_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("hyp_wallet_cash_international", $data['idConfig']);
$data['plr_customer_wallet_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("customer_wallet_cash_national", $data['idConfig']);
$data['plr_customer_wallet_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("customer_wallet_cash_international", $data['idConfig']);
$this->load->view('header', $data);
$this->load->view('config_wallet_ilink_hyp/agent_remove_cash');
@ -495,8 +495,8 @@ class Admin_dash extends CI_Controller
$data['plr_agent_cash_wallet_or_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("agent_cash_wallet_or_cash_international", $data['idConfig']);
$data['plr_sup_cash_wallet_or_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("sup_cash_wallet_or_cash_national", $data['idConfig']);
$data['plr_sup_cash_wallet_or_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("sup_cash_wallet_or_cash_international", $data['idConfig']);
$data['plr_hyp_cash_wallet_or_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("hyp_cash_wallet_or_cash_national", $data['idConfig']);
$data['plr_hyp_cash_wallet_or_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("hyp_cash_wallet_or_cash_international", $data['idConfig']);
// $data['plr_hyp_cash_wallet_or_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("hyp_cash_wallet_or_cash_national", $data['idConfig']);
// $data['plr_hyp_cash_wallet_or_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("hyp_cash_wallet_or_cash_international", $data['idConfig']);
$data['plr_agent_depot_wallet_ilink'] = $this->wallet_model->getPalierConfigWallet("agent_depot_wallet_ilink_international" , $data['idConfig']);
$data['plr_agent_depot_autre_wallet'] = $this->wallet_model->getPalierConfigWallet("agent_depot_autre_wallet_international" , $data['idConfig']);

View File

@ -1592,16 +1592,16 @@ class Gestion extends CI_Controller
case 'agent_remove_cash':
$plr_agent_wallet_cash_national = $_POST['plr_agent_wallet_cash_national'] ?? null;
$plr_sup_wallet_cash_national = $_POST['plr_sup_wallet_cash_national'] ?? null;
$plr_hyp_wallet_cash_national = $_POST['plr_hyp_wallet_cash_national'] ?? null;
$plr_customer_wallet_cash_national = $_POST['plr_customer_wallet_cash_national'] ?? null;
$plr_agent_wallet_cash_international = $_POST['plr_agent_wallet_cash_international'] ?? null;
$plr_sup_wallet_cash_international = $_POST['plr_sup_wallet_cash_international'] ?? null;
$plr_hyp_wallet_cash_international = $_POST['plr_hyp_wallet_cash_international'] ?? null;
$plr_customer_wallet_cash_international = $_POST['plr_customer_wallet_cash_international'] ?? null;
$this->insertPalier($plr_agent_wallet_cash_national, "agent_wallet_cash_national", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_sup_wallet_cash_national, "sup_wallet_cash_national", $idConfig ,'paliers_commissions_wallet');
$this->insertPalier($plr_hyp_wallet_cash_national, "hyp_wallet_cash_national", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_customer_wallet_cash_national, "customer_wallet_cash_national", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_agent_wallet_cash_international, "agent_wallet_cash_international", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_sup_wallet_cash_international, "sup_wallet_cash_international", $idConfig ,'paliers_commissions_wallet');
$this->insertPalier($plr_hyp_wallet_cash_international, "hyp_wallet_cash_international", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_customer_wallet_cash_international, "customer_wallet_cash_international", $idConfig,'paliers_commissions_wallet');
break;
case 'agent_remove_carte_cash':
$plr_customer_cart_cash_international = $_POST['plr_customer_cart_cash_international'] ?? null;
@ -1672,15 +1672,15 @@ class Gestion extends CI_Controller
$plr_agent_cash_wallet_or_cash_national = $_POST['plr_agent_cash_wallet_or_cash_national'] ?? null;
$plr_sup_cash_wallet_or_cash_international = $_POST['plr_sup_cash_wallet_or_cash_international'] ?? null;
$plr_sup_cash_wallet_or_cash_national = $_POST['plr_sup_cash_wallet_or_cash_national'] ?? null;
$plr_hyp_cash_wallet_or_cash_international = $_POST['plr_hyp_cash_wallet_or_cash_international'] ?? null;
$plr_hyp_cash_wallet_or_cash_national = $_POST['plr_hyp_cash_wallet_or_cash_national'] ?? null;
// $plr_hyp_cash_wallet_or_cash_international = $_POST['plr_hyp_cash_wallet_or_cash_international'] ?? null;
// $plr_hyp_cash_wallet_or_cash_national = $_POST['plr_hyp_cash_wallet_or_cash_national'] ?? null;
$this->insertPalier($plr_agent_cash_wallet_or_cash_international, "agent_cash_wallet_or_cash_international", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_agent_cash_wallet_or_cash_national, "agent_cash_wallet_or_cash_national", $idConfig ,'paliers_commissions_wallet');
$this->insertPalier($plr_sup_cash_wallet_or_cash_international, "sup_cash_wallet_or_cash_international", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_sup_cash_wallet_or_cash_national, "sup_cash_wallet_or_cash_national", $idConfig,'paliers_commissions_wallet');
$this->insertPalier($plr_hyp_cash_wallet_or_cash_international, "hyp_cash_wallet_or_cash_international", $idConfig ,'paliers_commissions_wallet');
$this->insertPalier($plr_hyp_cash_wallet_or_cash_national, "hyp_cash_wallet_or_cash_national", $idConfig,'paliers_commissions_wallet');
// $this->insertPalier($plr_hyp_cash_wallet_or_cash_international, "hyp_cash_wallet_or_cash_international", $idConfig ,'paliers_commissions_wallet');
// $this->insertPalier($plr_hyp_cash_wallet_or_cash_national, "hyp_cash_wallet_or_cash_national", $idConfig,'paliers_commissions_wallet');
break;
}

View File

@ -1450,8 +1450,8 @@ class Hyperviseur_dash extends CI_Controller
$data['plr_sup_wallet_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("sup_wallet_cash_national", $data['idConfig']);
$data['plr_sup_wallet_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("sup_wallet_cash_international", $data['idConfig']);
$data['plr_hyp_wallet_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("hyp_wallet_cash_national", $data['idConfig']);
$data['plr_hyp_wallet_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("hyp_wallet_cash_international", $data['idConfig']);
$data['plr_customer_wallet_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("customer_wallet_cash_national", $data['idConfig']);
$data['plr_customer_wallet_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("customer_wallet_cash_international", $data['idConfig']);
$this->load->view('header_hyp', $data);
$this->load->view('config_wallet_ilink_hyp/agent_remove_cash');
@ -1499,8 +1499,8 @@ class Hyperviseur_dash extends CI_Controller
$data['plr_agent_cash_wallet_or_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("agent_cash_wallet_or_cash_international", $data['idConfig']);
$data['plr_sup_cash_wallet_or_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("sup_cash_wallet_or_cash_national", $data['idConfig']);
$data['plr_sup_cash_wallet_or_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("sup_cash_wallet_or_cash_international", $data['idConfig']);
$data['plr_hyp_cash_wallet_or_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("hyp_cash_wallet_or_cash_national", $data['idConfig']);
$data['plr_hyp_cash_wallet_or_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("hyp_cash_wallet_or_cash_international", $data['idConfig']);
// $data['plr_hyp_cash_wallet_or_cash_national'] = $this->wallet_model->getPalierCommissionsWallet("hyp_cash_wallet_or_cash_national", $data['idConfig']);
// $data['plr_hyp_cash_wallet_or_cash_international'] = $this->wallet_model->getPalierCommissionsWallet("hyp_cash_wallet_or_cash_international", $data['idConfig']);
$data['plr_agent_depot_wallet_ilink'] = $this->wallet_model->getPalierConfigWallet("agent_depot_wallet_ilink_international" , $data['idConfig']);
$data['plr_agent_depot_autre_wallet'] = $this->wallet_model->getPalierConfigWallet("agent_depot_autre_wallet_international" , $data['idConfig']);

View File

@ -308,18 +308,18 @@ $lang['rate'] = 'Rate';
$lang ['rate_com_user_wallet_wallet_international'] = 'Wallet user commission rate to foreign country wallet';
$lang ['rate_com_user_wallet_wallet_national'] = 'Wallet user commission rate to national wallet';
$lang ['new_level'] = 'New level';
$lang ['rate_com_user_wallet_cash_international'] = 'Wallet user commission rate for foreign country cash';
$lang ['rate_com_user_wallet_cash_national'] = 'Wallet user commission rate with national cash';
$lang['rate_com_user_wallet_cash_international'] = "Customer commission rate on wallet send and cash withdrawal transaction to foreign country";
$lang['rate_com_user_wallet_cash_national'] = "Customer commission rate on domestic wallet cash sending and withdrawal";
$lang['rate_com_user_wallet_cart_national'] = 'Customer commission rate on domestic wallet-to-card transactions';
$lang['rate_com_user_wallet_cart_international'] = 'Customer commission rate on foreign wallet card transaction';
$lang['rate_com_user_cart_wallet_international'] = "Customer commission rate on international wallet card transaction";
$lang['rate_com_user_cart_wallet_national'] = "Customer commission rate on domestic wallet card transaction";
$lang['rate_com_user_cart_cash_international'] = 'International cash card user commission rate';
$lang['rate_com_user_cart_cash_national'] = 'National cash card user commission rate';
$lang ['rate_com_agent_depot_wallet_national'] = 'Agent depot commission rate to national iLink wallet';
$lang ['rate_com_agent_depot_wallet_international'] = 'Commission rate agent deposit to foreign iLink wallet';
$lang ['rate_com_agent_depot_autre_wallet_national'] = 'Agent depot commission rate to national other wallet';
$lang ['rate_com_agent_depot_autre_wallet_international'] = 'Commission rate agent deposit to foreign other wallet';
$lang['rate_com_agent_depot_wallet_national'] = "Customer commission rate for sending cash to domestic iLink wallet";
$lang['rate_com_agent_depot_wallet_international'] = "Customer commission rate for sending cash to foreign iLink wallet";
$lang['rate_com_agent_depot_other_wallet_national'] = "Customer commission rate for sending cash to other domestic wallet";
$lang['rate_com_agent_depot_other_wallet_international'] = "Customer's commission rate for sending cash to other foreign wallet";
$lang['rate_com_agent_depot_cash_cart_international'] = "Customer commission rate for sending cash to international card";
$lang['rate_com_agent_depot_cash_cart_national'] = "Customer commission rate on cash-to-card transactions";
$lang ['rate_com_agent_cash_cash_national'] = 'Agent commission rate sending cash to national cash';
@ -334,8 +334,8 @@ $lang['rate_com_agent_wallet_cash_international'] = "Geolocated agent's commissi
$lang['rate_com_agent_wallet_cash_national'] = "Geolocated agent's commission rate on national cash withdrawal operation";
$lang['rate_com_sup_wallet_cash_international'] = "Supervisor's commission rate on international cash withdrawal operation";
$lang['rate_com_sup_wallet_cash_national'] = "Supervisor's commission rate on national cash withdrawal operation";
$lang['rate_com_hyp_wallet_cash_international'] = "Hypervisor commission rate on international cash withdrawal operation";
$lang['rate_com_hyp_wallet_cash_national'] = "Hypervisor commission rate on national cash withdrawal operation";
$lang['rate_com_customer_remove_cash_international'] = "Customer commission rate on international cash withdrawal operation";
$lang['rate_com_customer_remove_cash_national'] = "Customer commission rate on national cash withdrawal operation";
$lang['rate_com_agent_depot_cart_international'] = "Geolocated agent's commission rate on international card deposit";
$lang['rate_com_agent_depot_cart_national'] = "Geolocated agent's commission rate on national card deposit operation";
$lang['rate_com_sup_depot_cart_international'] = "Supervisor commission rate on international card deposit transactions";

View File

@ -320,21 +320,21 @@
$lang['rate_com_user_wallet_wallet_international'] = 'Taux de commission du client sur opération d\'envoi de wallet à wallet pays étranger';
$lang['rate_com_user_wallet_wallet_national'] = 'Taux de commission du client sur opération d\'envoi de wallet à wallet national';
$lang['new_level'] = 'Nouveau palier';
$lang['rate_com_user_wallet_cash_international'] = 'Taux de commission du client sur opération d\'envoi de wallet à cash pays étranger';
$lang['rate_com_user_wallet_cash_national'] = 'Taux de commission du client sur opération d\'envoi de wallet à cash national';
$lang['rate_com_user_wallet_cash_international'] = "Taux de commission du client sur opération d'envoi et retrait de wallet à cash pays étranger";
$lang['rate_com_user_wallet_cash_national'] = "Taux de commission du client sur opération d'envoi et retrait de wallet à cash national";
$lang['rate_com_user_wallet_cart_national'] = 'Taux de commission du client sur opération d\'envoi de wallet à carte national';
$lang['rate_com_user_wallet_cart_international'] = 'Taux de commission du client sur opération d\'envoi de wallet à carte étranger';
$lang['rate_com_user_cart_wallet_international'] = "Taux de commission du client sur opération d'envoi de carte à wallet international";
$lang['rate_com_user_cart_wallet_national'] = "Taux de commission du client sur opération d'envoi de carte à wallet national";
$lang['rate_com_user_cart_cash_international'] = 'Taux de commission utilisateur carte à cash international';
$lang['rate_com_user_cart_cash_national'] = 'Taux de commission utilisateur carte à cash national';
$lang['rate_com_agent_depot_wallet_national'] = 'Taux de commission du client sur opération d\'envoi vers wallet iLink national';
$lang['rate_com_agent_depot_wallet_international'] = 'Taux de commission du client sur opération d\'envoi vers wallet iLink étranger';
$lang['rate_com_agent_depot_autre_wallet_national'] = 'Taux de commission du client sur opération d\'envoi vers autre wallet national';
$lang['rate_com_agent_depot_autre_wallet_international'] = 'Taux de commission du client sur opération d\'envoi vers autre wallet étranger';
$lang['rate_com_agent_depot_wallet_national'] = "Taux de commission du client sur opération d'envoi de cash vers wallet iLink national";
$lang['rate_com_agent_depot_wallet_international'] = "Taux de commission du client sur opération d'envoi de cash vers wallet iLink étranger";
$lang['rate_com_agent_depot_autre_wallet_national'] = "Taux de commission du client sur opération d'envoi de cash vers autre wallet national";
$lang['rate_com_agent_depot_autre_wallet_international'] = "Taux de commission du client sur opération d'envoi de cash vers autre wallet étranger";
$lang['rate_com_agent_depot_cash_cart_international'] = "Taux de commission du client sur opération d'envoi de cash vers carte international";
$lang['rate_com_agent_depot_cash_cart_national'] = "Taux de commission du client sur opération d'envoi de cash vers carte national";
$lang['rate_com_agent_cash_cash_national'] = 'Taux de commission du client sur opération d\'envoi de cash vers cash national';
$lang['rate_com_agent_cash_cash_national'] = "Taux de commission du client sur opération d'envoi cash vers cash national";
$lang['rate_com_agent_cash_cash_international'] = 'Taux de commission du client sur opération d\'envoi cash vers cash pays étranger';
$lang['rate_com_agent_send_cash_international'] = "Taux de commission de l'agent géolocalisé sur operation d'envoi d'argent international";
$lang['rate_com_agent_send_cash_national'] = "Taux de commission de l'agent géolocalisé sur operation d'envoi d'argent national";
@ -346,8 +346,8 @@
$lang['rate_com_agent_wallet_cash_national'] = "Taux de commission de l'agent géolocalisé sur operation de retrait d'argent national";
$lang['rate_com_sup_wallet_cash_international'] = "Taux de commission du superviseur sur operation de retrait d'argent international";
$lang['rate_com_sup_wallet_cash_national'] = "Taux de commission du superviseur sur operation de retrait d'argent national";
$lang['rate_com_hyp_wallet_cash_international'] = "Taux de commission de l'hyperviseur sur operation de retrait d'argent international";
$lang['rate_com_hyp_wallet_cash_national'] = "Taux de commission de l'hyperviseur sur operation de retrait d'argent national";
$lang['rate_com_customer_remove_cash_international'] = "Taux de commission du client sur operation de retrait d'argent international";
$lang['rate_com_customer_remove_cash_national'] = "Taux de commission du client sur operation de retrait d'argent national";
$lang['rate_com_agent_depot_cart_international'] = "Taux de commission de l'agent géolocalisé sur operation de depot vers carte international";
$lang['rate_com_agent_depot_cart_national'] = "Taux de commission de l'agent géolocalisé sur operation de depot vers carte national";
$lang['rate_com_sup_depot_cart_international'] = "Taux de commission superviseur sur operation de depot vers carte international";

View File

@ -64,6 +64,72 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
</div>
</div>
<div class="row" style="display:flex; justify-content: center">
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_customer_remove_cash_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_customer_wallet_cash_international) {
foreach ($plr_customer_wallet_cash_international->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_customer_remove_cash_national'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_customer_wallet_cash_national) {
foreach ($plr_customer_wallet_cash_national->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
@ -128,8 +194,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
<!-- /.box-body -->
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
@ -194,70 +258,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
<!-- /.box-body -->
</div>
</div>
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_hyp_wallet_cash_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_hyp_wallet_cash_international) {
foreach ($plr_hyp_wallet_cash_international->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_hyp_wallet_cash_national'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_hyp_wallet_cash_national) {
foreach ($plr_hyp_wallet_cash_national->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
</div>
</div>
<div class="modal fade" id="modal-update">
<div class="modal-dialog" style="max-width: 1300px; width: 100%;">
@ -271,6 +271,100 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
<div class="modal-body">
<form id="walletForm">
<div class="row" style="display:flex; justify-content: center">
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_customer_remove_cash_international'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new72"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="customer_wallet_cash_international" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_customer_wallet_cash_international) {
foreach ($plr_customer_wallet_cash_international->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add72" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit72" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete72" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_customer_remove_cash_national'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new7"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="customer_wallet_cash_national" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_customer_wallet_cash_national) {
foreach ($plr_customer_wallet_cash_national->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add7" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
@ -363,8 +457,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
@ -457,98 +549,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
</table>
</div>
</div>
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_hyp_wallet_cash_international'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new72"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="hyp_wallet_cash_international" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_hyp_wallet_cash_international) {
foreach ($plr_hyp_wallet_cash_international->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add72" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit72" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete72" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_hyp_wallet_cash_national'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new7"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="hyp_wallet_cash_national" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_hyp_wallet_cash_national) {
foreach ($plr_hyp_wallet_cash_national->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add7" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</form>
</div>
@ -603,11 +603,11 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
// Paliers
let plr_agent_wallet_cash_national = getPaliersTable('agent_wallet_cash_national');
let plr_sup_wallet_cash_national = getPaliersTable('sup_wallet_cash_national');
let plr_hyp_wallet_cash_national = getPaliersTable('hyp_wallet_cash_national');
let plr_customer_wallet_cash_national = getPaliersTable('customer_wallet_cash_national');
let plr_agent_wallet_cash_international = getPaliersTable('agent_wallet_cash_international');
let plr_sup_wallet_cash_international = getPaliersTable('sup_wallet_cash_international');
let plr_hyp_wallet_cash_international = getPaliersTable('hyp_wallet_cash_international');
let plr_customer_wallet_cash_international = getPaliersTable('customer_wallet_cash_international');
$.ajax({
url: '<?= base_url('Gestion/config_wallet/update')?>',
@ -619,10 +619,10 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
"network_id": network_id, "id_config": id_config,
"plr_agent_wallet_cash_national": plr_agent_wallet_cash_national,
"plr_sup_wallet_cash_national": plr_sup_wallet_cash_national,
"plr_hyp_wallet_cash_national": plr_hyp_wallet_cash_national,
"plr_customer_wallet_cash_national": plr_customer_wallet_cash_national,
"plr_agent_wallet_cash_international": plr_agent_wallet_cash_international,
"plr_sup_wallet_cash_international": plr_sup_wallet_cash_international,
"plr_hyp_wallet_cash_international": plr_hyp_wallet_cash_international,
"plr_customer_wallet_cash_international": plr_customer_wallet_cash_international,
},
success: function (data) {
if (data == '200') {
@ -838,7 +838,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
// Paliers nationaux
// Table 7
var actions7 = $("#hyp_wallet_cash_national td:last-child").html();
var actions7 = $("#customer_wallet_cash_national td:last-child").html();
// Append table with add row form on add new button click
$(".new7").click(function () {
if (!actions7) {
@ -847,7 +847,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
' <a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#hyp_wallet_cash_national tbody tr:last-child").index();
var index = $("#customer_wallet_cash_national tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
@ -855,8 +855,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
'<td> ' + actions7 + '</td>' +
'</tr>';
$("#hyp_wallet_cash_national").append(row);
$("#hyp_wallet_cash_national tbody tr").eq(index + 1).find(".add7, .edit7").toggle();
$("#customer_wallet_cash_national").append(row);
$("#customer_wallet_cash_national tbody tr").eq(index + 1).find(".add7, .edit7").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
@ -1104,7 +1104,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
// Paliers nationaux
// Table 7
var actions72 = $("#hyp_wallet_cash_international td:last-child").html();
var actions72 = $("#customer_wallet_cash_international td:last-child").html();
// Append table with add row form on add new button click
$(".new72").click(function () {
if (!actions72) {
@ -1113,7 +1113,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
' <a class="delete delete72" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#hyp_wallet_cash_international tbody tr:last-child").index();
var index = $("#customer_wallet_cash_international tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
@ -1121,8 +1121,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
'<td> ' + actions72 + '</td>' +
'</tr>';
$("#hyp_wallet_cash_international").append(row);
$("#hyp_wallet_cash_international tbody tr").eq(index + 1).find(".add72, .edit72").toggle();
$("#customer_wallet_cash_international").append(row);
$("#customer_wallet_cash_international tbody tr").eq(index + 1).find(".add72, .edit72").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click

View File

@ -62,8 +62,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
</div>
</div>
</div>
<div class="row" style="display:flex; justify-content: center">
<div class="row">
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
@ -128,8 +128,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
<!-- /.box-body -->
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
@ -194,70 +192,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
<!-- /.box-body -->
</div>
</div>
<div class="col-lg-6 col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_hyp_send_cash_international'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_hyp_cash_wallet_or_cash_international) {
foreach ($plr_hyp_cash_wallet_or_cash_international->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('rate_com_hyp_send_cash_national'); ?></h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive" style="overflow-x:auto;">
<table class="table table-hover">
<tbody>
<tr>
<th>Min</th>
<th>Max</th>
<th>Taux (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
</tr>
<?php
if ($plr_hyp_cash_wallet_or_cash_national) {
foreach ($plr_hyp_cash_wallet_or_cash_national->result() as $row) {
echo "<tr>
<td>" . $fmt->format($row->min) . "</td>
<td>" . $fmt->format($row->max) . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
</tr>';
}
}
?>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
</div>
</div>
<div class="row centered">
@ -468,7 +402,7 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
</div>
<div class="modal-body">
<form id="walletForm">
<div class="row" style="display:flex; justify-content: center">
<div class="row">
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
@ -561,8 +495,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
@ -655,98 +587,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
</table>
</div>
</div>
<div class="col-lg-6">
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_hyp_send_cash_international'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new72"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="hyp_cash_wallet_or_cash_international" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_hyp_cash_wallet_or_cash_international) {
foreach ($plr_hyp_cash_wallet_or_cash_international->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add72" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit72" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete72" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
<div class="form-group" style="overflow-x:auto;">
<div class="table-title">
<div class="row">
<div class="col-sm-8">
<label for="nom"
class="col-form-label"><?= $this->lang->line('rate_com_hyp_send_cash_national'); ?></label>
</div>
<div class="col-sm-4">
<button type="button" class="btn btn-info add-new new7"><i
class="fa fa-plus"></i> <?= $this->lang->line('new_level'); ?>
</button>
</div>
</div>
</div>
<table id="hyp_cash_wallet_or_cash_national" class="table table-bordered">
<thead>
<tr>
<th>Min</th>
<th>Max</th>
<th><?= $this->lang->line('rate'); ?> (%)</th>
<th><?= $this->lang->line('ceiling')?></th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
if ($plr_hyp_cash_wallet_or_cash_national) {
foreach ($plr_hyp_cash_wallet_or_cash_national->result() as $row) {
echo "<tr>
<td>" . $row->min . "</td>
<td>" . $row->max . "</td>
<td>" . $row->taux . "</td>
<td>" . (isset($row->plafond) ? floatval($row->plafond) : '') . "</td>" . '
<td>
<a class="add add7" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE03B;</i></a>
<a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>
<a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>
</td>
</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
@ -1081,11 +921,11 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
// Paliers commissions
let plr_agent_cash_wallet_or_cash_national = getPaliersTable('agent_cash_wallet_or_cash_national');
let plr_sup_cash_wallet_or_cash_national = getPaliersTable('sup_cash_wallet_or_cash_national');
let plr_hyp_cash_wallet_or_cash_national = getPaliersTable('hyp_cash_wallet_or_cash_national');
// let plr_hyp_cash_wallet_or_cash_national = getPaliersTable('hyp_cash_wallet_or_cash_national');
let plr_agent_cash_wallet_or_cash_international = getPaliersTable('agent_cash_wallet_or_cash_international');
let plr_sup_cash_wallet_or_cash_international = getPaliersTable('sup_cash_wallet_or_cash_international');
let plr_hyp_cash_wallet_or_cash_international = getPaliersTable('hyp_cash_wallet_or_cash_international');
// let plr_hyp_cash_wallet_or_cash_international = getPaliersTable('hyp_cash_wallet_or_cash_international');
// Paliers
var plr_agent_depot_wallet_ilink = getPaliersTable('agent_depot_wallet');
@ -1112,10 +952,8 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
"plr_agent_cash_cash_national": plr_agent_cash_cash_national,
"plr_agent_cash_wallet_or_cash_national": plr_agent_cash_wallet_or_cash_national,
"plr_sup_cash_wallet_or_cash_national": plr_sup_cash_wallet_or_cash_national,
"plr_hyp_cash_wallet_or_cash_national": plr_hyp_cash_wallet_or_cash_national,
"plr_agent_cash_wallet_or_cash_international": plr_agent_cash_wallet_or_cash_international,
"plr_sup_cash_wallet_or_cash_international": plr_sup_cash_wallet_or_cash_international,
"plr_hyp_cash_wallet_or_cash_international": plr_hyp_cash_wallet_or_cash_international,
},
success: function (data) {
if (data == '200') {
@ -1854,95 +1692,6 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$(".new1").removeAttr("disabled");
});
// Paliers nationaux
// Table 7
var actions7 = $("#hyp_cash_wallet_or_cash_national td:last-child").html();
// Append table with add row form on add new button click
$(".new7").click(function () {
if (!actions7) {
actions7 = '<a class="add add7" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE07B;</i></a>\n' +
' <a class="edit edit7" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete7" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#hyp_cash_wallet_or_cash_national tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
'<td><input type="number" required step="any" class="form-control" name="taux" id="taux"></td>' +
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
'<td> ' + actions7 + '</td>' +
'</tr>';
$("#hyp_cash_wallet_or_cash_national").append(row);
$("#hyp_cash_wallet_or_cash_national tbody tr").eq(index + 1).find(".add7, .edit7").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add7", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
input.each(function () {
if ($(this).attr('id') == 'min') {
if (min >= max) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else if ($(this).attr('id') == 'max') {
if (max <= min) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else {
if (!$(this)[0].checkValidity()) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
}
});
$(this).parents("tr").find(".error").first().focus();
if (!empty) {
input.each(function () {
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add7, .edit7").toggle();
$(".new7").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit7", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
if (index == 1)
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
if (index == 2)
$(this).html('<input type="number" required class="form-control" step="any" min="0" value="' + $(this).text() + '">');
if (index == 3)
$(this).html('<input type="number" class="form-control" min="1" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add7, .edit7").toggle();
$(".new7").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete7", function () {
$(this).parents("tr").remove();
$(".new7").removeAttr("disabled");
});
/**
* INTERNATIONAUX
*/
@ -2120,93 +1869,5 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
$(".new12").removeAttr("disabled");
});
// Paliers nationaux
// Table 7
var actions72 = $("#hyp_cash_wallet_or_cash_international td:last-child").html();
// Append table with add row form on add new button click
$(".new72").click(function () {
if (!actions72) {
actions72 = '<a class="add add72" title="Add" data-toggle="tooltip"><i class="material-icons">&#xE07B;</i></a>\n' +
' <a class="edit edit72" title="Edit" data-toggle="tooltip"><i class="material-icons">&#xE254;</i></a>\n' +
' <a class="delete delete72" title="Delete" data-toggle="tooltip"><i class="material-icons">&#xE872;</i></a>';
}
$(this).attr("disabled", "disabled");
var index = $("#hyp_cash_wallet_or_cash_international tbody tr:last-child").index();
var row = '<tr>' +
'<td><input type="number" required min="0" class="form-control" name="min" id="min"></td>' +
'<td><input type="number" required class="form-control" name="max" id="max"></td>' +
'<td><input type="number" required step="any" class="form-control" name="taux" id="taux"></td>' +
'<td><input type="number" min="1" class="form-control" name="plafond" id="plafond"></td>' +
'<td> ' + actions72 + '</td>' +
'</tr>';
$("#hyp_cash_wallet_or_cash_international").append(row);
$("#hyp_cash_wallet_or_cash_international tbody tr").eq(index + 1).find(".add72, .edit72").toggle();
$('[data-toggle="tooltip"]').tooltip();
});
// Add row on add button click
$(document).on("click", ".add72", function () {
var empty = false;
var input = $(this).parents("tr").find('input[type="number"]');
var min = parseFloat($(this).parents("tr").find('input[id="min"]').first().val());
var max = parseFloat($(this).parents("tr").find('input[id="max"]').first().val());
input.each(function () {
if ($(this).attr('id') == 'min') {
if (min >= max) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else if ($(this).attr('id') == 'max') {
if (max <= min) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
} else {
if (!$(this)[0].checkValidity()) {
$(this).addClass("error");
$(this)[0].reportValidity();
empty = true;
} else {
$(this).removeClass("error");
}
}
});
$(this).parents("tr").find(".error").first().focus();
if (!empty) {
input.each(function () {
$(this).parent("td").html($(this).val());
});
$(this).parents("tr").find(".add72, .edit72").toggle();
$(".new72").removeAttr("disabled");
}
});
// Edit row on edit button click
$(document).on("click", ".edit72", function () {
$(this).parents("tr").find("td:not(:last-child)").each(function (index) {
if (index == 0)
$(this).html('<input type="number" required class="form-control" min="0" id="min" value="' + $(this).text() + '">');
if (index == 1)
$(this).html('<input type="number" required class="form-control" id="max" value="' + $(this).text() + '">');
if (index == 2)
$(this).html('<input type="number" required class="form-control" step="any" min="0" value="' + $(this).text() + '">');
if (index == 3)
$(this).html('<input type="number" class="form-control" min="1" value="' + $(this).text() + '">');
});
$(this).parents("tr").find(".add7, .edit7").toggle();
$(".new72").attr("disabled", "disabled");
});
// Delete row on delete button click
$(document).on("click", ".delete72", function () {
$(this).parents("tr").remove();
$(".new72").removeAttr("disabled");
});
});
</script>