diff --git a/application/controllers/Admin.php b/application/controllers/Admin.php
index 9fc9ef1b..d7715fbf 100755
--- a/application/controllers/Admin.php
+++ b/application/controllers/Admin.php
@@ -3,12 +3,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Admin extends CI_Controller
{
- public function _contruct()
+ public function __construct()
{
- parent::_contruct();
+ parent::__construct();
$this->load->model('user_model');
-
-
+ $this->load->model('wallet_model');
}
public function index()
@@ -506,7 +505,9 @@ class Admin extends CI_Controller
$data['network'] = $this->session->userdata('network');
$data['pays'] = $this->user_model->getAllCountries();
$data['alert'] = "";
- $this->load->view('header', $data);
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+
+ $this->load->view('header', $data);
$this->load->view('listeadmin');
$this->load->view('footer');
}
diff --git a/application/controllers/Admin_dash.php b/application/controllers/Admin_dash.php
index f11da926..81ae1cbd 100755
--- a/application/controllers/Admin_dash.php
+++ b/application/controllers/Admin_dash.php
@@ -1,27 +1,24 @@
load->model('user_model');
+ $this->load->model('wallet_model');
+ $this->load->model('nano_credit_model');
}
public function index()
{
-
- if (!$this->session->userdata('email')) {
- $this->session->set_flashdata('error', 'log in first');
-
- $data['alert'] = "ok";
- $data['message'] = "Login first!";
-
-
- redirect('index.php', $data);
- } else {
+ if ($this->isLogged()) {
$data['pays'] = $this->user_model->getAllCountries();
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
@@ -41,6 +38,8 @@ class Admin_dash extends CI_Controller
$data['firstname'] = $this->session->userdata('firstname');
$data['lastname'] = $this->session->userdata('lastname');
$data['email'] = $this->session->userdata('email');
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+
$this->load->view('header', $data);
$this->load->view('admin_dash');
$this->load->view('footer');
@@ -50,15 +49,7 @@ class Admin_dash extends CI_Controller
public function filter()
{
- if (!$this->session->userdata('email')) {
- $this->session->set_flashdata('error', 'log in first');
-
- $data['alert'] = "ok";
- $data['message'] = "Login first!";
-
-
- redirect('index.php', $data);
- } else {
+ if ($this->isLogged()) {
$data['pays'] = $this->user_model->getAllCountries();
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
@@ -77,31 +68,26 @@ class Admin_dash extends CI_Controller
public function firstFilter()
{
-
- if (!$this->session->userdata('email')) {
- $this->session->set_flashdata('error', 'log in first');
-
- $data['alert'] = "ok";
- $data['message'] = "Login first!";
-
-
- redirect('index.php', $data);
- } else {
-
+ if ($this->isLogged()) {
if (isset($_POST)) {
$this->session->set_userdata('current_pays', $this->input->post('pays'));
- $pays_name = $this->db->query("SELECT name FROM countries WHERE id='" . $this->input->post('pays') . "'");
+ $pays_name = $this->db->query("SELECT name , currency_code FROM countries_currencies WHERE id='" . $this->input->post('pays') . "'");
$this->session->set_userdata('current_hyper', $this->input->post('hyper'));
- $infos_network = $this->db->query("SELECT name,phone FROM networks INNER JOIN networks_agents ON networks.id=networks_agents.network_id INNER JOIN codeGenerer ON networks_agents.codeGenerer_id=codeGenerer.id WHERE codeGenerer.code_membre='" . $this->input->post('hyper') . "'");
+ $infos_network = $this->db->query("SELECT networks.id, name,phone, networks_agents.agent_id, code_membre FROM networks INNER JOIN networks_agents ON networks.id=networks_agents.network_id INNER JOIN codeGenerer ON networks_agents.codeGenerer_id=codeGenerer.id WHERE codeGenerer.code_membre='" . $this->input->post('hyper') . "'");
$network = $infos_network->first_row()->name;
$contact_hyper = $infos_network->first_row()->phone;
$this->session->set_userdata('current_network', $network);
+ $this->session->set_userdata('current_network_id',$infos_network->first_row()->id);
+ $this->session->set_userdata('current_hyper_id',$infos_network->first_row()->agent_id);
+ $this->session->set_userdata('current_hyper_member_code',$infos_network->first_row()->code_membre);
+
$this->session->set_userdata('current_contact_hyper', $contact_hyper);
$this->session->set_userdata('current_ville', $this->input->post('ville'));
$town_name = $this->db->query("SELECT name FROM towns WHERE id='" . $this->input->post('ville') . "'");
$this->session->set_userdata('name_current_pays', $pays_name->first_row()->name);
$this->session->set_userdata('name_current_ville', $town_name->first_row()->name);
+ $this->session->set_userdata('currency_code', $pays_name->first_row()->currency_code);
$ville = $this->session->userdata('current_ville');
$hyper = $this->session->userdata('current_hyper');
@@ -123,6 +109,11 @@ class Admin_dash extends CI_Controller
$data['email'] = $this->session->userdata('email');
$data['network'] = $this->session->userdata('current_network');
$data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+ $hyperPosition = $this->db->query("SELECT a.latitude,a.longitude FROM agents a INNER JOIN networks_agents na ON a.id= na.agent_id INNER JOIN codeGenerer ON na.codeGenerer_id=codeGenerer.id WHERE codeGenerer.code_membre='" . $this->input->post('hyper') . "'");
+ $this->session->set_userdata('hyper_latitude', $hyperPosition->first_row()->latitude);
+ $this->session->set_userdata('hyper_longitude', $hyperPosition->first_row()->longitude);
+
$this->load->view('header', $data);
$this->load->view('admin_dash');
$this->load->view('footer');
@@ -130,6 +121,602 @@ class Admin_dash extends CI_Controller
}
}
+ // Wallet
+ public function wallet()
+ {
+ if ($this->isLogged()) {
+ $id_network = $this->session->userdata('current_network_id');
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+ if ($data['hasWallet']) {
+
+ if ($this->input->get('history')) {
+ $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 {
+ $context = new AutoContext();
+
+ $data["commission"] = "";
+ $data["principal"] = "";
+ $data["transactions"] = "";
+ $agent_id = $this->session->userdata('current_hyper_id');
+
+
+ $taux = $data['hasWallet']->first_row();
+ $data['idConfig'] = $taux->id;
+ if ($data['hasWallet']->first_row()->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;
+ $data['taux_ag_d'] = $taux->taux_com_ag_depot;
+ $data['taux_sup_r'] = $taux->taux_com_sup_retrait;
+ $data['taux_sup_d'] = $taux->taux_com_sup_depot;
+ $data['taux_bq_d'] = $taux->part_banque_depot;
+ $data['taux_bq_r'] = $taux->part_banque_retrait;
+ $data['frais_d'] = $taux->frais_min_banque_depot;
+
+ $agents_g = $this->user_model->getAllGeolocatedUsersForHyp($this->session->userdata('member_code'));
+
+ //Fetch all transactions of any geolocated agent of the network
+ $data["transactions"] = array();
+ $totalCommissionBanque = 0;
+ if ($agents_g) {
+ foreach ($agents_g->result() as $row) {
+ $wallet = $this->wallet_model->getWallet($row->agent_id);
+ if ($wallet) {
+ $transactions = $this->user_model->getAgentTransactions($wallet->first_row()->wallet_id);
+ if ($transactions) {
+ foreach ($transactions->result() as $trans) {
+ $totalCommissionBanque += $trans->commission_banque;
+ $trans->code_parrain = $row->code_parrain; // Add code parrain to transaction
+ array_push($data['transactions'], $trans);
+ }
+ }
+ }
+ }
+ }
+ $data["totalCommissionBanque"] = Money::of(round($totalCommissionBanque,2), $this->session->userdata('currency_code'), $context )->formatTo('fr_FR');
+
+ } elseif ($data['hasWallet']->first_row()->type == 'ilink') {
+
+ $transactions = $this->wallet_model->getNetworkIlinTransactions($id_network);
+ $data["transactions"] = array();
+ $totalCommissionBanque = 0;
+ if ($transactions) {
+ foreach ($transactions->result() as $trans) {
+ $totalCommissionBanque += $trans->commission_banque;
+ array_push($data['transactions'], $trans);
+ }
+ }
+ $data["totalCommissionBanque"] = Money::of(round($totalCommissionBanque,2), $this->session->userdata('currency_code'), $context )->formatTo('fr_FR');
+
+ }
+
+ //Create wallet if it not exist
+ $res = $this->wallet_model->getWallet($agent_id);
+ if ($res == false) {
+ $this->user_model->addWallet($agent_id);
+ $res = $this->wallet_model->getWallet($agent_id);
+ }
+
+ $row = $res->first_row();
+ $data["commission"] = Money::of(round($row->balance_com, 2), $this->session->userdata('currency_code'), $context)->formatTo('fr_FR');
+ $data["principal"] = Money::of(round($row->balance_princ, 2), $this->session->userdata('currency_code'), $context)->formatTo('fr_FR');
+ $data['wallet_id'] = $row->wallet_id;
+ $data['curreny_code'] = $this->session->userdata('currency_code');
+
+
+ $res = $this->wallet_model->getWalletPassword($id_network);
+ $data['walletPassword'] = $res ? $res->first_row() : null;
+ $data['alert'] = "";
+ $data['active'] = "wallet_wallet";
+ $data['pays'] = $this->user_model->getAllCountries();
+ $data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
+ $data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
+ $data['firstname'] = $this->session->userdata('firstname');
+ $data['lastname'] = $this->session->userdata('lastname');
+ $data['email'] = $this->session->userdata('email');
+ $data['network'] = $this->session->userdata('current_network');
+ $data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
+ $data['network_id'] = $this->session->userdata('current_network_id');
+ $data['country'] = $this->session->userdata('name_current_pays');
+
+ $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')
+ $this->load->view('gestion_wallet_hyp');
+ elseif ($data['hasWallet']->first_row()->type == 'ilink')
+ $this->load->view('gestion_wallet_ilink_hyp');
+ $this->load->view('footer');
+ }
+ }
+ }
+ }
+
+ private function historique($current_network_id, $startDate, $endDate, $type)
+ {
+ $data['configWallet'] = $this->wallet_model->getConfigWallet($current_network_id);
+ $format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d';
+ $data['startDate'] = $startDate ? date($format, strtotime($startDate)) : null;
+ $data['endDate'] = $endDate ? date($format, strtotime($endDate)) : null;
+ $endDate = Date('Y-m-d', strtotime($endDate . "+1 day"));
+ if ($type == 'transaction_ilink') {
+ $networkDetails = $this->user_model->getNetworkDetails($current_network_id);
+ $data['currency_name_fr'] = $networkDetails->first_row()->currency_name_fr;
+ $data['currency_name_en'] = $networkDetails->first_row()->currency_name_en;
+ }else if ($type == 'deleted_transactions')
+ $data['transactions'] = $this->user_model->getDeletedTransactions($startDate, $endDate, $this->session->userdata('current_network_id'));
+ else if ($type == 'commission_transfer')
+ $data['transactions'] = $this->wallet_model->getCommissionTransfersByNetwork($startDate, $endDate, $this->session->userdata('current_network_id'));
+ else if ($type == 'balance_statement'){
+ $res = $this->wallet_model->getWalletPassword($this->session->userdata('current_network_id'));
+ $data['walletPassword'] = $res ? $res->first_row() : null;
+
+ $data['wallets'] = $this->user_model->getInfosWalletAgentForHyper($this->session->userdata('current_network_id'));
+
+ } else if ($type == 'refund_history')
+ $data['refunds'] = $this->wallet_model->getRefunds($startDate, $endDate, $current_network_id);
+ else if ($type == 'commission_payments')
+ $data['payments'] = $this->wallet_model->getCommissionPayments($startDate, $endDate, $current_network_id);
+ else
+ $data['transactions'] = $this->wallet_model->getRecharges($startDate, $endDate, $current_network_id);
+
+ $data['active'] = "wallet_wallet";
+ $data['alert'] = "";
+ $data['pays'] = $this->user_model->getAllCountries();
+ $data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
+ $data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
+ $data['firstname'] = $this->session->userdata('firstname');
+ $data['lastname'] = $this->session->userdata('lastname');
+ $data['email'] = $this->session->userdata('email');
+ $data['network'] = $this->session->userdata('current_network');
+ $data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
+ $data['network_id'] = $this->session->userdata('current_network_id');
+ $data['country'] = $this->session->userdata('name_current_pays');
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+ $data['currency_code'] = $this->session->userdata('currency_code');
+
+ $data['category'] = $this->session->userdata('category');
+ $data['id_network'] = $current_network_id;
+
+ $this->load->view('header', $data);
+ if ($type == 'transaction')
+ $this->load->view('historique_transactions');
+ else if ($type == 'transaction_ilink')
+ $this->load->view('historique_transactions_ilink');
+ else if ($type == 'deleted_transactions')
+ $this->load->view('historique_transactions_deleted');
+ else if ($type == 'commission_transfer')
+ $this->load->view('historique_transferts_commission');
+ else if ($type == 'balance_statement')
+ $this->load->view('config_wallet_ilink_hyp/etat_soldes');
+ else if ($type == 'refund_history')
+ $this->load->view('historique_remboursement');
+ else if ($type == 'commission_payments')
+ $this->load->view('config_wallet_ilink_hyp/historique_commission_payements');
+ else
+ $this->load->view('historique_recharges');
+ $this->load->view('footer');
+ }
+
+ public function walletPassword()
+ {
+ if ($this->isLogged()) {
+ $data['active'] = "wallet_password";
+ $data['alert'] = "";
+ $data['pays'] = $this->user_model->getAllCountries();
+ $data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
+ $data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
+ $data['firstname'] = $this->session->userdata('firstname');
+ $data['lastname'] = $this->session->userdata('lastname');
+ $data['email'] = $this->session->userdata('email');
+ $data['network'] = $this->session->userdata('current_network');
+ $data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
+ $data['network_id'] = $this->session->userdata('current_network_id');
+ $data['country'] = $this->session->userdata('name_current_pays');
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+ $data['currency_code'] = $this->session->userdata('currency_code');
+
+ $res = $this->wallet_model->getWalletPassword($this->session->userdata('current_network_id'));
+ $data['walletPassword'] = $res ? $res->first_row() : null;
+ $this->load->view('header', $data);
+ $this->load->view('wallet_password');
+ $this->load->view('footer');
+ }
+ }
+
+ private function config_wallet($config , $country)
+ {
+// $data['configWallet'] = $this->wallet_model->getConfigWallet($network_id);
+ $data['active'] = "wallet_wallet";
+ $data['alert'] = "";
+ $data['pays'] = $this->user_model->getAllCountries();
+ $data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
+ $data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
+ $data['firstname'] = $this->session->userdata('firstname');
+ $data['lastname'] = $this->session->userdata('lastname');
+ $data['email'] = $this->session->userdata('email');
+ $data['network'] = $this->session->userdata('current_network');
+ $data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
+ $data['network_id'] = $this->session->userdata('current_network_id');
+ $data['country'] = $this->session->userdata('name_current_pays');
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+ $data['currency_code'] = $this->session->userdata('currency_code');
+
+ $data['category'] = $this->session->userdata('category');
+ $data['idConfig'] = $data['hasWallet']->first_row()->id;
+ $data['network_id'] = $this->session->userdata('current_network_id');
+ if (isset($country)) {
+ $data['country_id'] = $country;
+ $data['country'] = $this->wallet_model->getCountry($country)->first_row();
+ $res = $this->wallet_model->getActiveNetworksByCountry($country,$this->session->userdata('current_network_id'));
+ $data['networks'] = [];
+ if($res){
+ $result = $res->result();
+ foreach ($result as $network){
+ $res = $this->wallet_model->getSharingRate($network->id , $data['idConfig']);
+ $res2 = $this->wallet_model->getTransmittingNetwork($network->id , $data['idConfig']);
+ if($res){
+ $network->rate = $res->first_row()->taux_partage;
+ $network->url = $res->first_row()->url;
+ }else{
+ $network->rate = null;
+ $network->url = null;
+ }
+ $network->is_transmitting_network = $res2 ? true : false;
+ $network->rate_transmitting = $res2 ? $res2->first_row()->taux_partage : null;
+ $network->url_transmitting = $res2 ? $res2->first_row()->url : null;
+
+ $data['networks'][] = $network;
+ }
+ }
+ $this->load->view('header', $data);
+ $this->load->view('gestion_wallet_ilink_config_paying_network');
+ $this->load->view('footer');
+ return;
+ }
+ $res = $this->wallet_model->getWalletsCountries();
+ $data['countries'] = [];
+ if($res){
+ $result = $res->result();
+ foreach ($result as $country){
+ $res = $this->wallet_model->countPayingNetworks($country->id, $data['idConfig']);
+ $res2 = $this->wallet_model->countTransmittiongNetworks($country->id, $data['idConfig']);
+
+ $country->total_paying = $res ? $res->first_row()->total : null ;
+ $country->total_transmitting = $res ? $res2->first_row()->total : null ;
+
+ $data['countries'][] = $country;
+ }
+ }
+ $taux = $data['hasWallet']->first_row();
+ switch($config){
+ case 'paying_networks':
+ $this->load->view('header', $data);
+ $this->load->view('gestion_wallet_ilink_config_paying_networks');
+ break;
+ case 'user_wallet_wallet':
+ $data['plr_user_wallet_wallet'] = $this->wallet_model->getPalierConfigWallet("user_wallet_wallet_international", $data['idConfig']);
+ $data['plr_user_wallet_wallet_national'] = $this->wallet_model->getPalierConfigWallet("user_wallet_wallet_national", $data['idConfig']);
+ $this->load->view('header', $data);
+ $this->load->view('config_wallet_ilink_hyp/user_wallet_wallet');
+ break;
+ case 'user_wallet_carte':
+ $data['taux_u_w_cart'] = $taux->taux_com_user_wallet_carte;
+ $data['taux_hyp_s_wallet_cart_ilink'] = $taux->taux_com_hyp_envoi_wallet_carte_ilink;
+ $data['taux_bq_s_wallet_cart_ilink'] = $taux->taux_com_banque_envoi_wallet_carte_ilink;
+ $this->load->view('header', $data);
+ $this->load->view('config_wallet_ilink_hyp/user_wallet_carte');
+ break;
+ case 'user_wallet_cash':
+ $data['plr_user_wallet_cash'] = $this->wallet_model->getPalierConfigWallet("user_wallet_cash_international", $data['idConfig']);
+ $data['plr_user_wallet_cash_national'] = $this->wallet_model->getPalierConfigWallet("user_wallet_cash_national", $data['idConfig']);
+ $this->load->view('header', $data);
+ $this->load->view('config_wallet_ilink_hyp/user_wallet_cash');
+ break;
+ case 'user_carte_wallet':
+ $data['taux_u_c_w'] = $taux->taux_com_user_carte_wallet;
+ $data['taux_u_c_c'] = $taux->taux_com_user_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;
+ $this->load->view('header', $data);
+ $this->load->view('config_wallet_ilink_hyp/user_carte_wallet');
+ break;
+ case 'agent_remove_cash':
+ $data['taux_ag_r_c'] = $taux->taux_com_ag_retrait_cash;
+ $data['taux_sup_r_c'] = $taux->taux_com_sup_retrait_cash;
+ $data['taux_hyp_r_c'] = $taux->taux_com_hyp_retrait_cash;
+ $this->load->view('header', $data);
+ $this->load->view('config_wallet_ilink_hyp/agent_remove_cash');
+ break;
+ case 'agent_remove_carte_cash':
+ $data['taux_ag_cart_c'] = $taux->taux_com_wallet_ag_carte_cash;
+ $data['taux_ag_r_cart'] = $taux->taux_com_ag_retrait_carte_cash;
+ $data['taux_sup_r_cart'] = $taux->taux_com_sup_retrait_carte_cash;
+ $data['taux_hyp_r_cart'] = $taux->taux_com_hyp_retrait_carte_cash;
+ $data['taux_bq_r_cart'] = $taux->taux_com_banque_retrait_carte_cash;
+ $this->load->view('header', $data);
+ $this->load->view('config_wallet_ilink_hyp/agent_remove_carte_cash');
+ break;
+ case 'agent_send_cash_carte':
+ $data['taux_ag_d_c_c'] = $taux->taux_com_wallet_ag_envoi_cash_carte;
+ $data['taux_ag_d_c'] = $taux->taux_com_ag_depot_cash_carte;
+ $data['taux_sup_d_c'] = $taux->taux_com_sup_depot_cash_carte;
+ $data['taux_hyp_d_c'] = $taux->taux_com_hyp_depot_cash_carte;
+ $data['taux_bq_d_c'] = $taux->taux_com_banque_depot_cash_carte;
+ $this->load->view('header', $data);
+ $this->load->view('config_wallet_ilink_hyp/agent_send_cash_carte');
+ break;
+ case 'agent_send_cash_canal':
+ $data['taux_ag_s_c'] = $taux->taux_com_ag_envoi_cash;
+ $data['taux_sup_s_c'] = $taux->taux_com_sup_envoi_cash;
+ $data['taux_hyp_s_c'] = $taux->taux_com_hyp_envoi_cash;
+
+ $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']);
+ $data['plr_agent_cash_cash'] = $this->wallet_model->getPalierConfigWallet("agent_cash_cash_international", $data['idConfig']);
+
+ $data['plr_agent_depot_wallet_ilink_national'] = $this->wallet_model->getPalierConfigWallet("agent_depot_wallet_ilink_national" , $data['idConfig']);
+ $data['plr_agent_depot_autre_wallet_national'] = $this->wallet_model->getPalierConfigWallet("agent_depot_autre_wallet_national" , $data['idConfig']);
+ $data['plr_agent_cash_cash_national'] = $this->wallet_model->getPalierConfigWallet("agent_cash_cash_national", $data['idConfig']);
+ $this->load->view('header', $data);
+ $this->load->view('config_wallet_ilink_hyp/agent_send_cash_canal');
+ break;
+ case 'taxes':
+ $data['taxes'] = $this->wallet_model->getTaxes($data['idConfig']);
+ $this->load->view('header', $data);
+ $this->load->view('config_wallet_ilink_hyp/taxes');
+ break;
+ }
+ $this->load->view('footer');
+ }
+
+ private function show_config_infos($type)
+ {
+
+ $data['active'] = "wallet_wallet";
+ $data['alert'] = "";
+ $data['pays'] = $this->user_model->getAllCountries();
+ $data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
+ $data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
+ $data['firstname'] = $this->session->userdata('firstname');
+ $data['lastname'] = $this->session->userdata('lastname');
+ $data['email'] = $this->session->userdata('email');
+ $data['network'] = $this->session->userdata('current_network');
+ $data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
+ $data['network_id'] = $this->session->userdata('current_network_id');
+ $data['country'] = $this->session->userdata('name_current_pays');
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+ $data['currency_code'] = $this->session->userdata('currency_code');
+
+ $data['category'] = $this->session->userdata('category');
+ $data['idConfig'] = $data['hasWallet']->first_row()->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']);
+ $data['transmitting_networks'] = $this->wallet_model->getTransmittingNetworksByConfigWallet($data['idConfig']);
+
+ $this->load->view('header', $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)) {
+ $network_id = $_POST['network_id'];
+ $config_id = $_POST['config_id'];
+ $rate = $_POST['rate'];
+ $url = $_POST['url'];
+ $res = $this->wallet_model->setSharingRate($network_id, $config_id, $rate, $url);
+
+ if ($res) {
+ echo json_encode("200");
+ } else {
+ echo json_encode("500");
+ }
+
+ }
+ }
+ }
+
+ public function nano_credit()
+ {
+ if ($this->isLogged()) {
+ $data['network_id'] = $this->session->userdata('current_network_id');
+ if ($this->input->get('history')) {
+ $this->historique_nano_credit($data['network_id'], $this->input->get('d'), $this->input->get('f'), $this->input->get('history'));
+ } elseif ($this->input->get('config')) {
+ $this->config_nano_credit($this->input->get('config'));
+ } elseif ($this->input->get('group')) {
+ $this->users_group_details($this->input->get('group'));
+ } 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['rates'] = $this->nano_credit_model->getNanoCreditRates($data['idConfig']);
+ $data['taxes'] = $this->wallet_model->getTaxes($data['idConfig'], 'nano_credit');
+ $data['active'] = "nano_credit";
+ $data['alert'] = "";
+ $data['pays'] = $this->user_model->getAllCountries();
+ $data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
+ $data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
+ $data['firstname'] = $this->session->userdata('firstname');
+ $data['lastname'] = $this->session->userdata('lastname');
+ $data['email'] = $this->session->userdata('email');
+ $data['network'] = $this->session->userdata('current_network');
+ $data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
+ $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();
+
+ $this->load->view('header', $data);
+ $this->load->view('nano_credit/gestion_nano_credit_hyp');
+ $this->load->view('footer');
+ }
+ }
+ }
+
+ private function config_nano_credit($config)
+ {
+// $data['configWallet'] = $this->wallet_model->getConfigWallet($network_id);
+ $data['active'] = "nano_credit";
+ $data['alert'] = "";
+ $data['pays'] = $this->user_model->getAllCountries();
+ $data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
+ $data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
+ $data['firstname'] = $this->session->userdata('firstname');
+ $data['lastname'] = $this->session->userdata('lastname');
+ $data['email'] = $this->session->userdata('email');
+ $data['network'] = $this->session->userdata('current_network');
+ $data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
+ $data['network_id'] = $this->session->userdata('current_network_id');
+ $data['country'] = $this->session->userdata('name_current_pays');
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+ $data['currency_code'] = $this->session->userdata('currency_code');
+
+ $data['category'] = $this->session->userdata('category');
+ $data['idConfig'] = $data['hasWallet']->first_row()->id;
+ switch ($config) {
+ case 'nano_credit':
+ $taux = $data['hasWallet']->first_row();
+ $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;
+ $data['rates'] = $this->nano_credit_model->getNanoCreditRates($data['idConfig']);
+ $data['taxes'] = $this->wallet_model->getTaxes($data['idConfig'], 'nano_credit');
+ $this->load->view('header', $data);
+ $this->load->view('nano_credit/config_nano_credit');
+ break;
+
+ case 'epargne':
+ $data['rates'] = $this->nano_credit_model->getNanoCreditRates($data['idConfig'], 'epargne');
+ $data['taxes'] = $this->wallet_model->getTaxes($data['idConfig'], 'epargne');
+ $this->load->view('header', $data);
+ $this->load->view('nano_credit/config_savings');
+ break;
+ }
+ $this->load->view('footer');
+ }
+
+ private function historique_nano_credit($network_id, $startDate, $endDate, $type)
+ {
+
+// $data['configWallet'] = $this->wallet_model->getConfigWallet($network_id);
+ $format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d';
+ $data['startDate'] = $startDate ? date($format, strtotime($startDate)) : null;
+ $data['endDate'] = $endDate ? date($format, strtotime($endDate)) : null;
+ $endDate = Date('Y-m-d', strtotime($endDate . "+1 day"));
+ $data['currency_code'] = $this->session->userdata('currency_code');
+
+ if ($type == 'nano_credit') {
+ $data['transactions'] = $this->nano_credit_model->getUserDemandesCredit($startDate, $endDate, $network_id);
+
+ } else if ($type == 'savings') {
+ $data['transactions'] = $this->nano_credit_model->getUsersSavings($startDate, $endDate, $network_id);
+ }
+ $data['active'] = "nano_credit";
+ $data['alert'] = "";
+ $data['pays'] = $this->user_model->getAllCountries();
+ $data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
+ $data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
+ $data['firstname'] = $this->session->userdata('firstname');
+ $data['lastname'] = $this->session->userdata('lastname');
+ $data['email'] = $this->session->userdata('email');
+ $data['network'] = $this->session->userdata('current_network');
+ $data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
+ $data['network_id'] = $this->session->userdata('current_network_id');
+ $data['country'] = $this->session->userdata('name_current_pays');
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+ $data['currency_code'] = $this->session->userdata('currency_code');
+
+ $data['category'] = $this->session->userdata('category');
+ $data['id_network'] = $this->session->userdata('current_network_id');
+
+ $this->load->view('header', $data);
+ if ($type == 'savings')
+ $this->load->view('nano_credit/historique_savings');
+ else
+ $this->load->view('nano_credit/historique_nano_credit');
+ $this->load->view('footer');
+ }
+
+
+ private function users_group_details($group_code)
+ {
+ $data['active'] = "nano_credit";
+ $data['alert'] = "";
+ $data['pays'] = $this->user_model->getAllCountries();
+ $data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
+ $data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
+ $data['firstname'] = $this->session->userdata('firstname');
+ $data['lastname'] = $this->session->userdata('lastname');
+ $data['email'] = $this->session->userdata('email');
+ $data['network'] = $this->session->userdata('current_network');
+ $data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
+ $data['network_id'] = $this->session->userdata('current_network_id');
+ $data['country'] = $this->session->userdata('name_current_pays');
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+ $data['currency_code'] = $this->session->userdata('currency_code');
+
+ $data['category'] = $this->session->userdata('category');
+ $data['members'] = $this->nano_credit_model->getGroupMembers($group_code);
+ $data['group'] = $this->nano_credit_model->getGroup($group_code);
+
+ //Calcul de la capacite d'emprunt
+ $CE = 0;
+ if($data['members']){
+ $sommeCredits = 0;
+ $sommeEpargnes = 0;
+ foreach ($data['members']->result() as $user){
+ $sum_credit = $this->nano_credit_model->sumGroupCredit($user->id_user) ? $this->nano_credit_model->sumGroupCredit($user->id_user)->credit : 0;
+ $sommeCredits += $sum_credit;
+ $sommeEpargnes += $user->balance_epargne;
+ }
+ $CE = $sommeEpargnes - $sommeCredits;
+ }
+
+ $data['CE'] = $CE;
+ $data['group_code'] = $group_code;
+ $this->load->view('header', $data);
+ $this->load->view('nano_credit/users_group_detail');
+ $this->load->view('footer');
+ }
+
+ public function operators()
+ {
+
+ if ($this->isLogged()) {
+
+ $data['active'] = "operators";
+ $data['alert'] = "";
+ $data['pays'] = $this->user_model->getAllCountries();
+ $data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
+ $data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
+ $data['firstname'] = $this->session->userdata('firstname');
+ $data['lastname'] = $this->session->userdata('lastname');
+ $data['email'] = $this->session->userdata('email');
+ $data['network'] = $this->session->userdata('current_network');
+ $data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
+ $data['network_id'] = $this->session->userdata('current_network_id');
+ $data['country'] = $this->session->userdata('name_current_pays');
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+ $data['currency_code'] = $this->session->userdata('currency_code');
+ $data['category'] = $this->session->userdata('category');
+
+ $data['operators'] = $this->wallet_model->getOperatorsForNetwork($this->session->userdata('current_network_id'));
+
+
+ $this->load->view('header', $data);
+ $this->load->view('gestion_operateurs_hyp');
+ $this->load->view('footer');
+ }
+ }
+
public function documentation($route = null)
{
if (!$this->session->userdata('email')) {
@@ -168,4 +755,16 @@ class Admin_dash extends CI_Controller
}
}
+ private function isLogged(){
+ if (!$this->session->userdata('email')) {
+ $this->session->set_flashdata('error', 'log in first');
+
+ $data['alert'] = "ok";
+ $data['message'] = "Login first!";
+
+ redirect('index.php', $data);
+ return false;
+ }
+ return true;
+ }
}
diff --git a/application/controllers/Admin_password.php b/application/controllers/Admin_password.php
index 650d0a83..7eb40672 100755
--- a/application/controllers/Admin_password.php
+++ b/application/controllers/Admin_password.php
@@ -1,82 +1,82 @@
-load->model('user_model');
-
- }
-
- public function index()
- {
-
- if (!$this->input->get('token')) {
- echo "Lien incorrect";
- }
- else {
-
- $db_token = $this->user_model->getToken($this->input->get('token'));
- if($db_token==true){
- $this->session->set_userdata('token', $this->input->get('token'));
- $this->load->view('admin_update_password');
- }else{
- echo "Ce lien a déjà expiré";
- }
- }
-
- }
-
- public function create_password()
- {
-
- if (!$this->session->userdata('token')) {
- echo "Ce lien a déjà expiré";
- } else {
-
- if(isset($_POST))
- {
- $password = $this->input->post('password');
- $hash = $this->hashSSHA($password);
- $encrypted_password = $hash["encrypted"]; // encrypted password
- $salt = $hash["salt"]; // salt
-
- $res = $this->user_model->createPasswordAdmin($encrypted_password,$salt,$this->session->userdata('token'));
-
- if($res==true){
- $new_token = null;
- do {
- $new_token = bin2hex(openssl_random_pseudo_bytes(16));
- $tokenExist = $this->user_model->getToken($new_token);
- } while ($tokenExist==true);
-
-
- $res_token = $this->user_model->updateToken($new_token,$this->session->userdata('token'));
-
- if($res_token==true){
- $data['alert'] = 'password';
- $data['message'] = 'Votre mot de passe a été configuré avec succès';
- $this->load->view('login', $data);
- }else{
- echo "Une erreur s'est produite";
- }
- }else{
- echo "Une erreur s'est produite";
- }
- }
- }
- }
-
- public function hashSSHA($password) {
-
- $salt = sha1(rand());
- $salt = substr($salt, 0, 10);
- $encrypted = base64_encode(sha1($password . $salt, true) . $salt);
- $hash = array("salt" => $salt, "encrypted" => $encrypted);
- return $hash;
- }
-
-}
+load->model('user_model');
+
+ }
+
+ public function index()
+ {
+
+ if (!$this->input->get('token')) {
+ echo "Lien incorrect";
+ }
+ else {
+
+ $db_token = $this->user_model->getToken($this->input->get('token'));
+ if($db_token==true){
+ $this->session->set_userdata('token', $this->input->get('token'));
+ $this->load->view('admin_update_password');
+ }else{
+ echo "Ce lien a déjà expiré";
+ }
+ }
+
+ }
+
+ public function create_password()
+ {
+
+ if (!$this->session->userdata('token')) {
+ echo "Ce lien a déjà expiré";
+ } else {
+
+ if(isset($_POST))
+ {
+ $password = $this->input->post('password');
+ $hash = $this->hashSSHA($password);
+ $encrypted_password = $hash["encrypted"]; // encrypted password
+ $salt = $hash["salt"]; // salt
+
+ $res = $this->user_model->createPasswordAdmin($encrypted_password,$salt,$this->session->userdata('token'));
+
+ if($res==true){
+ $new_token = null;
+ do {
+ $new_token = bin2hex(openssl_random_pseudo_bytes(16));
+ $tokenExist = $this->user_model->getToken($new_token);
+ } while ($tokenExist==true);
+
+
+ $res_token = $this->user_model->updateToken($new_token,$this->session->userdata('token'));
+
+ if($res_token==true){
+ $data['alert'] = 'password';
+ $data['message'] = 'Votre mot de passe a été configuré avec succès';
+ $this->load->view('login', $data);
+ }else{
+ echo "Une erreur s'est produite";
+ }
+ }else{
+ echo "Une erreur s'est produite";
+ }
+ }
+ }
+ }
+
+ public function hashSSHA($password) {
+
+ $salt = sha1(rand());
+ $salt = substr($salt, 0, 10);
+ $encrypted = base64_encode(sha1($password . $salt, true) . $salt);
+ $hash = array("salt" => $salt, "encrypted" => $encrypted);
+ return $hash;
+ }
+
+}
diff --git a/application/controllers/CodesG.php b/application/controllers/CodesG.php
index a3abfae6..612cb667 100755
--- a/application/controllers/CodesG.php
+++ b/application/controllers/CodesG.php
@@ -4,9 +4,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class CodesG extends CI_Controller
{
- public function _contruct()
+ public function __construct()
{
- parent::_contruct();
+ parent::__construct();
$this->load->model('user_model');
}
diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php
index aace0e1e..7c78bb46 100755
--- a/application/controllers/Gestion.php
+++ b/application/controllers/Gestion.php
@@ -491,7 +491,7 @@ class Gestion extends CI_Controller
if ($query) {
- $link = "https://ilink-app.com/backofficebeta/index.php/Admin_password/?token=" . $token;
+ $link = base_url("index.php/Admin_password/?token=" . $token);
$this->load->library('email');
$this->email->from('noreply@ilink-app.com', 'iLink World');
diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php
index 0224188e..47a83956 100755
--- a/application/controllers/Hyperviseur_dash.php
+++ b/application/controllers/Hyperviseur_dash.php
@@ -535,10 +535,16 @@ class Hyperviseur_dash extends CI_Controller
$data['transactions'] = $this->user_model->getDeletedTransactions($startDate, $endDate, $this->session->userdata('network_id'));
else if ($type == 'commission_transfer')
$data['transactions'] = $this->wallet_model->getCommissionTransfersByNetwork($startDate, $endDate, $this->session->userdata('network_id'));
- else if ($type == 'balance_statement')
+ else if ($type == 'balance_statement'){
+ $res = $this->wallet_model->getWalletPassword($this->session->userdata('network_id'));
+ $data['walletPassword'] = $res ? $res->first_row() : null;
+
$data['wallets'] = $this->user_model->getInfosWalletAgentForHyper($this->session->userdata('network_id'));
- else if ($type == 'refund_history')
+
+ } else if ($type == 'refund_history')
$data['refunds'] = $this->wallet_model->getRefunds($startDate, $endDate, $network_id);
+ else if ($type == 'commission_payments')
+ $data['payments'] = $this->wallet_model->getCommissionPayments($startDate, $endDate, $network_id);
else
$data['transactions'] = $this->wallet_model->getRecharges($startDate, $endDate, $network_id);
@@ -569,6 +575,8 @@ class Hyperviseur_dash extends CI_Controller
$this->load->view('config_wallet_ilink_hyp/etat_soldes');
else if ($type == 'refund_history')
$this->load->view('historique_remboursement');
+ else if ($type == 'commission_payments')
+ $this->load->view('config_wallet_ilink_hyp/historique_commission_payements');
else
$this->load->view('historique_recharges');
$this->load->view('footer');
@@ -817,6 +825,32 @@ class Hyperviseur_dash extends CI_Controller
}
}
+ public function pay_commission_in_cash()
+ {
+ if ($this->isLogged()) {
+ if (isset($_POST)) {
+ $password = $_POST['password'];
+ $id_wallet_agent = $_POST['id_wallet_agent'];
+ $salt = $_POST['salt'];
+ $encrypted_password = $_POST['encrypted_password'];
+ $montant = $_POST['montant'];
+
+ $hash = base64_encode(sha1($password . $salt, true) . $salt);
+
+ if ($encrypted_password == $hash) {
+ $res = $this->wallet_model->payCommissionInCash($montant, $id_wallet_agent, $this->session->userdata('network_id'));
+ $code = $res ? '200' : '500';
+ } else {
+ $code = '400';
+ }
+
+ echo json_encode($code);
+
+ }
+ }
+ }
+
+
public function rembourser_compensation()
{
if ($this->isLogged()) {
@@ -1746,6 +1780,7 @@ class Hyperviseur_dash extends CI_Controller
$data['networks'] = $this->user_model->getActiveNetwork();
$data['currency_code'] = $this->session->userdata('currency_code');
$data['category'] = $this->session->userdata('category');
+ $data['network_id'] = $this->session->userdata('network_id');
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$data['operators'] = $this->wallet_model->getOperatorsForNetwork($this->session->userdata('network_id'));
diff --git a/application/controllers/List_users_s.php b/application/controllers/List_users_s.php
index 0c0071d4..25539e33 100755
--- a/application/controllers/List_users_s.php
+++ b/application/controllers/List_users_s.php
@@ -1,193 +1,193 @@
-load->model('Users_simple');
- }
-
- public function index()
- {
-
- if (!$this->session->userdata('token')) {
- $this->session->set_flashdata('error', 'log in first');
- $data['alert'] = "ok";
- $data['message'] = "Login first!";
- $this->load->view('login', $data);
- } else {
- $data['active'] = "simple_members";
- $data['alert'] = "";
- $data['network'] = $this->session->userdata('network');
- $this->load->view('header_sup', $data);
- $this->load->view('list_user_s');
- $this->load->view('footer');
- }
- }
-
- public function ajoutbtn()
- {
- if ($this->input->post('ajbtn')) {
- $nom = $this->input->post('nm');
- $prenom = $this->input->post('prnm');
- $Cpays = $this->input->post('cdpays');
- $Reso = $this->input->post('reso');
- $Cmbre = $this->input->post('cmbre');
- $emaill = $this->input->post('maill');
- $Catgry = $this->input->post('cat');
- $phoneNm = $this->input->post('tel');
-
-
- $data = array(
- 'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso,
- 'membre_code' => $Cmbre, 'emaill' => $emaill, 'category' => $Catgry, 'phone' => $phoneNm
-
- );
-
-
- $query = $this->db->insert('users_simple', $data);
- if ($query) {
-
- $data['alert'] = "ok";
- $data['success'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $phoneNm has been added!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- } else {
-
- $data['alert'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $phoneNm couldn't been added!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
-
- }
- } else {
-
- $data['alert'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "Database error!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- }
- }
-
- function suppr()
- {
- if ($this->input->get('recordId')) {
- $id = "+" . $this->input->get('recordId');
- $id = str_replace(' ', '', $id);
-
- /*$this->db->where('phone', $id);
- $query = $this->db->delete('users');
- */
- $query = $this->db->delete('users_simple', array('phone' => $id));
-
- if ($query) {
- $data['alert'] = "ok";
- $data['success'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $id has been deleted!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- } else {
- $data['alert'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $id couldn't been deleted!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- }
-
-
- } else {
- $data['alert'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $id couldn't been deleted! No data sent";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- }
-
- }
-
- public function modif()
- {
- if ($this->input->post('modifbtn')) {
- $nom = $this->input->post('nm');
- $prenom = $this->input->post('prnm');
- $Cpays = $this->input->post('cdpays');
- $Reso = $this->input->post('reso');
- $Cmbre = $this->input->post('cmbre');
- $emaill = $this->input->post('maill');
- $Catgry = $this->input->post('cat');
- $phoneNm = $this->input->post('tel');
-
-
- $data = array(
- 'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'member_code' => $Cmbre,
- 'email' => $emaill, 'category' => $Catgry
- );
-
- $this->db->where('phone', $phoneNm);
-
- $query = $this->db->update('users_simple', $data);
- if ($query) {
-
- $data['alert'] = "ok";
- $data['success'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $phoneNm has been updated!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
-
- //redirect('Listes_admin');
- } else {
-
- $data['alert'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $phoneNm couldn't been updated!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- }
- } else {
- $data['alert'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The record couldn't been updated! No data sent.";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- }
- }
-
-}
-
-?>
+load->model('Users_simple');
+ }
+
+ public function index()
+ {
+
+ if (!$this->session->userdata('token')) {
+ $this->session->set_flashdata('error', 'log in first');
+ $data['alert'] = "ok";
+ $data['message'] = "Login first!";
+ $this->load->view('login', $data);
+ } else {
+ $data['active'] = "simple_members";
+ $data['alert'] = "";
+ $data['network'] = $this->session->userdata('network');
+ $this->load->view('header_sup', $data);
+ $this->load->view('list_user_s');
+ $this->load->view('footer');
+ }
+ }
+
+ public function ajoutbtn()
+ {
+ if ($this->input->post('ajbtn')) {
+ $nom = $this->input->post('nm');
+ $prenom = $this->input->post('prnm');
+ $Cpays = $this->input->post('cdpays');
+ $Reso = $this->input->post('reso');
+ $Cmbre = $this->input->post('cmbre');
+ $emaill = $this->input->post('maill');
+ $Catgry = $this->input->post('cat');
+ $phoneNm = $this->input->post('tel');
+
+
+ $data = array(
+ 'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso,
+ 'membre_code' => $Cmbre, 'emaill' => $emaill, 'category' => $Catgry, 'phone' => $phoneNm
+
+ );
+
+
+ $query = $this->db->insert('users_simple', $data);
+ if ($query) {
+
+ $data['alert'] = "ok";
+ $data['success'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $phoneNm has been added!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ } else {
+
+ $data['alert'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $phoneNm couldn't been added!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+
+ }
+ } else {
+
+ $data['alert'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "Database error!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ }
+ }
+
+ function suppr()
+ {
+ if ($this->input->get('recordId')) {
+ $id = "+" . $this->input->get('recordId');
+ $id = str_replace(' ', '', $id);
+
+ /*$this->db->where('phone', $id);
+ $query = $this->db->delete('users');
+ */
+ $query = $this->db->delete('users_simple', array('phone' => $id));
+
+ if ($query) {
+ $data['alert'] = "ok";
+ $data['success'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $id has been deleted!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ } else {
+ $data['alert'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $id couldn't been deleted!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ }
+
+
+ } else {
+ $data['alert'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $id couldn't been deleted! No data sent";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ }
+
+ }
+
+ public function modif()
+ {
+ if ($this->input->post('modifbtn')) {
+ $nom = $this->input->post('nm');
+ $prenom = $this->input->post('prnm');
+ $Cpays = $this->input->post('cdpays');
+ $Reso = $this->input->post('reso');
+ $Cmbre = $this->input->post('cmbre');
+ $emaill = $this->input->post('maill');
+ $Catgry = $this->input->post('cat');
+ $phoneNm = $this->input->post('tel');
+
+
+ $data = array(
+ 'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'member_code' => $Cmbre,
+ 'email' => $emaill, 'category' => $Catgry
+ );
+
+ $this->db->where('phone', $phoneNm);
+
+ $query = $this->db->update('users_simple', $data);
+ if ($query) {
+
+ $data['alert'] = "ok";
+ $data['success'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $phoneNm has been updated!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+
+ //redirect('Listes_admin');
+ } else {
+
+ $data['alert'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $phoneNm couldn't been updated!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ }
+ } else {
+ $data['alert'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The record couldn't been updated! No data sent.";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ }
+ }
+
+}
+
+?>
diff --git a/application/controllers/Liste_users_g.php b/application/controllers/Liste_users_g.php
index 897c3be1..927a7314 100755
--- a/application/controllers/Liste_users_g.php
+++ b/application/controllers/Liste_users_g.php
@@ -1,196 +1,196 @@
-load->model('Users_model');
- }
-
- public function index()
- {
-
- if (!$this->session->userdata('token')) {
- $this->session->set_flashdata('error', 'log in first');
- $data['alert'] = "ok";
- $data['message'] = "Login first!";
- $this->load->view('login', $data);
- } else {
- $data['active'] = "simple_members";
- $data['parrain'] = $this->session->userdata('parrain');
- $data['alert'] = "";
- $data['network'] = $this->session->userdata('network');
- $data['longitude'] = $this->session->userdata('longitude');
- $data['latitude'] = $this->session->userdata('latitude');
- $this->load->view('header_sup', $data);
- $this->load->view('list_user_s');
- $this->load->view('footer');
- }
- }
-
- public function ajoutbtn()
- {
- if ($this->input->post('ajbtn')) {
- $nom = $this->input->post('nm');
- $prenom = $this->input->post('prnm');
- $Cpays = $this->input->post('cdpays');
- $Reso = $this->input->post('reso');
- $Cmbre = $this->input->post('cmbre');
- $emaill = $this->input->post('maill');
- $Catgry = $this->input->post('cat');
- $phoneNm = $this->input->post('tel');
-
-
- $data = array(
- 'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso,
- 'membre_code' => $Cmbre, 'emaill' => $emaill, 'category' => $Catgry, 'phone' => $phoneNm
-
- );
-
-
- $query = $this->db->insert('users_simple', $data);
- if ($query) {
-
- $data['alert'] = "ok";
- $data['success'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $phoneNm has been added!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- } else {
-
- $data['alert'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $phoneNm couldn't been added!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
-
- }
- } else {
-
- $data['alert'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "Database error!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- }
- }
-
- function suppr()
- {
- if ($this->input->get('recordId')) {
- $id = "+" . $this->input->get('recordId');
- $id = str_replace(' ', '', $id);
-
- /*$this->db->where('phone', $id);
- $query = $this->db->delete('users');
- */
- $query = $this->db->delete('users_simple', array('phone' => $id));
-
- if ($query) {
- $data['alert'] = "ok";
- $data['success'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $id has been deleted!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- } else {
- $data['alert'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $id couldn't been deleted!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- }
-
-
- } else {
- $data['alert'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $id couldn't been deleted! No data sent";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- }
-
- }
-
- public function modif()
- {
- if ($this->input->post('modifbtn')) {
- $nom = $this->input->post('nm');
- $prenom = $this->input->post('prnm');
- $Cpays = $this->input->post('cdpays');
- $Reso = $this->input->post('reso');
- $Cmbre = $this->input->post('cmbre');
- $emaill = $this->input->post('maill');
- $Catgry = $this->input->post('cat');
- $phoneNm = $this->input->post('tel');
-
-
- $data = array(
- 'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'member_code' => $Cmbre,
- 'email' => $emaill, 'category' => $Catgry
- );
-
- $this->db->where('phone', $phoneNm);
-
- $query = $this->db->update('users_simple', $data);
- if ($query) {
-
- $data['alert'] = "ok";
- $data['success'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $phoneNm has been updated!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
-
- //redirect('Listes_admin');
- } else {
-
- $data['alert'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The member $phoneNm couldn't been updated!";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- }
- } else {
- $data['alert'] = "ok";
- $data['active'] = "simple_members";
- $data['message'] = "The record couldn't been updated! No data sent.";
-
-
- $this->load->view('header', $data);
- $this->load->view('listemembers');
- $this->load->view('footer');
- }
- }
-
-}
-
-?>
\ No newline at end of file
+load->model('Users_model');
+ }
+
+ public function index()
+ {
+
+ if (!$this->session->userdata('token')) {
+ $this->session->set_flashdata('error', 'log in first');
+ $data['alert'] = "ok";
+ $data['message'] = "Login first!";
+ $this->load->view('login', $data);
+ } else {
+ $data['active'] = "simple_members";
+ $data['parrain'] = $this->session->userdata('parrain');
+ $data['alert'] = "";
+ $data['network'] = $this->session->userdata('network');
+ $data['longitude'] = $this->session->userdata('longitude');
+ $data['latitude'] = $this->session->userdata('latitude');
+ $this->load->view('header_sup', $data);
+ $this->load->view('list_user_s');
+ $this->load->view('footer');
+ }
+ }
+
+ public function ajoutbtn()
+ {
+ if ($this->input->post('ajbtn')) {
+ $nom = $this->input->post('nm');
+ $prenom = $this->input->post('prnm');
+ $Cpays = $this->input->post('cdpays');
+ $Reso = $this->input->post('reso');
+ $Cmbre = $this->input->post('cmbre');
+ $emaill = $this->input->post('maill');
+ $Catgry = $this->input->post('cat');
+ $phoneNm = $this->input->post('tel');
+
+
+ $data = array(
+ 'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso,
+ 'membre_code' => $Cmbre, 'emaill' => $emaill, 'category' => $Catgry, 'phone' => $phoneNm
+
+ );
+
+
+ $query = $this->db->insert('users_simple', $data);
+ if ($query) {
+
+ $data['alert'] = "ok";
+ $data['success'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $phoneNm has been added!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ } else {
+
+ $data['alert'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $phoneNm couldn't been added!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+
+ }
+ } else {
+
+ $data['alert'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "Database error!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ }
+ }
+
+ function suppr()
+ {
+ if ($this->input->get('recordId')) {
+ $id = "+" . $this->input->get('recordId');
+ $id = str_replace(' ', '', $id);
+
+ /*$this->db->where('phone', $id);
+ $query = $this->db->delete('users');
+ */
+ $query = $this->db->delete('users_simple', array('phone' => $id));
+
+ if ($query) {
+ $data['alert'] = "ok";
+ $data['success'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $id has been deleted!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ } else {
+ $data['alert'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $id couldn't been deleted!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ }
+
+
+ } else {
+ $data['alert'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $id couldn't been deleted! No data sent";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ }
+
+ }
+
+ public function modif()
+ {
+ if ($this->input->post('modifbtn')) {
+ $nom = $this->input->post('nm');
+ $prenom = $this->input->post('prnm');
+ $Cpays = $this->input->post('cdpays');
+ $Reso = $this->input->post('reso');
+ $Cmbre = $this->input->post('cmbre');
+ $emaill = $this->input->post('maill');
+ $Catgry = $this->input->post('cat');
+ $phoneNm = $this->input->post('tel');
+
+
+ $data = array(
+ 'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'member_code' => $Cmbre,
+ 'email' => $emaill, 'category' => $Catgry
+ );
+
+ $this->db->where('phone', $phoneNm);
+
+ $query = $this->db->update('users_simple', $data);
+ if ($query) {
+
+ $data['alert'] = "ok";
+ $data['success'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $phoneNm has been updated!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+
+ //redirect('Listes_admin');
+ } else {
+
+ $data['alert'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The member $phoneNm couldn't been updated!";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ }
+ } else {
+ $data['alert'] = "ok";
+ $data['active'] = "simple_members";
+ $data['message'] = "The record couldn't been updated! No data sent.";
+
+
+ $this->load->view('header', $data);
+ $this->load->view('listemembers');
+ $this->load->view('footer');
+ }
+ }
+
+}
+
+?>
diff --git a/application/controllers/Listes_admin.php b/application/controllers/Listes_admin.php
index a5c65959..dce1bec1 100755
--- a/application/controllers/Listes_admin.php
+++ b/application/controllers/Listes_admin.php
@@ -4,9 +4,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Listes_admin extends CI_Controller
{
- public function _contruct()
+ public function __construct()
{
- parent::_contruct();
+ parent::__construct();
$this->load->model('user_model');
}
diff --git a/application/controllers/Listes_members.php b/application/controllers/Listes_members.php
index 63cac441..47c32417 100755
--- a/application/controllers/Listes_members.php
+++ b/application/controllers/Listes_members.php
@@ -4,11 +4,13 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Listes_members extends CI_Controller
{
- public function _contruct()
+ public function __construct()
{
- parent::_contruct();
+ parent::__construct();
$this->load->model('user_model');
- }
+ $this->load->model('wallet_model');
+
+ }
public function index()
{
@@ -34,7 +36,9 @@ class Listes_members extends CI_Controller
$data['lastname'] = $this->session->userdata('lastname');
$data['email'] = $this->session->userdata('email');
$data['alert'] = "";
- $this->load->view('header', $data);
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+
+ $this->load->view('header', $data);
$this->load->view('listemembers');
$this->load->view('footer');
}
@@ -93,7 +97,9 @@ class Listes_members extends CI_Controller
function suppr()
{
- if ($this->input->get('recordId')) {
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+
+ if ($this->input->get('recordId')) {
$id = "+" . $this->input->get('recordId');
$id = str_replace(' ', '', $id);
diff --git a/application/controllers/Member_code_admin.php b/application/controllers/Member_code_admin.php
index 0828cb0a..61b8805d 100755
--- a/application/controllers/Member_code_admin.php
+++ b/application/controllers/Member_code_admin.php
@@ -4,10 +4,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Member_code_admin extends CI_Controller
{
- public function _contruct()
+ public function __construct()
{
- parent::_contruct();
+ parent::__construct();
$this->load->model('user_model');
+ $this->load->model('wallet_model');
}
@@ -39,7 +40,9 @@ class Member_code_admin extends CI_Controller
$data['email'] = $this->session->userdata('email');
$data['alert'] = "";
$data['pays'] = $this->user_model->getAllCountries();
- $this->load->view('header', $data);
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+
+ $this->load->view('header', $data);
$this->load->view('membreCodeAdmin');
$this->load->view('footer');
}
@@ -67,6 +70,8 @@ class Member_code_admin extends CI_Controller
$query = $this->db->insert('codemembre', $data);
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+
if ($query && $rslt) {
$data['active'] = "members_code";
@@ -92,7 +97,9 @@ class Member_code_admin extends CI_Controller
public function delete()
{
- if ($this->input->get('recordId')) {
+ $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
+
+ if ($this->input->get('recordId')) {
$id = "+" . $this->input->get('recordId');
$id = str_replace(' ', '', $id);
diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php
index f453820b..eeca86b2 100755
--- a/application/language/english/message_lang.php
+++ b/application/language/english/message_lang.php
@@ -612,4 +612,9 @@ $lang['nano_health_removal'] = 'Removal of nano health';
$lang['activate_nano_health'] = 'Activate nano health';
$lang['nano_health_deleted'] = 'Nano health deleted';
$lang['phone_already_exists'] = "This phone number already exists";
+$lang['pay_commission_in_cash'] = "Pay commission in cash";
+$lang['payment_done'] = "Payment made";
+$lang['commission_payments_history'] = "Commission payment history";
+$lang['initial_commission'] = "Initial commission";
+$lang['final_commission'] = "Final commission";
?>
diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php
index 759149a6..662927c0 100755
--- a/application/language/french/message_lang.php
+++ b/application/language/french/message_lang.php
@@ -624,4 +624,9 @@ $lang['nano_health_removal'] = 'Suppression du nano santé';
$lang['activate_nano_health'] = 'Activation du nano santé';
$lang['nano_health_deleted'] = 'Nano santé supprimé';
$lang['phone_already_exists'] = "This phone number already exists";
+$lang['pay_commission_in_cash'] = "Payer la commission en espèce";
+$lang['payment_done'] = "Paiement effectué";
+$lang['commission_payments_history'] = "Historique des paiements de commission";
+$lang['initial_commission'] = "Commission initiale";
+$lang['final_commission'] = "Commission finale";
?>
diff --git a/application/models/Wallet_model.php b/application/models/Wallet_model.php
index decf0f4e..6731ba02 100644
--- a/application/models/Wallet_model.php
+++ b/application/models/Wallet_model.php
@@ -943,4 +943,40 @@ LEFT JOIn networks_operators nb ON nb.id_operator_country = bc.id AND nb.id_netw
return date('Y-m-d H:i:s');
}
}
+
+ public function payCommissionInCash($montant, $id_wallet_agent,$id_network){
+ try{
+ $this->db->trans_begin();
+
+ $datetime = $this->getCurrentTimeByNetworkID($id_network);
+
+ $walletAgent = $this->db->get_where('wallets',['id' => $id_wallet_agent])->first_row();
+ // Mise à jour du compte
+ $sql = "UPDATE `wallets` SET balance_com = balance_com - ? WHERE (`id` = ? );";
+ $this->db->query($sql , array($montant,$id_wallet_agent));
+
+ $data = array('amount' => $montant , 'initial_commission' => $walletAgent->balance_com ,
+ 'final_commission' => $walletAgent->balance_com + $montant, 'id_wallet_agent' => $id_wallet_agent , 'date'=> $datetime);
+ $this->db->insert('commission_payments', $data);
+
+ $this->db->trans_commit();
+ return true;
+
+ }catch (Throwable $e){
+ $this->db->trans_rollback();
+ return false;
+ }
+ }
+
+ public function getCommissionPayments($debut, $fin, $id_network)
+ {
+ $chain = $debut ? " AND date BETWEEN '" . $debut . "' AND '" . $fin . "'" : "";
+ $query = $this->db->query("SELECT cp.* , wa.lastname, wa.currency_code FROM commission_payments cp
+ INNER JOIN wallet_agent wa ON cp.id_wallet_agent = wa.wallet_id WHERE wa.network_id =" . $id_network . $chain);
+ if ($query->num_rows() > 0) {
+ return $query;
+ } else {
+ return false;
+ }
+ }
}
diff --git a/application/views/config_wallet_ilink_hyp/etat_soldes.php b/application/views/config_wallet_ilink_hyp/etat_soldes.php
index 3aa72339..b06cf76d 100755
--- a/application/views/config_wallet_ilink_hyp/etat_soldes.php
+++ b/application/views/config_wallet_ilink_hyp/etat_soldes.php
@@ -80,6 +80,11 @@
= $this->lang->line('Telephone') ?>
= $this->lang->line('code membre') ?> |
Agent |
+ session->userdata('category') != 'super') { ?>
+
Action |
+
@@ -117,6 +125,14 @@
" . $row->codeMembre . " |
" . $row->lastname . " | ";
?>
+ session->userdata('category') != 'super') { ?>
+
+
+ |
+
+
@@ -171,10 +234,25 @@
-
+
diff --git a/application/views/config_wallet_ilink_hyp/historique_commission_payements.php b/application/views/config_wallet_ilink_hyp/historique_commission_payements.php
new file mode 100755
index 00000000..61fe18fb
--- /dev/null
+++ b/application/views/config_wallet_ilink_hyp/historique_commission_payements.php
@@ -0,0 +1,290 @@
+
+
+
+
+
+
+ db->hostname . ';dbname=' . $this->db->database, $this->db->username, $this->db->password);
+
+ $configuration = new PDOProviderConfiguration();
+
+ $configuration->tableName = 'exchange_rate';
+ $configuration->exchangeRateColumnName = 'exchange_rate';
+ $configuration->targetCurrencyColumnName = 'target_currency';
+ $configuration->sourceCurrencyCode = $baseCurrency;
+
+ // this provider loads exchange rates from your database
+ $provider = new PDOProvider($pdo, $configuration);
+
+ // this provider calculates exchange rates relative to the base currency
+ $provider = new BaseCurrencyProvider($provider, $baseCurrency);
+
+ // this currency converter can now handle any currency pair
+ $converter = new CurrencyConverter($provider);
+ $context = new AutoContext();
+
+ ?>
+
+
+
+
+
+
+
+
+ lang->line('Période') ?>
+
+
+
+
+ Format : session->userdata('site_lang') === 'french' ? 'Jour - Mois - Année ' : 'Year - Month - Day' ?>
+
+
+
+
+
+
+
+
+
+
+ num_rows();
+ $num = 0;
+ if ($numrows > 0) {
+ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
+ ?>
+
+
+
+
+ N° |
+ Agent |
+ lang->line('Montant') ?> |
+ lang->line('initial_commission') ?> |
+ lang->line('final_commission') ?> |
+ Date |
+
+
+
+
+ result() as $row) {
+ $num++;
+ echo "
+ $num |
+ " . $row->lastname . " |
+ " . Money::of(round($row->amount, 2), $row->currency_code, $context)->formatTo('fr_FR') . " |
+ " . Money::of(round($row->initial_commission, 2), $row->currency_code, $context)->formatTo('fr_FR') . " |
+ " . Money::of(round($row->final_commission, 2), $row->currency_code, $context)->formatTo('fr_FR') . " |
+ " . $row->date . " |
+
";
+ }
+ ?>
+
+
+ lang->line('no_refund');
+ }
+ } else {
+ echo $this->lang->line('no_refund');
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/application/views/gestion_operateurs_hyp.php b/application/views/gestion_operateurs_hyp.php
index d9a88e85..caac45f2 100755
--- a/application/views/gestion_operateurs_hyp.php
+++ b/application/views/gestion_operateurs_hyp.php
@@ -92,7 +92,7 @@
}else{
?>
= $this->lang->line('Inactif'); ?> |
- |
+ |
@@ -182,6 +182,7 @@
$(document).on("click", ".activeOperator", function () {
const id_operator_country = $(this).data('id-operator-country');
const id_network = $(this).data('id-network');
+ console.log(id_operator_country)
$.ajax({
url : '',
type : 'POST',
diff --git a/application/views/header.php b/application/views/header.php
index db1d25f1..593b722f 100755
--- a/application/views/header.php
+++ b/application/views/header.php
@@ -1,237 +1,285 @@
-
-
-
-
-
-
- iLink | Dashboard
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
iLink | Dashboard
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/application/views/listeadmin.php b/application/views/listeadmin.php
index 80e7bd1b..d904cc00 100755
--- a/application/views/listeadmin.php
+++ b/application/views/listeadmin.php
@@ -338,9 +338,9 @@