- Upgrade to php8.0

- Enable recharge account in Nano Santé hypervisor
This commit is contained in:
Djery-Tom 2023-06-07 20:53:49 +01:00
parent cd821e567b
commit c3c26f4852
18 changed files with 201 additions and 241 deletions

View File

@ -144,9 +144,9 @@ class Admin_dash extends CI_Controller
$agent_id = $this->session->userdata('current_hyper_id');
$taux = $data['hasWallet']->first_row();
$taux = $data['hasWallet'];
$data['idConfig'] = $taux->id;
if ($data['hasWallet']->first_row()->type == 'visa') {
if ($data['hasWallet']?->type == 'visa') {
$data['taux_client_r'] = $taux->taux_com_client_retrait;
$data['taux_client_d'] = $taux->taux_com_client_depot;
$data['taux_ag_r'] = $taux->taux_com_ag_retrait;
@ -179,7 +179,7 @@ class Admin_dash extends CI_Controller
}
$data["totalCommissionBanque"] = Money::of(round($totalCommissionBanque,2), $this->session->userdata('currency_code'), $context )->formatTo('fr_FR');
} elseif ($data['hasWallet']->first_row()->type == 'ilink') {
} elseif ($data['hasWallet']?->type == 'ilink') {
$transactions = $this->wallet_model->getNetworkIlinTransactions($id_network);
$data["transactions"] = array();
@ -226,9 +226,9 @@ class Admin_dash extends CI_Controller
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('current_hyper_member_code'));
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
$this->load->view('header', $data);
if ($data['hasWallet']->first_row()->type == 'visa')
if ($data['hasWallet']?->type == 'visa')
$this->load->view('gestion_wallet_hyp');
elseif ($data['hasWallet']->first_row()->type == 'ilink')
elseif ($data['hasWallet']?->type == 'ilink')
$this->load->view('gestion_wallet_ilink_hyp');
$this->load->view('footer');
}
@ -347,7 +347,7 @@ class Admin_dash extends CI_Controller
$data['currency_code'] = $this->session->userdata('currency_code');
$data['category'] = $this->session->userdata('category');
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$data['network_id'] = $this->session->userdata('current_network_id');
if (isset($country)) {
$data['country_id'] = $country;
@ -395,7 +395,7 @@ class Admin_dash extends CI_Controller
$data['countries'][] = $country;
}
}
$taux = $data['hasWallet']->first_row();
$taux = $data['hasWallet'];
switch($config){
case 'paying_networks':
$this->load->view('header', $data);
@ -519,7 +519,7 @@ class Admin_dash extends CI_Controller
$data['currency_code'] = $this->session->userdata('currency_code');
$data['category'] = $this->session->userdata('category');
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$res = $this->wallet_model->getWalletPassword($this->session->userdata('current_network_id'));
$data['walletPassword'] = $res ? $res->first_row() : null;
$data['networks'] = $this->wallet_model->getPayingNetworksByConfigWallet($data['idConfig']);
@ -562,7 +562,7 @@ class Admin_dash extends CI_Controller
} else {
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
$data['groups'] = $this->nano_credit_model->getUsersGroups($this->session->userdata('current_network_id'));
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$data['rates'] = $this->nano_credit_model->getNanoCreditRates($data['idConfig']);
$data['taxes'] = $this->wallet_model->getTaxes($data['idConfig'], 'nano_credit');
$data['active'] = "nano_credit";
@ -578,7 +578,7 @@ class Admin_dash extends CI_Controller
$data['network_id'] = $this->session->userdata('current_network_id');
$data['country'] = $this->session->userdata('name_current_pays');
$data['currency_code'] = $this->session->userdata('currency_code');
$data['configWallet'] = $data['hasWallet']->first_row();
$data['configWallet'] = $data['hasWallet'];
$this->load->view('header', $data);
$this->load->view('nano_credit/gestion_nano_credit_hyp');
@ -606,10 +606,10 @@ class Admin_dash extends CI_Controller
$data['currency_code'] = $this->session->userdata('currency_code');
$data['category'] = $this->session->userdata('category');
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
switch ($config) {
case 'nano_credit':
$taux = $data['hasWallet']->first_row();
$taux = $data['hasWallet'];
$data['taux_ag_nano_credit'] = $taux->taux_com_ag_nano_credit;
$data['taux_sup_nano_credit'] = $taux->taux_com_sup_nano_credit;
$data['taux_hyp_nano_credit'] = $taux->taux_com_hyp_nano_credit;

View File

@ -63,7 +63,7 @@ class Hyperviseur_dash extends CI_Controller
$data['active'] = "geolocated";
$data['total_points'] = $this->user_model->getCoutGeolocatedUsersForHyper($this->session->userdata('member_code'), $this->session->userdata('current_ville'));
$data['map_title'] = $this->lang->line($data['hasWallet']->first_row()->type == 'ilink_sante' ? 'service_providers_to' :'utilisateurs géolocalisés à') . " " . $this->session->userdata('current_ville');
$data['map_title'] = $this->lang->line($data['hasWallet']?->type == 'ilink_sante' ? 'service_providers_to' :'utilisateurs géolocalisés à') . " " . $this->session->userdata('current_ville');
$data['positions'] = $this->user_model->getUsersGeolocatedPositionByVilleForHyp($this->session->userdata('current_ville'), $this->session->userdata('member_code'));
$data['latitude'] = $this->session->userdata('latitude');
$data['longitude'] = $this->session->userdata('longitude');
@ -78,7 +78,7 @@ class Hyperviseur_dash extends CI_Controller
$data['alert'] = "";
if($data['hasWallet']->first_row()->type == 'ilink_sante'){
if($data['hasWallet']?->type == 'ilink_sante'){
$nh_config = $this->nano_health_model->getConfig($data['network_id']);
$data['nh_config'] = $nh_config ? $nh_config->first_row() : null ;
$data['provider_classes'] = $this->nano_health_model->getProviderClasses($data['nh_config'] ? $data['nh_config']->id : null);
@ -453,9 +453,9 @@ class Hyperviseur_dash extends CI_Controller
$agent_id = $this->session->userdata('agent_id');
$taux = $data['hasWallet']->first_row();
$taux = $data['hasWallet'];
$data['idConfig'] = $taux->id;
if ($data['hasWallet']->first_row()->type == 'visa') {
if ($data['hasWallet']?->type == 'visa') {
$data['taux_client_r'] = $taux->taux_com_client_retrait;
$data['taux_client_d'] = $taux->taux_com_client_depot;
$data['taux_ag_r'] = $taux->taux_com_ag_retrait;
@ -491,7 +491,7 @@ class Hyperviseur_dash extends CI_Controller
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code'));
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
} else if ($data['hasWallet']->first_row()->type == 'ilink') {
} else if ($data['hasWallet']?->type == 'ilink') {
$transactions = $this->wallet_model->getNetworkIlinTransactions($id_network);
$data["transactions"] = array();
@ -507,7 +507,7 @@ class Hyperviseur_dash extends CI_Controller
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code'));
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
}else if($data['hasWallet']->first_row()->type == 'ilink_sante'){
}else if($data['hasWallet']?->type == 'ilink_sante'){
$nh_config = $this->nano_health_model->getConfig($id_network);
$data['nh_config'] = $nh_config ? $nh_config->first_row() : null ;
$data['config_id'] = $data['nh_config'] ? $data['nh_config']->id : null ;
@ -537,11 +537,11 @@ class Hyperviseur_dash extends CI_Controller
$data['currency_code'] = $this->session->userdata('currency_code');
$this->load->view('header_hyp', $data);
if ($data['hasWallet']->first_row()->type == 'visa')
if ($data['hasWallet']?->type == 'visa')
$this->load->view('gestion_wallet_hyp');
elseif ($data['hasWallet']->first_row()->type == 'ilink')
elseif ($data['hasWallet']?->type == 'ilink')
$this->load->view('gestion_wallet_ilink_hyp');
elseif ($data['hasWallet']->first_row()->type == 'ilink_sante')
elseif ($data['hasWallet']?->type == 'ilink_sante')
$this->load->view('nano_health/hyper/gestion_wallet');
$this->load->view('footer');
}
@ -1010,14 +1010,14 @@ class Hyperviseur_dash extends CI_Controller
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$data['country'] = $this->session->userdata('current_pays');
$data['network_id'] = $this->session->userdata('network_id');
$data['countries'] = $this->wallet_model->getWalletsCountries();
$showResult = false;
$frais = 0;
$taxe = 0;
$config = $data['hasWallet']->first_row();
$config = $data['hasWallet'];
//Simulateur
$com_ag = $this->session->userdata('com_ag') ? $this->session->userdata('com_ag') : 0 ;
@ -1354,7 +1354,7 @@ class Hyperviseur_dash extends CI_Controller
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$data['country'] = $this->session->userdata('current_pays');
$data['category'] = $this->session->userdata('category');
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$data['network_id'] = $this->session->userdata('network_id');
$data['currency_code'] = $this->session->userdata('currency_code');
if (isset($country)) {
@ -1403,7 +1403,7 @@ class Hyperviseur_dash extends CI_Controller
$data['countries'][] = $country;
}
}
$taux = $data['hasWallet']->first_row();
$taux = $data['hasWallet'];
switch($config){
case 'paying_networks':
$this->load->view('header_hyp', $data);
@ -1543,7 +1543,7 @@ class Hyperviseur_dash extends CI_Controller
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$data['country'] = $this->session->userdata('current_pays');
$data['category'] = $this->session->userdata('category');
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$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']);
@ -1586,7 +1586,7 @@ class Hyperviseur_dash extends CI_Controller
} else {
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$data['groups'] = $this->nano_credit_model->getUsersGroups($this->session->userdata('network_id'));
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$data['rates'] = $this->nano_credit_model->getNanoCreditRates($data['idConfig']);
$data['taxes'] = $this->wallet_model->getTaxes($data['idConfig'], 'nano_credit');
$data['active'] = "nano_credit";
@ -1594,7 +1594,7 @@ class Hyperviseur_dash extends CI_Controller
$data['network'] = $this->session->userdata('network');
$data['country'] = $this->session->userdata('current_pays');
$data['currency_code'] = $this->session->userdata('currency_code');
$data['configWallet'] = $data['hasWallet']->first_row();
$data['configWallet'] = $data['hasWallet'];
$data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays'));
$this->load->view('header_hyp', $data);
$this->load->view('nano_credit/gestion_nano_credit_hyp');
@ -1613,12 +1613,12 @@ class Hyperviseur_dash extends CI_Controller
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$data['country'] = $this->session->userdata('current_pays');
$data['category'] = $this->session->userdata('category');
$data['idConfig'] = $data['hasWallet']->first_row()->id;
$data['idConfig'] = $data['hasWallet']?->id;
$data['network_id'] = $this->session->userdata('network_id');
switch ($config) {
case 'nano_credit':
$taux = $data['hasWallet']->first_row();
$taux = $data['hasWallet'];
$data['taux_ag_nano_credit'] = $taux->taux_com_ag_nano_credit;
$data['taux_sup_nano_credit'] = $taux->taux_com_sup_nano_credit;
$data['taux_hyp_nano_credit'] = $taux->taux_com_hyp_nano_credit;

View File

@ -231,9 +231,9 @@ class Superviseur_dash extends CI_Controller
foreach ($agents_g->result() as $row) {
$wallet = $this->wallet_model->getWallet($row->agent_id);
if ($wallet) {
if ($data['hasWallet']->first_row()->type == 'visa') {
if ($data['hasWallet']?->type == 'visa') {
$transactions = $this->user_model->getAgentTransactions($wallet->first_row()->wallet_id);
} else if ($data['hasWallet']->first_row()->type == 'ilink') {
} else if ($data['hasWallet']?->type == 'ilink') {
$transactions = $this->user_model->getAgentiLinkTransactions($wallet->first_row()->wallet_id);
}
if ($transactions) {
@ -252,7 +252,7 @@ class Superviseur_dash extends CI_Controller
$data["transactions"] = false;
}
if($data['hasWallet']->first_row()->type == 'ilink_sante') {
if($data['hasWallet']?->type == 'ilink_sante') {
$nh_config = $this->nano_health_model->getConfig($id_network);
$data['nh_config'] = $nh_config ? $nh_config->first_row() : null ;
$data['config_id'] = $data['nh_config'] ? $data['nh_config']->id : null ;
@ -277,11 +277,11 @@ class Superviseur_dash extends CI_Controller
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
// $data['geolocated_user'] = $this->user_model->getSuperNameAndCodeForSup($this->session->userdata('member_code'));
$this->load->view('header_sup', $data);
if ($data['hasWallet']->first_row()->type == 'visa')
if ($data['hasWallet']?->type == 'visa')
$this->load->view('gestion_wallet_sup');
elseif ($data['hasWallet']->first_row()->type == 'ilink')
elseif ($data['hasWallet']?->type == 'ilink')
$this->load->view('gestion_wallet_sup_ilink');
elseif ($data['hasWallet']->first_row()->type == 'ilink_sante')
elseif ($data['hasWallet']?->type == 'ilink_sante')
$this->load->view('nano_health/super/gestion_wallet');
$this->load->view('footer');
}

View File

@ -67,22 +67,22 @@ class WalletIlinkTransaction extends CI_Controller
if ($row->destinataire_phone) {
$destinataire = $row->destinataire_phone . ' | ' . $row->destinataire_name;
} else {
$destinataire = ($row->id_destinataire ? $row->id_destinataire . ' | ' : '') . ($row->nom_destinataire ? $row->nom_destinataire : '') . (' ' . $row->prenom_destinataire ? $row->prenom_destinataire : '');
$destinataire = ($row->id_destinataire ? $row->id_destinataire . ' | ' : '') . ($row->nom_destinataire ?? '') . (' ' . $row->prenom_destinataire ? $row->prenom_destinataire : '');
}
if ($row->user_phone) {
$emetteur = $row->user_phone . ' | ' . $row->user;
} else {
$emetteur = ($row->nom_emetteur ? $row->nom_emetteur : '') . (' ' . $row->prenom_emetteur ? $row->prenom_emetteur : '');
$emetteur = ($row->nom_emetteur ?? '') . (' ' . $row->prenom_emetteur ? $row->prenom_emetteur : '');
}
$moneyNetFinal = Money::of(round($row->montant_net_final_country, 2), $row->final_currency ? $row->final_currency : 'XAF', $this->context);
$moneyNetFinal = Money::of(round($row->montant_net_final_country, 2), $row->final_currency ?? 'XAF', $this->context);
$data[] = array($row->id_transaction, $operation, $numero_carte, $moneyNetInit->formatTo('fr_FR'), $moneyNetFinal->formatTo('fr_FR'),
Money::of(round($row->part_reseau_payeur_final_country ? $row->part_reseau_payeur_final_country : 0, 2), $row->final_currency ? $row->final_currency : 'XAF', $this->context)->formatTo('fr_FR'),
Money::of(round($row->part_reseau_payeur_final_country ?? 0, 2), $row->final_currency ?? 'XAF', $this->context)->formatTo('fr_FR'),
$this->lang->line($row->status_reseau_payeur), $row->final_currency, $row->pays_init,$row->pays_final, Money::of(round($row->frais,2), $row->init_currency,$this->context)->formatTo('fr_FR'),
Money::of(round($row->taxe, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),Money::of(round($row->commission_banque ? $row->commission_banque : 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),
Money::of(round($row->commission_hyp ? $row->commission_hyp : 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),Money::of(round($row->commission_sup ? $row->commission_sup : 0 , 2),$row->init_currency,$this->context)->formatTo('fr_FR'),
Money::of(round($row->commission_ag ? $row->commission_ag : 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'), $agent , $emetteur, $destinataire, $created);
Money::of(round($row->taxe, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),Money::of(round($row->commission_banque ?? 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),
Money::of(round($row->commission_hyp ?? 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'),Money::of(round($row->commission_sup ?? 0 , 2),$row->init_currency,$this->context)->formatTo('fr_FR'),
Money::of(round($row->commission_ag ?? 0, 2),$row->init_currency,$this->context)->formatTo('fr_FR'), $agent , $emetteur, $destinataire, $created);
}
$output = array(

View File

@ -1879,12 +1879,6 @@ class User_model extends CI_Model
return ($query->num_rows() > 0) ? $query : false;
}
public function getConfigWallet($id_network){
$sql = "SELECT * FROM `configWallet` WHERE id_network = ?";
$query = $this->db->query($sql , array($id_network));
return ($query->num_rows() > 0) ? $query : false;
}
public function addConfigWallet($network_id , $type){
$sql='INSERT INTO `configWallet` (`id_network`, `type`) VALUES (?,?);' ;
$query = $this->db->query($sql , array($network_id, $type));

View File

@ -27,7 +27,7 @@ class Wallet_model extends CI_Model
public function getConfigWallet($id_network){
$query = $this->db->get_where('configWallet' , ['id_network' => $id_network]);
return $query->num_rows() > 0 ? $query : false ;
return $query->num_rows() > 0 ? $query->first_row() : null ;
}
public function verifyConfigWalletInCountry($type, $country_id){

View File

@ -17,7 +17,7 @@ extract($_POST);
//$showResult = false;
//$frais = 0;
//$taxe = 0;
//$config = $hasWallet->first_row();
//$config = $hasWallet;
////Simulateur
//$com_ag = $this->session->userdata('com_ag') ? $this->session->userdata('com_ag') : 0 ;

View File

@ -470,58 +470,8 @@ $context = new \Brick\Money\Context\AutoContext();
</div>
</div>
</div>
<div class="modal fade" id="rechargeAccount" 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"><?= $this->lang->line('recharge_hypervisor_account'); ?></h3>
</div>
<div class="modal-body">
<?php if ($walletPassword != null) { ?>
<form id="rechargeAccountForm">
<div class="form-group">
<label for="montant" class="col-form-label"><?= $this->lang->line('Montant') ?></label>
<input type="text" required class="form-control" id="montant" name="montant" >
</div>
<!-- <div class="form-group">-->
<!-- <label for="password" class="col-form-label">--><?php //echo $this->lang->line('mot de passe') ?><!--</label>-->
<!-- <input type="password" required class="form-control" name="password" id="password">-->
<!-- </div>-->
<div class="form-group">
<label><?= $this->lang->line('mot de passe') ?></label>
<div class="input-group" id="show_hide_password">
<input class="form-control" name="password" id="password" type="password">
<div class="input-group-addon">
<a href=""><i class="fa fa-eye-slash" aria-hidden="true"></i></a>
</div>
</div>
</div>
<div class="clearfix">
<a href="#" id="resetPassword" class="pull-right forgot-password" data-wallet_password_id="<?= $walletPassword->id ?>" data-network="<?= $network ?>" data-country="<?= $country ?>"
data-email="<?= $walletPassword->email ?>">
<?= $this->lang->line('i_forgot_password') ?>
</a>
</div>
</form>
<?php }else{ ?>
<div class="text-center">
<h4> <?= $this->lang->line('no_wallet_password') ?></h4>
<a href="<?= base_url('Hyperviseur_dash/walletPassword') ?>" alt="" class="btn btn-primary"><?= $this->lang->line('click_here') ?></a>
</div>
<?php } ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
<?php if ($walletPassword != null) { ?>
<button type="button" class="btn btn-primary" data-wallet_id="<?= $wallet_id ?>" data-salt="<?= $walletPassword->salt ?>" data-encrypted_password="<?= $walletPassword->encrypted_password ?>" id="rechargeWallet" >
<?= $this->lang->line('recharge'); ?>
</button>
<?php }?>
</div>
</div>
</div>
</div>
</section>
<?php $this->load->view('include/recharge_account_modal',['walletPassword' => $walletPassword, 'network' => $network, 'country' => $country, 'wallet_id' => $wallet_id]) ?>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
@ -547,39 +497,6 @@ $context = new \Brick\Money\Context\AutoContext();
<script src="<?= base_url('bower_components/chart.js/Chart.js') ?>"></script>
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.5.4"></script>
<script>
$(function () {
$('#example1').DataTable();
anElement = new AutoNumeric('#montant', '', {digitGroupSeparator: ' ', decimalPlaces:'0', minimumValue : '1' , maximumValue: '99999999999999999999999999'});
$("#show_hide_password a").on('click', function(event) {
event.preventDefault();
if($('#show_hide_password input').attr("type") == "text"){
$('#show_hide_password input').attr('type', 'password');
$('#show_hide_password i').addClass( "fa-eye-slash" );
$('#show_hide_password i').removeClass( "fa-eye" );
}else if($('#show_hide_password input').attr("type") == "password"){
$('#show_hide_password input').attr('type', 'text');
$('#show_hide_password i').removeClass( "fa-eye-slash" );
$('#show_hide_password i').addClass( "fa-eye" );
}
});
// $('#example1').DataTable({
// "aLengthMenu": [[5, 10, 15, -1], [5, 10, 5, "All"]],
// "iDisplayLength": 5
// });
// $('#example2').DataTable({
// 'paging' : true,
// 'lengthChange': false,
// 'searching' : false,
// 'ordering' : true,
// 'info' : true,
// 'autoWidth' : false
// })
})
</script>
<script>
var areaChartData = {
@ -663,57 +580,7 @@ $context = new \Brick\Money\Context\AutoContext();
});
});
$('#rechargeWallet').click(function () {
const wallet_id = $(this).data('wallet_id');
const salt = $(this).data('salt');
const encrypted_password = $(this).data('encrypted_password');
if ($('#rechargeAccountForm')[0].checkValidity()) {
const montant = anElement.getNumber(); //parseFloat($('#montant').val());
const password = $('#password').val();
$.ajax({
url: '<?= base_url('Hyperviseur_dash/recharge_wallet')?>',
type: 'POST',
dataType: 'json',
data: {
"wallet_id": wallet_id,
"montant": montant ,
"password": password,
"salt" : salt,
"encrypted_password" : encrypted_password
},
success: function (data) {
if(data=='200'){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('account_recharged')?>",
text: "<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" :
}else if(data == '400'){
toastr.error("<?= $this->lang->line('incorrect_password')?>" , "<?= $this->lang->line('request_error')?>");
}else{
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
});
} else {
$('#rechargeAccountForm')[0].reportValidity();
}
});
</script>
<!-- Page script -->
<script src="<?= base_url('dist/js/custom.js') ?>"></script>

View File

@ -169,7 +169,7 @@
</li>
<?php if (($hasWallet->first_row()->type == 'ilink') && ($hasWallet->first_row()->has_nano_credit)) { ?>
<?php if (($hasWallet?->type == 'ilink') && ($hasWallet?->has_nano_credit)) { ?>
<li class="<?php if ($active == "nano_credit") {
echo "active";
} ?>">

View File

@ -104,7 +104,7 @@
<ul class="sidebar-menu" data-widget="tree">
<?php if ($hasWallet) {
?>
<?php if ($hasWallet->first_row()->type == 'ilink_sante') { ?>
<?php if ($hasWallet?->type == 'ilink_sante') { ?>
<li class="<?php if ($active == "wallet_health_care_sheets") {
echo "active";
} ?>">

View File

@ -140,7 +140,7 @@
} ?>">
<a href="#" data-toggle="modal" data-target="#modal-default">
<i class="fa fa-users"></i>
<span><?= $this->lang->line($hasWallet->first_row()->type == 'ilink_sante' ? 'service_providers' : 'Utilisateurs géolocalisés'); ?></span>
<span><?= $this->lang->line($hasWallet?->type == 'ilink_sante' ? 'service_providers' : 'Utilisateurs géolocalisés'); ?></span>
</a>
</li>
@ -152,7 +152,7 @@
</a>
</li>
<?php if ($hasWallet->first_row()->type != 'ilink_sante') { ?>
<?php if ($hasWallet?->type != 'ilink_sante') { ?>
<li class="<?= "treeview " . ((strpos($active, "demandes_credits") !== false) ? "active menu-open" : "") ?>"
style="height: auto;">
<a href="#">
@ -191,7 +191,7 @@
</a>
</li>
<?php } ?>
<?php if ($hasWallet) { ?>
<?php if ($hasWallet && $hasWallet?->type) { ?>
<li class="<?= "treeview " . ((strpos($active, "wallet_") !== false) ? "active menu-open" : "") ?>"
style="height: auto;">
<a href="#">
@ -211,7 +211,7 @@
<span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
</a>
</li>
<?php if ($hasWallet->first_row()->type == 'ilink') { ?>
<?php if ($hasWallet?->type == 'ilink') { ?>
<li class="<?php if ($active == "wallet_validating_account_opening_agents") {
echo "active";
} ?>">
@ -221,7 +221,7 @@
</a>
</li>
<?php } ?>
<?php if ($hasWallet->first_row()->type == 'ilink_sante') { ?>
<?php if ($hasWallet?->type == 'ilink_sante') { ?>
<li class="<?php if ($active == "wallet_drugs_and_devices") {
echo "active";
} ?>">
@ -299,7 +299,7 @@
</li>
<?php if (($hasWallet->first_row()->type == 'ilink') && ($hasWallet->first_row()->has_nano_credit)) { ?>
<?php if (($hasWallet?->type == 'ilink') && ($hasWallet?->has_nano_credit)) { ?>
<li class="<?php if ($active == "nano_credit") {
echo "active";
} ?>">
@ -326,7 +326,7 @@
</a>
</li>
<?php if (($hasWallet) && ($hasWallet->first_row()->type == 'ilink')) { ?>
<?php if (($hasWallet) && ($hasWallet?->type == 'ilink')) { ?>
<li class="<?php if ($active == "documentation") {
echo "active";
} ?>">

View File

@ -118,7 +118,7 @@
</a>
</li>
</li>
<?php if($hasWallet->first_row()->type != 'ilink_sante') { ?>
<?php if($hasWallet?->type != 'ilink_sante') { ?>
<li class="<?= "treeview " . ((strpos($active, "demandes_credits") !== false) ? "active menu-open" : "") ?>"
style="height: auto;">
<a href="#">
@ -162,7 +162,7 @@
</a>
</li>
<?php if (($hasWallet->first_row()->type == 'ilink') && ($hasWallet->first_row()->has_nano_credit)) { ?>
<?php if (($hasWallet?->type == 'ilink') && ($hasWallet?->has_nano_credit)) { ?>
<li class="<?php if ($active == "nano_credit") {
echo "active";
} ?>">

View File

@ -131,7 +131,7 @@ if($users_geolocated_query!=false){
<div class="inner">
<h3><?= $count_geo;?></h3>
<p><?= $this->lang->line($hasWallet->first_row()->type == 'ilink_sante' ? 'service_providers' : 'Utilisateurs géolocalisés'); ?></p>
<p><?= $this->lang->line($hasWallet?->type == 'ilink_sante' ? 'service_providers' : 'Utilisateurs géolocalisés'); ?></p>
</div>
<div class="icon">
<i class="ion ion-location"></i>
@ -154,7 +154,7 @@ if($users_geolocated_query!=false){
<a href="<?= base_url('Hyperviseur_dash/getAllSupervisor') ?>" class="small-box-footer"><?= $this->lang->line("Plus d'informations"); ?> <i class="fa fa-arrow-circle-right"></i></a>
</div>
</div>
<?php if($hasWallet->first_row()->type != 'ilink_sante') { ?>
<?php if($hasWallet?->type != 'ilink_sante') { ?>
<div class="col-lg-2 col-md-4 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
@ -232,7 +232,7 @@ if($users_geolocated_query!=false){
</div>
</div>
<div class="row">
<?php if($hasWallet->first_row()->type != 'ilink_sante') { ?>
<?php if($hasWallet?->type != 'ilink_sante') { ?>
<div class="col-xs-6">
<!-- DONUT CHART -->
<div class="box box-danger">
@ -251,7 +251,7 @@ if($users_geolocated_query!=false){
<!-- DONUT CHART -->
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title"><?= $this->lang->line( $hasWallet->first_row()->type == 'ilink_sante' ? 'service_providers_per_town' : "Utilisateurs géolocalisés par ville"); ?></h3>
<h3 class="box-title"><?= $this->lang->line( $hasWallet?->type == 'ilink_sante' ? 'service_providers_per_town' : "Utilisateurs géolocalisés par ville"); ?></h3>
</div>
<div class="box-body" id="chart">
<canvas id="pieChart" style="height:250px"></canvas>
@ -341,7 +341,7 @@ if($users_geolocated_query!=false){
Pie = JSON.parse(Pie);
}
<?php if($hasWallet->first_row()->type != 'ilink_sante') { ?>
<?php if($hasWallet?->type != 'ilink_sante') { ?>
var Pie2 = '<?= json_encode($pieChart2) ?>';
if(Pie2==='[]') {
var select = document.getElementById('chart2');

View File

@ -0,0 +1,125 @@
<div class="modal fade" id="rechargeAccount" 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"><?= $this->lang->line('recharge_hypervisor_account'); ?></h3>
</div>
<div class="modal-body">
<?php if ($walletPassword != null) { ?>
<form id="rechargeAccountForm">
<div class="form-group">
<label for="montant" class="col-form-label"><?= $this->lang->line('Montant') ?></label>
<input type="text" required class="form-control" id="montant" name="montant" >
</div>
<!-- <div class="form-group">-->
<!-- <label for="password" class="col-form-label">--><?php //echo $this->lang->line('mot de passe') ?><!--</label>-->
<!-- <input type="password" required class="form-control" name="password" id="password">-->
<!-- </div>-->
<div class="form-group">
<label><?= $this->lang->line('mot de passe') ?></label>
<div class="input-group" id="show_hide_password">
<input class="form-control" name="password" id="password" type="password">
<div class="input-group-addon">
<a href=""><i class="fa fa-eye-slash" aria-hidden="true"></i></a>
</div>
</div>
</div>
<div class="clearfix">
<a href="#" id="resetPassword" class="pull-right forgot-password" data-wallet_password_id="<?= $walletPassword->id ?>" data-network="<?= $network ?>" data-country="<?= $country ?>"
data-email="<?= $walletPassword->email ?>">
<?= $this->lang->line('i_forgot_password') ?>
</a>
</div>
</form>
<?php }else{ ?>
<div class="text-center">
<h4> <?= $this->lang->line('no_wallet_password') ?></h4>
<a href="<?= base_url('Hyperviseur_dash/walletPassword') ?>" alt="" class="btn btn-primary"><?= $this->lang->line('click_here') ?></a>
</div>
<?php } ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?= $this->lang->line('Fermer'); ?></button>
<?php if ($walletPassword != null) { ?>
<button type="button" class="btn btn-primary" data-wallet_id="<?= $wallet_id ?>" data-salt="<?= $walletPassword->salt ?>" data-encrypted_password="<?= $walletPassword->encrypted_password ?>" id="rechargeWallet" >
<?= $this->lang->line('recharge'); ?>
</button>
<?php }?>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.5.4"></script>
<script>
$(function () {
$('#example1').DataTable();
anElement = new AutoNumeric('#montant', '', {digitGroupSeparator: ' ', decimalPlaces:'0', minimumValue : '1' , maximumValue: '99999999999999999999999999'});
$("#show_hide_password a").on('click', function(event) {
event.preventDefault();
if($('#show_hide_password input').attr("type") == "text"){
$('#show_hide_password input').attr('type', 'password');
$('#show_hide_password i').addClass( "fa-eye-slash" );
$('#show_hide_password i').removeClass( "fa-eye" );
}else if($('#show_hide_password input').attr("type") == "password"){
$('#show_hide_password input').attr('type', 'text');
$('#show_hide_password i').removeClass( "fa-eye-slash" );
$('#show_hide_password i').addClass( "fa-eye" );
}
});
$('#rechargeWallet').click(function () {
const wallet_id = $(this).data('wallet_id');
const salt = $(this).data('salt');
const encrypted_password = $(this).data('encrypted_password');
if ($('#rechargeAccountForm')[0].checkValidity()) {
const montant = anElement.getNumber(); //parseFloat($('#montant').val());
const password = $('#password').val();
$.ajax({
url: '<?= base_url('Hyperviseur_dash/recharge_wallet')?>',
type: 'POST',
dataType: 'json',
data: {
"wallet_id": wallet_id,
"montant": montant ,
"password": password,
"salt" : salt,
"encrypted_password" : encrypted_password
},
success: function (data) {
if(data=='200'){
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('account_recharged')?>",
text: "<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" :
}else if(data == '400'){
toastr.error("<?= $this->lang->line('incorrect_password')?>" , "<?= $this->lang->line('request_error')?>");
}else{
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?= $this->lang->line('error_message')?>" , "<?= $this->lang->line('request_error')?>");
}
});
} else {
$('#rechargeAccountForm')[0].reportValidity();
}
});
})
</script>

View File

@ -317,35 +317,3 @@
});
</script>
<script>
$(document).on("click", "#cancel", function () {
const id_transaction = $(this).data('id-transaction');
$.ajax({
url: '<?= base_url('Gestion/cancelIlinkTransation')?>',
type: 'POST',
dataType: 'json',
data: {"id_transaction": id_transaction},
async: true,
success: function (data) {
if (data) {
Swal.fire({
icon: 'success',
title: "<?= $this->lang->line('canceled_transaction')?>",
text: "<?= $this->lang->line('informations_updated')?>",
timer: 3000
}).then(() => {
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
} else {
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, erreur) {
console.log(resultat + " " + erreur);
toastr.error("<?= $this->lang->line('error_message')?>", "<?= $this->lang->line('request_error')?>");
}
});
});
</script>

View File

@ -97,8 +97,11 @@ $careRequests = [];
</div>
</div>
<div class="row">
<div class="margin">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-update"
<div class="col-lg-4">
<button type="button" class="btn btn-primary btn-block margin" data-toggle="modal" data-target="#rechargeAccount"><?= $this->lang->line('recharge_hypervisor_account') ?> </button>
</div>
<div class="col-lg-8">
<button type="button" class="btn btn-primary margin" data-toggle="modal" data-target="#modal-update"
style="width: 100%"><?= $this->lang->line('Modifier la configuration') ?></button>
</div>
</div>
@ -819,6 +822,9 @@ $careRequests = [];
<?php $this->load->view('include/delete_modal',['title' => $this->lang->line('delete_provider_class'), 'id' => 'class']) ?>
<?php $this->load->view('include/loader') ?>
</section>
<?php $this->load->view('include/recharge_account_modal',['walletPassword' => $walletPassword, 'network' => $network, 'country' => $country, 'wallet_id' => $wallet_id]) ?>
</div>
<!-- jQuery 3 -->
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>

View File

@ -11,7 +11,7 @@
"source": "https://github.com/bcit-ci/CodeIgniter"
},
"require": {
"php": ">=7.0",
"php": ">=8.0",
"spatie/async": "^1.4",
"nesbot/carbon": "^2.33",
"brick/money": "^0.4.5",