+
lang->line('currency') ?>
+diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php old mode 100644 new mode 100755 index 3a1da68e..6381a220 --- a/application/controllers/Gestion.php +++ b/application/controllers/Gestion.php @@ -1543,15 +1543,56 @@ class Gestion extends CI_Controller $taux = $this->user_model->getTaux($network_id); if ($taux != null) { $taux = $taux->first_row(); - $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; + $data['idConfig'] = $taux->id; + if ($taux->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; + } elseif ($taux->type == 'ilink'){ + $data['plr_user_wallet_wallet'] = $this->user_model->getPalierConfigWallet("user_wallet_wallet" , $data['idConfig']); + $data['plr_user_wallet_cash'] = $this->user_model->getPalierConfigWallet("user_wallet_cash" , $data['idConfig']); + $data['plr_agent_depot_wallet'] = $this->user_model->getPalierConfigWallet("agent_depot_wallet" , $data['idConfig']); + $data['plr_agent_cash_cash'] = $this->user_model->getPalierConfigWallet("agent_cash_cash" , $data['idConfig']); + $data['u_w_w_min'] = $taux->taux_com_user_wallet_wallet_min; + $data['u_w_w_max'] = $taux->taux_com_user_wallet_wallet_max; + $data['taux_u_w_w'] = $taux->taux_com_user_wallet_wallet; + $data['u_w_c_min'] = $taux->taux_com_user_wallet_cash_min; + $data['u_w_c_max'] = $taux->taux_com_user_wallet_cash_max; + $data['taux_u_w_c'] = $taux->taux_com_user_wallet_cash; + $data['taux_u_w_cart'] = $taux->taux_com_user_wallet_carte; + $data['taux_u_c_w'] = $taux->taux_com_user_carte_wallet; + $data['taux_u_c_c'] = $taux->taux_com_user_carte_cash; + $data['ag_d_w_min'] = $taux->taux_com_wallet_ag_envoi_cash_wallet_min; + $data['ag_d_w_max'] = $taux->taux_com_wallet_ag_envoi_cash_wallet_max; + $data['taux_ag_d_w'] = $taux->taux_com_wallet_ag_envoi_cash_wallet; + $data['taux_ag_d_c_c'] = $taux->taux_com_wallet_ag_envoi_cash_carte; + $data['ag_c_c_min'] = $taux->taux_com_wallet_ag_envoi_cash_cash_min; + $data['ag_c_c_max'] = $taux->taux_com_wallet_ag_envoi_cash_cash_max; + $data['taux_ag_c_c'] = $taux->taux_com_wallet_ag_envoi_cash_cash; + $data['taux_ag_cart_c'] = $taux->taux_com_wallet_ag_carte_cash; + $data['taux_ag_cash_c'] = $taux->taux_com_wallet_ag_depot_carte; + $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['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; + $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; + $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; + } + $data['transactions'] = $this->user_model->getTransactions(null,null,$network_id); $totalCommissionBanque = 0; if($data['transactions']){ @@ -1560,20 +1601,7 @@ class Gestion extends CI_Controller } } $data['totalCommissionBanque'] = $totalCommissionBanque ; - } else { - $data["taux_client_r"] = "N/A"; - $data["taux_client_d"] = "N/A"; - $data["taux_ag_r"] = "N/A"; - $data["taux_ag_d"] = "N/A"; - $data["taux_sup_r"] = "N/A"; - $data["taux_sup_d"] = "N/A"; - $data['taux_bq_d'] = "N/A"; - $data['taux_bq_r'] = "N/A"; - $data['frais_d'] = "N/A"; - $data['totalCommissionBanque'] = "N/A"; - $data["transactions"] = false; - } $hyper = $this->user_model->getNetworkHyper($network_id)->first_row(); $data['walletHyper'] = $this->user_model->getWallet($hyper->agent_id); @@ -1590,8 +1618,12 @@ class Gestion extends CI_Controller $data['networks'] = $this->user_model->getActiveNetwork(); $this->load->view('header_gestion', $data); - $this->load->view('gestion_wallet'); + if ($taux->type == 'visa') + $this->load->view('gestion_wallet'); + elseif ($taux->type == 'ilink') + $this->load->view('gestion_wallet_ilink'); $this->load->view('footer'); + } } @@ -1614,26 +1646,63 @@ class Gestion extends CI_Controller if (isset($_POST)) { $network_id = $_POST['network_id']; + $type = $_POST['type']; if($method == 'create') { - $res = $this->user_model->addConfigWallet($network_id , 0 , 0, 0 ,0 , 0, 0, 0 , 0 , 0); + $res = $this->user_model->addConfigWallet($network_id , $type); // if($res) // $this->generateAllWallets($network_id); } else if($method = 'update'){ - $taux_client_r = $_POST['taux_client_r']; - $taux_client_d = $_POST['taux_client_d']; - $taux_ag_d = $_POST['taux_ag_d']; - $taux_ag_r = $_POST['taux_ag_r']; - $taux_sup_d = $_POST['taux_sup_d']; - $taux_sup_r = $_POST['taux_sup_r']; - $taux_bq_d = $_POST['taux_bq_d']; - $taux_bq_r = $_POST['taux_bq_r']; - $frais_d = $_POST['frais_d']; + if($type == 'uba'){ + $taux_client_r = $_POST['taux_client_r']; + $taux_client_d = $_POST['taux_client_d']; + $taux_ag_d = $_POST['taux_ag_d']; + $taux_ag_r = $_POST['taux_ag_r']; + $taux_sup_d = $_POST['taux_sup_d']; + $taux_sup_r = $_POST['taux_sup_r']; + $taux_bq_d = $_POST['taux_bq_d']; + $taux_bq_r = $_POST['taux_bq_r']; + $frais_d = $_POST['frais_d']; - $res = $this->user_model->updateConfigWallet($network_id , $taux_client_r , $taux_client_d , $taux_ag_r ,$taux_ag_d , $taux_sup_r , $taux_sup_d, $taux_bq_r , $taux_bq_d , $frais_d); + $res = $this->user_model->updateConfigWallet($network_id , $taux_client_r , $taux_client_d , $taux_ag_r ,$taux_ag_d , $taux_sup_r , $taux_sup_d, $taux_bq_r , $taux_bq_d , $frais_d); + + }else if ($type == 'ilink'){ + $idConfig = $_POST['id_config']; + $plr_user_wallet_wallet = isset($_POST['plr_user_wallet_wallet']) ? $_POST['plr_user_wallet_wallet'] : null ; + $plr_user_wallet_cash = isset($_POST['plr_user_wallet_cash']) ? $_POST['plr_user_wallet_cash'] : null ; + $plr_agent_depot_wallet = isset($_POST['plr_agent_depot_wallet']) ? $_POST['plr_agent_depot_wallet'] : null; + $plr_agent_cash_cash = isset($_POST['plr_agent_cash_cash']) ? $_POST['plr_agent_cash_cash'] : null ; + + $fields = $_POST['fields']; + $rows = []; + //Convert fields to simple array + foreach ($fields as $field) { + $array = json_decode(json_encode($field), true); + $i=0; + $name = ""; + foreach ($array as $key => $value){ + if($i == 0) + $name = $value; + else + $rows[$name] = $value; + $i++; + } + } + + $this->insertPalier($plr_user_wallet_wallet,"user_wallet_wallet", $idConfig); + $this->insertPalier($plr_user_wallet_cash,"user_wallet_cash", $idConfig); + $this->insertPalier($plr_agent_depot_wallet,"agent_depot_wallet", $idConfig); + $this->insertPalier($plr_agent_cash_cash,"agent_cash_cash", $idConfig); + + $this->user_model->updateConfigWalletIlink($rows['u_w_w_min'],$rows['u_w_w_max'],$rows['taux_u_w_w'],$rows['u_w_c_min'],$rows['u_w_c_max'],$rows['taux_u_w_c'],$rows['taux_u_w_cart'],$rows['taux_u_c_w'],$rows['taux_u_c_c'],$rows['ag_d_w_min'],$rows['ag_d_w_max'], + $rows['taux_ag_d_w'],$rows['taux_ag_d_c_c'],$rows['ag_c_c_min'],$rows['ag_c_c_max'],$rows['taux_ag_c_c'],$rows['taux_ag_cart_c'],$rows['taux_ag_cash_c'],$rows['taux_ag_s_c'],$rows['taux_sup_s_c'],$rows['taux_hyp_s_c'],$rows['taux_ag_r_c'],$rows['taux_sup_r_c'], + $rows['taux_hyp_r_c'],$rows['taux_ag_d_c'],$rows['taux_sup_d_c'],$rows['taux_hyp_d_c'],$rows['taux_bq_d_c'], $rows['taux_ag_r_cart'],$rows['taux_sup_r_cart'],$rows['taux_hyp_r_cart'],$rows['taux_bq_r_cart'],$idConfig); + + $res = true; + } } if ($res != false) { @@ -1646,6 +1715,25 @@ class Gestion extends CI_Controller } + private function insertPalier($palier , $name , $idConfig){ + + $exist = $this->user_model->getPalierConfigWallet($name , $idConfig); + if($exist){ + $this->user_model->deletePalierConfigWallet($name , $idConfig); + } + + if($palier) { + foreach ($palier as $p) { + $array = json_decode(json_encode($p), true); + $row = []; + foreach ($array as $key => $value){ + $row[] = $value; + } + $this->user_model->addPalierConfigWallet($name, $idConfig, $row[0], $row[1], $row[2]); + } + } + } + public function delete_config_wallet() { if($this->isLogged()){ @@ -1705,6 +1793,7 @@ class Gestion extends CI_Controller private function historique($network_id ,$startDate ,$endDate, $type) { + $data['configWallet'] = $this->user_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 ; @@ -1731,7 +1820,38 @@ class Gestion extends CI_Controller $this->load->view('footer'); } + public function currency() + { + if($this->isLogged()){ + $data['active'] = "currency"; + $data['alert'] = ""; + $data['game_pays'] = $this->user_model->getGameCountry(); + + if ($this->input->get('id')) { + + $network_id = $this->input->get('id'); + $networkDetails = $this->user_model->getNetworkDetails($network_id); + $data['network'] = $networkDetails->first_row()->network; + $data['country'] = $networkDetails->first_row()->country; + $data['currency_code'] = $networkDetails->first_row()->currency_code; + $data['currency_name_fr'] = $networkDetails->first_row()->currency_name_fr; + $data['currency_name_en'] = $networkDetails->first_row()->currency_name_en; + + $data['currencies'] = $this->user_model->getCurrencies($data['currency_code']); + $this->load->view('header_gestion', $data); + $this->load->view('gestion_monnaie'); + $this->load->view('footer'); + }else{ + + $data['networks'] = $this->user_model->getAllActivatedWalletNetworks(); + + $this->load->view('header_gestion', $data); + $this->load->view('gestion_monnaies'); + $this->load->view('footer'); + } + } + } } diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php old mode 100644 new mode 100755 index b12bfd26..8cb337b0 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -306,27 +306,69 @@ class Hyperviseur_dash extends CI_Controller $this->load->view('login', $data); } else { $id_network = $this->session->userdata('network_id'); - if($this->input->get('history')){ - $this->historique($id_network,$this->input->get('d'),$this->input->get('f'),$this->input->get('history')); - }else { + $data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('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')); + }else { + + $data["commission"] = ""; + $data["principal"] = ""; + $data["transactions"] = ""; + $agent_id = $this->session->userdata('agent_id'); - $data["commission"] = ""; - $data["principal"] = ""; - $data["transactions"] = ""; - $agent_id = $this->session->userdata('agent_id'); - $data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id')); - if ($data['hasWallet']) { $taux = $data['hasWallet']->first_row(); - $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; + $data['idConfig'] = $taux->id; + if ($data['hasWallet']->first_row()->type == 'uba'){ + $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; + } elseif ($data['hasWallet']->first_row()->type == 'ilink'){ + $data['plr_user_wallet_wallet'] = $this->user_model->getPalierConfigWallet("user_wallet_wallet" , $data['idConfig']); + $data['plr_user_wallet_cash'] = $this->user_model->getPalierConfigWallet("user_wallet_cash" , $data['idConfig']); + $data['plr_agent_depot_wallet'] = $this->user_model->getPalierConfigWallet("agent_depot_wallet" , $data['idConfig']); + $data['plr_agent_cash_cash'] = $this->user_model->getPalierConfigWallet("agent_cash_cash" , $data['idConfig']); + $data['u_w_w_min'] = $taux->taux_com_user_wallet_wallet_min; + $data['u_w_w_max'] = $taux->taux_com_user_wallet_wallet_max; + $data['taux_u_w_w'] = $taux->taux_com_user_wallet_wallet; + $data['u_w_c_min'] = $taux->taux_com_user_wallet_cash_min; + $data['u_w_c_max'] = $taux->taux_com_user_wallet_cash_max; + $data['taux_u_w_c'] = $taux->taux_com_user_wallet_cash; + $data['taux_u_w_cart'] = $taux->taux_com_user_wallet_carte; + $data['taux_u_c_w'] = $taux->taux_com_user_carte_wallet; + $data['taux_u_c_c'] = $taux->taux_com_user_carte_cash; + $data['ag_d_w_min'] = $taux->taux_com_wallet_ag_envoi_cash_wallet_min; + $data['ag_d_w_max'] = $taux->taux_com_wallet_ag_envoi_cash_wallet_max; + $data['taux_ag_d_w'] = $taux->taux_com_wallet_ag_envoi_cash_wallet; + $data['taux_ag_d_c_c'] = $taux->taux_com_wallet_ag_envoi_cash_carte; + $data['ag_c_c_min'] = $taux->taux_com_wallet_ag_envoi_cash_cash_min; + $data['ag_c_c_max'] = $taux->taux_com_wallet_ag_envoi_cash_cash_max; + $data['taux_ag_c_c'] = $taux->taux_com_wallet_ag_envoi_cash_cash; + $data['taux_ag_cart_c'] = $taux->taux_com_wallet_ag_carte_cash; + $data['taux_ag_cash_c'] = $taux->taux_com_wallet_ag_depot_carte; + $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['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; + $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; + $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; + } //Create wallet if it not exist $res = $this->user_model->getWallet($agent_id); @@ -360,48 +402,35 @@ class Hyperviseur_dash extends CI_Controller } } $data["totalCommissionBanque"] = $totalCommissionBanque; - } else { - $data["taux_client_r"] = "N/A"; - $data["taux_client_d"] = "N/A"; - $data["taux_ag_r"] = "N/A"; - $data["taux_ag_d"] = "N/A"; - $data["taux_sup_r"] = "N/A"; - $data["taux_sup_d"] = "N/A"; - $data['taux_bq_d'] = "N/A"; - $data['taux_bq_r'] = "N/A"; - $data['frais_d'] = "N/A"; - $data["commission"] = "N/A"; - $data["principal"] = "N/A"; - $data["totalCommissionBanque"] = "N/A"; - $data["transactions"] = false; - $data['wallet_id'] = null; - } - $res = $this->user_model->getWalletPassword($id_network); - $data['walletPassword'] = $res ? $res->first_row() : null; - $data['alert'] = ""; - $data['active'] = "wallet"; - $data['token'] = $this->session->userdata('token'); - $data['email'] = $this->session->userdata('email'); - $data['firstname'] = $this->session->userdata('firstname'); - $data['lastname'] = $this->session->userdata('lastname'); - $data['code_parrain'] = $this->session->userdata('code_parrain'); - $data['phone'] = $this->session->userdata('phone'); - $data['adresse'] = $this->session->userdata('adresse'); - $data['category'] = $this->session->userdata('category'); - $data['network'] = $this->session->userdata('network'); - $data['network_id'] = $id_network; - $data['country'] = $this->session->userdata('current_pays'); - $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['pays'] = $this->user_model->getAllGameCountries(); - $data['networks'] = $this->user_model->getActiveNetwork(); - $data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network); - $this->load->view('header_hyp', $data); - $this->load->view('gestion_wallet_hyp'); - $this->load->view('footer'); + $res = $this->user_model->getWalletPassword($id_network); + $data['walletPassword'] = $res ? $res->first_row() : null; + $data['alert'] = ""; + $data['active'] = "wallet"; + $data['token'] = $this->session->userdata('token'); + $data['email'] = $this->session->userdata('email'); + $data['firstname'] = $this->session->userdata('firstname'); + $data['lastname'] = $this->session->userdata('lastname'); + $data['code_parrain'] = $this->session->userdata('code_parrain'); + $data['phone'] = $this->session->userdata('phone'); + $data['adresse'] = $this->session->userdata('adresse'); + $data['category'] = $this->session->userdata('category'); + $data['network'] = $this->session->userdata('network'); + $data['network_id'] = $id_network; + $data['country'] = $this->session->userdata('current_pays'); + $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['pays'] = $this->user_model->getAllGameCountries(); + $data['networks'] = $this->user_model->getActiveNetwork(); + $data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network); + $this->load->view('header_hyp', $data); + if ($data['hasWallet']->first_row()->type == 'uba') + $this->load->view('gestion_wallet_hyp'); + elseif ($data['hasWallet']->first_row()->type == 'ilink') + $this->load->view('gestion_wallet_ilink_hyp'); + $this->load->view('footer'); + } } - } } @@ -420,7 +449,7 @@ class Hyperviseur_dash extends CI_Controller private function historique($network_id ,$startDate ,$endDate, $type) { - + $data['configWallet'] = $this->user_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 ; diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index 7addd3a0..b26c0321 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -1,154 +1,154 @@ diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index dc364a58..0bf4cf18 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -347,4 +347,12 @@ $lang['rate_com_agent_cart_cash'] = 'Taux de commission de l\'agent géolocalisé sur retrait carte à cash '; $lang['rate_com_agent_cash_cart'] = 'Taux de commission de l\'agent géolocalisé sur depot cash vers carte '; + // Gestion de la monnaie +$lang['currency'] = 'Monnaie'; +$lang['currency_code'] = 'Code de la monnaie'; +$lang['currency_management'] = 'Gestion de la monnaie'; +$lang['show_currency_rate_conversion'] = 'Afficher les taux de conversions'; +$lang['conversion_rate'] = 'Taux de conversion'; +$lang['new_rate'] = 'Nouveau taux'; +$lang['save'] = 'Enregistrer'; ?> diff --git a/application/models/User_model.php b/application/models/User_model.php old mode 100644 new mode 100755 index 74122389..24473d4e --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -1863,7 +1863,7 @@ class User_model extends CI_Model } public function getNetworkDetails($id_network){ - $query = $this->db->query("SELECT n.name AS network , c.name AS country FROM networks n INNER JOIN countries c ON n.country_id = c.id WHERE n.id = ".$id_network); + $query = $this->db->query("SELECT n.name AS network , c.name AS country , c.currency_name_fr , c.currency_code , c.currency_name_en FROM networks n INNER JOIN countries_currencies c ON n.country_id = c.id WHERE n.id = ".$id_network); if($query->num_rows()>0){ return $query; }else{ @@ -2078,9 +2078,9 @@ class User_model extends CI_Model } } - public function addConfigWallet($network_id , $taux_client_r , $taux_client_d, $taux_ag_r , $taux_ag_d , $taux_sup_r , $taux_sup_d , $taux_bq_r , $taux_bq_d , $frais_d ){ - $sql='INSERT INTO `configWallet` (`taux_com_client_retrait`, `taux_com_client_depot`, `taux_com_ag_retrait`, `taux_com_ag_depot`, `taux_com_sup_depot`, `taux_com_sup_retrait`, `part_banque_retrait`, `part_banque_depot`, `frais_min_banque_depot`, `id_network`) VALUES ( ?, ?, ?, ?, ?, ?, ? , ? , ? ,?);' ; - $query = $this->db->query($sql , array($taux_client_r,$taux_client_d,$taux_ag_r,$taux_ag_d,$taux_sup_r,$taux_sup_d, $taux_bq_r , $taux_bq_d , $frais_d , $network_id)); + public function addConfigWallet($network_id , $type){ + $sql='INSERT INTO `iLink_test2`.`configWallet` (`id_network`, `type`) VALUES (?,?);' ; + $query = $this->db->query($sql , array($network_id, $type)); return $query; } @@ -2159,8 +2159,8 @@ class User_model extends CI_Model // Mot de passe du wallet public function getAllActivatedWalletNetworks(){ - $query = $this->db->query("SELECT n.name AS network,n.status AS status,n.id,c.name AS country, wp.id AS wallet_password FROM networks n - INNER JOIN countries c ON n.country_id=c.id INNER JOIN configWallet cw ON cw.id_network = n.id + $query = $this->db->query("SELECT n.id AS id_network , n.name AS network,n.status AS status,c.name AS country,c.currency_name_fr,c.currency_code, wp.id AS wallet_password FROM networks n + INNER JOIN countries_currencies c ON n.country_id=c.id INNER JOIN configWallet cw ON cw.id_network = n.id LEFT JOIN walletsPassword wp ON wp.network_id = n.id WHERE status = 1;"); if($query->num_rows()>0){ return $query; @@ -2214,4 +2214,73 @@ class User_model extends CI_Model $query = $this->db->query($sql , array($montant,$wallet_id)); return $query; } + + // Wallet ilink + public function addPalierConfigWallet($type , $idConfig ,$min, $max ,$taux){ + $sql = "INSERT INTO `paliersConfigWallet` (`type`, `min`, `max`, `taux`, `idConfig`) VALUES (?,?,?,?,?);"; + $query = $this->db->query($sql , array($type,$min, $max , $taux ,$idConfig)); + return $query; + } + + public function updatePalierConfigWallet($id ,$min , $max ,$taux){ + $sql = "UPDATE `paliersConfigWallet` SET `min` = ? , `max` = ? , `taux` = ? WHERE (`id` = ?);"; + $query = $this->db->query($sql , array($min, $max , $taux , $id)); + return $query; + } + + public function getPalierConfigWallet($type , $idConfig){ + $sql = "SELECT * FROM `paliersConfigWallet` WHERE (`type` = ? AND `idConfig` = ? );"; + $query = $this->db->query($sql , array($type,$idConfig)); + if($query->num_rows()>0){ + return $query; + }else{ + return false; + } + } + + public function getOnePalierConfigWallet($id){ + $sql = "SELECT * FROM `paliersConfigWallet` WHERE (`id` = ?);"; + $query = $this->db->query($sql , array($id)); + if($query->num_rows()>0){ + return $query; + }else{ + return false; + } + } + + public function deletePalierConfigWallet($type , $idConfig){ + $sql = "DELETE FROM `paliersConfigWallet` WHERE (`type` = ? AND `idConfig` = ? );"; + $query = $this->db->query($sql , array($type,$idConfig)); + return $query; + + } + + public function updateConfigWalletIlink($u_w_w_min,$u_w_w_max,$taux_u_w_w,$u_w_c_min,$u_w_c_max,$taux_u_w_c,$taux_u_w_cart,$taux_u_c_w,$taux_u_c_c,$ag_d_w_min,$ag_d_w_max,$taux_ag_d_w, + $taux_ag_d_c_c,$ag_c_c_min,$ag_c_c_max,$taux_ag_c_c,$taux_ag_cart_c,$taux_ag_cash_c,$taux_ag_s_c,$taux_sup_s_c,$taux_hyp_s_c,$taux_ag_r_c,$taux_sup_r_c,$taux_hyp_r_c, + $taux_ag_d_c,$taux_sup_d_c,$taux_hyp_d_c,$taux_bq_d_c ,$taux_ag_r_cart,$taux_sup_r_cart,$taux_hyp_r_cart,$taux_bq_r_cart ,$idConfig){ + $sql = "UPDATE `configWallet` SET `taux_com_user_wallet_wallet_min` = ? , `taux_com_user_wallet_wallet_max` = ?, `taux_com_user_wallet_wallet` = ?, `taux_com_user_wallet_cash_min` = ?, `taux_com_user_wallet_cash_max` = ?, `taux_com_user_wallet_cash` = ?, `taux_com_user_wallet_carte` = ?, + `taux_com_user_carte_wallet` = ?, `taux_com_user_carte_cash` = ?, `taux_com_wallet_ag_envoi_cash_wallet_min` = ?, `taux_com_wallet_ag_envoi_cash_wallet_max` = ?, `taux_com_wallet_ag_envoi_cash_wallet` = ?, `taux_com_wallet_ag_envoi_cash_carte` = ?, `taux_com_wallet_ag_envoi_cash_cash_min` = ?, + `taux_com_wallet_ag_envoi_cash_cash_max` = ?, `taux_com_wallet_ag_envoi_cash_cash` = ?,`taux_com_wallet_ag_carte_cash` = ?, `taux_com_wallet_ag_depot_carte` = ?, `taux_com_ag_envoi_cash` = ?, `taux_com_sup_envoi_cash` = ?, `taux_com_hyp_envoi_cash` = ?, `taux_com_ag_retrait_cash` = ?, `taux_com_sup_retrait_cash` = ?, `taux_com_hyp_retrait_cash` = ?, + `taux_com_ag_depot_cash_carte` = ?, `taux_com_sup_depot_cash_carte` = ?, `taux_com_hyp_depot_cash_carte` = ?, `taux_com_banque_depot_cash_carte` = ?, `taux_com_ag_retrait_carte_cash` = ?, `taux_com_sup_retrait_carte_cash` = ?, `taux_com_hyp_retrait_carte_cash` = ?, `taux_com_banque_retrait_carte_cash` = ? WHERE (`id` = ?);"; + $query = $this->db->query($sql , array($u_w_w_min,$u_w_w_max,$taux_u_w_w,$u_w_c_min,$u_w_c_max,$taux_u_w_c,$taux_u_w_cart,$taux_u_c_w,$taux_u_c_c,$ag_d_w_min,$ag_d_w_max,$taux_ag_d_w, + $taux_ag_d_c_c,$ag_c_c_min,$ag_c_c_max,$taux_ag_c_c,$taux_ag_cart_c,$taux_ag_cash_c,$taux_ag_s_c,$taux_sup_s_c,$taux_hyp_s_c,$taux_ag_r_c,$taux_sup_r_c,$taux_hyp_r_c, + $taux_ag_d_c,$taux_sup_d_c,$taux_hyp_d_c,$taux_bq_d_c , $taux_ag_r_cart,$taux_sup_r_cart,$taux_hyp_r_cart, $taux_bq_r_cart , $idConfig)); + return $query; + } + + public function getCurrencies($code){ + $sql= "SELECT * FROM currencies WHERE id IN( + SELECT idCurrency FROM countries WHERE id IN ( + SELECT country_id FROM networks WHERE status = 1 + ) + ) AND code <> ? ;"; + $query = $this->db->query($sql, array($code)); + if($query->num_rows()>0){ + return $query; + }else{ + return false; + } + } + + } diff --git a/application/views/gestion_monnaie.php b/application/views/gestion_monnaie.php new file mode 100755 index 00000000..3f11e10f --- /dev/null +++ b/application/views/gestion_monnaie.php @@ -0,0 +1,353 @@ + + + + + + + + + +
lang->line('currency') ?>
+N° | +lang->line('Reseau'); ?> | +lang->line('Pays'); ?> | +lang->line('currency'); ?> | +lang->line('currency_code'); ?> | +Action | +
---|---|---|---|---|---|
$num | +$row->network | +$row->country | "; + ?> + +currency_name_fr; ?> | +currency_code; ?> | + ++ + lang->line('show_currency_rate_conversion'); ?> + + | + +
lang->line('rate_com_user_wallet_cart') ?>
+lang->line('rate_com_user_cart_wallet') ?>
+lang->line('rate_com_user_cart_cash') ?>
+lang->line('rate_com_agent_depot_cash_cart') ?>
+lang->line('rate_com_agent_send_cash') ?>
+lang->line('rate_com_sup_send_cash') ?>
+lang->line('rate_com_hyp_send_cash') ?>
+lang->line('rate_com_agent_remove_cash') ?>
+lang->line('rate_com_sup_remove_cash') ?>
+lang->line('rate_com_sup_remove_cash') ?>
+lang->line('rate_com_agent_cart_cash') ?>
+lang->line('rate_com_agent_cash_cart') ?>
+lang->line('rate_com_agent_depot_cart') ?>
+lang->line('rate_com_sup_depot_cart') ?>
+lang->line('rate_com_hyp_depot_cart') ?>
+lang->line('rate_com_bq_depot_cart') ?>
+lang->line('rate_com_agent_remove_cart') ?>
+lang->line('rate_com_sup_remove_cart') ?>
+lang->line('rate_com_hyp_remove_cart') ?>
+lang->line('rate_com_bq_remove_cart') ?>
+Min (FCFA) | +Max (FCFA) | +Taux (%) | +
---|---|---|
".$fmt->format($row->min)." | +".$fmt->format($row->max)." | +".$row->taux." | ".' +
Min (FCFA) | +Max (FCFA) | +Taux (%) | +".$fmt->format($u_w_w_min)." | +".$fmt->format($u_w_w_max)." | +".$taux_u_w_w." | ".' + '; + + + ?> + +
---|
Min (FCFA) | +Max (FCFA) | +Taux (%) | +
---|---|---|
".$fmt->format($row->min)." | +".$fmt->format($row->max)." | +".$row->taux." | ".' +
Min (FCFA) | +Max (FCFA) | +Taux (%) | +".$fmt->format($u_w_c_min)." | +".$fmt->format($u_w_c_max)." | +".$taux_u_w_c." | ".' + '; + + + ?> + +
---|
Min (FCFA) | +Max (FCFA) | +Taux (%) | +
---|---|---|
".$fmt->format($row->min)." | +".$fmt->format($row->max)." | +".$row->taux." | ".' +
Min (FCFA) | +Max (FCFA) | +Taux (%) | +".$fmt->format($ag_d_w_min)." | +".$fmt->format($ag_d_w_max)." | +".$taux_ag_d_w." | ".' + '; + + + ?> + +
---|
Min (FCFA) | +Max (FCFA) | +Taux (%) | +
---|---|---|
".$fmt->format($row->min)." | +".$fmt->format($row->max)." | +".$row->taux." | ".' +
Min (FCFA) | +Max (FCFA) | +Taux (%) | +".$fmt->format($ag_c_c_min)." | +".$fmt->format($ag_c_c_max)." | +".$taux_ag_c_c." | ".' + '; + ?> + +
---|
".$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() . " | + "; + + } + ?> + +
---|
lang->line('Solde Principal') ?>
+lang->line('Solde Commission') ?>
+lang->line('Total commission de la banque') ?>
+lang->line('rate_com_user_wallet_cart') ?>
+lang->line('rate_com_user_cart_wallet') ?>
+lang->line('rate_com_user_cart_cash') ?>
+lang->line('rate_com_agent_depot_cash_cart') ?>
+lang->line('rate_com_agent_send_cash') ?>
+lang->line('rate_com_sup_send_cash') ?>
+lang->line('rate_com_hyp_send_cash') ?>
+lang->line('rate_com_agent_remove_cash') ?>
+lang->line('rate_com_sup_remove_cash') ?>
+lang->line('rate_com_sup_remove_cash') ?>
+lang->line('rate_com_agent_cart_cash') ?>
+lang->line('rate_com_agent_cash_cart') ?>
+lang->line('rate_com_agent_depot_cart') ?>
+lang->line('rate_com_sup_depot_cart') ?>
+lang->line('rate_com_hyp_depot_cart') ?>
+lang->line('rate_com_bq_depot_cart') ?>
+lang->line('rate_com_agent_remove_cart') ?>
+lang->line('rate_com_sup_remove_cart') ?>
+lang->line('rate_com_hyp_remove_cart') ?>
+lang->line('rate_com_bq_remove_cart') ?>
+Min (FCFA) | +Max (FCFA) | +Taux (%) | +
---|---|---|
".$fmt->format($row->min)." | +".$fmt->format($row->max)." | +".$row->taux." | ".' +
Min (FCFA) | +Max (FCFA) | +Taux (%) | +".$fmt->format($u_w_w_min)." | +".$fmt->format($u_w_w_max)." | +".$taux_u_w_w." | ".' + '; + + + ?> + +
---|
Min (FCFA) | +Max (FCFA) | +Taux (%) | +
---|---|---|
".$fmt->format($row->min)." | +".$fmt->format($row->max)." | +".$row->taux." | ".' +
Min (FCFA) | +Max (FCFA) | +Taux (%) | +".$fmt->format($u_w_c_min)." | +".$fmt->format($u_w_c_max)." | +".$taux_u_w_c." | ".' + '; + + + ?> + +
---|
Min (FCFA) | +Max (FCFA) | +Taux (%) | +
---|---|---|
".$fmt->format($row->min)." | +".$fmt->format($row->max)." | +".$row->taux." | ".' +
Min (FCFA) | +Max (FCFA) | +Taux (%) | +".$fmt->format($ag_d_w_min)." | +".$fmt->format($ag_d_w_max)." | +".$taux_ag_d_w." | ".' + '; + + + ?> + +
---|
Min (FCFA) | +Max (FCFA) | +Taux (%) | +
---|---|---|
".$fmt->format($row->min)." | +".$fmt->format($row->max)." | +".$row->taux." | ".' +
Min (FCFA) | +Max (FCFA) | +Taux (%) | +".$fmt->format($ag_c_c_min)." | +".$fmt->format($ag_c_c_max)." | +".$taux_ag_c_c." | ".' + '; + ?> + +
---|
".$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'." | "; + ?> +|
---|---|---|---|---|---|
".$row->lastname." | +".$fmt->format($princ)." | +".$fmt->format($com)." | "; + $nb_depots = 0; + $nb_retraits = 0; + $commission_banque = 0; + foreach($depots as $depot){ + if($depot->code_parrain == $row->member_code) { + $nb_depots ++; + $commission_banque+= $depot->commission_banque; + } + } + foreach($retraits as $retrait){ + if($retrait->code_parrain == $row->member_code) { + $nb_retraits ++; + $commission_banque+= $retrait->commission_banque; + } + } + echo "".$fmt->format($commission_banque)." | +".$nb_depots." | +".$nb_retraits." | +