@@ -226,79 +174,48 @@
$(document).on("click", ".openModal", function () {
network_id = $(this).data('network-id');
- });
+ })
- $('#addWallet').click(function(){
+ $(document).on("click", ".enableWallet", function () {
+ const network_id = $(this).data('network-id');
+ $.ajax({
+ url : '',
+ type : 'POST',
+ dataType : 'json',
+ data: {"network_id": network_id},
+ success : function(data){
+ if(data=='200'){
- if($('#walletForm')[0].checkValidity()) {
- var taux_client_r = parseFloat($('#taux_client_r').val());
- var taux_client_d = parseFloat($('#taux_client_d').val());
- var taux_ag_r = parseFloat($('#taux_ag_r').val());
- var taux_ag_d = parseFloat($('#taux_ag_d').val());
- var taux_sup_r = parseFloat($('#taux_sup_r').val());
- var taux_sup_d = parseFloat($('#taux_sup_d').val());
- var taux_bq_d = parseFloat($('#taux_bq_d').val());
- var taux_bq_r = parseFloat($('#taux_bq_r').val());
- var frais_d =$('#frais_d').val();
-
- var sommeRetrait = taux_ag_r + taux_sup_r +taux_bq_r ;
- var sommeDepot = taux_ag_d + taux_sup_d + taux_bq_d ;
-
- if((taux_ag_r + taux_sup_r) > 100){
- toastr.error("lang->line('first_rule')?>", "lang->line('management_rule')?>");
- }else if((taux_ag_d + taux_sup_d) > 100){
- toastr.error("lang->line('second_rule')?>", "lang->line('management_rule')?>");
- }else if(sommeRetrait >= taux_client_r){
- toastr.error("lang->line('third_rule')?>", "lang->line('management_rule')?>")
- }else if(sommeDepot >= 100){
- toastr.error("lang->line('fourth_rule')?>", "lang->line('management_rule')?>");
- }else{
- $.ajax({
- url : '',
- type : 'POST',
- dataType : 'json',
- data: {"network_id": network_id ,"taux_client_r": taux_client_r, "taux_client_d": taux_client_d,"taux_ag_r": taux_ag_r, "taux_ag_d": taux_ag_d , "taux_sup_r": taux_sup_r , "taux_sup_d": taux_sup_d,
- "taux_bq_r": taux_bq_r, "taux_bq_d":taux_bq_d, "frais_d": frais_d},
- success : function(data){
- if(data=='200'){
-
- Swal.fire({
- icon: 'success',
- title: "lang->line('wallet_created')?>",
- text: "lang->line('informations_updated')?>",
- timer: 3000
- }).then(()=>{
- location.reload();
- });
- // alert("Les informations ont été mises à jour.") ? "" :
- }else{
- toastr.error("lang->line('error_message')?>" , "lang->line('request_error')?>");
- }
- },
- error : function(resultat, statut, error){
- console.log(resultat+" "+error );
- toastr.error("lang->line('error_message')?>" , "lang->line('request_error')?>");
- }
- }).done(function () {
- $.ajax({
- url : '',
- type : 'POST',
- dataType : 'json',
- data : {"network_id": network_id},
- async : true ,
- timeout : 0,
- success : function () {
- console.log("All wallets are generated");
- }
+ Swal.fire({
+ icon: 'success',
+ title: "lang->line('wallet_created')?>",
+ text: "lang->line('informations_updated')?>",
+ timer: 3000
+ }).then(()=>{
+ location.reload();
});
- });
+ // alert("Les informations ont été mises à jour.") ? "" :
+ }else{
+ toastr.error("lang->line('error_message')?>" , "lang->line('request_error')?>");
+ }
+ },
+ error : function(resultat, statut, error){
+ console.log(resultat+" "+error );
+ toastr.error("lang->line('error_message')?>" , "lang->line('request_error')?>");
}
-
- }else {
- $('#walletForm')[0].reportValidity();
- }
-
-
+ }).done(function () {
+ $.ajax({
+ url : '',
+ type : 'POST',
+ dataType : 'json',
+ data : {"network_id": network_id},
+ async : true ,
+ timeout : 0,
+ success : function () {
+ console.log("All wallets are generated");
+ }
+ });
+ });
});
$('#deleteWallet').click(function(){
diff --git a/application/views/header_gestion.php b/application/views/header_gestion.php
index a3b2d3e3..94eea329 100644
--- a/application/views/header_gestion.php
+++ b/application/views/header_gestion.php
@@ -147,11 +147,6 @@
Wallet
-
">
-
- lang->line('menu_wallet_password'); ?>
-
-
@@ -49,7 +49,7 @@
lang->line('Période') ?>
@@ -160,6 +160,7 @@
$(function () {
const lang = $('#picker').data('lang');
+ const category = $('#picker').data('category');
$('input[name="daterange"]').daterangepicker({
opens: 'left',
autoUpdateInput: false,
@@ -170,14 +171,20 @@
}, function (start, end, label) {
const debut = start.format('YYYY-MM-DD');
const fin = end.format('YYYY-MM-DD');
- window.location = "" + "?id=118&history=recharge" + "&d=" + debut + "&f=" + fin;
+ if(category)
+ window.location = "" + "?history=recharge" + "&d=" + debut + "&f=" + fin;
+ else
+ window.location = "" + "?id=118&history=recharge" + "&d=" + debut + "&f=" + fin;
});
$('input[name="daterange"]').on('cancel.daterangepicker', function(ev, picker) {
//do something, like clearing an input
$('#daterange').val('');
- window.location = "" + "?id=118&history=recharge";
+ if(category)
+ window.location = "" + "?history=recharge";
+ else
+ window.location = "" + "?id=118&history=recharge";
});
});
diff --git a/application/views/historique_transactions.php b/application/views/historique_transactions.php
index c1df7543..67228c6f 100755
--- a/application/views/historique_transactions.php
+++ b/application/views/historique_transactions.php
@@ -9,7 +9,7 @@