- Add new feature : "Payement des commissions superviseurs en cash"

- Add hyperviseur menu in admin panel
This commit is contained in:
Djery-Tom 2021-04-22 16:34:32 +01:00
parent a1cab68982
commit 0d35ecb601
19 changed files with 1976 additions and 768 deletions

View File

@ -3,12 +3,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Admin extends CI_Controller class Admin extends CI_Controller
{ {
public function _contruct() public function __construct()
{ {
parent::_contruct(); parent::__construct();
$this->load->model('user_model'); $this->load->model('user_model');
$this->load->model('wallet_model');
} }
public function index() public function index()
@ -506,7 +505,9 @@ class Admin extends CI_Controller
$data['network'] = $this->session->userdata('network'); $data['network'] = $this->session->userdata('network');
$data['pays'] = $this->user_model->getAllCountries(); $data['pays'] = $this->user_model->getAllCountries();
$data['alert'] = ""; $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('listeadmin');
$this->load->view('footer'); $this->load->view('footer');
} }

View File

@ -1,27 +1,24 @@
<?php <?php
use Brick\Money\Context\AutoContext;
use Brick\Money\Money;
defined('BASEPATH') or exit('No direct script access allowed'); defined('BASEPATH') or exit('No direct script access allowed');
class Admin_dash extends CI_Controller class Admin_dash extends CI_Controller
{ {
public function _contruct() public function __construct()
{ {
parent::_contruct(); parent::__construct();
$this->load->model('user_model'); $this->load->model('user_model');
$this->load->model('wallet_model');
$this->load->model('nano_credit_model');
} }
public function index() public function index()
{ {
if ($this->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);
} else {
$data['pays'] = $this->user_model->getAllCountries(); $data['pays'] = $this->user_model->getAllCountries();
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id); $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['firstname'] = $this->session->userdata('firstname');
$data['lastname'] = $this->session->userdata('lastname'); $data['lastname'] = $this->session->userdata('lastname');
$data['email'] = $this->session->userdata('email'); $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('header', $data);
$this->load->view('admin_dash'); $this->load->view('admin_dash');
$this->load->view('footer'); $this->load->view('footer');
@ -50,15 +49,7 @@ class Admin_dash extends CI_Controller
public function filter() public function filter()
{ {
if (!$this->session->userdata('email')) { if ($this->isLogged()) {
$this->session->set_flashdata('error', 'log in first');
$data['alert'] = "ok";
$data['message'] = "Login first!";
redirect('index.php', $data);
} else {
$data['pays'] = $this->user_model->getAllCountries(); $data['pays'] = $this->user_model->getAllCountries();
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id); $data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
@ -77,31 +68,26 @@ class Admin_dash extends CI_Controller
public function firstFilter() public function firstFilter()
{ {
if ($this->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);
} else {
if (isset($_POST)) { if (isset($_POST)) {
$this->session->set_userdata('current_pays', $this->input->post('pays')); $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')); $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; $network = $infos_network->first_row()->name;
$contact_hyper = $infos_network->first_row()->phone; $contact_hyper = $infos_network->first_row()->phone;
$this->session->set_userdata('current_network', $network); $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_contact_hyper', $contact_hyper);
$this->session->set_userdata('current_ville', $this->input->post('ville')); $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') . "'"); $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_pays', $pays_name->first_row()->name);
$this->session->set_userdata('name_current_ville', $town_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'); $ville = $this->session->userdata('current_ville');
$hyper = $this->session->userdata('current_hyper'); $hyper = $this->session->userdata('current_hyper');
@ -123,6 +109,11 @@ class Admin_dash extends CI_Controller
$data['email'] = $this->session->userdata('email'); $data['email'] = $this->session->userdata('email');
$data['network'] = $this->session->userdata('current_network'); $data['network'] = $this->session->userdata('current_network');
$data['contact_hyper'] = $this->session->userdata('current_contact_hyper'); $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('header', $data);
$this->load->view('admin_dash'); $this->load->view('admin_dash');
$this->load->view('footer'); $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) public function documentation($route = null)
{ {
if (!$this->session->userdata('email')) { 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;
}
} }

View File

@ -1,82 +1,82 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
class Admin_password extends CI_Controller class Admin_password extends CI_Controller
{ {
public function _contruct() public function __construct()
{ {
parent::_contruct(); parent::__construct();
$this->load->model('user_model'); $this->load->model('user_model');
} }
public function index() public function index()
{ {
if (!$this->input->get('token')) { if (!$this->input->get('token')) {
echo "Lien incorrect"; echo "Lien incorrect";
} }
else { else {
$db_token = $this->user_model->getToken($this->input->get('token')); $db_token = $this->user_model->getToken($this->input->get('token'));
if($db_token==true){ if($db_token==true){
$this->session->set_userdata('token', $this->input->get('token')); $this->session->set_userdata('token', $this->input->get('token'));
$this->load->view('admin_update_password'); $this->load->view('admin_update_password');
}else{ }else{
echo "Ce lien a déjà expiré"; echo "Ce lien a déjà expiré";
} }
} }
} }
public function create_password() public function create_password()
{ {
if (!$this->session->userdata('token')) { if (!$this->session->userdata('token')) {
echo "Ce lien a déjà expiré"; echo "Ce lien a déjà expiré";
} else { } else {
if(isset($_POST)) if(isset($_POST))
{ {
$password = $this->input->post('password'); $password = $this->input->post('password');
$hash = $this->hashSSHA($password); $hash = $this->hashSSHA($password);
$encrypted_password = $hash["encrypted"]; // encrypted password $encrypted_password = $hash["encrypted"]; // encrypted password
$salt = $hash["salt"]; // salt $salt = $hash["salt"]; // salt
$res = $this->user_model->createPasswordAdmin($encrypted_password,$salt,$this->session->userdata('token')); $res = $this->user_model->createPasswordAdmin($encrypted_password,$salt,$this->session->userdata('token'));
if($res==true){ if($res==true){
$new_token = null; $new_token = null;
do { do {
$new_token = bin2hex(openssl_random_pseudo_bytes(16)); $new_token = bin2hex(openssl_random_pseudo_bytes(16));
$tokenExist = $this->user_model->getToken($new_token); $tokenExist = $this->user_model->getToken($new_token);
} while ($tokenExist==true); } while ($tokenExist==true);
$res_token = $this->user_model->updateToken($new_token,$this->session->userdata('token')); $res_token = $this->user_model->updateToken($new_token,$this->session->userdata('token'));
if($res_token==true){ if($res_token==true){
$data['alert'] = 'password'; $data['alert'] = 'password';
$data['message'] = 'Votre mot de passe a été configuré avec succès'; $data['message'] = 'Votre mot de passe a été configuré avec succès';
$this->load->view('login', $data); $this->load->view('login', $data);
}else{ }else{
echo "Une erreur s'est produite"; echo "Une erreur s'est produite";
} }
}else{ }else{
echo "Une erreur s'est produite"; echo "Une erreur s'est produite";
} }
} }
} }
} }
public function hashSSHA($password) { public function hashSSHA($password) {
$salt = sha1(rand()); $salt = sha1(rand());
$salt = substr($salt, 0, 10); $salt = substr($salt, 0, 10);
$encrypted = base64_encode(sha1($password . $salt, true) . $salt); $encrypted = base64_encode(sha1($password . $salt, true) . $salt);
$hash = array("salt" => $salt, "encrypted" => $encrypted); $hash = array("salt" => $salt, "encrypted" => $encrypted);
return $hash; return $hash;
} }
} }

View File

@ -4,9 +4,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class CodesG extends CI_Controller class CodesG extends CI_Controller
{ {
public function _contruct() public function __construct()
{ {
parent::_contruct(); parent::__construct();
$this->load->model('user_model'); $this->load->model('user_model');
} }

View File

@ -491,7 +491,7 @@ class Gestion extends CI_Controller
if ($query) { 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->load->library('email');
$this->email->from('noreply@ilink-app.com', 'iLink World'); $this->email->from('noreply@ilink-app.com', 'iLink World');

View File

@ -535,10 +535,16 @@ class Hyperviseur_dash extends CI_Controller
$data['transactions'] = $this->user_model->getDeletedTransactions($startDate, $endDate, $this->session->userdata('network_id')); $data['transactions'] = $this->user_model->getDeletedTransactions($startDate, $endDate, $this->session->userdata('network_id'));
else if ($type == 'commission_transfer') else if ($type == 'commission_transfer')
$data['transactions'] = $this->wallet_model->getCommissionTransfersByNetwork($startDate, $endDate, $this->session->userdata('network_id')); $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')); $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); $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 else
$data['transactions'] = $this->wallet_model->getRecharges($startDate, $endDate, $network_id); $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'); $this->load->view('config_wallet_ilink_hyp/etat_soldes');
else if ($type == 'refund_history') else if ($type == 'refund_history')
$this->load->view('historique_remboursement'); $this->load->view('historique_remboursement');
else if ($type == 'commission_payments')
$this->load->view('config_wallet_ilink_hyp/historique_commission_payements');
else else
$this->load->view('historique_recharges'); $this->load->view('historique_recharges');
$this->load->view('footer'); $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() public function rembourser_compensation()
{ {
if ($this->isLogged()) { if ($this->isLogged()) {
@ -1746,6 +1780,7 @@ class Hyperviseur_dash extends CI_Controller
$data['networks'] = $this->user_model->getActiveNetwork(); $data['networks'] = $this->user_model->getActiveNetwork();
$data['currency_code'] = $this->session->userdata('currency_code'); $data['currency_code'] = $this->session->userdata('currency_code');
$data['category'] = $this->session->userdata('category'); $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['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
$data['operators'] = $this->wallet_model->getOperatorsForNetwork($this->session->userdata('network_id')); $data['operators'] = $this->wallet_model->getOperatorsForNetwork($this->session->userdata('network_id'));

View File

@ -1,193 +1,193 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
class List_users_s extends CI_Controller class List_users_s extends CI_Controller
{ {
public function _contruct() public function __construct()
{ {
parent::_contruct(); parent::__construct();
$this->load->model('Users_simple'); $this->load->model('Users_simple');
} }
public function index() public function index()
{ {
if (!$this->session->userdata('token')) { if (!$this->session->userdata('token')) {
$this->session->set_flashdata('error', 'log in first'); $this->session->set_flashdata('error', 'log in first');
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['message'] = "Login first!"; $data['message'] = "Login first!";
$this->load->view('login', $data); $this->load->view('login', $data);
} else { } else {
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['alert'] = ""; $data['alert'] = "";
$data['network'] = $this->session->userdata('network'); $data['network'] = $this->session->userdata('network');
$this->load->view('header_sup', $data); $this->load->view('header_sup', $data);
$this->load->view('list_user_s'); $this->load->view('list_user_s');
$this->load->view('footer'); $this->load->view('footer');
} }
} }
public function ajoutbtn() public function ajoutbtn()
{ {
if ($this->input->post('ajbtn')) { if ($this->input->post('ajbtn')) {
$nom = $this->input->post('nm'); $nom = $this->input->post('nm');
$prenom = $this->input->post('prnm'); $prenom = $this->input->post('prnm');
$Cpays = $this->input->post('cdpays'); $Cpays = $this->input->post('cdpays');
$Reso = $this->input->post('reso'); $Reso = $this->input->post('reso');
$Cmbre = $this->input->post('cmbre'); $Cmbre = $this->input->post('cmbre');
$emaill = $this->input->post('maill'); $emaill = $this->input->post('maill');
$Catgry = $this->input->post('cat'); $Catgry = $this->input->post('cat');
$phoneNm = $this->input->post('tel'); $phoneNm = $this->input->post('tel');
$data = array( $data = array(
'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso,
'membre_code' => $Cmbre, 'emaill' => $emaill, 'category' => $Catgry, 'phone' => $phoneNm 'membre_code' => $Cmbre, 'emaill' => $emaill, 'category' => $Catgry, 'phone' => $phoneNm
); );
$query = $this->db->insert('users_simple', $data); $query = $this->db->insert('users_simple', $data);
if ($query) { if ($query) {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['success'] = "ok"; $data['success'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $phoneNm has been added!"; $data['message'] = "The member $phoneNm has been added!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} else { } else {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $phoneNm couldn't been added!"; $data['message'] = "The member $phoneNm couldn't been added!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} }
} else { } else {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "Database error!"; $data['message'] = "Database error!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} }
} }
function suppr() function suppr()
{ {
if ($this->input->get('recordId')) { if ($this->input->get('recordId')) {
$id = "+" . $this->input->get('recordId'); $id = "+" . $this->input->get('recordId');
$id = str_replace(' ', '', $id); $id = str_replace(' ', '', $id);
/*$this->db->where('phone', $id); /*$this->db->where('phone', $id);
$query = $this->db->delete('users'); $query = $this->db->delete('users');
*/ */
$query = $this->db->delete('users_simple', array('phone' => $id)); $query = $this->db->delete('users_simple', array('phone' => $id));
if ($query) { if ($query) {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['success'] = "ok"; $data['success'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $id has been deleted!"; $data['message'] = "The member $id has been deleted!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} else { } else {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $id couldn't been deleted!"; $data['message'] = "The member $id couldn't been deleted!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} }
} else { } else {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $id couldn't been deleted! No data sent"; $data['message'] = "The member $id couldn't been deleted! No data sent";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} }
} }
public function modif() public function modif()
{ {
if ($this->input->post('modifbtn')) { if ($this->input->post('modifbtn')) {
$nom = $this->input->post('nm'); $nom = $this->input->post('nm');
$prenom = $this->input->post('prnm'); $prenom = $this->input->post('prnm');
$Cpays = $this->input->post('cdpays'); $Cpays = $this->input->post('cdpays');
$Reso = $this->input->post('reso'); $Reso = $this->input->post('reso');
$Cmbre = $this->input->post('cmbre'); $Cmbre = $this->input->post('cmbre');
$emaill = $this->input->post('maill'); $emaill = $this->input->post('maill');
$Catgry = $this->input->post('cat'); $Catgry = $this->input->post('cat');
$phoneNm = $this->input->post('tel'); $phoneNm = $this->input->post('tel');
$data = array( $data = array(
'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'member_code' => $Cmbre, 'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'member_code' => $Cmbre,
'email' => $emaill, 'category' => $Catgry 'email' => $emaill, 'category' => $Catgry
); );
$this->db->where('phone', $phoneNm); $this->db->where('phone', $phoneNm);
$query = $this->db->update('users_simple', $data); $query = $this->db->update('users_simple', $data);
if ($query) { if ($query) {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['success'] = "ok"; $data['success'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $phoneNm has been updated!"; $data['message'] = "The member $phoneNm has been updated!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
//redirect('Listes_admin'); //redirect('Listes_admin');
} else { } else {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $phoneNm couldn't been updated!"; $data['message'] = "The member $phoneNm couldn't been updated!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} }
} else { } else {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The record couldn't been updated! No data sent."; $data['message'] = "The record couldn't been updated! No data sent.";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} }
} }
} }
?> ?>

View File

@ -1,196 +1,196 @@
<?php <?php
defined('BASEPATH') OR exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
class Liste_users_g extends CI_Controller class Liste_users_g extends CI_Controller
{ {
public function _contruct() public function __construct()
{ {
parent::_contruct(); parent::__construct();
$this->load->model('Users_model'); $this->load->model('Users_model');
} }
public function index() public function index()
{ {
if (!$this->session->userdata('token')) { if (!$this->session->userdata('token')) {
$this->session->set_flashdata('error', 'log in first'); $this->session->set_flashdata('error', 'log in first');
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['message'] = "Login first!"; $data['message'] = "Login first!";
$this->load->view('login', $data); $this->load->view('login', $data);
} else { } else {
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['parrain'] = $this->session->userdata('parrain'); $data['parrain'] = $this->session->userdata('parrain');
$data['alert'] = ""; $data['alert'] = "";
$data['network'] = $this->session->userdata('network'); $data['network'] = $this->session->userdata('network');
$data['longitude'] = $this->session->userdata('longitude'); $data['longitude'] = $this->session->userdata('longitude');
$data['latitude'] = $this->session->userdata('latitude'); $data['latitude'] = $this->session->userdata('latitude');
$this->load->view('header_sup', $data); $this->load->view('header_sup', $data);
$this->load->view('list_user_s'); $this->load->view('list_user_s');
$this->load->view('footer'); $this->load->view('footer');
} }
} }
public function ajoutbtn() public function ajoutbtn()
{ {
if ($this->input->post('ajbtn')) { if ($this->input->post('ajbtn')) {
$nom = $this->input->post('nm'); $nom = $this->input->post('nm');
$prenom = $this->input->post('prnm'); $prenom = $this->input->post('prnm');
$Cpays = $this->input->post('cdpays'); $Cpays = $this->input->post('cdpays');
$Reso = $this->input->post('reso'); $Reso = $this->input->post('reso');
$Cmbre = $this->input->post('cmbre'); $Cmbre = $this->input->post('cmbre');
$emaill = $this->input->post('maill'); $emaill = $this->input->post('maill');
$Catgry = $this->input->post('cat'); $Catgry = $this->input->post('cat');
$phoneNm = $this->input->post('tel'); $phoneNm = $this->input->post('tel');
$data = array( $data = array(
'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso,
'membre_code' => $Cmbre, 'emaill' => $emaill, 'category' => $Catgry, 'phone' => $phoneNm 'membre_code' => $Cmbre, 'emaill' => $emaill, 'category' => $Catgry, 'phone' => $phoneNm
); );
$query = $this->db->insert('users_simple', $data); $query = $this->db->insert('users_simple', $data);
if ($query) { if ($query) {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['success'] = "ok"; $data['success'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $phoneNm has been added!"; $data['message'] = "The member $phoneNm has been added!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} else { } else {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $phoneNm couldn't been added!"; $data['message'] = "The member $phoneNm couldn't been added!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} }
} else { } else {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "Database error!"; $data['message'] = "Database error!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} }
} }
function suppr() function suppr()
{ {
if ($this->input->get('recordId')) { if ($this->input->get('recordId')) {
$id = "+" . $this->input->get('recordId'); $id = "+" . $this->input->get('recordId');
$id = str_replace(' ', '', $id); $id = str_replace(' ', '', $id);
/*$this->db->where('phone', $id); /*$this->db->where('phone', $id);
$query = $this->db->delete('users'); $query = $this->db->delete('users');
*/ */
$query = $this->db->delete('users_simple', array('phone' => $id)); $query = $this->db->delete('users_simple', array('phone' => $id));
if ($query) { if ($query) {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['success'] = "ok"; $data['success'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $id has been deleted!"; $data['message'] = "The member $id has been deleted!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} else { } else {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $id couldn't been deleted!"; $data['message'] = "The member $id couldn't been deleted!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} }
} else { } else {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $id couldn't been deleted! No data sent"; $data['message'] = "The member $id couldn't been deleted! No data sent";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} }
} }
public function modif() public function modif()
{ {
if ($this->input->post('modifbtn')) { if ($this->input->post('modifbtn')) {
$nom = $this->input->post('nm'); $nom = $this->input->post('nm');
$prenom = $this->input->post('prnm'); $prenom = $this->input->post('prnm');
$Cpays = $this->input->post('cdpays'); $Cpays = $this->input->post('cdpays');
$Reso = $this->input->post('reso'); $Reso = $this->input->post('reso');
$Cmbre = $this->input->post('cmbre'); $Cmbre = $this->input->post('cmbre');
$emaill = $this->input->post('maill'); $emaill = $this->input->post('maill');
$Catgry = $this->input->post('cat'); $Catgry = $this->input->post('cat');
$phoneNm = $this->input->post('tel'); $phoneNm = $this->input->post('tel');
$data = array( $data = array(
'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'member_code' => $Cmbre, 'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'member_code' => $Cmbre,
'email' => $emaill, 'category' => $Catgry 'email' => $emaill, 'category' => $Catgry
); );
$this->db->where('phone', $phoneNm); $this->db->where('phone', $phoneNm);
$query = $this->db->update('users_simple', $data); $query = $this->db->update('users_simple', $data);
if ($query) { if ($query) {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['success'] = "ok"; $data['success'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $phoneNm has been updated!"; $data['message'] = "The member $phoneNm has been updated!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
//redirect('Listes_admin'); //redirect('Listes_admin');
} else { } else {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The member $phoneNm couldn't been updated!"; $data['message'] = "The member $phoneNm couldn't been updated!";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} }
} else { } else {
$data['alert'] = "ok"; $data['alert'] = "ok";
$data['active'] = "simple_members"; $data['active'] = "simple_members";
$data['message'] = "The record couldn't been updated! No data sent."; $data['message'] = "The record couldn't been updated! No data sent.";
$this->load->view('header', $data); $this->load->view('header', $data);
$this->load->view('listemembers'); $this->load->view('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} }
} }
} }
?> ?>

View File

@ -4,9 +4,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Listes_admin extends CI_Controller class Listes_admin extends CI_Controller
{ {
public function _contruct() public function __construct()
{ {
parent::_contruct(); parent::__construct();
$this->load->model('user_model'); $this->load->model('user_model');
} }

View File

@ -4,11 +4,13 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Listes_members extends CI_Controller class Listes_members extends CI_Controller
{ {
public function _contruct() public function __construct()
{ {
parent::_contruct(); parent::__construct();
$this->load->model('user_model'); $this->load->model('user_model');
} $this->load->model('wallet_model');
}
public function index() public function index()
{ {
@ -34,7 +36,9 @@ class Listes_members extends CI_Controller
$data['lastname'] = $this->session->userdata('lastname'); $data['lastname'] = $this->session->userdata('lastname');
$data['email'] = $this->session->userdata('email'); $data['email'] = $this->session->userdata('email');
$data['alert'] = ""; $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('listemembers');
$this->load->view('footer'); $this->load->view('footer');
} }
@ -93,7 +97,9 @@ class Listes_members extends CI_Controller
function suppr() 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 = "+" . $this->input->get('recordId');
$id = str_replace(' ', '', $id); $id = str_replace(' ', '', $id);

View File

@ -4,10 +4,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Member_code_admin extends CI_Controller 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('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['email'] = $this->session->userdata('email');
$data['alert'] = ""; $data['alert'] = "";
$data['pays'] = $this->user_model->getAllCountries(); $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('membreCodeAdmin');
$this->load->view('footer'); $this->load->view('footer');
} }
@ -67,6 +70,8 @@ class Member_code_admin extends CI_Controller
$query = $this->db->insert('codemembre', $data); $query = $this->db->insert('codemembre', $data);
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
if ($query && $rslt) { if ($query && $rslt) {
$data['active'] = "members_code"; $data['active'] = "members_code";
@ -92,7 +97,9 @@ class Member_code_admin extends CI_Controller
public function delete() 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 = "+" . $this->input->get('recordId');
$id = str_replace(' ', '', $id); $id = str_replace(' ', '', $id);

View File

@ -612,4 +612,9 @@ $lang['nano_health_removal'] = 'Removal of nano health';
$lang['activate_nano_health'] = 'Activate nano health'; $lang['activate_nano_health'] = 'Activate nano health';
$lang['nano_health_deleted'] = 'Nano health deleted'; $lang['nano_health_deleted'] = 'Nano health deleted';
$lang['phone_already_exists'] = "This phone number already exists"; $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";
?> ?>

View File

@ -624,4 +624,9 @@ $lang['nano_health_removal'] = 'Suppression du nano santé';
$lang['activate_nano_health'] = 'Activation du nano santé'; $lang['activate_nano_health'] = 'Activation du nano santé';
$lang['nano_health_deleted'] = 'Nano santé supprimé'; $lang['nano_health_deleted'] = 'Nano santé supprimé';
$lang['phone_already_exists'] = "This phone number already exists"; $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";
?> ?>

View File

@ -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'); 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;
}
}
} }

View File

@ -80,6 +80,11 @@
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('export_balance_statement') ?></h3> <h3 class="box-title"><?php echo $this->lang->line('export_balance_statement') ?></h3>
<div class="box-tools">
<a class="btn btn-primary" href="<?php echo current_url().('?history=commission_payments')?>">
<?php echo $this->lang->line('commission_payments_history'); ?>
</a>
</div>
</div> </div>
<div class="box-body" style="overflow-x:auto;"> <div class="box-body" style="overflow-x:auto;">
<?php <?php
@ -102,6 +107,9 @@
<th><?= $this->lang->line('Telephone') ?></th> <th><?= $this->lang->line('Telephone') ?></th>
<th><?= $this->lang->line('code membre') ?></th> <th><?= $this->lang->line('code membre') ?></th>
<th>Agent</th> <th>Agent</th>
<?php if ($this->session->userdata('category') != 'super') { ?>
<th align='center'>Action</th>
<?php } ?>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -117,6 +125,14 @@
<td>" . $row->codeMembre . "</td> <td>" . $row->codeMembre . "</td>
<td>" . $row->lastname . "</td>"; <td>" . $row->lastname . "</td>";
?> ?>
<?php if ($this->session->userdata('category') != 'super') { ?>
<td>
<button data-toggle="modal" data-target="#payCommission" class="btn btn-danger payCommissionBtn"
data-id_wallet_agent="<?=$row->wallet_id?>" <?php if($row->category != 'super') echo "style = 'display:none'"?> >
<?= $this->lang->line('pay_commission_in_cash')?>
</button>
</td>
<?php } ?>
</tr> </tr>
<?php <?php
@ -139,6 +155,53 @@
</div> </div>
</div> </div>
</div> </div>
<div class="modal fade" id="payCommission" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title"><?php echo $this->lang->line('pay_commission_in_cash'); ?></h3>
</div>
<div class="modal-body">
<?php if ($walletPassword != null) { ?>
<form id="payCommissionForm">
<div class="form-group">
<label for="montant" class="col-form-label"><?php echo $this->lang->line('Montant') ?></label>
<input type="text" required class="form-control" id="montant" name="montant" >
</div>
<div class="form-group">
<label><?php echo $this->lang->line('mot de passe') ?></label>
<div class="input-group" id="show_hide_password">
<input class="form-control" name="password" id="password" type="password">
<div class="input-group-addon">
<a href=""><i class="fa fa-eye-slash" aria-hidden="true"></i></a>
</div>
</div>
</div>
<div class="clearfix">
<a href="#" id="resetPassword" class="pull-right forgot-password" data-wallet_password_id="<?php echo $walletPassword->id ?>" data-network="<?php echo $network ?>" data-country="<?php echo $country ?>"
data-email="<?php echo $walletPassword->email ?>">
<?php echo $this->lang->line('i_forgot_password') ?>
</a>
</div>
</form>
<?php }else{ ?>
<div class="text-center">
<h4> <?php echo $this->lang->line('no_wallet_password') ?></h4>
<a href="<?php echo base_url('index.php/Hyperviseur_dash/walletPassword') ?>" alt="" class="btn btn-primary"><?php echo $this->lang->line('click_here') ?></a>
</div>
<?php } ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
<?php if ($walletPassword != null) { ?>
<button type="button" class="btn btn-primary" data-salt="<?php echo $walletPassword->salt ?>" data-encrypted_password="<?php echo $walletPassword->encrypted_password ?>" id="pay" >
<?php echo $this->lang->line('recharge'); ?>
</button>
<?php }?>
</div>
</div>
</div>
</div>
</section> </section>
@ -171,10 +234,25 @@
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js"></script> <script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js"></script>
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script> <script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script> <script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.5.4"></script>
<script> <script>
$(function () { $(function () {
anElement = new AutoNumeric('#montant', '', {digitGroupSeparator: ' ', decimalPlaces:'0', minimumValue : '1' , maximumValue: '99999999999999999999999999'});
$("#show_hide_password a").on('click', function(event) {
event.preventDefault();
if($('#show_hide_password input').attr("type") == "text"){
$('#show_hide_password input').attr('type', 'password');
$('#show_hide_password i').addClass( "fa-eye-slash" );
$('#show_hide_password i').removeClass( "fa-eye" );
}else if($('#show_hide_password input').attr("type") == "password"){
$('#show_hide_password input').attr('type', 'text');
$('#show_hide_password i').removeClass( "fa-eye-slash" );
$('#show_hide_password i').addClass( "fa-eye" );
}
});
const lang = $('table').data('lang'); const lang = $('table').data('lang');
var rows = $('table').data('rows'); var rows = $('table').data('rows');
var currency = $('table').data('currency'); var currency = $('table').data('currency');
@ -281,4 +359,101 @@
table.buttons().container() table.buttons().container()
.appendTo('#example_wrapper .col-sm-6:eq(0)'); .appendTo('#example_wrapper .col-sm-6:eq(0)');
}); });
var id_wallet_agent = null;
$('.payCommissionBtn').click(function () {
id_wallet_agent = $(this).data('id_wallet_agent');
})
$('#resetPassword').click(function () {
const wallet_password_id = $(this).data('wallet_password_id');
const network = $(this).data('network');
const country = $(this).data('country');
const email = $(this).data('email');
$.ajax({
url: '<?php echo base_url('index.php/Hyperviseur_dash/resetWalletPassword')?>',
type: 'POST',
dataType: 'json',
data: {
"wallet_password_id": wallet_password_id,
"email": email,
"network" : network ,
"country" : country
},
success: function (data) {
if(data=='200'){
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('password_has_been_reset')?>",
text:"<?php echo $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" :
}else{
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
});
});
$('#pay').click(function () {
const salt = $(this).data('salt');
const encrypted_password = $(this).data('encrypted_password');
if ($('#payCommissionForm')[0].checkValidity()) {
const montant = anElement.getNumber(); //parseFloat($('#montant').val());
const password = $('#password').val();
$.ajax({
url: '<?php echo base_url('index.php/Hyperviseur_dash/pay_commission_in_cash')?>',
type: 'POST',
dataType: 'json',
data: {
"id_wallet_agent" : id_wallet_agent,
"montant": montant ,
"password": password,
"salt" : salt,
"encrypted_password" : encrypted_password
},
success: function (data) {
if(data=='200'){
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('payment_done')?>",
text: "<?php echo $this->lang->line('informations_updated')?>",
timer: 3000
}).then(()=>{
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" :
}else if(data == '400'){
toastr.error("<?php echo $this->lang->line('incorrect_password')?>" , "<?php echo $this->lang->line('request_error')?>");
}else{
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, error) {
console.log(resultat + " " + error);
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
}
});
} else {
$('#payCommissionForm')[0].reportValidity();
}
});
</script> </script>

View File

@ -0,0 +1,290 @@
<!-- DataTables -->
<link rel="stylesheet"
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css">
<div class="content-wrapper">
<?php
use Brick\Money\Context\AutoContext;
use Brick\Money\CurrencyConverter;
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
use Brick\Money\ExchangeRateProvider\PDOProvider;
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
use Brick\Money\Money;
// set to whatever your rates are relative to
$baseCurrency = 'USD';
// use your own credentials, or re-use your existing PDO connection
$pdo = new PDO('mysql:host=' . $this->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();
?>
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('commission_payments_history');
echo ' ' . $network . ' - ' . $country; ?>
<!-- <input type="button" class="btn btn-primary pull-right" id="Bactiver"-->
<!-- value="Activer/Désactiver le(s) réseau(x)" />-->
</h1>
<?php
$site_url = base_url();
if ($alert == "ok") {
if (!$success == "ok") {
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-aqua"><i class="ion ion-android-time"></i></span>
<div class="info-box-content">
<span class="info-box-text"><?php echo $this->lang->line('Période') ?> </span>
<span class="info-box-number">
<input id="picker"
style="background: #fff; cursor: pointer; padding: 1px 1px; border: 1px solid #ccc; width: 100%"
data-category="<?php echo isset($category) ? $category : null ?>"
type="text" name="daterange"
data-lang="<?php echo $this->session->userdata('site_lang') ?>"
value="<?php echo ($startDate != null & $endDate != null) ? $startDate . ' - ' . $endDate : '' ?>"/>
</span>
<span> Format : <?php echo $this->session->userdata('site_lang') === 'french' ? 'Jour - Mois - Année ' : 'Year - Month - Day' ?> </span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('commission_payments_history'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<?php
if ($payments){
$numrows = $payments->num_rows();
$num = 0;
if ($numrows > 0) {
$fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
?>
<table id="transactions" class="table table-bordered table-striped">
<thead>
<tr>
<th align='center'></th>
<th>Agent</th>
<th><?php echo $this->lang->line('Montant') ?></th>
<th><?php echo $this->lang->line('initial_commission') ?></th>
<th><?php echo $this->lang->line('final_commission') ?></th>
<th align='center'>Date</th>
</tr>
</thead>
<tbody>
<?php
foreach ($payments->result() as $row) {
$num++;
echo "<tr>
<td align='center' >$num</td>
<td>" . $row->lastname . "</td>
<td>" . Money::of(round($row->amount, 2), $row->currency_code, $context)->formatTo('fr_FR') . "</td>
<td>" . Money::of(round($row->initial_commission, 2), $row->currency_code, $context)->formatTo('fr_FR') . "</td>
<td>" . Money::of(round($row->final_commission, 2), $row->currency_code, $context)->formatTo('fr_FR') . "</td>
<td>" . $row->date . "</td>
</tr>";
}
?>
</tbody>
<?php
} else {
echo $this->lang->line('no_refund');
}
} else {
echo $this->lang->line('no_refund');
}
?>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- SlimScroll -->
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment-with-locales.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.19/sorting/datetime-moment.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.20/dataRender/datetime.js"></script
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.20/dataRender/datetime.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.html5.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.colVis.min.js"></script>
<script>
$(function () {
const lang = $('#picker').data('lang');
const format = lang === 'french' ? 'fr' : 'en';
moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date
$('#transactions').DataTable({
"aaSorting": [[5, "desc"]],
"columnDefs": [{
targets: 5,
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
}],
dom: 'Bfrtip',
"buttons": [
'pageLength',
{
"extend": 'excelHtml5',
title: "<?= $this->lang->line('commission_payments_history') ?>",
customizeData: function (data) {
for (var i = 0; i < data.body.length; i++) {
for (var j = 0; j < data.body[i].length; j++) {
// data.body[i][j] = '\u200C' + data.body[i][j];
if ([2,3,4].includes(j)) {
// Get the value and strip the non numeric characters
// var value = $(this).text();
value = data.body[i][j].replace(',', ".")
data.body[i][j] = Number(value.replace(/[^0-9\.-]+/g, ""));
}
}
}
},
trim: false,
},
{
extend: 'csvHtml5',
title: "<?= $this->lang->line('commission_payments_history') ?>",
customizeData: function (data) {
for (var i = 0; i < data.body.length; i++) {
for (var j = 0; j < data.body[i].length; j++) {
// data.body[i][j] = '\u200C' + data.body[i][j];
if ([2,3,4].includes(j)) {
// Get the value and strip the non numeric characters
// var value = $(this).text();
value = data.body[i][j].replace(',', ".")
data.body[i][j] = Number(value.replace(/[^0-9\.-]+/g, ""));
}
}
}
},
trim: false,
},
{
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'LEGAL',
title: "<?= $this->lang->line('commission_payments_history') ?>",
trim: false,
},
// 'colvis'
]
});
});
</script>
<script type="text/javascript">
var startDate;
var endDate;
$(function () {
const lang = $('#picker').data('lang');
const category = $('#picker').data('category');
const id_network = "<?= $id_network?>";
$('input[name="daterange"]').daterangepicker({
opens: 'left',
autoUpdateInput: false,
locale: {
format: lang === 'french' ? 'DD-MM-YYYY' : 'YYYY-MM-DD',
cancelLabel: 'Clear'
}
}, function (start, end, label) {
const debut = start.format('YYYY-MM-DD');
const fin = end.format('YYYY-MM-DD');
if (category)
window.location = "<?php echo current_url()?>" + "?history=commission_payments" + "&d=" + debut + "&f=" + fin;
else
window.location = "<?php echo current_url()?>" + "?id="+id_network+"&history=commission_payments" + "&d=" + debut + "&f=" + fin;
});
$('input[name="daterange"]').on('cancel.daterangepicker', function (ev, picker) {
//do something, like clearing an input
$('#daterange').val('');
if (category)
window.location = "<?php echo current_url()?>" + "?history=commission_payments";
else
window.location = "<?php echo current_url()?>" + "?id="+id_network+"&history=commission_payments";
});
});
</script>

View File

@ -92,7 +92,7 @@
}else{ }else{
?> ?>
<td><span class="label label-danger"><?= $this->lang->line('Inactif'); ?></span></td> <td><span class="label label-danger"><?= $this->lang->line('Inactif'); ?></span></td>
<td><button type="button" data-id-operator-country="<?= $row->id ?>" data-id-network="<?= $this->session->userdata('network_id') ?>" class="btn btn-primary activeOperator" ><?php echo $this->lang->line('Activer'); ?></button></td> <td><button type="button" data-id-operator-country="<?= $row->id ?>" data-id-network="<?= $network_id ?>" class="btn btn-primary activeOperator" ><?php echo $this->lang->line('Activer'); ?></button></td>
<?php <?php
} }
?> ?>
@ -182,6 +182,7 @@
$(document).on("click", ".activeOperator", function () { $(document).on("click", ".activeOperator", function () {
const id_operator_country = $(this).data('id-operator-country'); const id_operator_country = $(this).data('id-operator-country');
const id_network = $(this).data('id-network'); const id_network = $(this).data('id-network');
console.log(id_operator_country)
$.ajax({ $.ajax({
url : '<?php echo base_url('index.php/Hyperviseur_dash/active_operator')?>', url : '<?php echo base_url('index.php/Hyperviseur_dash/active_operator')?>',
type : 'POST', type : 'POST',

View File

@ -1,237 +1,285 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?> <?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>iLink | Dashboard</title> <title>iLink | Dashboard</title>
<!-- Tell the browser to be responsive to screen width --> <!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.7 --> <!-- Bootstrap 3.3.7 -->
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap/dist/css/bootstrap.min.css') ?>"> <link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap/dist/css/bootstrap.min.css') ?>">
<!-- Font Awesome --> <!-- Font Awesome -->
<link rel="stylesheet" href="<?php echo base_url('bower_components/font-awesome/css/font-awesome.min.css') ?>"> <link rel="stylesheet" href="<?php echo base_url('bower_components/font-awesome/css/font-awesome.min.css') ?>">
<!-- Ionicons --> <!-- Ionicons -->
<link rel="stylesheet" href="<?php echo base_url('bower_components/Ionicons/css/ionicons.min.css') ?>"> <link rel="stylesheet" href="<?php echo base_url('bower_components/Ionicons/css/ionicons.min.css') ?>">
<!-- Theme style --> <!-- Theme style -->
<link rel="stylesheet" href="<?php echo base_url('dist/css/AdminLTE.css') ?>"> <link rel="stylesheet" href="<?php echo base_url('dist/css/AdminLTE.css') ?>">
<!-- AdminLTE Skins. Choose a skin from the css/skins <!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. --> folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="<?php echo base_url('dist/css/skins/_all-skins.min.css') ?>"> <link rel="stylesheet" href="<?php echo base_url('dist/css/skins/_all-skins.min.css') ?>">
<link rel="shortcut icon" href="<?php echo base_url('favicon.ico') ?>" type="image/x-icon"> <link rel="shortcut icon" href="<?php echo base_url('favicon.ico') ?>" type="image/x-icon">
<link rel="icon" href="<?php echo base_url('favicon.ico') ?>" type="image/x-icon"> <link rel="icon" href="<?php echo base_url('favicon.ico') ?>" type="image/x-icon">
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--> <![endif]-->
<style media="screen"> <style media="screen">
.img-dash { .img-dash {
height: 50px !important; height: 50px !important;
float: left !important; float: left !important;
padding: 1% !important; padding: 1% !important;
} }
.table_modified { .table_modified {
font-size: 11px !important; font-size: 11px !important;
} }
</style> </style>
</head> </head>
<body class="hold-transition skin-blue sidebar-mini"> <body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper"> <div class="wrapper">
<header class="main-header"> <header class="main-header">
<!-- Logo --> <!-- Logo -->
<a href="#" class="logo"> <a href="#" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels --> <!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>iLink</b></span> <span class="logo-mini"><b>iLink</b></span>
<!-- logo for regular state and mobile devices --> <!-- logo for regular state and mobile devices -->
<span class="logo-lg"> <span class="logo-lg">
<img class="img img-responsive img-dash" src="<?php echo base_url('images/logo.png') ?>"> <img class="img img-responsive img-dash" src="<?php echo base_url('images/logo.png') ?>">
<b>iLink</b> World <b>iLink</b> World
</span> </span>
</a> </a>
<!-- Header Navbar: style can be found in header.less --> <!-- Header Navbar: style can be found in header.less -->
<nav class="navbar navbar-static-top"> <nav class="navbar navbar-static-top">
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button"> <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
<span class="sr-only">Toggle navigation</span> <span class="sr-only">Toggle navigation</span>
</a> </a>
<div class="navbar-custom-menu"> <div class="navbar-custom-menu">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<!-- User Account: style can be found in dropdown.less --> <!-- User Account: style can be found in dropdown.less -->
<li class="dropdown user user-menu"> <li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
<b><?php echo $this->session->userdata('current_network');?></b> - <b><?php echo $this->session->userdata('current_network');?></b> -
<b><?php echo $this->session->userdata('name_current_pays');?></b> - <b><?php echo $this->session->userdata('name_current_pays');?></b> -
<b><?php echo $this->session->userdata('name_current_ville');?></b> <b><?php echo $this->session->userdata('name_current_ville');?></b>
- <?php echo $this->lang->line('Bienvenue'); ?> <span class="hidden-xs"><b><?php echo $lastname;?></b></span> - <?php echo $this->lang->line('Bienvenue'); ?> <span class="hidden-xs"><b><?php echo $lastname;?></b></span>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu" style="width: 400px">
<!-- User image --> <!-- User image -->
<li class="user-header"> <li class="user-header">
<p> <p>
<?php echo $this->lang->line('administrateur'); ?> <?php echo $this->lang->line('administrateur'); ?>
<small><?php echo $email;?></small> <small><?php echo $email;?></small>
</p> </p>
</li> </li>
<li class="user-body"> <li class="user-body">
<div class="row"> <div class="row">
<div class="col-xs-3 text-center"> <div class="col-xs-3 text-center">
<?php echo $this->session->userdata('current_network');?> <?php echo $this->session->userdata('current_network');?>
</div> </div>
<div class="col-xs-4 text-center"> <div class="col-xs-4 text-center">
<?php echo $this->session->userdata('current_hyper');?> <?php echo $this->session->userdata('current_hyper');?>
</div> </div>
<div class="col-xs-5 text-center"> <div class="col-xs-5 text-center">
<?php echo $this->session->userdata('current_contact_hyper');?> <?php echo $this->session->userdata('current_contact_hyper');?>
</div> </div>
</div> </div>
<!-- /.row --> <!-- /.row -->
</li> </li>
<!-- Menu Footer--> <!-- Menu Footer-->
<li class="user-footer"> <li class="user-footer">
<div class="pull-left"> <div class="pull-left">
<a href="#" data-toggle="modal" data-target="#modal-defaultSwitch" class="btn btn-default btn-flat"><?php echo $this->lang->line('Reseau'); ?></a> <a href="#" data-toggle="modal" data-target="#modal-defaultSwitch" class="btn btn-default btn-flat"><?php echo $this->lang->line('Reseau'); ?></a>
</div> </div>
<div class="pull-right"> <div class="pull-right">
<a href="<?php echo base_url('index.php/Admin_dash/filter') ?>" class="btn btn-default btn-flat"><?php echo $this->lang->line('Terminer'); ?></a> <a href="<?php echo base_url('index.php/Admin_dash/filter') ?>" class="btn btn-default btn-flat"><?php echo $this->lang->line('Terminer'); ?></a>
</div> </div>
</li> </li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div> </div>
</nav> </nav>
</header> </header>
<!-- Left side column. contains the logo and sidebar --> <!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar"> <aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less --> <!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar"> <section class="sidebar">
<!-- sidebar menu: : style can be found in sidebar.less --> <!-- sidebar menu: : style can be found in sidebar.less -->
<ul class="sidebar-menu" data-widget="tree"> <ul class="sidebar-menu" data-widget="tree">
<li class="<?php if($active=="dash"){echo "active";} ?>"> <li class="<?php if($active=="dash"){echo "active";} ?>">
<a href="<?php echo base_url('index.php/Admin_dash') ?>"> <a href="<?php echo base_url('index.php/Admin_dash') ?>">
<i class="fa fa-dashboard"></i> <span><?php echo $this->lang->line('Tableau de bord'); ?></span> <i class="fa fa-dashboard"></i> <span><?php echo $this->lang->line('Tableau de bord'); ?></span>
</a> </a>
</li> </li>
<li class="<?php if($active=="members"){echo "active";} ?>"> <li class="<?php if($active=="members"){echo "active";} ?>">
<a href="<?php echo base_url('index.php/Admin/initGetAllUser_g') ?>"> <a href="<?php echo base_url('index.php/Admin/initGetAllUser_g') ?>">
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Utilisateurs géolocalisés'); ?></span> <i class="fa fa-users"></i> <span><?php echo $this->lang->line('Utilisateurs géolocalisés'); ?></span>
</a> </a>
</li> </li>
<li class="<?php if($active=="simple_members"){echo "active";} ?>"> <li class="<?php if($active=="simple_members"){echo "active";} ?>">
<a href="<?php echo base_url('index.php/Listes_members') ?>"> <a href="<?php echo base_url('index.php/Listes_members') ?>">
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Utilisateurs simples'); ?></span> <i class="fa fa-users"></i> <span><?php echo $this->lang->line('Utilisateurs simples'); ?></span>
</a> </a>
</li> </li>
<li class="<?php if($active=="members_code"){echo "active";} ?>"> <li class="<?php if($active=="members_code"){echo "active";} ?>">
<a href="<?php echo base_url('index.php/Member_code_admin') ?>"> <a href="<?php echo base_url('index.php/Member_code_admin') ?>">
<i class="fa fa-database"></i> <span><?php echo $this->lang->line('code membre'); ?></span> <i class="fa fa-database"></i> <span><?php echo $this->lang->line('code membre'); ?></span>
</a> </a>
</li> </li>
<!--<li class="<?php //if($active=="demandes"){echo "active";} ?>"> <!--<li class="<?php //if($active=="demandes"){echo "active";} ?>">
<a href="<?php //echo base_url('index.php/Admin/getAllDemandes') ?>"> <a href="<?php //echo base_url('index.php/Admin/getAllDemandes') ?>">
<i class="fa fa-ticket"></i> <span><?php //echo $this->lang->line('Demandes de crédits'); ?></span> <i class="fa fa-ticket"></i> <span><?php //echo $this->lang->line('Demandes de crédits'); ?></span>
</a> </a>
</li>--> </li>-->
<li class="<?php if($active=="deconnexion"){echo "active";} ?>"> <?php if ($hasWallet) {?>
<a href="#" data-toggle="modal" data-target="#modal-disconnect"> <li class="<?= "treeview " . ((strpos($active, "wallet_") !== false) ? "active menu-open" : "") ?>"
<i class="glyphicon glyphicon-off"></i> <span><?php echo $this->lang->line('Déconnexion'); ?></span> style="height: auto;">
</a> <a href="#">
</li> <i class="fa fa-credit-card-alt"></i>
</ul> <span><?php echo $this->lang->line('wallet_management'); ?></span>
</section> <span class="pull-right-container">
<!-- /.sidebar --> <i class="fa fa-angle-left pull-right"></i>
</aside> </span>
</a>
<div class="modal fade" id="modal-defaultSwitch"> <ul class="treeview-menu"
<div class="modal-dialog"> style="<?= (strpos($active, "wallet_") !== false) ? "" : "display: none;" ?>">
<div class="modal-content"> <li class="<?php if ($active == "wallet_wallet") {
<form action="<?php echo base_url('index.php/Admin/filtreData')?>" method="post"> echo "active";
<div class="modal-header"> } ?>">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <a href="<?php echo base_url('index.php/Admin_dash/wallet') ?>">
<span aria-hidden="true">&times;</span> <i class="glyphicon glyphicon-credit-card"></i>
</button> <span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
<h4 class="modal-title"><?php echo $this->lang->line('Appliquer un filtre'); ?></h4> </a>
</div> </li>
<div class="modal-body"> <li class="<?php if ($active == "wallet_password") {
<div class="form-group"> echo "active";
<?php } ?>">
$result=$pays; <a href="<?php echo base_url('index.php/Admin_dash/walletPassword') ?>">
$numrows=$result->num_rows(); <i class="glyphicon glyphicon-lock"></i>
if ($numrows > 0) { ?> <span><?php echo $this->lang->line('menu_wallet_password'); ?></span>
<select class="form-control input-lg" name="pays" required id="pays"> </a>
<?php foreach($result->result() as $row) { </li>
echo "<option value='".$row->id."'>".$row->name."</option>"; </ul>
} ?> </li>
</select>
<?php }else{
echo $this->lang->line('Aucun pays'); <?php if (($hasWallet->first_row()->type == 'ilink') && ($hasWallet->first_row()->has_nano_credit)) { ?>
} <li class="<?php if ($active == "nano_credit") {
?> echo "active";
</div> } ?>">
<div class="form-group"> <a href="<?php echo base_url('index.php/Admin_dash/nano_credit') ?>">
<?php <i class="fa fa-money"></i> <span>Nano credit</span>
$result=$hyper; </a>
$numrows=$result->num_rows(); </li>
if ($numrows > 0) { ?>
<select class="form-control input-lg" name="hyper" required id="hyper"> <li class="<?php if($active=="operators"){echo "active";} ?>">
<?php foreach($result->result() as $row) { <a href="<?php echo base_url('index.php/Admin_dash/operators') ?>">
echo "<option value='".$row->code_membre."'>".$row->lastname."-".$row->network." (".$row->code_membre.")</option>"; <i class="fa fa-building"></i> <span><?php echo $this->lang->line('operators'); ?></span>
} ?> </a>
</select> </li>
<?php }else{ <?php }?>
echo $this->lang->line('Aucun hyperviseur'); <?php } ?>
} <li class="<?php if($active=="deconnexion"){echo "active";} ?>">
?> <a href="#" data-toggle="modal" data-target="#modal-disconnect">
</div> <i class="glyphicon glyphicon-off"></i> <span><?php echo $this->lang->line('Déconnexion'); ?></span>
<div class="form-group"> </a>
<?php </li>
$result=$ville; </ul>
$numrows=$result->num_rows(); </section>
if ($numrows > 0) { ?> <!-- /.sidebar -->
<select class="form-control input-lg" name="ville" required id="ville"> </aside>
<?php foreach($result->result() as $row) {
echo "<option value='".$row->town_id."'>".$row->town."</option>"; <div class="modal fade" id="modal-defaultSwitch">
} ?> <div class="modal-dialog">
</select> <div class="modal-content">
<?php }else{ <form action="<?php echo base_url('index.php/Admin_dash/firstFilter')?>" method="post">
echo $this->lang->line('Aucune ville'); <div class="modal-header">
} <button type="button" class="close" data-dismiss="modal" aria-label="Close">
?> <span aria-hidden="true">&times;</span>
</div> </button>
<h4 class="modal-title"><?php echo $this->lang->line('Appliquer un filtre'); ?></h4>
</div> </div>
<div class="modal-footer"> <div class="modal-body">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button> <div class="form-group">
<button type="submit" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button> <?php
</div> $result=$pays;
</form> $numrows=$result->num_rows();
</div> if ($numrows > 0) { ?>
</div> <select class="form-control input-lg" name="pays" required id="pays">
</div> <?php foreach($result->result() as $row) {
echo "<option value='".$row->id."'>".$row->name."</option>";
<div class="modal fade" id="modal-disconnect"> } ?>
<div class="modal-dialog"> </select>
<div class="modal-content"> <?php }else{
<form action="<?php echo base_url('index.php/Users/logout') ?>"> echo $this->lang->line('Aucun pays');
<div class="modal-header"> }
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> ?>
<span aria-hidden="true">&times;</span> </div>
</button> <div class="form-group">
<h4 class="modal-title"><?php echo $this->lang->line('Déconnexion'); ?></h4> <?php
</div> $result=$hyper;
<div class="modal-body"> $numrows=$result->num_rows();
<?php echo $this->lang->line('Vous allez être déconnecté'); ?> if ($numrows > 0) { ?>
</div> <select class="form-control input-lg" name="hyper" required id="hyper">
<div class="modal-footer"> <?php foreach($result->result() as $row) {
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button> echo "<option value='".$row->code_membre."'>".$row->lastname."-".$row->network." (".$row->code_membre.")</option>";
<button type="submit" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button> } ?>
</div> </select>
</form> <?php }else{
</div> echo $this->lang->line('Aucun Admin');
</div> }
</div> ?>
</div>
<div class="form-group">
<?php
$result=$ville;
$numrows=$result->num_rows();
if ($numrows > 0) { ?>
<select class="form-control input-lg" name="ville" required id="ville">
<?php foreach($result->result() as $row) {
echo "<option value='".$row->town_id."'>".$row->town."</option>";
} ?>
</select>
<?php }else{
echo $this->lang->line('Aucune ville');
}
?>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
<button type="submit" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="modal-disconnect">
<div class="modal-dialog">
<div class="modal-content">
<form action="<?php echo base_url('index.php/Users/logout') ?>">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title"><?php echo $this->lang->line('Déconnexion'); ?></h4>
</div>
<div class="modal-body">
<?php echo $this->lang->line('Vous allez être déconnecté'); ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
<button type="submit" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
</div>
</form>
</div>
</div>
</div>

View File

@ -338,9 +338,9 @@
<script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script> <script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
<script type="text/javascript"> <script type="text/javascript">
$(window).load(function() { $(window).on('load', function(){
$(".loader").fadeOut("1000"); $(".loader").fadeOut("1000");
}) });
</script> </script>
<script> <script>