From 888c17ba8e508328a8e4946599fc2c4f291e4cbc Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Tue, 23 Jun 2020 16:49:59 +0100 Subject: [PATCH] + Add list of all paying networks --- application/controllers/Gestion.php | 3 + application/controllers/Hyperviseur_dash.php | 24 ++ application/language/french/message_lang.php | 1 + application/models/User_model.php | 20 ++ application/views/gestion_wallet_autre.php | 162 ++++++------- .../views/gestion_wallet_ilink_hyp.php | 3 + ...on_wallet_ilink_paying_network_account.php | 218 ++++++++++++++++++ 7 files changed, 350 insertions(+), 81 deletions(-) create mode 100755 application/views/gestion_wallet_ilink_paying_network_account.php diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php index f4955f49..ef65a720 100755 --- a/application/controllers/Gestion.php +++ b/application/controllers/Gestion.php @@ -1591,6 +1591,9 @@ class Gestion extends CI_Controller $data['taux_bq_r_cart'] = $taux->taux_com_banque_retrait_carte_cash; $data['taux_hyp_r_cart_ilink'] = $taux->taux_com_hyp_retrait_carte_cash_ilink; $data['taux_bq_r_cart_ilink'] = $taux->taux_com_banque_retrait_carte_cash_ilink; + }elseif ($taux->type == 'autre') { + $res = $this->user_model->getSharingRateByNetwork($network_id); + $data['commission'] = $res ? $res->first_row()->balance_com : 0 ; } $data['transactions'] = $this->user_model->getTransactions(null,null,$network_id); diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php index c3ba4ad3..346d1749 100755 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -315,6 +315,8 @@ class Hyperviseur_dash extends CI_Controller $this->historique($id_network, $this->input->get('d'), $this->input->get('f'), $this->input->get('history')); } elseif ($this->input->get('config')) { $this->config_wallet($this->input->get('config'), $this->input->get('country')); + } elseif ($this->input->get('show')) { + $this->show_config_infos($this->input->get('show')); }else { $data["commission"] = ""; @@ -1028,6 +1030,28 @@ class Hyperviseur_dash extends CI_Controller $this->load->view('footer'); } + private function show_config_infos($type) + { + + $data['active'] = "wallet"; + $data['alert'] = ""; + $data['firstname'] = $this->session->userdata('firstname'); + $data['lastname'] = $this->session->userdata('lastname'); + $data['email'] = $this->session->userdata('email'); + $data['network'] = $this->session->userdata('network'); + $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); + $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); + $data['hasWallet'] = $this->user_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['networks'] = $this->user_model->getPayingNetworksByConfigWallet($data['idConfig']); + + $this->load->view('header_hyp', $data); + $this->load->view('gestion_wallet_ilink_paying_network_account'); + $this->load->view('footer'); + } + public function config_sharing_rate(){ if ($this->isLogged()) { if (isset($_POST)) { diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index 67c520fa..8ee5d47e 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -408,4 +408,5 @@ $lang['sharing_updated'] = 'Taux de partage mis à jour'; $lang['not_defined'] ='Non défini'; $lang['no_network'] = 'Aucun réseau'; $lang['activated_countries'] = 'Pays activés'; +$lang['paying_networks_accounts'] = 'Comptes des reseaux payeurs' ?> diff --git a/application/models/User_model.php b/application/models/User_model.php index 71acfd32..932e49e7 100755 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -2465,6 +2465,16 @@ class User_model extends CI_Model } } + public function getSharingRateByNetwork($id_network){ + $sql = "SELECT balance_com FROM `paying_networks` WHERE `id_network` = ? ;"; + $query = $this->db->query($sql , array($id_network)); + if($query->num_rows()>0){ + return $query; + }else{ + return false; + } + } + public function countPayingNetworks($id_country ,$idConfig){ $sql = "SELECT count(id) as total FROM `paying_networks` WHERE `id_network` IN (SELECT distinct n.id FROM countries c INNER JOIN networks n ON n.country_id = c.id WHERE n.status = 1 AND c.id = ? @@ -2486,4 +2496,14 @@ class User_model extends CI_Model return false; } } + + public function getPayingNetworksByConfigWallet($id_config){ + $query = $this->db->query("SELECT n.name , n.id , cw.type , c.name as country , pw.taux_partage as rate , pw.balance_com FROM networks n INNER JOIN countries c ON n.country_id=c.id + INNER JOIN configWallet cw ON cw.id_network = n.id INNER JOIN paying_networks pw ON pw.id_network = n.id WHERE n.id IN ( SELECT id_network FROM paying_networks pw WHERE id_configWallet = $id_config )"); + if($query->num_rows()>0){ + return $query; + }else{ + return false; + } + } } diff --git a/application/views/gestion_wallet_autre.php b/application/views/gestion_wallet_autre.php index 96e8efd7..c17e06af 100755 --- a/application/views/gestion_wallet_autre.php +++ b/application/views/gestion_wallet_autre.php @@ -171,94 +171,94 @@ $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
-
-
+
+
-

%

-

lang->line('rate_com_user_wallet_cart') ?>

+

format($commission); ?>FCFA

+

lang->line('Solde Commission') ?>

- +
-
-
-
-
-

- lang->line('Historique des 12 derniers mois'); ?>

- -
-
-
- -
-
-
-
-
-
-
-

- lang->line("Parts dépots & retraits"); ?>

-
-
- -
-
-
- -
-
-
-

lang->line('Commission Hyperviseur') ?>

-
-
- - - - ".$this->lang->line('Nom')." - - - - - "; - ?> - - - - - - - - "; - - echo " - - "; - - } - ?> - -
".$this->lang->line('Solde Principal')."".$this->lang->line('Solde Commission')."".$this->lang->line('Commission banque')."".$this->lang->line('DEPOT'). 's'."".$this->lang->line('RETRAIT').'s'."
" . $walletHyper->first_row()->lastname . "" . $fmt->format($walletHyper->first_row()->balance_princ) . "" . $fmt->format($walletHyper->first_row()->balance_com) . "" . $fmt->format($totalCommissionBanque) . "" . $depots->num_rows() . "" . $retraits->num_rows() . "
-
-
-
- -
+ + + + + +lang->line('Historique des 12 derniers mois'); ?> + + +lang->line('transactions_historic'); ?> + + +lang->line('recharge_historic'); ?> + + + + + + + + + + + + + + +lang->line("Parts dépots & retraits"); ?> + + + + + + + + + + +lang->line('Commission Hyperviseur') ?> + + + + + +".$this->lang->line('Nom')." +// ".$this->lang->line('Solde Principal')." +// ".$this->lang->line('Solde Commission')." +// ".$this->lang->line('Commission banque')." +// ".$this->lang->line('DEPOT'). 's'." +// ".$this->lang->line('RETRAIT').'s'.""; +// ?> + + + + +// " . $walletHyper->first_row()->lastname . " +// " . $fmt->format($walletHyper->first_row()->balance_princ) . " +// " . $fmt->format($walletHyper->first_row()->balance_com) . " +// " . $fmt->format($totalCommissionBanque) . ""; +// +// echo "" . $depots->num_rows() . " +// " . $retraits->num_rows() . " +// "; +// +// } +// ?> + + + + + + +
diff --git a/application/views/gestion_wallet_ilink_hyp.php b/application/views/gestion_wallet_ilink_hyp.php index 641fc9b7..4e2f2ec2 100755 --- a/application/views/gestion_wallet_ilink_hyp.php +++ b/application/views/gestion_wallet_ilink_hyp.php @@ -943,6 +943,9 @@

lang->line('Historique des 12 derniers mois'); ?>

+ + lang->line('paying_networks_accounts'); ?> + lang->line('transactions_historic'); ?> diff --git a/application/views/gestion_wallet_ilink_paying_network_account.php b/application/views/gestion_wallet_ilink_paying_network_account.php new file mode 100755 index 00000000..157f09b7 --- /dev/null +++ b/application/views/gestion_wallet_ilink_paying_network_account.php @@ -0,0 +1,218 @@ + + + +
+ +
+ +

+ lang->line('paying_networks_accounts')?> +

+ +
+ +

Erreur!

+ +
+ + +
+ +

Success!

+ +
+ + +
+ +
+
+
+
+
+

lang->line('paying_networks'); ?>

+
+
+ + num_rows(); + $num = 0; + if ($numrows > 0) { + $fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL ); + ?> + + + + + + + + + + + + + result() as $row) { + + $num++; + //$member_code = randomString1(10); + echo " + + + + "; + ?> + rate != null ) { + ?> + + + + + + + +
lang->line('Nom'); ?>lang->line('Pays'); ?>Wallet lang->line('share_rate')?>lang->line('Solde Commission')?>
$num$row->name$row->country".strtoupper($row->type)." + rate . ' %'?> + + lang->line('not_defined'); ?> + + format($row->balance_com)?> +
+ + lang->line('Aucun réseau'); + } + } else { + echo $this->lang->line('Aucun réseau'); + } + ?> +
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + +