+ Add wallet module
This commit is contained in:
parent
c1c1940258
commit
89ff6e9025
|
@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||||
| a PHP script and you can easily do that on your own.
|
| a PHP script and you can easily do that on your own.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
$config['base_url'] = 'https://'.$_SERVER['SERVER_NAME'].'/backofficeiLinkTest';
|
$config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/backofficeiLinkTest';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
@ -77,7 +77,7 @@ $db['default'] = array(
|
||||||
'dsn' => '',
|
'dsn' => '',
|
||||||
'hostname' => 'localhost',
|
'hostname' => 'localhost',
|
||||||
'username' => 'root',
|
'username' => 'root',
|
||||||
'password' => 'vps@2017GA',
|
'password' => '',
|
||||||
'database' => 'iLink_test2',
|
'database' => 'iLink_test2',
|
||||||
'dbdriver' => 'mysqli',
|
'dbdriver' => 'mysqli',
|
||||||
'dbprefix' => '',
|
'dbprefix' => '',
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -13,7 +13,6 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
{
|
{
|
||||||
parent::_contruct();
|
parent::_contruct();
|
||||||
$this->load->model('user_model');
|
$this->load->model('user_model');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
|
@ -27,7 +26,6 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
|
|
||||||
redirect('index.php', $data);
|
redirect('index.php', $data);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$count_d_traite = $this->user_model->getCountDemandeByStatut($this->session->userdata('member_code'),1);
|
$count_d_traite = $this->user_model->getCountDemandeByStatut($this->session->userdata('member_code'),1);
|
||||||
$count_d_no_traite = $this->user_model->getCountDemandeByStatut($this->session->userdata('member_code'),0);
|
$count_d_no_traite = $this->user_model->getCountDemandeByStatut($this->session->userdata('member_code'),0);
|
||||||
$count_d = $this->user_model->getCountDemande($this->session->userdata('member_code'));
|
$count_d = $this->user_model->getCountDemande($this->session->userdata('member_code'));
|
||||||
|
@ -54,6 +52,7 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
$data['count_d_no_traite'] = $count_d_no_traite;
|
$data['count_d_no_traite'] = $count_d_no_traite;
|
||||||
$data['count_d_users'] = $count_d;
|
$data['count_d_users'] = $count_d;
|
||||||
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
|
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
|
||||||
|
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
$this->load->view('header_hyp', $data);
|
$this->load->view('header_hyp', $data);
|
||||||
$this->load->view('hyperviseur_dash');
|
$this->load->view('hyperviseur_dash');
|
||||||
$this->load->view('footer');
|
$this->load->view('footer');
|
||||||
|
@ -97,6 +96,7 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
$data['villes'] = $this->user_model->getVilleByUserGeo($data['network'],$this->session->userdata('current_pays'));
|
$data['villes'] = $this->user_model->getVilleByUserGeo($data['network'],$this->session->userdata('current_pays'));
|
||||||
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
|
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
|
||||||
$data['alert'] = "";
|
$data['alert'] = "";
|
||||||
|
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
$this->load->view('header_hyp', $data);
|
$this->load->view('header_hyp', $data);
|
||||||
$this->load->view('listeadmin');
|
$this->load->view('listeadmin');
|
||||||
$this->load->view('footer');
|
$this->load->view('footer');
|
||||||
|
@ -151,6 +151,7 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code'));
|
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code'));
|
||||||
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
|
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
|
||||||
$data['alert'] = "";
|
$data['alert'] = "";
|
||||||
|
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
$this->load->view('header_hyp', $data);
|
$this->load->view('header_hyp', $data);
|
||||||
$this->load->view('listeadmin');
|
$this->load->view('listeadmin');
|
||||||
$this->load->view('footer');
|
$this->load->view('footer');
|
||||||
|
@ -210,6 +211,7 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
$data['list'] = $this->user_model->getDemandesBySuper($this->session->userdata('member_code'),$this->input->post('super'));
|
$data['list'] = $this->user_model->getDemandesBySuper($this->session->userdata('member_code'),$this->input->post('super'));
|
||||||
$data['temp_moyen'] = $this->user_model->getTempsMoyenByVille($this->session->userdata('member_code'),$this->input->post('super'));
|
$data['temp_moyen'] = $this->user_model->getTempsMoyenByVille($this->session->userdata('member_code'),$this->input->post('super'));
|
||||||
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
|
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
|
||||||
|
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
$this->load->view('header_hyp', $data);
|
$this->load->view('header_hyp', $data);
|
||||||
$this->load->view('demande');
|
$this->load->view('demande');
|
||||||
$this->load->view('footer');
|
$this->load->view('footer');
|
||||||
|
@ -264,12 +266,14 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code'));
|
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code'));
|
||||||
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
|
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
|
||||||
$data['type'] = $this->lang->line('Adhésion');
|
$data['type'] = $this->lang->line('Adhésion');
|
||||||
|
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
$this->load->view('header_hyp', $data);
|
$this->load->view('header_hyp', $data);
|
||||||
$this->load->view('demande');
|
$this->load->view('demande');
|
||||||
$this->load->view('footer');
|
$this->load->view('footer');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wallet
|
||||||
public function wallet(){
|
public function wallet(){
|
||||||
if (!$this->session->userdata('email')) {
|
if (!$this->session->userdata('email')) {
|
||||||
$this->session->set_flashdata('error', 'log in first');
|
$this->session->set_flashdata('error', 'log in first');
|
||||||
|
@ -278,31 +282,44 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
$data['message'] = "Login first!";
|
$data['message'] = "Login first!";
|
||||||
$this->load->view('login', $data);
|
$this->load->view('login', $data);
|
||||||
} else {
|
} else {
|
||||||
if(!empty($_GET))
|
$id_network = $this->session->userdata('network_id');
|
||||||
{ //
|
$data["commission"] = "";
|
||||||
$id_network = $this->input->get('r');
|
$data["principal"] = "";
|
||||||
$data["taux_com_retrait"] = "";
|
|
||||||
$data["taux_com_ag_retrait"] = "";
|
|
||||||
$data["taux_com_ag_depot"] = "";
|
|
||||||
$data["com_depot"] = "";
|
|
||||||
$data["transactions"] = "";
|
$data["transactions"] = "";
|
||||||
$res = $this->user_model->getTaux($id_network);
|
$agent_id = $this->session->userdata('agent_id');
|
||||||
|
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
|
|
||||||
|
$res = $this->user_model->getWallet($agent_id);
|
||||||
if ($res!=null){
|
if ($res!=null){
|
||||||
foreach ($res->result() AS $row){
|
$row = $res->first_row();
|
||||||
$data["taux_com_retrait"] = $row->taux_r;
|
$data["commission"] = $row->balance_com;
|
||||||
$data["taux_com_ag_depot"] = $row->taux_ag_d;
|
$data["principal"] = $row->balance_princ;
|
||||||
$data["taux_com_ag_retrait"] = $row->taux_ag_r;
|
$agents_g = $this->user_model->getAllGeolocatedUsersForHyp($this->session->userdata('member_code'));
|
||||||
$data["com_depot"] = $row->taux_d;
|
|
||||||
|
//Fetch all transactions of any geolocated agent of the network
|
||||||
|
$data["transactions"] = array();
|
||||||
|
if($agents_g){
|
||||||
|
foreach($agents_g->result() AS $row){
|
||||||
|
$wallet = $this->user_model->getWallet($row->agent_id);
|
||||||
|
if($wallet){
|
||||||
|
$transactions = $this->user_model->getAgentTransactions($wallet->first_row()->wallet_id);
|
||||||
|
if($transactions){
|
||||||
|
foreach($transactions->result() AS $trans){
|
||||||
|
$trans->code_parrain = $row->code_parrain ; // Add code parrain to transaction
|
||||||
|
array_push( $data['transactions'], $trans);
|
||||||
}
|
}
|
||||||
$data["transactions"] = $this->user_model->getTransactions($id_network);
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$data["taux_com_retrait"] = "N/A";
|
$data["commission"] = "N/A";
|
||||||
$data["taux_com_ag_retrait"] = "N/A";
|
$data["principal"] = "N/A";
|
||||||
$data["taux_com_ag_depot"] = "N/A";
|
|
||||||
$data["com_depot"] = "N/A";
|
|
||||||
$data["transactions"] = false;
|
$data["transactions"] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$data['alert'] = "";
|
$data['alert'] = "";
|
||||||
$data['active'] = "wallet";
|
$data['active'] = "wallet";
|
||||||
$data['token'] = $this->session->userdata('token');
|
$data['token'] = $this->session->userdata('token');
|
||||||
|
@ -321,9 +338,9 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
$data['networks'] = $this->user_model->getActiveNetwork();
|
$data['networks'] = $this->user_model->getActiveNetwork();
|
||||||
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
|
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
|
||||||
$this->load->view('header_hyp',$data);
|
$this->load->view('header_hyp',$data);
|
||||||
$this->load->view('gestion_wallet');
|
$this->load->view('gestion_wallet_hyp');
|
||||||
$this->load->view('footer');
|
$this->load->view('footer');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ class Superviseur_dash extends CI_Controller
|
||||||
$data['count_d_users'] = $count_d;
|
$data['count_d_users'] = $count_d;
|
||||||
$data['count_d_traite'] = $count_d_traite;
|
$data['count_d_traite'] = $count_d_traite;
|
||||||
$data['count_d_no_traite'] = $count_d_no_traite;
|
$data['count_d_no_traite'] = $count_d_no_traite;
|
||||||
|
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
$this->load->view('header_sup', $data);
|
$this->load->view('header_sup', $data);
|
||||||
$this->load->view('superviseur_dash');
|
$this->load->view('superviseur_dash');
|
||||||
$this->load->view('footer');
|
$this->load->view('footer');
|
||||||
|
@ -88,6 +89,7 @@ class Superviseur_dash extends CI_Controller
|
||||||
$data['category'] = $this->session->userdata('category');
|
$data['category'] = $this->session->userdata('category');
|
||||||
$data['network'] = $this->session->userdata('network');
|
$data['network'] = $this->session->userdata('network');
|
||||||
$data['alert'] = "";
|
$data['alert'] = "";
|
||||||
|
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
$this->load->view('header_sup', $data);
|
$this->load->view('header_sup', $data);
|
||||||
$this->load->view('listeadmin');
|
$this->load->view('listeadmin');
|
||||||
$this->load->view('footer');
|
$this->load->view('footer');
|
||||||
|
@ -124,6 +126,7 @@ class Superviseur_dash extends CI_Controller
|
||||||
$data['temp_moyen'] = $this->user_model->getTempsMoyen($this->session->userdata('member_code'));
|
$data['temp_moyen'] = $this->user_model->getTempsMoyen($this->session->userdata('member_code'));
|
||||||
$data['temp_moyen_mine'] = $this->user_model->getTempsMoyenDemandeSup($this->session->userdata('member_code'));
|
$data['temp_moyen_mine'] = $this->user_model->getTempsMoyenDemandeSup($this->session->userdata('member_code'));
|
||||||
$data['list'] = $this->user_model->getDemandesForSuper($this->session->userdata('member_code'));
|
$data['list'] = $this->user_model->getDemandesForSuper($this->session->userdata('member_code'));
|
||||||
|
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
$this->load->view('header_sup', $data);
|
$this->load->view('header_sup', $data);
|
||||||
$this->load->view('demande');
|
$this->load->view('demande');
|
||||||
$this->load->view('footer');
|
$this->load->view('footer');
|
||||||
|
@ -157,9 +160,81 @@ class Superviseur_dash extends CI_Controller
|
||||||
$data['temp_moyen'] = $this->user_model->getTempsMoyenAd($this->session->userdata('member_code'));
|
$data['temp_moyen'] = $this->user_model->getTempsMoyenAd($this->session->userdata('member_code'));
|
||||||
$data['list'] = $this->user_model->getDemandesAdForSuper($this->session->userdata('member_code'));
|
$data['list'] = $this->user_model->getDemandesAdForSuper($this->session->userdata('member_code'));
|
||||||
$data['type'] = 'adhésions';
|
$data['type'] = 'adhésions';
|
||||||
|
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
$this->load->view('header_sup', $data);
|
$this->load->view('header_sup', $data);
|
||||||
$this->load->view('demande');
|
$this->load->view('demande');
|
||||||
$this->load->view('footer');
|
$this->load->view('footer');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wallet
|
||||||
|
public function wallet(){
|
||||||
|
if (!$this->session->userdata('email')) {
|
||||||
|
$this->session->set_flashdata('error', 'log in first');
|
||||||
|
|
||||||
|
$data['alert'] = "ok";
|
||||||
|
$data['message'] = "Login first!";
|
||||||
|
$this->load->view('login', $data);
|
||||||
|
} else {
|
||||||
|
$id_network = $this->session->userdata('network_id');
|
||||||
|
$data["commission"] = "";
|
||||||
|
$data["principal"] = "";
|
||||||
|
$data["transactions"] = "";
|
||||||
|
$agent_id = $this->session->userdata('agent_id');
|
||||||
|
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
|
|
||||||
|
$res = $this->user_model->getWallet($agent_id);
|
||||||
|
if ($res!=null){
|
||||||
|
$row = $res->first_row();
|
||||||
|
$data["commission"] = $row->balance_com;
|
||||||
|
$data["principal"] = $row->balance_princ;
|
||||||
|
$agents_g = $this->user_model->getUsersGeolocatedForSup($this->session->userdata('member_code'));
|
||||||
|
$data['agents_g'] = $agents_g;
|
||||||
|
|
||||||
|
//Fetch all transactions of any geolocated agent of the network
|
||||||
|
$data["transactions"] = array();
|
||||||
|
if($agents_g){
|
||||||
|
foreach($agents_g->result() AS $row){
|
||||||
|
$wallet = $this->user_model->getWallet($row->agent_id);
|
||||||
|
if($wallet){
|
||||||
|
$transactions = $this->user_model->getAgentTransactions($wallet->first_row()->wallet_id);
|
||||||
|
if($transactions){
|
||||||
|
foreach($transactions->result() AS $trans){
|
||||||
|
$trans->agent_id = $row->agent_id ; // Add agent id to transaction
|
||||||
|
array_push( $data['transactions'], $trans);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$data["commission"] = "N/A";
|
||||||
|
$data["principal"] = "N/A";
|
||||||
|
$data["transactions"] = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$data['alert'] = "";
|
||||||
|
$data['active'] = "wallet";
|
||||||
|
$data['token'] = $this->session->userdata('token');
|
||||||
|
$data['email'] = $this->session->userdata('email');
|
||||||
|
$data['firstname'] = $this->session->userdata('firstname');
|
||||||
|
$data['lastname'] = $this->session->userdata('lastname');
|
||||||
|
$data['code_parrain'] = $this->session->userdata('code_parrain');
|
||||||
|
$data['phone'] = $this->session->userdata('phone');
|
||||||
|
$data['adresse'] = $this->session->userdata('adresse');
|
||||||
|
$data['category'] = $this->session->userdata('category');
|
||||||
|
$data['network'] = $this->session->userdata('network');
|
||||||
|
$data['network_id'] = $id_network;
|
||||||
|
$data['villes'] = $this->user_model->getVilleByUserGeo($data['network'],$this->session->userdata('current_pays'));
|
||||||
|
$data['pays'] = $this->user_model->getAllGameCountries();
|
||||||
|
$data['networks'] = $this->user_model->getActiveNetwork();
|
||||||
|
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
|
||||||
|
$this->load->view('header_sup',$data);
|
||||||
|
$this->load->view('gestion_wallet_sup');
|
||||||
|
$this->load->view('footer');
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,6 +86,7 @@
|
||||||
$this->session->set_userdata('firstname', $data->firstname);
|
$this->session->set_userdata('firstname', $data->firstname);
|
||||||
$this->session->set_userdata('lastname', $data->lastname);
|
$this->session->set_userdata('lastname', $data->lastname);
|
||||||
$this->session->set_userdata('adresse', $data->adresse);
|
$this->session->set_userdata('adresse', $data->adresse);
|
||||||
|
$this->session->set_userdata('agent_id', $data->agent_id);
|
||||||
|
|
||||||
if($user_login['user_role']==1){
|
if($user_login['user_role']==1){
|
||||||
$this->session->set_userdata('country', $data->country);
|
$this->session->set_userdata('country', $data->country);
|
||||||
|
|
|
@ -219,4 +219,16 @@ $lang['Utilisateur simple'] = 'Simple user';
|
||||||
$lang['Statut du compte'] = 'Account status';
|
$lang['Statut du compte'] = 'Account status';
|
||||||
$lang['Publicité'] = 'Publicity';
|
$lang['Publicité'] = 'Publicity';
|
||||||
$lang['Gestion de la publicité'] = 'Advertising Management';
|
$lang['Gestion de la publicité'] = 'Advertising Management';
|
||||||
|
|
||||||
|
//Wallet
|
||||||
|
$lang['Gestion des wallets'] = 'Wallet Management';
|
||||||
|
$lang['Réseaux activés'] = 'Activated networks';
|
||||||
|
$lang['Configuration du wallet'] = 'Wallet configuration';
|
||||||
|
$lang['Taux de commission client sur retrait'] = 'Customer commission rate on withdrawal';
|
||||||
|
$lang['Taux de commission client sur dépot'] = 'Client commission rate on deposit';
|
||||||
|
$lang['Taux de commission agent géolocalisé sur retrait'] = 'Geolocated agent commission rate on withdrawal';
|
||||||
|
$lang['Taux de commission agent géolocalisé sur dépot'] = 'Geolocated agent commission rate on deposit';
|
||||||
|
$lang['Taux de commission superviseur sur retrait'] = 'Supervisor commission rate on withdrawal';
|
||||||
|
$lang['Taux de commission superviseur sur dépot'] = 'Supervisor commission rate on deposit';
|
||||||
|
$lang['Suppression du wallet'] = 'Removal of the wallet';
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -235,4 +235,23 @@
|
||||||
$lang[''] = '';
|
$lang[''] = '';
|
||||||
$lang[''] = '';
|
$lang[''] = '';
|
||||||
$lang[''] = '';
|
$lang[''] = '';
|
||||||
|
|
||||||
|
//Wallet
|
||||||
|
$lang['Gestion des wallets'] = 'Gestion des wallets';
|
||||||
|
$lang['Réseaux activés'] = 'Réseaux activés';
|
||||||
|
$lang['Configuration du wallet'] = 'Configuration du wallet';
|
||||||
|
$lang['Taux de commission client sur retrait'] = 'Taux de commission client sur retrait';
|
||||||
|
$lang['Taux de commission client sur dépot'] = 'Taux de commission client sur dépot';
|
||||||
|
$lang['Taux de commission agent géolocalisé sur retrait'] = 'Taux de commission agent géolocalisé sur retrait';
|
||||||
|
$lang['Taux de commission agent géolocalisé sur dépot'] = 'Taux de commission agent géolocalisé sur dépot';
|
||||||
|
$lang['Taux de commission superviseur sur retrait'] = 'Taux de commission superviseur sur retrait';
|
||||||
|
$lang['Taux de commission superviseur sur dépot'] = 'Taux de commission superviseur sur dépot';
|
||||||
|
$lang['Part de la banque sur le retrait'] = 'Part de la banque partenaire sur le retrait';
|
||||||
|
$lang['Part de la banque sur le dépot'] = 'Part de la banque partenaire sur le dépot';
|
||||||
|
$lang['Frais minimun de la banque sur le dépot'] = 'Frais minimun de la banque sur le dépot du client';
|
||||||
|
$lang['Suppression du wallet'] = 'Suppression du wallet';
|
||||||
|
$lang['Modifier la configuration'] = 'Modifier la configuration';
|
||||||
|
$lang['Commissions Hyperviseur'] = 'Commissions Hyperviseur';
|
||||||
|
$lang['Commissions Superviseurs'] = 'Commissions Superviseurs';
|
||||||
|
$lang['Commissions Agents']= 'Commissions Agents';
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -198,7 +198,7 @@ class User_model extends CI_Model
|
||||||
|
|
||||||
public function getUsersGeolocatedByVilleForHyp($ville,$codeHyp){
|
public function getUsersGeolocatedByVilleForHyp($ville,$codeHyp){
|
||||||
|
|
||||||
$query = $this->db->query("SELECT child.adresse AS adresse,child.category AS childcat,child.lastname AS lastname,child.solde AS solde,
|
$query = $this->db->query("SELECT child.adresse AS adresse,child.category AS childcat,child.lastname AS lastname,
|
||||||
child.latitude AS latitude, child.longitude AS longitude,
|
child.latitude AS latitude, child.longitude AS longitude,
|
||||||
child.etat AS active, child.code_parrain AS code_parrain,child.code_membre AS member_code,
|
child.etat AS active, child.code_parrain AS code_parrain,child.code_membre AS member_code,
|
||||||
child.network AS network, child.phone AS phone, child.email AS email,dad.adresse AS supadresse,
|
child.network AS network, child.phone AS phone, child.email AS email,dad.adresse AS supadresse,
|
||||||
|
@ -332,7 +332,7 @@ class User_model extends CI_Model
|
||||||
|
|
||||||
public function getSupervisorsForHyp($codeHyp){
|
public function getSupervisorsForHyp($codeHyp){
|
||||||
|
|
||||||
$query = $this->db->query("SELECT child.adresse AS adresse,child.category AS childcat,child.lastname AS lastname,child.solde AS solde,
|
$query = $this->db->query("SELECT child.adresse AS adresse,child.category AS childcat,child.lastname AS lastname,
|
||||||
child.etat AS active, child.code_parrain AS code_parrain,child.code_membre AS member_code,
|
child.etat AS active, child.code_parrain AS code_parrain,child.code_membre AS member_code,
|
||||||
child.network AS network, child.phone AS phone, child.email AS email,dad.adresse AS supadresse,
|
child.network AS network, child.phone AS phone, child.email AS email,dad.adresse AS supadresse,
|
||||||
dad.lastname AS suplastname, dad.code_membre AS sup_code_membre,dad.code_membre AS sup_code_parrain,
|
dad.lastname AS suplastname, dad.code_membre AS sup_code_membre,dad.code_membre AS sup_code_parrain,
|
||||||
|
@ -352,7 +352,7 @@ class User_model extends CI_Model
|
||||||
|
|
||||||
public function getUsersGeolocatedForSup($codeSup){
|
public function getUsersGeolocatedForSup($codeSup){
|
||||||
|
|
||||||
$query = $this->db->query("SELECT child.adresse AS adresse,child.category AS childcat,child.lastname AS lastname,child.solde AS solde,
|
$query = $this->db->query("SELECT child.adresse AS adresse,child.category AS childcat,child.lastname AS lastname,child.agent_id,
|
||||||
child.etat AS active, child.code_parrain AS code_parrain,child.code_membre AS member_code,
|
child.etat AS active, child.code_parrain AS code_parrain,child.code_membre AS member_code,
|
||||||
child.network AS network, child.phone AS phone, child.email AS email,dad.adresse AS supadresse,
|
child.network AS network, child.phone AS phone, child.email AS email,dad.adresse AS supadresse,
|
||||||
dad.lastname AS suplastname, dad.code_membre AS sup_code_membre,dad.code_parrain AS sup_code_parrain,
|
dad.lastname AS suplastname, dad.code_membre AS sup_code_membre,dad.code_parrain AS sup_code_parrain,
|
||||||
|
@ -1652,7 +1652,7 @@ class User_model extends CI_Model
|
||||||
|
|
||||||
public function getSuperNameAndCodeForHyp($codeHyp){
|
public function getSuperNameAndCodeForHyp($codeHyp){
|
||||||
|
|
||||||
$query = $this->db->query("SELECT child.lastname AS lastname, child.code_membre AS member_code
|
$query = $this->db->query("SELECT child.lastname AS lastname, child.code_membre AS member_code, child.agent_id
|
||||||
FROM super_infos AS child
|
FROM super_infos AS child
|
||||||
INNER JOIN hyper_infos AS dad
|
INNER JOIN hyper_infos AS dad
|
||||||
ON child.code_parrain='".$codeHyp."'
|
ON child.code_parrain='".$codeHyp."'
|
||||||
|
@ -1827,11 +1827,7 @@ class User_model extends CI_Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function getTaux($id_network){
|
public function getTaux($id_network){
|
||||||
$query = $this->db->query("SELECT configWallet.id,
|
$query = $this->db->query("SELECT *
|
||||||
taux_com_retrait AS taux_r,
|
|
||||||
taux_com_ag_retrait AS taux_ag_r,
|
|
||||||
com_depot AS taux_d,
|
|
||||||
taux_com_ag_depot AS taux_ag_d
|
|
||||||
FROM configWallet
|
FROM configWallet
|
||||||
WHERE `id_network`=".$id_network);
|
WHERE `id_network`=".$id_network);
|
||||||
if($query->num_rows()>0){
|
if($query->num_rows()>0){
|
||||||
|
@ -2010,4 +2006,106 @@ class User_model extends CI_Model
|
||||||
$query = $this->db->query("INSERT INTO publiciteConfig(id_config,id_country, valeur_bool) VALUE (2,".$id_country.",1)");
|
$query = $this->db->query("INSERT INTO publiciteConfig(id_config,id_country, valeur_bool) VALUE (2,".$id_country.",1)");
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wallet
|
||||||
|
|
||||||
|
public function getAllActivatedNetworks(){
|
||||||
|
$query = $this->db->query("SELECT networks.name AS network,networks.status AS status,networks.id,countries.name AS country,networks.country_id , configWallet.id_network FROM `networks`
|
||||||
|
INNER JOIN countries ON networks.country_id=countries.id LEFT JOIN configWallet ON configWallet.id_network = networks.id WHERE status = 1");
|
||||||
|
if($query->num_rows()>0){
|
||||||
|
return $query;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getConfigWallet($id_network){
|
||||||
|
$sql = "SELECT * FROM `configWallet` WHERE id_network = ?";
|
||||||
|
$query = $this->db->query($sql , array($id_network));
|
||||||
|
if($query->num_rows()>0){
|
||||||
|
return $query;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addConfigWallet($network_id , $taux_client_r , $taux_client_d, $taux_ag_r , $taux_ag_d , $taux_sup_r , $taux_sup_d , $taux_bq_r , $taux_bq_d , $frais_d ){
|
||||||
|
$sql='INSERT INTO `configWallet` (`taux_com_client_retrait`, `taux_com_client_depot`, `taux_com_ag_retrait`, `taux_com_ag_depot`, `taux_com_sup_depot`, `taux_com_sup_retrait`, `part_banque_retrait`, `part_banque_depot`, `frais_min_banque_depot`, `id_network`) VALUES ( ?, ?, ?, ?, ?, ?, ? , ? , ? ,?);' ;
|
||||||
|
$query = $this->db->query($sql , array($taux_client_r,$taux_client_d,$taux_ag_r,$taux_ag_d,$taux_sup_r,$taux_sup_d, $taux_bq_r , $taux_bq_d , $frais_d , $network_id));
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function updateConfigWallet($network_id , $taux_client_r , $taux_client_d, $taux_ag_r , $taux_ag_d , $taux_sup_r , $taux_sup_d , $taux_bq_r , $taux_bq_d , $frais_d ){
|
||||||
|
$sql= 'UPDATE `configWallet` SET `taux_com_client_retrait` = ?, `taux_com_client_depot` = ?, `taux_com_ag_retrait` = ?, `taux_com_ag_depot` = ?, `taux_com_sup_retrait` = ? , `taux_com_sup_depot` = ?, `part_banque_retrait` = ?, `part_banque_depot` = ?, `frais_min_banque_depot` = ? WHERE (`id_network` = ?);';
|
||||||
|
$query = $this->db->query($sql , array($taux_client_r,$taux_client_d,$taux_ag_r,$taux_ag_d,$taux_sup_r,$taux_sup_d, $taux_bq_r , $taux_bq_d , $frais_d , $network_id));
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deleteConfigWallet($network_id){
|
||||||
|
$query = $this->db->query("DELETE FROM `configWallet` WHERE `configWallet`.`id_network` = '".$network_id."'");
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getWallet($id_agent){
|
||||||
|
$sql = "SELECT * FROM `wallet_agent` WHERE agent_id = ?";
|
||||||
|
$query = $this->db->query($sql , array($id_agent));
|
||||||
|
if($query->num_rows()>0){
|
||||||
|
return $query;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addWallet($id_agent){
|
||||||
|
|
||||||
|
$sql = "SELECT * FROM `networks_agents` WHERE agent_id = ?";
|
||||||
|
$query = $this->db->query($sql , array($id_agent));
|
||||||
|
if($query->num_rows()>0){
|
||||||
|
$id_networkAgent = $query->first_row()->id;
|
||||||
|
$sql = "INSERT INTO `wallets` (`id_networkAgent`) VALUES (?);";
|
||||||
|
$query = $this->db->query($sql , array($id_networkAgent));
|
||||||
|
return $query;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAgentTransactions($id_wallet){
|
||||||
|
$query = $this->db->query("SELECT *
|
||||||
|
FROM wallet_transaction
|
||||||
|
WHERE `id_wallet`= '".$id_wallet."'");
|
||||||
|
if($query->num_rows()>0){
|
||||||
|
return $query;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getNetworkHyper($id_network){
|
||||||
|
$sql = "SELECT * FROM `hyper_infos` WHERE network_id = ?";
|
||||||
|
$query = $this->db->query($sql , array($id_network));
|
||||||
|
if($query->num_rows()>0){
|
||||||
|
return $query;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAllAgentsForNetwork($id_network){
|
||||||
|
$sql = "SELECT * FROM super_infos WHERE network_id = ?";
|
||||||
|
$query = $this->db->query($sql , array($id_network));
|
||||||
|
if($query->num_rows()>0){
|
||||||
|
return $query;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reinitializeWallet($id_wallet){
|
||||||
|
$sql = "UPDATE `wallets` SET `balance_princ` = '0', `balance_com` = '0', `created_date` = ? WHERE (`id` = ?)";
|
||||||
|
$query = $this->db->query($sql , array(new DateTime(),$id_wallet));
|
||||||
|
return $query;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>">
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>">
|
||||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
|
<link rel="stylesheet"
|
||||||
|
href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
|
||||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
|
||||||
<link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>">
|
<link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>">
|
||||||
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
<link rel="stylesheet"
|
||||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
function convertDate($date){
|
function convertDate($date)
|
||||||
|
{
|
||||||
$month = null;
|
$month = null;
|
||||||
switch ($date) {
|
switch ($date) {
|
||||||
case "Jan":
|
case "Jan":
|
||||||
|
@ -47,74 +50,87 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $month;
|
return $month;
|
||||||
}
|
}
|
||||||
|
|
||||||
$month = time();
|
$month = time();
|
||||||
$months[]=convertDate(date("M"));
|
$months[] = convertDate(date("M"));
|
||||||
$label_months [] = date("M")." ".date("Y");
|
$label_months [] = date("M") . " " . date("Y");
|
||||||
$years[]= date("Y");
|
$years[] = date("Y");
|
||||||
for ($i = 1; $i <= 11; $i++) {
|
for ($i = 1; $i <= 11; $i++) {
|
||||||
$month = strtotime('last month', $month);
|
$month = strtotime('last month', $month);
|
||||||
$months [] = convertDate(date("M", $month));
|
$months [] = convertDate(date("M", $month));
|
||||||
$years[] = date("Y", $month);
|
$years[] = date("Y", $month);
|
||||||
$label_months [] = date("M", $month)." ".date("Y", $month);
|
$label_months [] = date("M", $month) . " " . date("Y", $month);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
** Retraits
|
** Retraits
|
||||||
**/
|
**/
|
||||||
$date = date("Y");
|
$date = date("Y");
|
||||||
|
|
||||||
$retraits_data[] = '';
|
$retraits_data[] = '';
|
||||||
$retraits_data =array();
|
$retraits_data = array();
|
||||||
for ($i = 1; $i <= 12; $i++) {
|
for ($i = 1; $i <= 12; $i++) {
|
||||||
$retraits_query_mounth = $this->db->query("SELECT id FROM infos_transaction
|
$retraits_query_mounth = $this->db->query("SELECT id FROM infos_transaction
|
||||||
WHERE network_id='".$network_id."'
|
WHERE network_id='" . $network_id . "'
|
||||||
AND MONTH(date_created) = '".$months[$i-1]."'
|
AND MONTH(date_created) = '" . $months[$i - 1] . "'
|
||||||
AND YEAR(date_created) = '".$years[$i-1]."'
|
AND YEAR(date_created) = '" . $years[$i - 1] . "'
|
||||||
AND type_transac='debit'");
|
AND type_transac='debit'");
|
||||||
$retraits_data[] = $retraits_query_mounth->num_rows();
|
$retraits_data[] = $retraits_query_mounth->num_rows();
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
|
$startDate = (new DateTime('01-' . $months[11] . '-' . $years[11]))->format('Y-m-d H:i:s');
|
||||||
|
$endDate = date_create_from_format('m/Y', $months[0] . '/' . $years[0])->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
$retraits = $this->db->query("SELECT * FROM infos_transaction
|
||||||
|
WHERE network_id='" . $network_id . "'
|
||||||
|
AND date_created BETWEEN '" . $startDate . "' AND '" . $endDate . "'
|
||||||
|
AND type_transac='debit'");
|
||||||
|
|
||||||
|
/**
|
||||||
** Dépots
|
** Dépots
|
||||||
**/
|
**/
|
||||||
$date = date("Y");
|
$date = date("Y");
|
||||||
|
|
||||||
$depots_data[] = '';
|
$depots_data[] = '';
|
||||||
$depots_data =array();
|
$depots_data = array();
|
||||||
for ($i = 1; $i <= 12; $i++) {
|
for ($i = 1; $i <= 12; $i++) {
|
||||||
$depots_query_mounth = $this->db->query("SELECT id FROM infos_transaction
|
$depots_query_mounth = $this->db->query("SELECT id FROM infos_transaction
|
||||||
WHERE network_id='".$network_id."'
|
WHERE network_id='" . $network_id . "'
|
||||||
AND MONTH(date_created) = '".$months[$i-1]."'
|
AND MONTH(date_created) = '" . $months[$i - 1] . "'
|
||||||
AND YEAR(date_created) = '".$years[$i-1]."'
|
AND YEAR(date_created) = '" . $years[$i - 1] . "'
|
||||||
AND type_transac='credit'");
|
AND type_transac='credit'");
|
||||||
$depots_data[] = $depots_query_mounth->num_rows();
|
$depots_data[] = $depots_query_mounth->num_rows();
|
||||||
}
|
}
|
||||||
|
$depots = $this->db->query("SELECT * FROM infos_transaction
|
||||||
|
WHERE network_id='" . $network_id . "'
|
||||||
|
AND date_created BETWEEN '" . $startDate . "' AND '" . $endDate . "'
|
||||||
|
AND type_transac='credit'");
|
||||||
|
|
||||||
if($transactions!=false){
|
if ($transactions != false) {
|
||||||
$transac=$transactions->num_rows();
|
$transac = $transactions->num_rows();
|
||||||
$array_transac = array();
|
$array_transac = array();
|
||||||
$num = 0;
|
$num = 0;
|
||||||
if ($transac > 0) {
|
if ($transac > 0) {
|
||||||
foreach($transactions->result() as $row) {
|
foreach ($transactions->result() as $row) {
|
||||||
$num++;
|
$num++;
|
||||||
$array_transac[] = $row->type_transac;
|
$array_transac[] = $row->type_transac;
|
||||||
}
|
}
|
||||||
$vals_transac = array_count_values($array_transac);
|
$vals_transac = array_count_values($array_transac);
|
||||||
$pieChart = array();
|
$pieChart = array();
|
||||||
foreach(array_keys($vals_transac) as $paramName) {
|
foreach (array_keys($vals_transac) as $paramName) {
|
||||||
$color = dechex(rand(0x000000, 0xFFFFFF));
|
$color = dechex(rand(0x000000, 0xFFFFFF));
|
||||||
$trash = array("value" => $vals_transac[$paramName],
|
$trash = array("value" => $vals_transac[$paramName],
|
||||||
"color" => "#".$color,
|
"color" => "#" . $color,
|
||||||
"highlight" => "#".$color,
|
"highlight" => "#" . $color,
|
||||||
"label" => $paramName);
|
"label" => $paramName);
|
||||||
|
|
||||||
$pieChart[]= $trash;
|
$pieChart[] = $trash;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
$pieChart = array();
|
$pieChart = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -128,9 +144,9 @@
|
||||||
<?php
|
<?php
|
||||||
$site_url = base_url();
|
$site_url = base_url();
|
||||||
|
|
||||||
if($alert=="ok") {
|
if ($alert == "ok") {
|
||||||
|
|
||||||
if(!$success=="ok"){
|
if (!$success == "ok") {
|
||||||
?>
|
?>
|
||||||
<div class='alert alert-danger alert-dismissible col-xs-6'>
|
<div class='alert alert-danger alert-dismissible col-xs-6'>
|
||||||
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
|
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
|
||||||
|
@ -151,66 +167,143 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-3 col-xs-6">
|
<div class="margin">
|
||||||
<div class="small-box bg-aqua">
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-update"
|
||||||
|
style="width: 100%"><?php echo $this->lang->line('Modifier la configuration') ?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row centered">
|
||||||
|
<div class="col-lg-2 col-lg-offset-2 col-xs-6">
|
||||||
|
<div class="small-box bg-red-active">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h3><?php echo $taux_com_retrait; ?><sup style="font-size: 20px">%</sup></h3>
|
<h3><?php echo $taux_client_r; ?><sup style="font-size: 20px">%</sup></h3>
|
||||||
<p>Taux de commission sur retraits</p>
|
<p><?php echo $this->lang->line('Taux de commission client sur retrait') ?></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="ion ion-android-arrow-up"></i>
|
<i class="ion ion-android-arrow-up"></i>
|
||||||
</div>
|
</div>
|
||||||
<a href="#" data-toggle="modal" data-target="#modal-update" data-type="com_ret" class="small-box-footer">Modifier <i class="fa fa-arrow-circle-right"></i></a>
|
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_client_r" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-3 col-xs-6">
|
<div class="col-lg-2 col-xs-6">
|
||||||
<div class="small-box bg-green">
|
<div class="small-box bg-aqua-active">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h3><?php echo $taux_com_ag_retrait; ?><sup style="font-size: 20px">%</sup></h3>
|
<h3><?php echo $taux_ag_r; ?><sup style="font-size: 20px">%</sup></h3>
|
||||||
<p>Comission agent sur retrait</p>
|
<p><?php echo $this->lang->line('Taux de commission agent géolocalisé sur retrait') ?> </p>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="ion ion-android-arrow-up"></i>
|
<i class="ion ion-android-arrow-up"></i>
|
||||||
</div>
|
</div>
|
||||||
<a href="#" data-toggle="modal" data-target="#modal-update" data-type="com_ag_ret" class="small-box-footer">Modifier <i class="fa fa-arrow-circle-right"></i></a>
|
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_ag_r" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-3 col-xs-6">
|
<div class="col-lg-2 col-xs-6">
|
||||||
<div class="small-box bg-yellow">
|
<div class="small-box bg-aqua-active">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h3><?php echo $com_depot; ?> <sup style="font-size: 20px">FCFA</sup></h3>
|
<h3><?php echo $taux_sup_r; ?><sup style="font-size: 20px">%</sup></h3>
|
||||||
<p>Comission sur dépot</p>
|
<p><?php echo $this->lang->line('Taux de commission superviseur sur retrait') ?> </p>
|
||||||
|
</div>
|
||||||
|
<div class="icon">
|
||||||
|
<i class="ion ion-android-arrow-up"></i>
|
||||||
|
</div>
|
||||||
|
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_sup_r" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-2 col-xs-6">
|
||||||
|
<div class="small-box bg-aqua-active">
|
||||||
|
<div class="inner">
|
||||||
|
<h3><?php echo $taux_bq_r; ?><sup style="font-size: 20px">%</sup></h3>
|
||||||
|
<p><?php echo $this->lang->line('Part de la banque sur le retrait') ?> </p>
|
||||||
|
</div>
|
||||||
|
<div class="icon">
|
||||||
|
<i class="ion ion-android-arrow-up"></i>
|
||||||
|
</div>
|
||||||
|
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_bq_r" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-2 col-lg-offset-1 col-xs-6">
|
||||||
|
<div class="small-box bg-green-active">
|
||||||
|
<div class="inner">
|
||||||
|
<h3><?php echo $taux_client_d; ?><sup style="font-size: 20px">%</sup></h3>
|
||||||
|
<p><?php echo $this->lang->line('Taux de commission client sur dépot') ?></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="ion ion-android-arrow-down"></i>
|
<i class="ion ion-android-arrow-down"></i>
|
||||||
</div>
|
</div>
|
||||||
<a href="#" data-toggle="modal" data-target="#modal-update" data-type="com_dep" class="small-box-footer">Modifier <i class="fa fa-arrow-circle-right"></i></a>
|
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_client_d" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-lg-3 col-xs-6">
|
<div class="col-lg-2 col-xs-6">
|
||||||
<div class="small-box bg-red">
|
<div class="small-box bg-green-active">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h3><?php echo $taux_com_ag_depot; ?><sup style="font-size: 20px">%</sup></h3>
|
<h3><?php echo $frais_d; ?><sup style="font-size: 20px">FCFA</sup></h3>
|
||||||
<p>Comission agent sur dépot</p>
|
<p><?php echo $this->lang->line('Frais minimun de la banque sur le dépot') ?> </p>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="ion ion-android-arrow-down"></i>
|
<i class="ion ion-android-arrow-down"></i>
|
||||||
</div>
|
</div>
|
||||||
<a href="#" data-toggle="modal" data-target="#modal-update" data-type="com_ag_dep" class="small-box-footer">Modifier <i class="fa fa-arrow-circle-right"></i></a>
|
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="frais_d" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-2 col-xs-6">
|
||||||
|
<div class="small-box bg-yellow-active">
|
||||||
|
<div class="inner">
|
||||||
|
<h3><?php echo $taux_ag_d; ?><sup style="font-size: 20px">%</sup></h3>
|
||||||
|
<p><?php echo $this->lang->line('Taux de commission agent géolocalisé sur dépot') ?> </p>
|
||||||
|
</div>
|
||||||
|
<div class="icon">
|
||||||
|
<i class="ion ion-android-arrow-down"></i>
|
||||||
|
</div>
|
||||||
|
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_ag_d" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-2 col-xs-6">
|
||||||
|
<div class="small-box bg-yellow-active">
|
||||||
|
<div class="inner">
|
||||||
|
<h3><?php echo $taux_sup_d; ?><sup style="font-size: 20px">%</sup></h3>
|
||||||
|
<p><?php echo $this->lang->line('Taux de commission superviseur sur dépot') ?> </p>
|
||||||
|
</div>
|
||||||
|
<div class="icon">
|
||||||
|
<i class="ion ion-android-arrow-down"></i>
|
||||||
|
</div>
|
||||||
|
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_sup_d" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-lg-2 col-xs-6">
|
||||||
|
<div class="small-box bg-yellow-active">
|
||||||
|
<div class="inner">
|
||||||
|
<h3><?php echo $taux_bq_d; ?><sup style="font-size: 20px">%</sup></h3>
|
||||||
|
<p><?php echo $this->lang->line('Part de la banque sur le dépot') ?> </p>
|
||||||
|
</div>
|
||||||
|
<div class="icon">
|
||||||
|
<i class="ion ion-android-arrow-down"></i>
|
||||||
|
</div>
|
||||||
|
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_bq_d" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="box box-success">
|
<div class="box box-success">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Retraits et dépots des 12 derniers mois<?php //echo $this->lang->line('Souscription des 12 derniers mois'); ?></h3>
|
<h3 class="box-title">Retraits et dépots des 12 derniers
|
||||||
|
mois<?php //echo $this->lang->line('Souscription des 12 derniers mois'); ?></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="chart" id="chart">
|
<div class="chart" id="chart">
|
||||||
|
@ -222,7 +315,8 @@
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<div class="box box-danger">
|
<div class="box box-danger">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">Parts dépots & retraits<?php //echo $this->lang->line("Utilisateurs géolocalisés par ville"); ?></h3>
|
<h3 class="box-title">Parts dépots &
|
||||||
|
retraits<?php //echo $this->lang->line("Utilisateurs géolocalisés par ville"); ?></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body" id="chart2">
|
<div class="box-body" id="chart2">
|
||||||
<canvas id="pieChart" style="height:250px"></canvas>
|
<canvas id="pieChart" style="height:250px"></canvas>
|
||||||
|
@ -233,13 +327,14 @@
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<h3 class="box-title">Commissions Superviseurs</h3>
|
<h3 class="box-title"><?php echo $this->lang->line('Commissions Hyperviseur') ?></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<table id="example1" class="table table-bordered table-hover">
|
<table id="example1" class="table table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Nom</th>
|
<th>Nom</th>
|
||||||
|
<th>Solde Princ.</th>
|
||||||
<th>Solde Com.</th>
|
<th>Solde Com.</th>
|
||||||
<th>Dépots</th>
|
<th>Dépots</th>
|
||||||
<th>Retraits</th>
|
<th>Retraits</th>
|
||||||
|
@ -247,31 +342,18 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
$data = $agentWalletInfos;
|
if ($walletHyper) {
|
||||||
if($data!=false){
|
|
||||||
|
|
||||||
$numrows=$data->num_rows();
|
|
||||||
$num = 0;
|
|
||||||
if ($numrows > 0) {
|
|
||||||
foreach($data->result() as $row) {
|
|
||||||
$num++;
|
|
||||||
echo "<tr>
|
echo "<tr>
|
||||||
<td>".$row->lastname."</td>
|
<td>" . $walletHyper->first_row()->lastname . "</td>
|
||||||
<td>".$row->balance_com."</td>
|
<td>" . $walletHyper->first_row()->balance_princ . "</td>
|
||||||
<td> 4</td>
|
<td>" . $walletHyper->first_row()->balance_com . "</td>";
|
||||||
<td>X</td>
|
|
||||||
|
echo "<td>" . $depots->num_rows() . "</td>
|
||||||
|
<td>" . $retraits->num_rows() . "</td>
|
||||||
</tr>";
|
</tr>";
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td>Trident</td>
|
|
||||||
<td>Win 7</td>
|
|
||||||
<td> 4</td>
|
|
||||||
<td>X</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -280,31 +362,84 @@
|
||||||
<div class="modal fade" id="modal-update">
|
<div class="modal fade" id="modal-update">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<form action="<?php echo base_url('index.php/Gestion/updateTaux')?>" method="post">
|
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">Définissez la nouvelle valeur<?php //echo $this->lang->line('Sélectionnez le pays'); ?></h4>
|
<h3 class="modal-title"><?php echo $this->lang->line('Configuration du wallet'); ?></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
<form id="walletForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<input class="form-control" type="number" value="" name="taux" id="taux">
|
<label for="nom"
|
||||||
|
class="col-form-label"><?php echo $this->lang->line('Taux de commission client sur retrait') . ' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control"
|
||||||
|
id="taux_client_r" name="taux_client_r" value="<?= $taux_client_r ?>">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email"
|
||||||
|
class="col-form-label"><?php echo $this->lang->line('Taux de commission agent géolocalisé sur retrait') . ' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control"
|
||||||
|
name="taux_ag_r" id="taux_ag_r" value="<?= $taux_ag_r ?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="form-group">
|
||||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
<label for="email"
|
||||||
<button type="submit" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
|
class="col-form-label"><?php echo $this->lang->line('Taux de commission superviseur sur retrait') . ' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control"
|
||||||
|
name="taux_sup_r" id="taux_sup_r" value="<?= $taux_sup_r ?>">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email"
|
||||||
|
class="col-form-label"><?php echo $this->lang->line('Part de la banque sur le retrait') . ' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control" id="taux_bq_r"
|
||||||
|
name="taux_bq_r" value="<?= $taux_bq_r ?>">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="adresse"
|
||||||
|
class="col-form-label"><?php echo $this->lang->line('Taux de commission client sur dépot') . ' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control"
|
||||||
|
id="taux_client_d" name="taux_client_d" value="<?= $taux_client_d ?>">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email"
|
||||||
|
class="col-form-label"><?php echo $this->lang->line('Frais minimun de la banque sur le dépot') . ' (FCFA)'; ?></label>
|
||||||
|
<input type="number" min="0" required class="form-control" id="frais_d"
|
||||||
|
name="frais_d" value="<?= $frais_d ?>">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email"
|
||||||
|
class="col-form-label"><?php echo $this->lang->line('Taux de commission agent géolocalisé sur dépot') . ' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control" id="taux_ag_d"
|
||||||
|
name="taux_ag_d" value="<?= $taux_ag_d ?>">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email"
|
||||||
|
class="col-form-label"><?php echo $this->lang->line('Taux de commission superviseur sur dépot') . ' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control"
|
||||||
|
id="taux_sup_d" name="taux_sup_d" value="<?= $taux_sup_d ?>">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email"
|
||||||
|
class="col-form-label"><?php echo $this->lang->line('Part de la banque sur le dépot') . ' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control"
|
||||||
|
name="taux_bq_d" id="taux_bq_d" value="<?= $taux_bq_d ?>">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</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="button" id="updateWallet" data-network-id="<?= $network_id ?>"
|
||||||
|
class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<!-- jQuery 3 -->
|
<!-- jQuery 3 -->
|
||||||
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
|
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
|
||||||
<!-- Bootstrap 3.3.7 -->
|
<!-- Bootstrap 3.3.7 -->
|
||||||
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
|
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
|
||||||
|
@ -320,68 +455,151 @@
|
||||||
<!-- AdminLTE for demo purposes -->
|
<!-- AdminLTE for demo purposes -->
|
||||||
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
|
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
|
||||||
|
|
||||||
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
|
|
||||||
|
|
||||||
<script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script>
|
<script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script>
|
||||||
<script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
|
<script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
|
||||||
<script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
|
<script
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
|
src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
|
||||||
|
<scriptf
|
||||||
|
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></scriptf>
|
||||||
<!-- ChartJS -->
|
<!-- ChartJS -->
|
||||||
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
||||||
|
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
|
||||||
|
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
$('#example1').DataTable({
|
$('#example1').DataTable();
|
||||||
"aLengthMenu": [[5, 10, 15, -1], [5, 10, 5, "All"]],
|
// $('#example1').DataTable({
|
||||||
"iDisplayLength": 5
|
// "aLengthMenu": [[5, 10, 15, -1], [5, 10, 5, "All"]],
|
||||||
})
|
// "iDisplayLength": 5
|
||||||
$('#example2').DataTable({
|
// });
|
||||||
'paging' : true,
|
// $('#example2').DataTable({
|
||||||
'lengthChange': false,
|
// 'paging' : true,
|
||||||
'searching' : false,
|
// 'lengthChange': false,
|
||||||
'ordering' : true,
|
// 'searching' : false,
|
||||||
'info' : true,
|
// 'ordering' : true,
|
||||||
'autoWidth' : false
|
// 'info' : true,
|
||||||
})
|
// 'autoWidth' : false
|
||||||
|
// })
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var areaChartData = {
|
var areaChartData = {
|
||||||
labels : <?php echo json_encode($label_months) ?>,
|
labels: <?php echo json_encode($label_months) ?>,
|
||||||
datasets: [
|
datasets: [
|
||||||
{
|
{
|
||||||
label : 'Electronics',
|
label: 'Electronics',
|
||||||
fillColor : 'rgba(255, 162, 0, 1)',
|
fillColor: 'rgba(255, 162, 0, 1)',
|
||||||
strokeColor : 'rgba(255, 162, 0, 1)',
|
strokeColor: 'rgba(255, 162, 0, 1)',
|
||||||
pointColor : 'rgba(255, 162, 0, 1)',
|
pointColor: 'rgba(255, 162, 0, 1)',
|
||||||
pointStrokeColor : '#ffa200',
|
pointStrokeColor: '#ffa200',
|
||||||
pointHighlightFill : '#fff',
|
pointHighlightFill: '#fff',
|
||||||
pointHighlightStroke: 'rgba(220,220,220,1)',
|
pointHighlightStroke: 'rgba(220,220,220,1)',
|
||||||
data: <?php echo json_encode($depots_data) ?>
|
data: <?php echo json_encode($depots_data) ?>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label : 'Digital Goods',
|
label: 'Digital Goods',
|
||||||
fillColor : 'rgba(0, 187, 255, 1)',
|
fillColor: 'rgba(0, 187, 255, 1)',
|
||||||
strokeColor : 'rgba(0, 187, 255, 1)',
|
strokeColor: 'rgba(0, 187, 255, 1)',
|
||||||
pointColor : '#00bbff',
|
pointColor: '#00bbff',
|
||||||
pointStrokeColor : 'rgba(0, 187, 255, 1)',
|
pointStrokeColor: 'rgba(0, 187, 255, 1)',
|
||||||
pointHighlightFill : '#fff',
|
pointHighlightFill: '#fff',
|
||||||
pointHighlightStroke: 'rgba(0, 187, 255, 1)',
|
pointHighlightStroke: 'rgba(0, 187, 255, 1)',
|
||||||
data : <?php echo json_encode($retraits_data) ?>
|
data: <?php echo json_encode($retraits_data) ?>
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var Pie = '<?php echo json_encode($pieChart) ?>';
|
var Pie = '<?php echo json_encode($pieChart) ?>';
|
||||||
if(Pie==='[]'){
|
if (Pie === '[]') {
|
||||||
var select = document.getElementById('chart2');
|
var select = document.getElementById('chart2');
|
||||||
$(select.children).hide();
|
$(select.children).hide();
|
||||||
$(select).append("<p>Aucune transaction</p>");
|
$(select).append("<p>Aucune transaction</p>");
|
||||||
}else{
|
} else {
|
||||||
Pie = JSON.parse(Pie);
|
Pie = JSON.parse(Pie);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
toastr.options.closeButton = true;
|
||||||
|
toastr.options.closeMethod = 'fadeOut';
|
||||||
|
toastr.options.closeDuration = 5000;
|
||||||
|
toastr.options.closeEasing = 'swing';
|
||||||
|
|
||||||
|
$('#updateWallet').click(function () {
|
||||||
|
|
||||||
|
var network_id = $(this).data('network-id');
|
||||||
|
|
||||||
|
if ($('#walletForm')[0].checkValidity()) {
|
||||||
|
var taux_client_r = parseFloat($('#taux_client_r').val());
|
||||||
|
var taux_client_d = parseFloat($('#taux_client_d').val());
|
||||||
|
var taux_ag_r = parseFloat($('#taux_ag_r').val());
|
||||||
|
var taux_ag_d = parseFloat($('#taux_ag_d').val());
|
||||||
|
var taux_sup_r = parseFloat($('#taux_sup_r').val());
|
||||||
|
var taux_sup_d = parseFloat($('#taux_sup_d').val());
|
||||||
|
var taux_bq_d = parseFloat($('#taux_bq_d').val());
|
||||||
|
var taux_bq_r = parseFloat($('#taux_bq_r').val());
|
||||||
|
var frais_d = $('#frais_d').val();
|
||||||
|
|
||||||
|
var sommeRetrait = taux_ag_r + taux_sup_r + taux_bq_r;
|
||||||
|
var sommeDepot = taux_ag_d + taux_sup_d + taux_bq_d;
|
||||||
|
|
||||||
|
if((taux_ag_r + taux_sup_r) > 100){
|
||||||
|
toastr.error("La somme des % des retraits de l'agent et du superviseur doit être inférieur à 100.", 'Règle de gestion');
|
||||||
|
}else if((taux_ag_d + taux_sup_d) > 100){
|
||||||
|
toastr.error("La somme des % des dépots de l'agent et du superviseur doit être inférieur à 100.", 'Règle de gestion');
|
||||||
|
}else if(sommeRetrait >= taux_client_r){
|
||||||
|
toastr.error('La somme des % des retraits doit être inférieur au taux client de retrait.', 'Règle de gestion')
|
||||||
|
}else if(sommeDepot >= 100){
|
||||||
|
toastr.error("La somme des % des dépots doit être inférieur à 100.", 'Règle de gestion');
|
||||||
|
}else{
|
||||||
|
$.ajax({
|
||||||
|
url: '<?php echo base_url('index.php/Gestion/config_wallet/update')?>',
|
||||||
|
type: 'POST',
|
||||||
|
dataType: 'json',
|
||||||
|
data: {
|
||||||
|
"network_id": network_id,
|
||||||
|
"taux_client_r": taux_client_r,
|
||||||
|
"taux_client_d": taux_client_d,
|
||||||
|
"taux_ag_r": taux_ag_r,
|
||||||
|
"taux_ag_d": taux_ag_d,
|
||||||
|
"taux_sup_r": taux_sup_r,
|
||||||
|
"taux_sup_d": taux_sup_d,
|
||||||
|
"taux_bq_r": taux_bq_r,
|
||||||
|
"taux_bq_d": taux_bq_d,
|
||||||
|
"frais_d": frais_d
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
if(data=='200'){
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Mise à jour du wallet',
|
||||||
|
text:'Les informations ont été mises à jour',
|
||||||
|
timer: 3000
|
||||||
|
}).then(()=>{
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
// alert("Les informations ont été mises à jour.") ? "" :
|
||||||
|
}else{
|
||||||
|
toastr.error("Une erreur s'est produite." , 'Erreur requete');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
error: function (resultat, statut, error) {
|
||||||
|
console.log(resultat + " " + error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$('#walletForm')[0].reportValidity();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<!-- Page script -->
|
<!-- Page script -->
|
||||||
<script src="<?php echo base_url('dist/js/custom.js') ?>"></script>
|
<script src="<?php echo base_url('dist/js/custom.js') ?>"></script>
|
||||||
|
|
|
@ -0,0 +1,373 @@
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>">
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>">
|
||||||
|
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
function convertDate($date){
|
||||||
|
$month = null;
|
||||||
|
switch ($date) {
|
||||||
|
case "Jan":
|
||||||
|
$month = 1;
|
||||||
|
break;
|
||||||
|
case "Feb":
|
||||||
|
$month = 2;
|
||||||
|
break;
|
||||||
|
case "Mar":
|
||||||
|
$month = 3;
|
||||||
|
break;
|
||||||
|
case "Apr":
|
||||||
|
$month = 4;
|
||||||
|
break;
|
||||||
|
case "May":
|
||||||
|
$month = 5;
|
||||||
|
break;
|
||||||
|
case "Jun":
|
||||||
|
$month = 6;
|
||||||
|
break;
|
||||||
|
case "Jul":
|
||||||
|
$month = 7;
|
||||||
|
break;
|
||||||
|
case "Aug":
|
||||||
|
$month = 8;
|
||||||
|
break;
|
||||||
|
case "Sep":
|
||||||
|
$month = 9;
|
||||||
|
break;
|
||||||
|
case "Oct":
|
||||||
|
$month = 10;
|
||||||
|
break;
|
||||||
|
case "Nov":
|
||||||
|
$month = 11;
|
||||||
|
break;
|
||||||
|
case "Dec":
|
||||||
|
$month = 12;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $month;
|
||||||
|
}
|
||||||
|
|
||||||
|
$month = time();
|
||||||
|
$months[]=convertDate(date("M"));
|
||||||
|
$label_months [] = date("M")." ".date("Y");
|
||||||
|
$years[]= date("Y");
|
||||||
|
for ($i = 1; $i <= 11; $i++) {
|
||||||
|
$month = strtotime('last month', $month);
|
||||||
|
$months [] = convertDate(date("M", $month));
|
||||||
|
$years[] = date("Y", $month);
|
||||||
|
$label_months [] = date("M", $month)." ".date("Y", $month);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
** Retraits
|
||||||
|
**/
|
||||||
|
$date = date("Y");
|
||||||
|
|
||||||
|
$retraits_data[] = '';
|
||||||
|
$retraits_data =array();
|
||||||
|
for ($i = 1; $i <= 12; $i++) {
|
||||||
|
$retraits_query_mounth = array_filter($transactions, function ($trans) use ($i, $months ,$years){
|
||||||
|
$month = date("m",strtotime($trans->date));
|
||||||
|
$year = date("Y",strtotime($trans->date));
|
||||||
|
return $month == $months[$i-1] && $year == $years[$i-1] && $trans->type == 'debit' ;
|
||||||
|
});
|
||||||
|
$retraits_data[] = sizeof($retraits_query_mounth);
|
||||||
|
}
|
||||||
|
|
||||||
|
$startDate = (new DateTime('01-'.$months[11].'-'.$years[11]))-> format('Y-m-d H:i:s');
|
||||||
|
$endDate = date_create_from_format ('m/Y',$months[0].'/'.$years[0])-> format('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
$retraits = array_filter($transactions, function ($trans) use ($i, $endDate ,$startDate){
|
||||||
|
$date = strtotime($trans->date);
|
||||||
|
return $date >= strtotime($startDate) && $date <= strtotime($endDate) && $trans->type == 'debit' ;
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
** Dépots
|
||||||
|
**/
|
||||||
|
$date = date("Y");
|
||||||
|
|
||||||
|
$depots_data[] = '';
|
||||||
|
$depots_data =array();
|
||||||
|
for ($i = 1; $i <= 12; $i++) {
|
||||||
|
$depots_query_mounth= array_filter($transactions, function ($trans) use ($i, $months ,$years){
|
||||||
|
$month = date("m",strtotime($trans->date));
|
||||||
|
$year = date("Y",strtotime($trans->date));
|
||||||
|
return $month == $months[$i-1] && $year == $years[$i-1] && $trans->type == 'credit' ;
|
||||||
|
});
|
||||||
|
$depots_data[] = sizeof($depots_query_mounth);
|
||||||
|
}
|
||||||
|
$depots = array_filter($transactions, function ($trans) use ($i, $endDate ,$startDate){
|
||||||
|
$date = strtotime($trans->date);
|
||||||
|
return $date >= strtotime($startDate) && $date <= strtotime($endDate) && $trans->type == 'credit' ;
|
||||||
|
});
|
||||||
|
|
||||||
|
if($transactions!=false){
|
||||||
|
$transac=sizeof($transactions);
|
||||||
|
$array_transac = array();
|
||||||
|
$num = 0;
|
||||||
|
if ($transac > 0) {
|
||||||
|
foreach($transactions as $row) {
|
||||||
|
$num++;
|
||||||
|
$array_transac[] = $row->type;
|
||||||
|
}
|
||||||
|
$vals_transac = array_count_values($array_transac);
|
||||||
|
$pieChart = array();
|
||||||
|
foreach(array_keys($vals_transac) as $paramName) {
|
||||||
|
$color = dechex(rand(0x000000, 0xFFFFFF));
|
||||||
|
$trash = array("value" => $vals_transac[$paramName],
|
||||||
|
"color" => "#".$color,
|
||||||
|
"highlight" => "#".$color,
|
||||||
|
"label" => $paramName);
|
||||||
|
|
||||||
|
$pieChart[]= $trash;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$pieChart = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<section class="content-header">
|
||||||
|
|
||||||
|
<h1>
|
||||||
|
Wallet <?php echo $network; ?>
|
||||||
|
</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">×</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-lg-4 col-xs-6">
|
||||||
|
<div class="small-box bg-aqua">
|
||||||
|
<div class="inner">
|
||||||
|
<h3><?php echo $principal; ?><sup style="font-size: 20px">FCFA</sup></h3>
|
||||||
|
<p>Solde principal</p>
|
||||||
|
</div>
|
||||||
|
<div class="icon">
|
||||||
|
<i class="ion ion-cash"></i>
|
||||||
|
</div>
|
||||||
|
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_client_r" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-lg-4 col-xs-6">
|
||||||
|
<div class="small-box bg-green">
|
||||||
|
<div class="inner">
|
||||||
|
<h3><?php echo $commission; ?><sup style="font-size: 20px">FCFA</sup></h3>
|
||||||
|
<p>Solde commission</p>
|
||||||
|
</div>
|
||||||
|
<div class="icon">
|
||||||
|
<i class="ion ion-cash"></i>
|
||||||
|
</div>
|
||||||
|
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_client_r" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="box box-success">
|
||||||
|
<div class="box-header with-border">
|
||||||
|
<h3 class="box-title">Retraits et dépots des 12 derniers mois<?php //echo $this->lang->line('Souscription des 12 derniers mois'); ?></h3>
|
||||||
|
</div>
|
||||||
|
<div class="box-body">
|
||||||
|
<div class="chart" id="chart">
|
||||||
|
<canvas id="barChart" style="height:230px"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-6">
|
||||||
|
<div class="box box-danger">
|
||||||
|
<div class="box-header with-border">
|
||||||
|
<h3 class="box-title">Parts dépots & retraits<?php //echo $this->lang->line("Utilisateurs géolocalisés par ville"); ?></h3>
|
||||||
|
</div>
|
||||||
|
<div class="box-body" id="chart2">
|
||||||
|
<canvas id="pieChart" style="height:250px"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-xs-6">
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header">
|
||||||
|
<h3 class="box-title"><?php echo $this->lang->line('Commissions Superviseurs') ?></h3>
|
||||||
|
</div>
|
||||||
|
<div class="box-body">
|
||||||
|
<table id="example1" class="table table-bordered table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Nom</th>
|
||||||
|
<th>Solde Princ.</th>
|
||||||
|
<th>Solde Com.</th>
|
||||||
|
<th>Dépots</th>
|
||||||
|
<th>Retraits</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if($superviseurs!=false){
|
||||||
|
foreach($superviseurs->result() as $row) {
|
||||||
|
$wallet = null;
|
||||||
|
foreach ($agentWalletInfos->result() as $value) {
|
||||||
|
if ($value->agent_id == $row->agent_id) {
|
||||||
|
$wallet = $value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$com = 0;
|
||||||
|
$princ = 0;
|
||||||
|
if($wallet) {
|
||||||
|
$com = $wallet->balance_com;
|
||||||
|
$princ = $wallet->balance_princ;
|
||||||
|
}
|
||||||
|
echo "<tr>
|
||||||
|
<td>".$row->lastname."</td>
|
||||||
|
<td>".$princ."</td>
|
||||||
|
<td>".$com."</td>";
|
||||||
|
$nb_depots = 0;
|
||||||
|
$nb_retraits = 0;
|
||||||
|
foreach($depots as $depot){
|
||||||
|
if($depot->code_parrain == $row->member_code) {
|
||||||
|
$nb_depots ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach($retraits as $retrait){
|
||||||
|
if($retrait->code_parrain == $row->member_code) {
|
||||||
|
$nb_retraits ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo "<td>".$nb_depots."</td>
|
||||||
|
<td>".$nb_retraits."</td>
|
||||||
|
</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</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 src="<?php echo base_url('dist/js/demo.js') ?>"></script>
|
||||||
|
|
||||||
|
<script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script>
|
||||||
|
<script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
|
||||||
|
<script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
|
||||||
|
<!-- ChartJS -->
|
||||||
|
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
$('#example1').DataTable();
|
||||||
|
// $('#example1').DataTable({
|
||||||
|
// "aLengthMenu": [[5, 10, 15, -1], [5, 10, 5, "All"]],
|
||||||
|
// "iDisplayLength": 5
|
||||||
|
// });
|
||||||
|
// $('#example2').DataTable({
|
||||||
|
// 'paging' : true,
|
||||||
|
// 'lengthChange': false,
|
||||||
|
// 'searching' : false,
|
||||||
|
// 'ordering' : true,
|
||||||
|
// 'info' : true,
|
||||||
|
// 'autoWidth' : false
|
||||||
|
// })
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var areaChartData = {
|
||||||
|
labels : <?php echo json_encode($label_months) ?>,
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
label : 'Electronics',
|
||||||
|
fillColor : 'rgba(255, 162, 0, 1)',
|
||||||
|
strokeColor : 'rgba(255, 162, 0, 1)',
|
||||||
|
pointColor : 'rgba(255, 162, 0, 1)',
|
||||||
|
pointStrokeColor : '#ffa200',
|
||||||
|
pointHighlightFill : '#fff',
|
||||||
|
pointHighlightStroke: 'rgba(220,220,220,1)',
|
||||||
|
data: <?php echo json_encode($depots_data) ?>
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label : 'Digital Goods',
|
||||||
|
fillColor : 'rgba(0, 187, 255, 1)',
|
||||||
|
strokeColor : 'rgba(0, 187, 255, 1)',
|
||||||
|
pointColor : '#00bbff',
|
||||||
|
pointStrokeColor : 'rgba(0, 187, 255, 1)',
|
||||||
|
pointHighlightFill : '#fff',
|
||||||
|
pointHighlightStroke: 'rgba(0, 187, 255, 1)',
|
||||||
|
data : <?php echo json_encode($retraits_data) ?>
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var Pie = '<?php echo json_encode($pieChart) ?>';
|
||||||
|
if(Pie==='[]'){
|
||||||
|
var select = document.getElementById('chart2');
|
||||||
|
$(select.children).hide();
|
||||||
|
$(select).append("<p>Aucune transaction</p>");
|
||||||
|
}else{
|
||||||
|
Pie = JSON.parse(Pie);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<!-- Page script -->
|
||||||
|
<script src="<?php echo base_url('dist/js/custom.js') ?>"></script>
|
|
@ -0,0 +1,371 @@
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>">
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>">
|
||||||
|
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
function convertDate($date){
|
||||||
|
$month = null;
|
||||||
|
switch ($date) {
|
||||||
|
case "Jan":
|
||||||
|
$month = 1;
|
||||||
|
break;
|
||||||
|
case "Feb":
|
||||||
|
$month = 2;
|
||||||
|
break;
|
||||||
|
case "Mar":
|
||||||
|
$month = 3;
|
||||||
|
break;
|
||||||
|
case "Apr":
|
||||||
|
$month = 4;
|
||||||
|
break;
|
||||||
|
case "May":
|
||||||
|
$month = 5;
|
||||||
|
break;
|
||||||
|
case "Jun":
|
||||||
|
$month = 6;
|
||||||
|
break;
|
||||||
|
case "Jul":
|
||||||
|
$month = 7;
|
||||||
|
break;
|
||||||
|
case "Aug":
|
||||||
|
$month = 8;
|
||||||
|
break;
|
||||||
|
case "Sep":
|
||||||
|
$month = 9;
|
||||||
|
break;
|
||||||
|
case "Oct":
|
||||||
|
$month = 10;
|
||||||
|
break;
|
||||||
|
case "Nov":
|
||||||
|
$month = 11;
|
||||||
|
break;
|
||||||
|
case "Dec":
|
||||||
|
$month = 12;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $month;
|
||||||
|
}
|
||||||
|
|
||||||
|
$month = time();
|
||||||
|
$months[]=convertDate(date("M"));
|
||||||
|
$label_months [] = date("M")." ".date("Y");
|
||||||
|
$years[]= date("Y");
|
||||||
|
for ($i = 1; $i <= 11; $i++) {
|
||||||
|
$month = strtotime('last month', $month);
|
||||||
|
$months [] = convertDate(date("M", $month));
|
||||||
|
$years[] = date("Y", $month);
|
||||||
|
$label_months [] = date("M", $month)." ".date("Y", $month);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
** Retraits
|
||||||
|
**/
|
||||||
|
$date = date("Y");
|
||||||
|
|
||||||
|
$retraits_data[] = '';
|
||||||
|
$retraits_data =array();
|
||||||
|
for ($i = 1; $i <= 12; $i++) {
|
||||||
|
$retraits_query_mounth = array_filter($transactions, function ($trans) use ($i, $months ,$years){
|
||||||
|
$month = date("m",strtotime($trans->date));
|
||||||
|
$year = date("Y",strtotime($trans->date));
|
||||||
|
return $month == $months[$i-1] && $year == $years[$i-1] && $trans->type == 'debit' ;
|
||||||
|
});
|
||||||
|
$retraits_data[] = sizeof($retraits_query_mounth);
|
||||||
|
}
|
||||||
|
|
||||||
|
$startDate = (new DateTime('01-'.$months[11].'-'.$years[11]))-> format('Y-m-d H:i:s');
|
||||||
|
$endDate = date_create_from_format ('m/Y',$months[0].'/'.$years[0])-> format('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
$retraits = array_filter($transactions, function ($trans) use ($i, $endDate ,$startDate){
|
||||||
|
$date = strtotime($trans->date);
|
||||||
|
return $date >= strtotime($startDate) && $date <= strtotime($endDate) && $trans->type == 'debit' ;
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
** Dépots
|
||||||
|
**/
|
||||||
|
$date = date("Y");
|
||||||
|
|
||||||
|
$depots_data[] = '';
|
||||||
|
$depots_data =array();
|
||||||
|
for ($i = 1; $i <= 12; $i++) {
|
||||||
|
$depots_query_mounth= array_filter($transactions, function ($trans) use ($i, $months ,$years){
|
||||||
|
$month = date("m",strtotime($trans->date));
|
||||||
|
$year = date("Y",strtotime($trans->date));
|
||||||
|
return $month == $months[$i-1] && $year == $years[$i-1] && $trans->type == 'credit' ;
|
||||||
|
});
|
||||||
|
$depots_data[] = sizeof($depots_query_mounth);
|
||||||
|
}
|
||||||
|
$depots = array_filter($transactions, function ($trans) use ($i, $endDate ,$startDate){
|
||||||
|
$date = strtotime($trans->date);
|
||||||
|
return $date >= strtotime($startDate) && $date <= strtotime($endDate) && $trans->type == 'credit' ;
|
||||||
|
});
|
||||||
|
|
||||||
|
if($transactions!=false){
|
||||||
|
$transac=sizeof($transactions);
|
||||||
|
$array_transac = array();
|
||||||
|
$num = 0;
|
||||||
|
if ($transac > 0) {
|
||||||
|
foreach($transactions as $row) {
|
||||||
|
$num++;
|
||||||
|
$array_transac[] = $row->type;
|
||||||
|
}
|
||||||
|
$vals_transac = array_count_values($array_transac);
|
||||||
|
$pieChart = array();
|
||||||
|
foreach(array_keys($vals_transac) as $paramName) {
|
||||||
|
$color = dechex(rand(0x000000, 0xFFFFFF));
|
||||||
|
$trash = array("value" => $vals_transac[$paramName],
|
||||||
|
"color" => "#".$color,
|
||||||
|
"highlight" => "#".$color,
|
||||||
|
"label" => $paramName);
|
||||||
|
|
||||||
|
$pieChart[]= $trash;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$pieChart = array();
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<section class="content-header">
|
||||||
|
|
||||||
|
<h1>
|
||||||
|
Wallet <?php echo $network; ?>
|
||||||
|
</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">×</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-lg-4 col-xs-6">
|
||||||
|
<div class="small-box bg-aqua">
|
||||||
|
<div class="inner">
|
||||||
|
<h3><?php echo $principal; ?><sup style="font-size: 20px">FCFA</sup></h3>
|
||||||
|
<p>Solde principal</p>
|
||||||
|
</div>
|
||||||
|
<div class="icon">
|
||||||
|
<i class="ion ion-cash"></i>
|
||||||
|
</div>
|
||||||
|
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_client_r" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-lg-4 col-xs-6">
|
||||||
|
<div class="small-box bg-green">
|
||||||
|
<div class="inner">
|
||||||
|
<h3><?php echo $commission; ?><sup style="font-size: 20px">FCFA</sup></h3>
|
||||||
|
<p>Solde commission</p>
|
||||||
|
</div>
|
||||||
|
<div class="icon">
|
||||||
|
<i class="ion ion-cash"></i>
|
||||||
|
</div>
|
||||||
|
<!-- <a href="#" data-toggle="modal" data-target="#modal-update" data-type="taux_client_r" class="small-box-footer openModal">Modifier <i class="fa fa-arrow-circle-right"></i></a>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="box box-success">
|
||||||
|
<div class="box-header with-border">
|
||||||
|
<h3 class="box-title">Retraits et dépots des 12 derniers mois<?php //echo $this->lang->line('Souscription des 12 derniers mois'); ?></h3>
|
||||||
|
</div>
|
||||||
|
<div class="box-body">
|
||||||
|
<div class="chart" id="chart">
|
||||||
|
<canvas id="barChart" style="height:230px"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-6">
|
||||||
|
<div class="box box-danger">
|
||||||
|
<div class="box-header with-border">
|
||||||
|
<h3 class="box-title">Parts dépots & retraits<?php //echo $this->lang->line("Utilisateurs géolocalisés par ville"); ?></h3>
|
||||||
|
</div>
|
||||||
|
<div class="box-body" id="chart2">
|
||||||
|
<canvas id="pieChart" style="height:250px"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-xs-6">
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header">
|
||||||
|
<h3 class="box-title"><?php echo $this->lang->line('Commissions Agents') ?></h3>
|
||||||
|
</div>
|
||||||
|
<div class="box-body">
|
||||||
|
<table id="example1" class="table table-bordered table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Nom</th>
|
||||||
|
<th>Solde Princ.</th>
|
||||||
|
<th>Solde Com.</th>
|
||||||
|
<th>Dépots</th>
|
||||||
|
<th>Retraits</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if($agents_g){
|
||||||
|
foreach($agents_g->result() as $row) {
|
||||||
|
$wallet = null;
|
||||||
|
foreach ($agentWalletInfos->result() as $value) {
|
||||||
|
if ($value->agent_id == $row->agent_id) {
|
||||||
|
$wallet = $value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$com = 0;
|
||||||
|
$princ = 0;
|
||||||
|
if($wallet) {
|
||||||
|
$com = $wallet->balance_com;
|
||||||
|
$princ = $wallet->balance_princ;
|
||||||
|
}
|
||||||
|
echo "<tr>
|
||||||
|
<td>".$row->lastname."</td>
|
||||||
|
<td>".$princ."</td>
|
||||||
|
<td>".$com."</td>";
|
||||||
|
$nb_depots = 0;
|
||||||
|
$nb_retraits = 0;
|
||||||
|
foreach($depots as $depot){
|
||||||
|
if($depot->agent_id == $row->agent_id) {
|
||||||
|
$nb_depots ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach($retraits as $retrait){
|
||||||
|
if($retrait->agent_id == $row->agent_id) {
|
||||||
|
$nb_retraits ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
echo "<td>".$nb_depots."</td>
|
||||||
|
<td>".$nb_retraits."</td>
|
||||||
|
</tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</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 src="<?php echo base_url('dist/js/demo.js') ?>"></script>
|
||||||
|
|
||||||
|
<script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script>
|
||||||
|
<script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
|
||||||
|
<script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
|
||||||
|
<!-- ChartJS -->
|
||||||
|
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
$('#example1').DataTable();
|
||||||
|
// $('#example1').DataTable({
|
||||||
|
// "aLengthMenu": [[5, 10, 15, -1], [5, 10, 5, "All"]],
|
||||||
|
// "iDisplayLength": 5
|
||||||
|
// });
|
||||||
|
// $('#example2').DataTable({
|
||||||
|
// 'paging' : true,
|
||||||
|
// 'lengthChange': false,
|
||||||
|
// 'searching' : false,
|
||||||
|
// 'ordering' : true,
|
||||||
|
// 'info' : true,
|
||||||
|
// 'autoWidth' : false
|
||||||
|
// })
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var areaChartData = {
|
||||||
|
labels : <?php echo json_encode($label_months) ?>,
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
label : 'Electronics',
|
||||||
|
fillColor : 'rgba(255, 162, 0, 1)',
|
||||||
|
strokeColor : 'rgba(255, 162, 0, 1)',
|
||||||
|
pointColor : 'rgba(255, 162, 0, 1)',
|
||||||
|
pointStrokeColor : '#ffa200',
|
||||||
|
pointHighlightFill : '#fff',
|
||||||
|
pointHighlightStroke: 'rgba(220,220,220,1)',
|
||||||
|
data: <?php echo json_encode($depots_data) ?>
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label : 'Digital Goods',
|
||||||
|
fillColor : 'rgba(0, 187, 255, 1)',
|
||||||
|
strokeColor : 'rgba(0, 187, 255, 1)',
|
||||||
|
pointColor : '#00bbff',
|
||||||
|
pointStrokeColor : 'rgba(0, 187, 255, 1)',
|
||||||
|
pointHighlightFill : '#fff',
|
||||||
|
pointHighlightStroke: 'rgba(0, 187, 255, 1)',
|
||||||
|
data : <?php echo json_encode($retraits_data) ?>
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var Pie = '<?php echo json_encode($pieChart) ?>';
|
||||||
|
if(Pie==='[]'){
|
||||||
|
var select = document.getElementById('chart2');
|
||||||
|
$(select.children).hide();
|
||||||
|
$(select).append("<p>Aucune transaction</p>");
|
||||||
|
}else{
|
||||||
|
Pie = JSON.parse(Pie);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<!-- Page script -->
|
||||||
|
<script src="<?php echo base_url('dist/js/custom.js') ?>"></script>
|
|
@ -0,0 +1,335 @@
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
|
||||||
|
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<section class="content-header">
|
||||||
|
|
||||||
|
<h1>
|
||||||
|
<?php echo $this->lang->line('Gestion des wallets'); ?>
|
||||||
|
<input type="button" class="btn btn-primary pull-right" id="Bactiver" value="Activer/Désactiver le(s) réseau(x)" style="display: none;" />
|
||||||
|
</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">×</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-xs-12">
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header">
|
||||||
|
<h3 class="box-title"><?php echo $this->lang->line('Réseaux activés'); ?></h3>
|
||||||
|
</div>
|
||||||
|
<div class="box-body">
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$sql2 = $networks;
|
||||||
|
if($sql2!=false){
|
||||||
|
$numrows=$sql2->num_rows();
|
||||||
|
$num = 0;
|
||||||
|
if ($numrows > 0) {
|
||||||
|
?>
|
||||||
|
<table id="validated" class="table table-bordered table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th align='center'>N°</th>
|
||||||
|
<th><?php echo $this->lang->line('Reseau'); ?></th>
|
||||||
|
<th><?php echo $this->lang->line('Pays'); ?></th>
|
||||||
|
<th align='center'> Wallet </th>
|
||||||
|
<th align='center'><?php echo $this->lang->line('Activer/Désactiver'); ?></th>
|
||||||
|
<th align='center'> Action </th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
foreach($sql2->result() as $row) {
|
||||||
|
$num ++;
|
||||||
|
//$member_code = randomString1(10);
|
||||||
|
echo "<tr>
|
||||||
|
<td align='center'>$num</td>
|
||||||
|
<td >$row->network</td>
|
||||||
|
<td>$row->country</td>";
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
|
if($row->id_network){
|
||||||
|
?>
|
||||||
|
<td><span class="label label-success"><?php echo $this->lang->line('Actif'); ?></span></td>
|
||||||
|
<td><button type="button" data-toggle="modal" data-target="#disableWallet" data-network-id="<?php echo $row->id ?>" class="btn btn-danger openModal"><?php echo $this->lang->line('Désactiver'); ?></button></td>
|
||||||
|
<?php
|
||||||
|
}else{
|
||||||
|
?>
|
||||||
|
<td><span class="label label-danger"><?php echo $this->lang->line('Inactif'); ?></span></td>
|
||||||
|
<td><button type="button" data-toggle="modal" data-target="#enableWallet" data-network-id="<?php echo $row->id ?>" class="btn btn-primary openModal"><?php echo $this->lang->line('Activer'); ?></button></td>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<td>
|
||||||
|
<a href="<?php echo current_url().($row->id_network ? '?id='.$row->id_network : '')?>" class="btn btn-primary btn-block" <?php if(!$row->id_network) echo "disabled"?> >
|
||||||
|
<b><?php echo $this->lang->line('Voir plus...'); ?></b>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
echo $this->lang->line('Aucun réseau');
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
echo $this->lang->line('Aucun réseau');
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal fade" id="enableWallet" 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('Configuration du wallet'); ?></h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<form id="walletForm">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="nom" class="col-form-label"><?php echo $this->lang->line('Taux de commission client sur retrait').' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control" id="taux_client_r" name="taux_client_r" value="0">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email" class="col-form-label"><?php echo $this->lang->line('Taux de commission agent géolocalisé sur retrait').' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control" name="taux_ag_r" id="taux_ag_r" value="0">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email" class="col-form-label"><?php echo $this->lang->line('Taux de commission superviseur sur retrait').' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control" name="taux_sup_r" id="taux_sup_r" value="0">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email" class="col-form-label"><?php echo $this->lang->line('Part de la banque sur le retrait').' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control" id="taux_bq_r" name="taux_bq_r" value="0">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="adresse" class="col-form-label"><?php echo $this->lang->line('Taux de commission client sur dépot') .' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control" id="taux_client_d" name="taux_client_d" value="0">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email" class="col-form-label"><?php echo $this->lang->line('Frais minimun de la banque sur le dépot').' (FCFA)'; ?></label>
|
||||||
|
<input type="number" min="0" required class="form-control" id="frais_d" name="frais_d" value="0">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email" class="col-form-label"><?php echo $this->lang->line('Taux de commission agent géolocalisé sur dépot').' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control" id="taux_ag_d" name="taux_ag_d" value="0">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email" class="col-form-label"><?php echo $this->lang->line('Taux de commission superviseur sur dépot').' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control" id="taux_sup_d" name="taux_sup_d" value="0">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="email" class="col-form-label"><?php echo $this->lang->line('Part de la banque sur le dépot').' (%)'; ?></label>
|
||||||
|
<input type="number" min="0" step=".01" required class="form-control" name="taux_bq_d" id="taux_bq_d" value="0">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||||
|
<button type="button" class="btn btn-primary" id="addWallet" > <?php echo $this->lang->line('Valider'); ?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="modal fade" id="disableWallet" 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('Suppression du wallet'); ?></h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<h4> Etes vous certain de vouloir ?</h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||||
|
<button type="button" class="btn btn-primary" id="deleteWallet" > <?php echo $this->lang->line('Valider'); ?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="alert alert-info alert-dismissible" aria-hidden="true">-->
|
||||||
|
<!-- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>-->
|
||||||
|
<!-- <h4><i class="icon fa fa-info"></i>Info!</h4>-->
|
||||||
|
<!-- Data is Saved-->
|
||||||
|
<!-- </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 src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.js"></script>
|
||||||
|
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
$('#unvalidated').DataTable();
|
||||||
|
$('#validated').DataTable();
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
toastr.options.closeButton = true;
|
||||||
|
toastr.options.closeMethod = 'fadeOut';
|
||||||
|
toastr.options.closeDuration = 5000;
|
||||||
|
toastr.options.closeEasing = 'swing';
|
||||||
|
|
||||||
|
var network_id = null;
|
||||||
|
|
||||||
|
$(document).on("click", ".openModal", function () {
|
||||||
|
network_id = $(this).data('network-id');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#addWallet').click(function(){
|
||||||
|
|
||||||
|
if($('#walletForm')[0].checkValidity()) {
|
||||||
|
var taux_client_r = parseFloat($('#taux_client_r').val());
|
||||||
|
var taux_client_d = parseFloat($('#taux_client_d').val());
|
||||||
|
var taux_ag_r = parseFloat($('#taux_ag_r').val());
|
||||||
|
var taux_ag_d = parseFloat($('#taux_ag_d').val());
|
||||||
|
var taux_sup_r = parseFloat($('#taux_sup_r').val());
|
||||||
|
var taux_sup_d = parseFloat($('#taux_sup_d').val());
|
||||||
|
var taux_bq_d = parseFloat($('#taux_bq_d').val());
|
||||||
|
var taux_bq_r = parseFloat($('#taux_bq_r').val());
|
||||||
|
var frais_d =$('#frais_d').val();
|
||||||
|
|
||||||
|
var sommeRetrait = taux_ag_r + taux_sup_r +taux_bq_r ;
|
||||||
|
var sommeDepot = taux_ag_d + taux_sup_d + taux_bq_d ;
|
||||||
|
|
||||||
|
if((taux_ag_r + taux_sup_r) > 100){
|
||||||
|
toastr.error("La somme des % des retraits de l'agent et du superviseur doit être inférieur à 100.", 'Règle de gestion');
|
||||||
|
}else if((taux_ag_d + taux_sup_d) > 100){
|
||||||
|
toastr.error("La somme des % des dépots de l'agent et du superviseur doit être inférieur à 100.", 'Règle de gestion');
|
||||||
|
}else if(sommeRetrait >= taux_client_r){
|
||||||
|
// alert("La somme des % des retraits doit être inférieur au taux client de retrait.");
|
||||||
|
toastr.error('La somme des % des retraits doit être inférieur au taux client de retrait.', 'Règle de gestion')
|
||||||
|
}else if(sommeDepot >= 100){
|
||||||
|
toastr.error("La somme des % des dépots doit être inférieur à 100.", 'Règle de gestion');
|
||||||
|
}else{
|
||||||
|
$.ajax({
|
||||||
|
url : '<?php echo base_url('index.php/Gestion/config_wallet/create')?>',
|
||||||
|
type : 'POST',
|
||||||
|
dataType : 'json',
|
||||||
|
data: {"network_id": network_id ,"taux_client_r": taux_client_r, "taux_client_d": taux_client_d,"taux_ag_r": taux_ag_r, "taux_ag_d": taux_ag_d , "taux_sup_r": taux_sup_r , "taux_sup_d": taux_sup_d,
|
||||||
|
"taux_bq_r": taux_bq_r, "taux_bq_d":taux_bq_d, "frais_d": frais_d},
|
||||||
|
success : function(data){
|
||||||
|
if(data=='200'){
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Nouveau wallet',
|
||||||
|
text:'Les informations ont été mises à jour',
|
||||||
|
timer: 3000
|
||||||
|
}).then(()=>{
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
// alert("Les informations ont été mises à jour.") ? "" :
|
||||||
|
}else{
|
||||||
|
toastr.error("Une erreur s'est produite." , 'Erreur requete');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error : function(resultat, statut, error){
|
||||||
|
console.log(resultat+" "+error );
|
||||||
|
}
|
||||||
|
}).done(function () {
|
||||||
|
$.ajax({
|
||||||
|
url : '<?php echo base_url('index.php/Gestion/generateAllWallets')?>',
|
||||||
|
type : 'POST',
|
||||||
|
dataType : 'json',
|
||||||
|
data : {"network_id": network_id},
|
||||||
|
timeout : 0,
|
||||||
|
async : true ,
|
||||||
|
success : function () {
|
||||||
|
console.log("All wallets are generated");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
$('#walletForm')[0].reportValidity();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#deleteWallet').click(function(){
|
||||||
|
$.ajax({
|
||||||
|
url : '<?php echo base_url('index.php/Gestion/delete_config_wallet')?>',
|
||||||
|
type : 'POST',
|
||||||
|
dataType : 'json',
|
||||||
|
data: {"network_id": network_id },
|
||||||
|
success : function(data, statut){
|
||||||
|
if(data=='200'){
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Suppression wallet',
|
||||||
|
text: 'Les informations ont été mises à jour',
|
||||||
|
timer: 3000
|
||||||
|
}).then(()=>{
|
||||||
|
location.reload();
|
||||||
|
});
|
||||||
|
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
|
||||||
|
}else{
|
||||||
|
toastr.error("Une erreur s'est produite.", 'Erreur requete');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
error : function(resultat, statut, erreur){
|
||||||
|
console.log(resultat+" "+erreur);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
|
@ -143,7 +143,7 @@
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="<?php if($active=="wallet"){echo "active";} ?>">
|
<li class="<?php if($active=="wallet"){echo "active";} ?>">
|
||||||
<a href="#" data-toggle="modal" data-target="#modal-choix-network">
|
<a href="<?php echo base_url('index.php/Gestion/wallet') ?>">
|
||||||
<i class="glyphicon glyphicon-credit-card"></i> <span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
|
<i class="glyphicon glyphicon-credit-card"></i> <span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -199,47 +199,47 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal fade" id="modal-choix-network">
|
<!-- <div class="modal fade" id="modal-choix-network">-->
|
||||||
<div class="modal-dialog">
|
<!-- <div class="modal-dialog">-->
|
||||||
<div class="modal-content">
|
<!-- <div class="modal-content">-->
|
||||||
<form action="<?php echo base_url('index.php/Gestion/wallet')?>" method="post">
|
<!-- <form action="--><?php //echo base_url('index.php/Gestion/wallet')?><!--" method="post">-->
|
||||||
<div class="modal-header">
|
<!-- <div class="modal-header">-->
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<!-- <button type="button" class="close" data-dismiss="modal" aria-label="Close">-->
|
||||||
<span aria-hidden="true">×</span>
|
<!-- <span aria-hidden="true">×</span>-->
|
||||||
</button>
|
<!-- </button>-->
|
||||||
<h4 class="modal-title">Sélectionnez le réseau<?php //echo $this->lang->line('Sélectionnez le pays'); ?></h4>
|
<!-- <h4 class="modal-title">Sélectionnez le réseau--><?php ////echo $this->lang->line('Sélectionnez le pays'); ?><!--</h4>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<div class="modal-body">
|
<!-- <div class="modal-body">-->
|
||||||
|
<!---->
|
||||||
<div class="form-group">
|
<!-- <div class="form-group">-->
|
||||||
|
<!---->
|
||||||
<?php
|
<!-- --><?php
|
||||||
$result=$networks;
|
// $result=$networks;
|
||||||
|
//
|
||||||
$numrows=$result->num_rows();
|
// $numrows=$result->num_rows();
|
||||||
|
//
|
||||||
if ($numrows > 0) { ?>
|
// if ($numrows > 0) { ?>
|
||||||
<select class="form-control input-lg" name="id" required>
|
<!-- <select class="form-control input-lg" name="id" required>-->
|
||||||
<?php foreach($result->result() as $row) {
|
<!-- --><?php //foreach($result->result() as $row) {
|
||||||
|
//
|
||||||
echo "<option value=".$row->id.">".$row->name." - ".$row->country."</option>";
|
// echo "<option value=".$row->id.">".$row->name." - ".$row->country."</option>";
|
||||||
} ?>
|
// } ?>
|
||||||
</select>
|
<!-- </select>-->
|
||||||
<?php }else{
|
<!-- --><?php //}else{
|
||||||
echo "Aucun réseau";
|
// echo "Aucun réseau";
|
||||||
}
|
// }
|
||||||
?>
|
// ?>
|
||||||
|
<!---->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
|
<!---->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
<div class="modal-footer">
|
<!-- <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="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>
|
<!-- <button type="submit" class="btn btn-primary">--><?php //echo $this->lang->line('Continuer'); ?><!--</button>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</form>
|
<!-- </form>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -143,10 +143,10 @@
|
||||||
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Demandes adhésion'); ?></span>
|
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Demandes adhésion'); ?></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php if($this->session->userdata('network_id') == 118){
|
<?php if($hasWallet){
|
||||||
?>
|
?>
|
||||||
<li class="<?php if($active=="wallet"){echo "active";} ?>">
|
<li class="<?php if($active=="wallet"){echo "active";} ?>">
|
||||||
<a href="<?php echo base_url('index.php/Hyperviseur_dash/wallet?r='.$this->session->userdata('network_id')) ?>">
|
<a href="<?php echo base_url('index.php/Hyperviseur_dash/wallet') ?>">
|
||||||
<i class="glyphicon glyphicon-credit-card"></i> <span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
|
<i class="glyphicon glyphicon-credit-card"></i> <span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -122,6 +122,14 @@
|
||||||
<i class="fa fa-users"></i> <span>Demandes d'adhésion</span>
|
<i class="fa fa-users"></i> <span>Demandes d'adhésion</span>
|
||||||
</a>
|
</a>
|
||||||
</li>-->
|
</li>-->
|
||||||
|
<?php if($hasWallet){
|
||||||
|
?>
|
||||||
|
<li class="<?php if($active=="wallet"){echo "active";} ?>">
|
||||||
|
<a href="<?php echo base_url('index.php/Superviseur_dash/wallet') ?>">
|
||||||
|
<i class="glyphicon glyphicon-credit-card"></i> <span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
<!-- /.sidebar -->
|
<!-- /.sidebar -->
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
"source": "https://github.com/bcit-ci/CodeIgniter"
|
"source": "https://github.com/bcit-ci/CodeIgniter"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.7"
|
"php": ">=5.4"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
|
"paragonie/random_compat": "Provides better randomness in PHP 5.x"
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue