diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php index bd9b26f1..d03393bb 100644 --- a/application/controllers/Gestion.php +++ b/application/controllers/Gestion.php @@ -27,8 +27,7 @@ class Gestion extends CI_Controller $hyper = $this->session->userdata('current_hyper'); $pays = $this->session->userdata('current_pays'); - //wallet - $data['networks'] = $this->user_model->getActiveNetwork(); + $data['list_villes'] = $this->user_model->getAllVilles(); $data['pays'] = $this->user_model->getAllPays(); $data['game_pays'] = $this->user_model->getGameCountry(); @@ -223,8 +222,7 @@ class Gestion extends CI_Controller $data['list_villes'] = $this->user_model->getAllVilles(); $data['pays'] = $this->user_model->getAllPays(); $data['game_pays'] = $this->user_model->getGameCountry(); - //wallet - $data['networks'] = $this->user_model->getActiveNetwork(); + $this->load->view('header_gestion', $data); $this->load->view('gestion_villes'); @@ -239,8 +237,7 @@ class Gestion extends CI_Controller $data['list_villes'] = $this->user_model->getAllVilles(); $data['pays'] = $this->user_model->getAllPays(); - //wallet - $data['networks'] = $this->user_model->getActiveNetwork(); + $this->load->view('header_gestion', $data); $this->load->view('gestion_villes'); @@ -272,7 +269,7 @@ class Gestion extends CI_Controller $data['networks'] = $this->user_model->getAllNetworksNames(); $data['assigned_networks'] = $this->user_model->getAllAssignedNetworks(); //wallet - $data['networks'] = $this->user_model->getActiveNetwork(); +// $data['networks'] = $this->user_model->getActiveNetwork(); $this->load->view('header_gestion', $data); $this->load->view('gestion_networks'); @@ -444,8 +441,6 @@ class Gestion extends CI_Controller $data['list_villes'] = $this->user_model->getAllVilles(); $data['pays'] = $this->user_model->getAllCountries(); $data['game_pays'] = $this->user_model->getGameCountry(); - //wallet - $data['networks'] = $this->user_model->getActiveNetwork(); $data['alert'] = ""; $data['active'] = "admin"; @@ -597,8 +592,7 @@ class Gestion extends CI_Controller $data['alert'] = ""; $data['active'] = "codes-hyper"; $data['list'] = $this->user_model->getGeneratedHyperCodes(); - //wallet - $data['networks'] = $this->user_model->getActiveNetwork(); + $this->load->view('header_gestion', $data); $this->load->view('codeg'); @@ -647,8 +641,7 @@ class Gestion extends CI_Controller $data['firstname'] = $this->session->userdata('firstname'); $data['lastname'] = $this->session->userdata('lastname'); $data['email'] = $this->session->userdata('email'); - //wallet - $data['networks'] = $this->user_model->getActiveNetwork(); + $this->load->view('header_gestion', $data); $this->load->view('codeg'); $this->load->view('footer'); @@ -673,8 +666,7 @@ class Gestion extends CI_Controller $data['firstname'] = $this->session->userdata('firstname'); $data['lastname'] = $this->session->userdata('lastname'); $data['email'] = $this->session->userdata('email'); - //wallet - $data['networks'] = $this->user_model->getActiveNetwork(); + $this->load->view('header_gestion', $data); $this->load->view('codeg'); @@ -735,8 +727,7 @@ class Gestion extends CI_Controller $data["network_geolocalisation"] = $network_geolocalisation; $data["total"] = $count; $data['assigned_networks'] = $this->user_model->getAllAssignedNetworks(); - //wallet - $data['networks'] = $this->user_model->getActiveNetwork(); + $this->load->view('header_gestion', $data); $this->load->view('gestion_geolocalisation'); @@ -785,8 +776,7 @@ class Gestion extends CI_Controller $data["network_geolocalisation"] = $network_geolocalisation; $data["total"] = $count; $data['assigned_networks'] = $this->user_model->getAllAssignedNetworks(); - //wallet - $data['networks'] = $this->user_model->getActiveNetwork(); + $this->load->view('header_gestion', $data); $this->load->view('gestion_geolocalisation'); @@ -934,8 +924,7 @@ class Gestion extends CI_Controller $data["total"] = $count; $data['assigned_networks'] = $this->user_model->getAllAssignedNetworks(); $data['game_pays'] = $this->user_model->getGameCountry(); - //wallet - $data['networks'] = $this->user_model->getActiveNetwork(); + $this->load->view('header_gestion', $data); $this->load->view('gestion_campagne'); @@ -984,8 +973,7 @@ class Gestion extends CI_Controller $data["network_geolocalisation"] = $network_geolocalisation; $data["total"] = $count; $data['assigned_networks'] = $this->user_model->getAllAssignedNetworks(); - //wallet - $data['networks'] = $this->user_model->getActiveNetwork(); + $this->load->view('header_gestion', $data); $this->load->view('gestion_geolocalisation'); @@ -1052,8 +1040,7 @@ class Gestion extends CI_Controller $data['active'] = "game"; $data['code_parrain'] = $this->session->userdata('code_parrain'); $data['alert'] = ""; - //wallet - $data['networks'] = $this->user_model->getActiveNetwork(); + $this->load->view('header_gestion', $data); $this->load->view('game'); $this->load->view('footer'); @@ -1554,7 +1541,7 @@ class Gestion extends CI_Controller }else{ $taux = $this->user_model->getTaux($network_id); if ($taux != null) { - $taux = $this->user_model->getTaux($network_id)->first_row(); + $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; @@ -1596,8 +1583,6 @@ class Gestion extends CI_Controller $data['country'] = $networkDetails->first_row()->country; } // $data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($network_id); - $res = $this->user_model->getWalletPassword($network_id) ; - $data['walletPassword'] = $res ? $res->first_row() : null ; $data['active'] = "wallet"; $data['alert'] = ""; $data['game_pays'] = $this->user_model->getGameCountry(); @@ -1628,24 +1613,25 @@ class Gestion extends CI_Controller if (isset($_POST)) { $network_id = $_POST['network_id']; - $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($method == 'create') { - $res = $this->user_model->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); + $res = $this->user_model->addConfigWallet($network_id , 0 , 0, 0 ,0 , 0, 0, 0 , 0 , 0); // 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']; + $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); } @@ -1731,7 +1717,6 @@ class Gestion extends CI_Controller $data['alert'] = ""; $data['networks'] = $this->user_model->getAllActivatedNetworks(); $data['game_pays'] = $this->user_model->getGameCountry(); - $data['networks'] = $this->user_model->getAllActivatedNetworks(); $networkDetails = $this->user_model->getNetworkDetails($network_id); if($networkDetails){ $data['network'] = $networkDetails->first_row()->network; @@ -1745,142 +1730,7 @@ class Gestion extends CI_Controller $this->load->view('footer'); } - public function walletPassword(){ - if($this->isLogged()){ - $data['active'] = "wallet_password"; - $data['alert'] = ""; - $data['game_pays'] = $this->user_model->getGameCountry(); - $data['networks'] = $this->user_model->getAllActivatedWalletNetworks(); - $this->load->view('header_gestion', $data); - $this->load->view('wallet_password'); - $this->load->view('footer'); - } - } - public function generate_wallet_password(){ - if($this->isLogged()){ - if (isset($_POST)) { - $network_id = isset($_POST['network_id']) ? $_POST['network_id'] : null; - $email = $_POST['email']; -// $size = $_POST['size']; - $wallet_password_id = isset($_POST['wallet_password_id']) ? $_POST['wallet_password_id'] : null ; - $network = $_POST['network']; - $country = $_POST['country']; - - $password = $this->generate_string(); - $hash = $this->hashSSHA($password); - $encrypted_password = $hash['encrypted'] ; - $salt = $hash['salt'] ; - - $this->load->library('email'); - $this->email->from('noreply@ilink-app.com', 'iLink World'); - $this->email->to($email); - - $this->email->subject($this->lang->line('wallet_password').' '.$network . ' - '.$country); - $this->email->message($this->lang->line('mot de passe').' : '.$password); - - if ($this->email->send()) { - if($wallet_password_id == null) - $this->user_model->addWalletPassword($network_id,$encrypted_password,$salt,$email); - else - $this->user_model->updateWalletPassword($wallet_password_id,$encrypted_password,$salt,$email); - $res = true; - } else { -// show_error($this->email->print_debugger()); - $res = false; - } - - if ($res) { - echo json_encode("200"); - } else { - echo json_encode("500"); - } - } - } - } - - private function generate_string($length = 10){ - $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'. - '0123456789-=~!@#$%^&*()_+,./<>?;:[]{}\|'; - - $str = ''; - $max = strlen($chars) - 1; - - for ($i=0; $i < $length; $i++) - $str .= $chars[mt_rand(0, $max)]; - - return $str; - } - - private 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; - } - - public function resetWalletPassword(){ - if($this->isLogged()){ - if (isset($_POST)) { - $email = $_POST['email']; - $wallet_password_id = isset($_POST['wallet_password_id']) ? $_POST['wallet_password_id'] : null ; - $network = $_POST['network']; - $country = $_POST['country']; - - $password = $this->generate_string(); - $hash = $this->hashSSHA($password); - $encrypted_password = $hash['encrypted'] ; - $salt = $hash['salt'] ; - - $this->load->library('email'); - $this->email->from('noreply@ilink-app.com', 'iLink World'); - $this->email->to($email); - - $this->email->subject($this->lang->line('reset_wallet_password').' '.$network . ' - '.$country); - $this->email->message($this->lang->line('mot de passe').' : '.$password); - - if ($this->email->send()) { - $this->user_model->updateWalletPassword($wallet_password_id,$encrypted_password,$salt,$email); - $res = true; - } else { -// show_error($this->email->print_debugger()); - $res = false; - } - - if ($res) { - echo json_encode("200"); - } else { - echo json_encode("500"); - } - } - } - } - - public function recharge_wallet(){ - if($this->isLogged()){ - if (isset($_POST)) { - $password = $_POST['password']; - $wallet_id = $_POST['wallet_id']; - $salt = $_POST['salt'] ; - $encrypted_password = $_POST['encrypted_password']; - $montant = $_POST['montant']; - - $hash = base64_encode(sha1($password . $salt, true) . $salt); - - if($encrypted_password == $hash){ - $this->user_model->updateWalletBalance($montant,$wallet_id); - $res = $this->user_model->addWalletRecharge($montant,$wallet_id); - $code = $res ? '200' : '500' ; - }else{ - $code = '400'; - } - - echo json_encode($code); - - } - } - } } diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php index adb3af50..3f2a440e 100644 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -303,76 +303,296 @@ class Hyperviseur_dash extends CI_Controller $data['message'] = "Login first!"; $this->load->view('login', $data); } else { - $id_network = $this->session->userdata('network_id'); - $data["commission"] = ""; + $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["commission"] = ""; $data["principal"] = ""; - $data["transactions"] = ""; - $agent_id = $this->session->userdata('agent_id'); + $data["transactions"] = ""; + $agent_id = $this->session->userdata('agent_id'); $data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id')); - //Create wallet if it not exist - $res = $this->user_model->getWallet($agent_id ); - if($res == false){ - if($data['hasWallet']){ - $this->user_model->addWallet($agent_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; + + //Create wallet if it not exist + $res = $this->user_model->getWallet($agent_id); + if ($res == false) { + $this->user_model->addWallet($agent_id); + $res = $this->user_model->getWallet($agent_id); } - } - $res = $this->user_model->getWallet($agent_id); - if ($res!=null){ $row = $res->first_row(); - $data["commission"] = $row->balance_com; + $data["commission"] = $row->balance_com; $data["principal"] = $row->balance_princ; - $agents_g = $this->user_model->getAllGeolocatedUsersForHyp($this->session->userdata('member_code')); + $data['wallet_id'] = $row->wallet_id; + $agents_g = $this->user_model->getAllGeolocatedUsersForHyp($this->session->userdata('member_code')); - //Fetch all transactions of any geolocated agent of the network + //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->user_model->getWallet($row->agent_id); - if($wallet){ + if ($agents_g) { + foreach ($agents_g->result() as $row) { + $wallet = $this->user_model->getWallet($row->agent_id); + if ($wallet) { $transactions = $this->user_model->getAgentTransactions($wallet->first_row()->wallet_id); - if($transactions){ - foreach($transactions->result() AS $trans){ + 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); + $trans->code_parrain = $row->code_parrain; // Add code parrain to transaction + array_push($data['transactions'], $trans); } } } } } $data["totalCommissionBanque"] = $totalCommissionBanque; - }else{ - $data["commission"] = "N/A"; + } 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["transactions"] = false; + } - - $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['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); + $this->load->view('gestion_wallet_hyp'); + $this->load->view('footer'); + } } } + + private function isLogged() + { + if (!$this->session->userdata('email')) { + $this->session->set_flashdata('error', 'log in first'); + + $data['alert'] = "ok"; + $data['message'] = "Login first!"; + $this->load->view('login', $data); + return false; + } + return true; + } + + private function historique($network_id ,$startDate ,$endDate, $type) + { + + $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') + $data['transactions'] = $this->user_model->getTransactions($startDate , $endDate ,$network_id); + else + $data['transactions'] = $this->user_model->getRecharges($startDate , $endDate ,$network_id); + + $data['active'] = "wallet"; + $data['alert'] = ""; + $data['firstname'] = $this->session->userdata('firstname'); + $data['lastname'] = $this->session->userdata('lastname'); + $data['email'] = $this->session->userdata('email'); + $data['network'] = $this->session->userdata('network'); + $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); + $data['networks'] = $this->user_model->getActiveNetwork(); + $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); + $data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id')); + $data['country'] = $this->session->userdata('current_pays'); + $data['category'] = $this->session->userdata('category'); + + $this->load->view('header_hyp', $data); + if($type == 'transaction') + $this->load->view('historique_transactions'); + else + $this->load->view('historique_recharges'); + $this->load->view('footer'); + } + + public function walletPassword(){ + if($this->isLogged()){ + $data['active'] = "wallet_password"; + $data['alert'] = ""; + $data['firstname'] = $this->session->userdata('firstname'); + $data['lastname'] = $this->session->userdata('lastname'); + $data['email'] = $this->session->userdata('email'); + $data['network'] = $this->session->userdata('network'); + $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); + $data['networks'] = $this->user_model->getActiveNetwork(); + $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); + $data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id')); + $data['country'] = $this->session->userdata('current_pays'); + $data['network_id'] = $this->session->userdata('network_id'); + $res = $this->user_model->getWalletPassword($this->session->userdata('network_id')); + $data['walletPassword'] = $res ? $res->first_row() : null; + $this->load->view('header_hyp', $data); + $this->load->view('wallet_password'); + $this->load->view('footer'); + } + } + + public function generate_wallet_password(){ + if($this->isLogged()){ + if (isset($_POST)) { + $network_id = isset($_POST['network_id']) ? $_POST['network_id'] : null; + $email = $_POST['email']; +// $size = $_POST['size']; + $wallet_password_id = isset($_POST['wallet_password_id']) ? $_POST['wallet_password_id'] : null ; + $network = $_POST['network']; + $country = $_POST['country']; + + $password = $this->generate_string(); + $hash = $this->hashSSHA($password); + $encrypted_password = $hash['encrypted'] ; + $salt = $hash['salt'] ; + + $this->load->library('email'); + $this->email->from('noreply@ilink-app.com', 'iLink World'); + $this->email->to($email); + + $this->email->subject($this->lang->line('wallet_password').' '.$network . ' - '.$country); + $this->email->message($this->lang->line('mot de passe').' : '.$password); + + if ($this->email->send()) { + if($wallet_password_id == null) + $this->user_model->addWalletPassword($network_id,$encrypted_password,$salt,$email); + else + $this->user_model->updateWalletPassword($wallet_password_id,$encrypted_password,$salt,$email); + $res = true; + } else { +// show_error($this->email->print_debugger()); + $res = false; + } + + if ($res) { + echo json_encode("200"); + } else { + echo json_encode("500"); + } + } + } + } + + private function generate_string($length = 10){ + $chars = 'abcdefghjkmnpqrstuvwxyz'. + '23456789'; + + $str = ''; + $max = strlen($chars) - 1; + + for ($i=0; $i < $length; $i++) + $str .= $chars[mt_rand(0, $max)]; + + return $str; + } + + private 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; + } + + public function resetWalletPassword(){ + if($this->isLogged()){ + if (isset($_POST)) { + $email = $_POST['email']; + $wallet_password_id = isset($_POST['wallet_password_id']) ? $_POST['wallet_password_id'] : null ; + $network = $_POST['network']; + $country = $_POST['country']; + + $password = $this->generate_string(); + $hash = $this->hashSSHA($password); + $encrypted_password = $hash['encrypted'] ; + $salt = $hash['salt'] ; + + $this->load->library('email'); + $this->email->from('noreply@ilink-app.com', 'iLink World'); + $this->email->to($email); + + $this->email->subject($this->lang->line('reset_wallet_password').' '.$network . ' - '.$country); + $this->email->message($this->lang->line('mot de passe').' : '.$password); + + if ($this->email->send()) { + $this->user_model->updateWalletPassword($wallet_password_id,$encrypted_password,$salt,$email); + $res = true; + } else { +// show_error($this->email->print_debugger()); + $res = false; + } + + if ($res) { + echo json_encode("200"); + } else { + echo json_encode("500"); + } + } + } + } + + public function recharge_wallet(){ + if($this->isLogged()){ + if (isset($_POST)) { + $password = $_POST['password']; + $wallet_id = $_POST['wallet_id']; + $salt = $_POST['salt'] ; + $encrypted_password = $_POST['encrypted_password']; + $montant = $_POST['montant']; + + $hash = base64_encode(sha1($password . $salt, true) . $salt); + + if($encrypted_password == $hash){ + $this->user_model->updateWalletBalance($montant,$wallet_id); + $res = $this->user_model->addWalletRecharge($montant,$wallet_id); + $code = $res ? '200' : '500' ; + }else{ + $code = '400'; + } + + echo json_encode($code); + + } + } + } + } diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index 19fbffae..099541dc 100644 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -279,7 +279,7 @@ $lang['request_error'] = 'Request error'; $lang['error_message'] = 'An error has occurred.'; $lang['wallet_password'] = 'Wallet password'; $lang['wallet_update'] = 'Wallet update'; -$lang['recharge_hypervisor_account'] = 'Reload virtual currency in the hypervisor account'; +$lang['recharge_hypervisor_account'] = 'Reload virtual currency in my account'; $lang['recharge'] = 'Recharge'; $lang['click_here'] = 'Click here'; $lang['no_wallet_password'] = 'No password exists for this wallet, please generate a password! '; diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index a52f269c..d3dab847 100644 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -276,7 +276,7 @@ // Mot de passe du wallet $lang['menu_wallet_password'] = 'Mot de passe Wallet' ; - $lang['header_wallet_password'] = 'Gestion des mots de passe des wallets' ; + $lang['header_wallet_password'] = 'Gestion du mot de passe du wallet' ; $lang['activated_wallets'] = 'Wallets actifs' ; $lang['generated'] = 'Généré'; $lang['not_generated'] = 'Non généré'; @@ -291,7 +291,7 @@ $lang['error_message'] = 'Une erreur s\'est produite.'; $lang['wallet_password'] = 'Mot de passe du wallet'; $lang['wallet_update'] = 'Mise à jour du wallet'; - $lang['recharge_hypervisor_account'] = 'Recharger de la monnaie virtuelle dans le compte de l\'hyperviseur'; + $lang['recharge_hypervisor_account'] = 'Recharger de la monnaie virtuelle dans mon compte'; $lang['recharge'] = 'Recharger'; $lang['click_here'] = 'Cliquez ici'; $lang['no_wallet_password'] = 'Aucun mot de passe n\'existe pour ce wallet, veuillez generer un mot de passe ! '; diff --git a/application/views/gestion_wallet.php b/application/views/gestion_wallet.php index 99a6386c..38f96a06 100644 --- a/application/views/gestion_wallet.php +++ b/application/views/gestion_wallet.php @@ -5,7 +5,6 @@ -
-
-
- -
-
-
- -
-
+

%

@@ -374,124 +364,7 @@ if ($transactions != false) {
- - +
@@ -520,16 +393,13 @@ if ($transactions != false) { src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"> - - - + - diff --git a/application/views/gestion_wallet_hyp.php b/application/views/gestion_wallet_hyp.php index 92990845..2575b0f7 100644 --- a/application/views/gestion_wallet_hyp.php +++ b/application/views/gestion_wallet_hyp.php @@ -4,6 +4,7 @@ +

- Wallet + Wallet

-
@@ -185,7 +185,6 @@
-
@@ -209,11 +208,149 @@
+
+
+
+ +
+
+
+
+ +
+
+
+
+

%

+

lang->line('Taux de commission client sur retrait') ?>

+
+
+ +
+ +
+
+
+
+
+

%

+

lang->line('Taux de commission agent géolocalisé sur retrait') ?>

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

%

+

lang->line('Taux de commission superviseur sur retrait') ?>

+
+
+ +
+ +
+
+
+
+
+

%

+

lang->line('Part de la banque sur le retrait') ?>

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

%

+

lang->line('Taux de commission client sur dépot') ?>

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

FCFA

+

lang->line('Frais minimun de la banque sur le dépot') ?>

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

%

+

lang->line('Taux de commission agent géolocalisé sur dépot') ?>

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

%

+

lang->line('Taux de commission superviseur sur dépot') ?>

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

%

+

lang->line('Part de la banque sur le dépot') ?>

+
+
+ +
+ +
+
+ +
+
@@ -302,6 +439,124 @@
+ +
@@ -330,11 +585,15 @@ + + + diff --git a/application/views/gestion_wallets.php b/application/views/gestion_wallets.php index 0dfcd6ad..d5dff834 100755 --- a/application/views/gestion_wallets.php +++ b/application/views/gestion_wallets.php @@ -84,7 +84,7 @@ }else{ ?> lang->line('Inactif'); ?> - + @@ -114,59 +114,7 @@
- +