- Add new feature : "Payement des commissions superviseurs en cash"
- Add hyperviseur menu in admin panel
This commit is contained in:
parent
a1cab68982
commit
0d35ecb601
|
@ -3,12 +3,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||
|
||||
class Admin extends CI_Controller
|
||||
{
|
||||
public function _contruct()
|
||||
public function __construct()
|
||||
{
|
||||
parent::_contruct();
|
||||
parent::__construct();
|
||||
$this->load->model('user_model');
|
||||
|
||||
|
||||
$this->load->model('wallet_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
|
@ -506,7 +505,9 @@ class Admin extends CI_Controller
|
|||
$data['network'] = $this->session->userdata('network');
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$data['alert'] = "";
|
||||
$this->load->view('header', $data);
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listeadmin');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
|
|
@ -1,27 +1,24 @@
|
|||
<?php
|
||||
|
||||
use Brick\Money\Context\AutoContext;
|
||||
use Brick\Money\Money;
|
||||
|
||||
defined('BASEPATH') or exit('No direct script access allowed');
|
||||
|
||||
class Admin_dash extends CI_Controller
|
||||
{
|
||||
public function _contruct()
|
||||
public function __construct()
|
||||
{
|
||||
parent::_contruct();
|
||||
parent::__construct();
|
||||
$this->load->model('user_model');
|
||||
$this->load->model('wallet_model');
|
||||
$this->load->model('nano_credit_model');
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
if (!$this->session->userdata('email')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
|
||||
|
||||
redirect('index.php', $data);
|
||||
} else {
|
||||
if ($this->isLogged()) {
|
||||
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
|
||||
|
@ -41,6 +38,8 @@ class Admin_dash extends CI_Controller
|
|||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('admin_dash');
|
||||
$this->load->view('footer');
|
||||
|
@ -50,15 +49,7 @@ class Admin_dash extends CI_Controller
|
|||
|
||||
public function filter()
|
||||
{
|
||||
if (!$this->session->userdata('email')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
|
||||
|
||||
redirect('index.php', $data);
|
||||
} else {
|
||||
if ($this->isLogged()) {
|
||||
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
|
||||
|
@ -77,31 +68,26 @@ class Admin_dash extends CI_Controller
|
|||
|
||||
public function firstFilter()
|
||||
{
|
||||
|
||||
if (!$this->session->userdata('email')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
|
||||
|
||||
redirect('index.php', $data);
|
||||
} else {
|
||||
|
||||
if ($this->isLogged()) {
|
||||
if (isset($_POST)) {
|
||||
$this->session->set_userdata('current_pays', $this->input->post('pays'));
|
||||
$pays_name = $this->db->query("SELECT name FROM countries WHERE id='" . $this->input->post('pays') . "'");
|
||||
$pays_name = $this->db->query("SELECT name , currency_code FROM countries_currencies WHERE id='" . $this->input->post('pays') . "'");
|
||||
$this->session->set_userdata('current_hyper', $this->input->post('hyper'));
|
||||
$infos_network = $this->db->query("SELECT name,phone FROM networks INNER JOIN networks_agents ON networks.id=networks_agents.network_id INNER JOIN codeGenerer ON networks_agents.codeGenerer_id=codeGenerer.id WHERE codeGenerer.code_membre='" . $this->input->post('hyper') . "'");
|
||||
$infos_network = $this->db->query("SELECT networks.id, name,phone, networks_agents.agent_id, code_membre FROM networks INNER JOIN networks_agents ON networks.id=networks_agents.network_id INNER JOIN codeGenerer ON networks_agents.codeGenerer_id=codeGenerer.id WHERE codeGenerer.code_membre='" . $this->input->post('hyper') . "'");
|
||||
$network = $infos_network->first_row()->name;
|
||||
$contact_hyper = $infos_network->first_row()->phone;
|
||||
$this->session->set_userdata('current_network', $network);
|
||||
$this->session->set_userdata('current_network_id',$infos_network->first_row()->id);
|
||||
$this->session->set_userdata('current_hyper_id',$infos_network->first_row()->agent_id);
|
||||
$this->session->set_userdata('current_hyper_member_code',$infos_network->first_row()->code_membre);
|
||||
|
||||
$this->session->set_userdata('current_contact_hyper', $contact_hyper);
|
||||
$this->session->set_userdata('current_ville', $this->input->post('ville'));
|
||||
$town_name = $this->db->query("SELECT name FROM towns WHERE id='" . $this->input->post('ville') . "'");
|
||||
|
||||
$this->session->set_userdata('name_current_pays', $pays_name->first_row()->name);
|
||||
$this->session->set_userdata('name_current_ville', $town_name->first_row()->name);
|
||||
$this->session->set_userdata('currency_code', $pays_name->first_row()->currency_code);
|
||||
|
||||
$ville = $this->session->userdata('current_ville');
|
||||
$hyper = $this->session->userdata('current_hyper');
|
||||
|
@ -123,6 +109,11 @@ class Admin_dash extends CI_Controller
|
|||
$data['email'] = $this->session->userdata('email');
|
||||
$data['network'] = $this->session->userdata('current_network');
|
||||
$data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
$hyperPosition = $this->db->query("SELECT a.latitude,a.longitude FROM agents a INNER JOIN networks_agents na ON a.id= na.agent_id INNER JOIN codeGenerer ON na.codeGenerer_id=codeGenerer.id WHERE codeGenerer.code_membre='" . $this->input->post('hyper') . "'");
|
||||
$this->session->set_userdata('hyper_latitude', $hyperPosition->first_row()->latitude);
|
||||
$this->session->set_userdata('hyper_longitude', $hyperPosition->first_row()->longitude);
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('admin_dash');
|
||||
$this->load->view('footer');
|
||||
|
@ -130,6 +121,602 @@ class Admin_dash extends CI_Controller
|
|||
}
|
||||
}
|
||||
|
||||
// Wallet
|
||||
public function wallet()
|
||||
{
|
||||
if ($this->isLogged()) {
|
||||
$id_network = $this->session->userdata('current_network_id');
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
if ($data['hasWallet']) {
|
||||
|
||||
if ($this->input->get('history')) {
|
||||
$this->historique($id_network, $this->input->get('d'), $this->input->get('f'), $this->input->get('history'));
|
||||
} elseif ($this->input->get('config')) {
|
||||
$this->config_wallet($this->input->get('config'), $this->input->get('country'));
|
||||
} elseif ($this->input->get('show')) {
|
||||
$this->show_config_infos($this->input->get('show'));
|
||||
}else {
|
||||
$context = new AutoContext();
|
||||
|
||||
$data["commission"] = "";
|
||||
$data["principal"] = "";
|
||||
$data["transactions"] = "";
|
||||
$agent_id = $this->session->userdata('current_hyper_id');
|
||||
|
||||
|
||||
$taux = $data['hasWallet']->first_row();
|
||||
$data['idConfig'] = $taux->id;
|
||||
if ($data['hasWallet']->first_row()->type == 'visa') {
|
||||
$data['taux_client_r'] = $taux->taux_com_client_retrait;
|
||||
$data['taux_client_d'] = $taux->taux_com_client_depot;
|
||||
$data['taux_ag_r'] = $taux->taux_com_ag_retrait;
|
||||
$data['taux_ag_d'] = $taux->taux_com_ag_depot;
|
||||
$data['taux_sup_r'] = $taux->taux_com_sup_retrait;
|
||||
$data['taux_sup_d'] = $taux->taux_com_sup_depot;
|
||||
$data['taux_bq_d'] = $taux->part_banque_depot;
|
||||
$data['taux_bq_r'] = $taux->part_banque_retrait;
|
||||
$data['frais_d'] = $taux->frais_min_banque_depot;
|
||||
|
||||
$agents_g = $this->user_model->getAllGeolocatedUsersForHyp($this->session->userdata('member_code'));
|
||||
|
||||
//Fetch all transactions of any geolocated agent of the network
|
||||
$data["transactions"] = array();
|
||||
$totalCommissionBanque = 0;
|
||||
if ($agents_g) {
|
||||
foreach ($agents_g->result() as $row) {
|
||||
$wallet = $this->wallet_model->getWallet($row->agent_id);
|
||||
if ($wallet) {
|
||||
$transactions = $this->user_model->getAgentTransactions($wallet->first_row()->wallet_id);
|
||||
if ($transactions) {
|
||||
foreach ($transactions->result() as $trans) {
|
||||
$totalCommissionBanque += $trans->commission_banque;
|
||||
$trans->code_parrain = $row->code_parrain; // Add code parrain to transaction
|
||||
array_push($data['transactions'], $trans);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$data["totalCommissionBanque"] = Money::of(round($totalCommissionBanque,2), $this->session->userdata('currency_code'), $context )->formatTo('fr_FR');
|
||||
|
||||
} elseif ($data['hasWallet']->first_row()->type == 'ilink') {
|
||||
|
||||
$transactions = $this->wallet_model->getNetworkIlinTransactions($id_network);
|
||||
$data["transactions"] = array();
|
||||
$totalCommissionBanque = 0;
|
||||
if ($transactions) {
|
||||
foreach ($transactions->result() as $trans) {
|
||||
$totalCommissionBanque += $trans->commission_banque;
|
||||
array_push($data['transactions'], $trans);
|
||||
}
|
||||
}
|
||||
$data["totalCommissionBanque"] = Money::of(round($totalCommissionBanque,2), $this->session->userdata('currency_code'), $context )->formatTo('fr_FR');
|
||||
|
||||
}
|
||||
|
||||
//Create wallet if it not exist
|
||||
$res = $this->wallet_model->getWallet($agent_id);
|
||||
if ($res == false) {
|
||||
$this->user_model->addWallet($agent_id);
|
||||
$res = $this->wallet_model->getWallet($agent_id);
|
||||
}
|
||||
|
||||
$row = $res->first_row();
|
||||
$data["commission"] = Money::of(round($row->balance_com, 2), $this->session->userdata('currency_code'), $context)->formatTo('fr_FR');
|
||||
$data["principal"] = Money::of(round($row->balance_princ, 2), $this->session->userdata('currency_code'), $context)->formatTo('fr_FR');
|
||||
$data['wallet_id'] = $row->wallet_id;
|
||||
$data['curreny_code'] = $this->session->userdata('currency_code');
|
||||
|
||||
|
||||
$res = $this->wallet_model->getWalletPassword($id_network);
|
||||
$data['walletPassword'] = $res ? $res->first_row() : null;
|
||||
$data['alert'] = "";
|
||||
$data['active'] = "wallet_wallet";
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
|
||||
$data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['network'] = $this->session->userdata('current_network');
|
||||
$data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
|
||||
$data['network_id'] = $this->session->userdata('current_network_id');
|
||||
$data['country'] = $this->session->userdata('name_current_pays');
|
||||
|
||||
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('current_hyper_member_code'));
|
||||
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
|
||||
$this->load->view('header', $data);
|
||||
if ($data['hasWallet']->first_row()->type == 'visa')
|
||||
$this->load->view('gestion_wallet_hyp');
|
||||
elseif ($data['hasWallet']->first_row()->type == 'ilink')
|
||||
$this->load->view('gestion_wallet_ilink_hyp');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function historique($current_network_id, $startDate, $endDate, $type)
|
||||
{
|
||||
$data['configWallet'] = $this->wallet_model->getConfigWallet($current_network_id);
|
||||
$format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d';
|
||||
$data['startDate'] = $startDate ? date($format, strtotime($startDate)) : null;
|
||||
$data['endDate'] = $endDate ? date($format, strtotime($endDate)) : null;
|
||||
$endDate = Date('Y-m-d', strtotime($endDate . "+1 day"));
|
||||
if ($type == 'transaction_ilink') {
|
||||
$networkDetails = $this->user_model->getNetworkDetails($current_network_id);
|
||||
$data['currency_name_fr'] = $networkDetails->first_row()->currency_name_fr;
|
||||
$data['currency_name_en'] = $networkDetails->first_row()->currency_name_en;
|
||||
}else if ($type == 'deleted_transactions')
|
||||
$data['transactions'] = $this->user_model->getDeletedTransactions($startDate, $endDate, $this->session->userdata('current_network_id'));
|
||||
else if ($type == 'commission_transfer')
|
||||
$data['transactions'] = $this->wallet_model->getCommissionTransfersByNetwork($startDate, $endDate, $this->session->userdata('current_network_id'));
|
||||
else if ($type == 'balance_statement'){
|
||||
$res = $this->wallet_model->getWalletPassword($this->session->userdata('current_network_id'));
|
||||
$data['walletPassword'] = $res ? $res->first_row() : null;
|
||||
|
||||
$data['wallets'] = $this->user_model->getInfosWalletAgentForHyper($this->session->userdata('current_network_id'));
|
||||
|
||||
} else if ($type == 'refund_history')
|
||||
$data['refunds'] = $this->wallet_model->getRefunds($startDate, $endDate, $current_network_id);
|
||||
else if ($type == 'commission_payments')
|
||||
$data['payments'] = $this->wallet_model->getCommissionPayments($startDate, $endDate, $current_network_id);
|
||||
else
|
||||
$data['transactions'] = $this->wallet_model->getRecharges($startDate, $endDate, $current_network_id);
|
||||
|
||||
$data['active'] = "wallet_wallet";
|
||||
$data['alert'] = "";
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
|
||||
$data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['network'] = $this->session->userdata('current_network');
|
||||
$data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
|
||||
$data['network_id'] = $this->session->userdata('current_network_id');
|
||||
$data['country'] = $this->session->userdata('name_current_pays');
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
$data['currency_code'] = $this->session->userdata('currency_code');
|
||||
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['id_network'] = $current_network_id;
|
||||
|
||||
$this->load->view('header', $data);
|
||||
if ($type == 'transaction')
|
||||
$this->load->view('historique_transactions');
|
||||
else if ($type == 'transaction_ilink')
|
||||
$this->load->view('historique_transactions_ilink');
|
||||
else if ($type == 'deleted_transactions')
|
||||
$this->load->view('historique_transactions_deleted');
|
||||
else if ($type == 'commission_transfer')
|
||||
$this->load->view('historique_transferts_commission');
|
||||
else if ($type == 'balance_statement')
|
||||
$this->load->view('config_wallet_ilink_hyp/etat_soldes');
|
||||
else if ($type == 'refund_history')
|
||||
$this->load->view('historique_remboursement');
|
||||
else if ($type == 'commission_payments')
|
||||
$this->load->view('config_wallet_ilink_hyp/historique_commission_payements');
|
||||
else
|
||||
$this->load->view('historique_recharges');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
public function walletPassword()
|
||||
{
|
||||
if ($this->isLogged()) {
|
||||
$data['active'] = "wallet_password";
|
||||
$data['alert'] = "";
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
|
||||
$data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['network'] = $this->session->userdata('current_network');
|
||||
$data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
|
||||
$data['network_id'] = $this->session->userdata('current_network_id');
|
||||
$data['country'] = $this->session->userdata('name_current_pays');
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
$data['currency_code'] = $this->session->userdata('currency_code');
|
||||
|
||||
$res = $this->wallet_model->getWalletPassword($this->session->userdata('current_network_id'));
|
||||
$data['walletPassword'] = $res ? $res->first_row() : null;
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('wallet_password');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
private function config_wallet($config , $country)
|
||||
{
|
||||
// $data['configWallet'] = $this->wallet_model->getConfigWallet($network_id);
|
||||
$data['active'] = "wallet_wallet";
|
||||
$data['alert'] = "";
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
|
||||
$data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['network'] = $this->session->userdata('current_network');
|
||||
$data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
|
||||
$data['network_id'] = $this->session->userdata('current_network_id');
|
||||
$data['country'] = $this->session->userdata('name_current_pays');
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
$data['currency_code'] = $this->session->userdata('currency_code');
|
||||
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['idConfig'] = $data['hasWallet']->first_row()->id;
|
||||
$data['network_id'] = $this->session->userdata('current_network_id');
|
||||
if (isset($country)) {
|
||||
$data['country_id'] = $country;
|
||||
$data['country'] = $this->wallet_model->getCountry($country)->first_row();
|
||||
$res = $this->wallet_model->getActiveNetworksByCountry($country,$this->session->userdata('current_network_id'));
|
||||
$data['networks'] = [];
|
||||
if($res){
|
||||
$result = $res->result();
|
||||
foreach ($result as $network){
|
||||
$res = $this->wallet_model->getSharingRate($network->id , $data['idConfig']);
|
||||
$res2 = $this->wallet_model->getTransmittingNetwork($network->id , $data['idConfig']);
|
||||
if($res){
|
||||
$network->rate = $res->first_row()->taux_partage;
|
||||
$network->url = $res->first_row()->url;
|
||||
}else{
|
||||
$network->rate = null;
|
||||
$network->url = null;
|
||||
}
|
||||
$network->is_transmitting_network = $res2 ? true : false;
|
||||
$network->rate_transmitting = $res2 ? $res2->first_row()->taux_partage : null;
|
||||
$network->url_transmitting = $res2 ? $res2->first_row()->url : null;
|
||||
|
||||
$data['networks'][] = $network;
|
||||
}
|
||||
}
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('gestion_wallet_ilink_config_paying_network');
|
||||
$this->load->view('footer');
|
||||
return;
|
||||
}
|
||||
$res = $this->wallet_model->getWalletsCountries();
|
||||
$data['countries'] = [];
|
||||
if($res){
|
||||
$result = $res->result();
|
||||
foreach ($result as $country){
|
||||
$res = $this->wallet_model->countPayingNetworks($country->id, $data['idConfig']);
|
||||
$res2 = $this->wallet_model->countTransmittiongNetworks($country->id, $data['idConfig']);
|
||||
|
||||
$country->total_paying = $res ? $res->first_row()->total : null ;
|
||||
$country->total_transmitting = $res ? $res2->first_row()->total : null ;
|
||||
|
||||
$data['countries'][] = $country;
|
||||
}
|
||||
}
|
||||
$taux = $data['hasWallet']->first_row();
|
||||
switch($config){
|
||||
case 'paying_networks':
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('gestion_wallet_ilink_config_paying_networks');
|
||||
break;
|
||||
case 'user_wallet_wallet':
|
||||
$data['plr_user_wallet_wallet'] = $this->wallet_model->getPalierConfigWallet("user_wallet_wallet_international", $data['idConfig']);
|
||||
$data['plr_user_wallet_wallet_national'] = $this->wallet_model->getPalierConfigWallet("user_wallet_wallet_national", $data['idConfig']);
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('config_wallet_ilink_hyp/user_wallet_wallet');
|
||||
break;
|
||||
case 'user_wallet_carte':
|
||||
$data['taux_u_w_cart'] = $taux->taux_com_user_wallet_carte;
|
||||
$data['taux_hyp_s_wallet_cart_ilink'] = $taux->taux_com_hyp_envoi_wallet_carte_ilink;
|
||||
$data['taux_bq_s_wallet_cart_ilink'] = $taux->taux_com_banque_envoi_wallet_carte_ilink;
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('config_wallet_ilink_hyp/user_wallet_carte');
|
||||
break;
|
||||
case 'user_wallet_cash':
|
||||
$data['plr_user_wallet_cash'] = $this->wallet_model->getPalierConfigWallet("user_wallet_cash_international", $data['idConfig']);
|
||||
$data['plr_user_wallet_cash_national'] = $this->wallet_model->getPalierConfigWallet("user_wallet_cash_national", $data['idConfig']);
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('config_wallet_ilink_hyp/user_wallet_cash');
|
||||
break;
|
||||
case 'user_carte_wallet':
|
||||
$data['taux_u_c_w'] = $taux->taux_com_user_carte_wallet;
|
||||
$data['taux_u_c_c'] = $taux->taux_com_user_carte_cash;
|
||||
$data['taux_hyp_r_cart_ilink'] = $taux->taux_com_hyp_retrait_carte_cash_ilink;
|
||||
$data['taux_bq_r_cart_ilink'] = $taux->taux_com_banque_retrait_carte_cash_ilink;
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('config_wallet_ilink_hyp/user_carte_wallet');
|
||||
break;
|
||||
case 'agent_remove_cash':
|
||||
$data['taux_ag_r_c'] = $taux->taux_com_ag_retrait_cash;
|
||||
$data['taux_sup_r_c'] = $taux->taux_com_sup_retrait_cash;
|
||||
$data['taux_hyp_r_c'] = $taux->taux_com_hyp_retrait_cash;
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('config_wallet_ilink_hyp/agent_remove_cash');
|
||||
break;
|
||||
case 'agent_remove_carte_cash':
|
||||
$data['taux_ag_cart_c'] = $taux->taux_com_wallet_ag_carte_cash;
|
||||
$data['taux_ag_r_cart'] = $taux->taux_com_ag_retrait_carte_cash;
|
||||
$data['taux_sup_r_cart'] = $taux->taux_com_sup_retrait_carte_cash;
|
||||
$data['taux_hyp_r_cart'] = $taux->taux_com_hyp_retrait_carte_cash;
|
||||
$data['taux_bq_r_cart'] = $taux->taux_com_banque_retrait_carte_cash;
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('config_wallet_ilink_hyp/agent_remove_carte_cash');
|
||||
break;
|
||||
case 'agent_send_cash_carte':
|
||||
$data['taux_ag_d_c_c'] = $taux->taux_com_wallet_ag_envoi_cash_carte;
|
||||
$data['taux_ag_d_c'] = $taux->taux_com_ag_depot_cash_carte;
|
||||
$data['taux_sup_d_c'] = $taux->taux_com_sup_depot_cash_carte;
|
||||
$data['taux_hyp_d_c'] = $taux->taux_com_hyp_depot_cash_carte;
|
||||
$data['taux_bq_d_c'] = $taux->taux_com_banque_depot_cash_carte;
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('config_wallet_ilink_hyp/agent_send_cash_carte');
|
||||
break;
|
||||
case 'agent_send_cash_canal':
|
||||
$data['taux_ag_s_c'] = $taux->taux_com_ag_envoi_cash;
|
||||
$data['taux_sup_s_c'] = $taux->taux_com_sup_envoi_cash;
|
||||
$data['taux_hyp_s_c'] = $taux->taux_com_hyp_envoi_cash;
|
||||
|
||||
$data['plr_agent_depot_wallet_ilink'] = $this->wallet_model->getPalierConfigWallet("agent_depot_wallet_ilink_international" , $data['idConfig']);
|
||||
$data['plr_agent_depot_autre_wallet'] = $this->wallet_model->getPalierConfigWallet("agent_depot_autre_wallet_international" , $data['idConfig']);
|
||||
$data['plr_agent_cash_cash'] = $this->wallet_model->getPalierConfigWallet("agent_cash_cash_international", $data['idConfig']);
|
||||
|
||||
$data['plr_agent_depot_wallet_ilink_national'] = $this->wallet_model->getPalierConfigWallet("agent_depot_wallet_ilink_national" , $data['idConfig']);
|
||||
$data['plr_agent_depot_autre_wallet_national'] = $this->wallet_model->getPalierConfigWallet("agent_depot_autre_wallet_national" , $data['idConfig']);
|
||||
$data['plr_agent_cash_cash_national'] = $this->wallet_model->getPalierConfigWallet("agent_cash_cash_national", $data['idConfig']);
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('config_wallet_ilink_hyp/agent_send_cash_canal');
|
||||
break;
|
||||
case 'taxes':
|
||||
$data['taxes'] = $this->wallet_model->getTaxes($data['idConfig']);
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('config_wallet_ilink_hyp/taxes');
|
||||
break;
|
||||
}
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
private function show_config_infos($type)
|
||||
{
|
||||
|
||||
$data['active'] = "wallet_wallet";
|
||||
$data['alert'] = "";
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
|
||||
$data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['network'] = $this->session->userdata('current_network');
|
||||
$data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
|
||||
$data['network_id'] = $this->session->userdata('current_network_id');
|
||||
$data['country'] = $this->session->userdata('name_current_pays');
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
$data['currency_code'] = $this->session->userdata('currency_code');
|
||||
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['idConfig'] = $data['hasWallet']->first_row()->id;
|
||||
$res = $this->wallet_model->getWalletPassword($this->session->userdata('current_network_id'));
|
||||
$data['walletPassword'] = $res ? $res->first_row() : null;
|
||||
$data['networks'] = $this->wallet_model->getPayingNetworksByConfigWallet($data['idConfig']);
|
||||
$data['transmitting_networks'] = $this->wallet_model->getTransmittingNetworksByConfigWallet($data['idConfig']);
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('gestion_wallet_ilink_paying_network_account');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
public function config_sharing_rate(){
|
||||
if ($this->isLogged()) {
|
||||
if (isset($_POST)) {
|
||||
$network_id = $_POST['network_id'];
|
||||
$config_id = $_POST['config_id'];
|
||||
$rate = $_POST['rate'];
|
||||
$url = $_POST['url'];
|
||||
$res = $this->wallet_model->setSharingRate($network_id, $config_id, $rate, $url);
|
||||
|
||||
if ($res) {
|
||||
echo json_encode("200");
|
||||
} else {
|
||||
echo json_encode("500");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function nano_credit()
|
||||
{
|
||||
if ($this->isLogged()) {
|
||||
$data['network_id'] = $this->session->userdata('current_network_id');
|
||||
if ($this->input->get('history')) {
|
||||
$this->historique_nano_credit($data['network_id'], $this->input->get('d'), $this->input->get('f'), $this->input->get('history'));
|
||||
} elseif ($this->input->get('config')) {
|
||||
$this->config_nano_credit($this->input->get('config'));
|
||||
} elseif ($this->input->get('group')) {
|
||||
$this->users_group_details($this->input->get('group'));
|
||||
} else {
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
$data['groups'] = $this->nano_credit_model->getUsersGroups($this->session->userdata('current_network_id'));
|
||||
$data['idConfig'] = $data['hasWallet']->first_row()->id;
|
||||
$data['rates'] = $this->nano_credit_model->getNanoCreditRates($data['idConfig']);
|
||||
$data['taxes'] = $this->wallet_model->getTaxes($data['idConfig'], 'nano_credit');
|
||||
$data['active'] = "nano_credit";
|
||||
$data['alert'] = "";
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
|
||||
$data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['network'] = $this->session->userdata('current_network');
|
||||
$data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
|
||||
$data['network_id'] = $this->session->userdata('current_network_id');
|
||||
$data['country'] = $this->session->userdata('name_current_pays');
|
||||
$data['currency_code'] = $this->session->userdata('currency_code');
|
||||
$data['configWallet'] = $data['hasWallet']->first_row();
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('nano_credit/gestion_nano_credit_hyp');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function config_nano_credit($config)
|
||||
{
|
||||
// $data['configWallet'] = $this->wallet_model->getConfigWallet($network_id);
|
||||
$data['active'] = "nano_credit";
|
||||
$data['alert'] = "";
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
|
||||
$data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['network'] = $this->session->userdata('current_network');
|
||||
$data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
|
||||
$data['network_id'] = $this->session->userdata('current_network_id');
|
||||
$data['country'] = $this->session->userdata('name_current_pays');
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
$data['currency_code'] = $this->session->userdata('currency_code');
|
||||
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['idConfig'] = $data['hasWallet']->first_row()->id;
|
||||
switch ($config) {
|
||||
case 'nano_credit':
|
||||
$taux = $data['hasWallet']->first_row();
|
||||
$data['taux_ag_nano_credit'] = $taux->taux_com_ag_nano_credit;
|
||||
$data['taux_sup_nano_credit'] = $taux->taux_com_sup_nano_credit;
|
||||
$data['taux_hyp_nano_credit'] = $taux->taux_com_hyp_nano_credit;
|
||||
$data['rates'] = $this->nano_credit_model->getNanoCreditRates($data['idConfig']);
|
||||
$data['taxes'] = $this->wallet_model->getTaxes($data['idConfig'], 'nano_credit');
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('nano_credit/config_nano_credit');
|
||||
break;
|
||||
|
||||
case 'epargne':
|
||||
$data['rates'] = $this->nano_credit_model->getNanoCreditRates($data['idConfig'], 'epargne');
|
||||
$data['taxes'] = $this->wallet_model->getTaxes($data['idConfig'], 'epargne');
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('nano_credit/config_savings');
|
||||
break;
|
||||
}
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
private function historique_nano_credit($network_id, $startDate, $endDate, $type)
|
||||
{
|
||||
|
||||
// $data['configWallet'] = $this->wallet_model->getConfigWallet($network_id);
|
||||
$format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d';
|
||||
$data['startDate'] = $startDate ? date($format, strtotime($startDate)) : null;
|
||||
$data['endDate'] = $endDate ? date($format, strtotime($endDate)) : null;
|
||||
$endDate = Date('Y-m-d', strtotime($endDate . "+1 day"));
|
||||
$data['currency_code'] = $this->session->userdata('currency_code');
|
||||
|
||||
if ($type == 'nano_credit') {
|
||||
$data['transactions'] = $this->nano_credit_model->getUserDemandesCredit($startDate, $endDate, $network_id);
|
||||
|
||||
} else if ($type == 'savings') {
|
||||
$data['transactions'] = $this->nano_credit_model->getUsersSavings($startDate, $endDate, $network_id);
|
||||
}
|
||||
$data['active'] = "nano_credit";
|
||||
$data['alert'] = "";
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
|
||||
$data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['network'] = $this->session->userdata('current_network');
|
||||
$data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
|
||||
$data['network_id'] = $this->session->userdata('current_network_id');
|
||||
$data['country'] = $this->session->userdata('name_current_pays');
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
$data['currency_code'] = $this->session->userdata('currency_code');
|
||||
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['id_network'] = $this->session->userdata('current_network_id');
|
||||
|
||||
$this->load->view('header', $data);
|
||||
if ($type == 'savings')
|
||||
$this->load->view('nano_credit/historique_savings');
|
||||
else
|
||||
$this->load->view('nano_credit/historique_nano_credit');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
|
||||
private function users_group_details($group_code)
|
||||
{
|
||||
$data['active'] = "nano_credit";
|
||||
$data['alert'] = "";
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
|
||||
$data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['network'] = $this->session->userdata('current_network');
|
||||
$data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
|
||||
$data['network_id'] = $this->session->userdata('current_network_id');
|
||||
$data['country'] = $this->session->userdata('name_current_pays');
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
$data['currency_code'] = $this->session->userdata('currency_code');
|
||||
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['members'] = $this->nano_credit_model->getGroupMembers($group_code);
|
||||
$data['group'] = $this->nano_credit_model->getGroup($group_code);
|
||||
|
||||
//Calcul de la capacite d'emprunt
|
||||
$CE = 0;
|
||||
if($data['members']){
|
||||
$sommeCredits = 0;
|
||||
$sommeEpargnes = 0;
|
||||
foreach ($data['members']->result() as $user){
|
||||
$sum_credit = $this->nano_credit_model->sumGroupCredit($user->id_user) ? $this->nano_credit_model->sumGroupCredit($user->id_user)->credit : 0;
|
||||
$sommeCredits += $sum_credit;
|
||||
$sommeEpargnes += $user->balance_epargne;
|
||||
}
|
||||
$CE = $sommeEpargnes - $sommeCredits;
|
||||
}
|
||||
|
||||
$data['CE'] = $CE;
|
||||
$data['group_code'] = $group_code;
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('nano_credit/users_group_detail');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
public function operators()
|
||||
{
|
||||
|
||||
if ($this->isLogged()) {
|
||||
|
||||
$data['active'] = "operators";
|
||||
$data['alert'] = "";
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$data['hyper'] = $this->user_model->getAllHyper($data['pays']->first_row()->id);
|
||||
$data['ville'] = $this->user_model->getVilleNetworkByHyper($data['hyper']->first_row()->code_membre);
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['network'] = $this->session->userdata('current_network');
|
||||
$data['contact_hyper'] = $this->session->userdata('current_contact_hyper');
|
||||
$data['network_id'] = $this->session->userdata('current_network_id');
|
||||
$data['country'] = $this->session->userdata('name_current_pays');
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
$data['currency_code'] = $this->session->userdata('currency_code');
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
|
||||
$data['operators'] = $this->wallet_model->getOperatorsForNetwork($this->session->userdata('current_network_id'));
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('gestion_operateurs_hyp');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
public function documentation($route = null)
|
||||
{
|
||||
if (!$this->session->userdata('email')) {
|
||||
|
@ -168,4 +755,16 @@ class Admin_dash extends CI_Controller
|
|||
}
|
||||
}
|
||||
|
||||
private function isLogged(){
|
||||
if (!$this->session->userdata('email')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
|
||||
redirect('index.php', $data);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,82 +1,82 @@
|
|||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Admin_password extends CI_Controller
|
||||
{
|
||||
|
||||
public function _contruct()
|
||||
{
|
||||
parent::_contruct();
|
||||
$this->load->model('user_model');
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
if (!$this->input->get('token')) {
|
||||
echo "Lien incorrect";
|
||||
}
|
||||
else {
|
||||
|
||||
$db_token = $this->user_model->getToken($this->input->get('token'));
|
||||
if($db_token==true){
|
||||
$this->session->set_userdata('token', $this->input->get('token'));
|
||||
$this->load->view('admin_update_password');
|
||||
}else{
|
||||
echo "Ce lien a déjà expiré";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function create_password()
|
||||
{
|
||||
|
||||
if (!$this->session->userdata('token')) {
|
||||
echo "Ce lien a déjà expiré";
|
||||
} else {
|
||||
|
||||
if(isset($_POST))
|
||||
{
|
||||
$password = $this->input->post('password');
|
||||
$hash = $this->hashSSHA($password);
|
||||
$encrypted_password = $hash["encrypted"]; // encrypted password
|
||||
$salt = $hash["salt"]; // salt
|
||||
|
||||
$res = $this->user_model->createPasswordAdmin($encrypted_password,$salt,$this->session->userdata('token'));
|
||||
|
||||
if($res==true){
|
||||
$new_token = null;
|
||||
do {
|
||||
$new_token = bin2hex(openssl_random_pseudo_bytes(16));
|
||||
$tokenExist = $this->user_model->getToken($new_token);
|
||||
} while ($tokenExist==true);
|
||||
|
||||
|
||||
$res_token = $this->user_model->updateToken($new_token,$this->session->userdata('token'));
|
||||
|
||||
if($res_token==true){
|
||||
$data['alert'] = 'password';
|
||||
$data['message'] = 'Votre mot de passe a été configuré avec succès';
|
||||
$this->load->view('login', $data);
|
||||
}else{
|
||||
echo "Une erreur s'est produite";
|
||||
}
|
||||
}else{
|
||||
echo "Une erreur s'est produite";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function hashSSHA($password) {
|
||||
|
||||
$salt = sha1(rand());
|
||||
$salt = substr($salt, 0, 10);
|
||||
$encrypted = base64_encode(sha1($password . $salt, true) . $salt);
|
||||
$hash = array("salt" => $salt, "encrypted" => $encrypted);
|
||||
return $hash;
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Admin_password extends CI_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('user_model');
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
if (!$this->input->get('token')) {
|
||||
echo "Lien incorrect";
|
||||
}
|
||||
else {
|
||||
|
||||
$db_token = $this->user_model->getToken($this->input->get('token'));
|
||||
if($db_token==true){
|
||||
$this->session->set_userdata('token', $this->input->get('token'));
|
||||
$this->load->view('admin_update_password');
|
||||
}else{
|
||||
echo "Ce lien a déjà expiré";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function create_password()
|
||||
{
|
||||
|
||||
if (!$this->session->userdata('token')) {
|
||||
echo "Ce lien a déjà expiré";
|
||||
} else {
|
||||
|
||||
if(isset($_POST))
|
||||
{
|
||||
$password = $this->input->post('password');
|
||||
$hash = $this->hashSSHA($password);
|
||||
$encrypted_password = $hash["encrypted"]; // encrypted password
|
||||
$salt = $hash["salt"]; // salt
|
||||
|
||||
$res = $this->user_model->createPasswordAdmin($encrypted_password,$salt,$this->session->userdata('token'));
|
||||
|
||||
if($res==true){
|
||||
$new_token = null;
|
||||
do {
|
||||
$new_token = bin2hex(openssl_random_pseudo_bytes(16));
|
||||
$tokenExist = $this->user_model->getToken($new_token);
|
||||
} while ($tokenExist==true);
|
||||
|
||||
|
||||
$res_token = $this->user_model->updateToken($new_token,$this->session->userdata('token'));
|
||||
|
||||
if($res_token==true){
|
||||
$data['alert'] = 'password';
|
||||
$data['message'] = 'Votre mot de passe a été configuré avec succès';
|
||||
$this->load->view('login', $data);
|
||||
}else{
|
||||
echo "Une erreur s'est produite";
|
||||
}
|
||||
}else{
|
||||
echo "Une erreur s'est produite";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function hashSSHA($password) {
|
||||
|
||||
$salt = sha1(rand());
|
||||
$salt = substr($salt, 0, 10);
|
||||
$encrypted = base64_encode(sha1($password . $salt, true) . $salt);
|
||||
$hash = array("salt" => $salt, "encrypted" => $encrypted);
|
||||
return $hash;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||
class CodesG extends CI_Controller
|
||||
{
|
||||
|
||||
public function _contruct()
|
||||
public function __construct()
|
||||
{
|
||||
parent::_contruct();
|
||||
parent::__construct();
|
||||
$this->load->model('user_model');
|
||||
|
||||
}
|
||||
|
|
|
@ -491,7 +491,7 @@ class Gestion extends CI_Controller
|
|||
|
||||
if ($query) {
|
||||
|
||||
$link = "https://ilink-app.com/backofficebeta/index.php/Admin_password/?token=" . $token;
|
||||
$link = base_url("index.php/Admin_password/?token=" . $token);
|
||||
$this->load->library('email');
|
||||
|
||||
$this->email->from('noreply@ilink-app.com', 'iLink World');
|
||||
|
|
|
@ -535,10 +535,16 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$data['transactions'] = $this->user_model->getDeletedTransactions($startDate, $endDate, $this->session->userdata('network_id'));
|
||||
else if ($type == 'commission_transfer')
|
||||
$data['transactions'] = $this->wallet_model->getCommissionTransfersByNetwork($startDate, $endDate, $this->session->userdata('network_id'));
|
||||
else if ($type == 'balance_statement')
|
||||
else if ($type == 'balance_statement'){
|
||||
$res = $this->wallet_model->getWalletPassword($this->session->userdata('network_id'));
|
||||
$data['walletPassword'] = $res ? $res->first_row() : null;
|
||||
|
||||
$data['wallets'] = $this->user_model->getInfosWalletAgentForHyper($this->session->userdata('network_id'));
|
||||
else if ($type == 'refund_history')
|
||||
|
||||
} else if ($type == 'refund_history')
|
||||
$data['refunds'] = $this->wallet_model->getRefunds($startDate, $endDate, $network_id);
|
||||
else if ($type == 'commission_payments')
|
||||
$data['payments'] = $this->wallet_model->getCommissionPayments($startDate, $endDate, $network_id);
|
||||
else
|
||||
$data['transactions'] = $this->wallet_model->getRecharges($startDate, $endDate, $network_id);
|
||||
|
||||
|
@ -569,6 +575,8 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$this->load->view('config_wallet_ilink_hyp/etat_soldes');
|
||||
else if ($type == 'refund_history')
|
||||
$this->load->view('historique_remboursement');
|
||||
else if ($type == 'commission_payments')
|
||||
$this->load->view('config_wallet_ilink_hyp/historique_commission_payements');
|
||||
else
|
||||
$this->load->view('historique_recharges');
|
||||
$this->load->view('footer');
|
||||
|
@ -817,6 +825,32 @@ class Hyperviseur_dash extends CI_Controller
|
|||
}
|
||||
}
|
||||
|
||||
public function pay_commission_in_cash()
|
||||
{
|
||||
if ($this->isLogged()) {
|
||||
if (isset($_POST)) {
|
||||
$password = $_POST['password'];
|
||||
$id_wallet_agent = $_POST['id_wallet_agent'];
|
||||
$salt = $_POST['salt'];
|
||||
$encrypted_password = $_POST['encrypted_password'];
|
||||
$montant = $_POST['montant'];
|
||||
|
||||
$hash = base64_encode(sha1($password . $salt, true) . $salt);
|
||||
|
||||
if ($encrypted_password == $hash) {
|
||||
$res = $this->wallet_model->payCommissionInCash($montant, $id_wallet_agent, $this->session->userdata('network_id'));
|
||||
$code = $res ? '200' : '500';
|
||||
} else {
|
||||
$code = '400';
|
||||
}
|
||||
|
||||
echo json_encode($code);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function rembourser_compensation()
|
||||
{
|
||||
if ($this->isLogged()) {
|
||||
|
@ -1746,6 +1780,7 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$data['networks'] = $this->user_model->getActiveNetwork();
|
||||
$data['currency_code'] = $this->session->userdata('currency_code');
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['network_id'] = $this->session->userdata('network_id');
|
||||
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id'));
|
||||
$data['operators'] = $this->wallet_model->getOperatorsForNetwork($this->session->userdata('network_id'));
|
||||
|
|
|
@ -1,193 +1,193 @@
|
|||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class List_users_s extends CI_Controller
|
||||
{
|
||||
|
||||
public function _contruct()
|
||||
{
|
||||
parent::_contruct();
|
||||
$this->load->model('Users_simple');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
if (!$this->session->userdata('token')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
$this->load->view('login', $data);
|
||||
} else {
|
||||
$data['active'] = "simple_members";
|
||||
$data['alert'] = "";
|
||||
$data['network'] = $this->session->userdata('network');
|
||||
$this->load->view('header_sup', $data);
|
||||
$this->load->view('list_user_s');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
public function ajoutbtn()
|
||||
{
|
||||
if ($this->input->post('ajbtn')) {
|
||||
$nom = $this->input->post('nm');
|
||||
$prenom = $this->input->post('prnm');
|
||||
$Cpays = $this->input->post('cdpays');
|
||||
$Reso = $this->input->post('reso');
|
||||
$Cmbre = $this->input->post('cmbre');
|
||||
$emaill = $this->input->post('maill');
|
||||
$Catgry = $this->input->post('cat');
|
||||
$phoneNm = $this->input->post('tel');
|
||||
|
||||
|
||||
$data = array(
|
||||
'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso,
|
||||
'membre_code' => $Cmbre, 'emaill' => $emaill, 'category' => $Catgry, 'phone' => $phoneNm
|
||||
|
||||
);
|
||||
|
||||
|
||||
$query = $this->db->insert('users_simple', $data);
|
||||
if ($query) {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['success'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm has been added!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
} else {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm couldn't been added!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "Database error!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
function suppr()
|
||||
{
|
||||
if ($this->input->get('recordId')) {
|
||||
$id = "+" . $this->input->get('recordId');
|
||||
$id = str_replace(' ', '', $id);
|
||||
|
||||
/*$this->db->where('phone', $id);
|
||||
$query = $this->db->delete('users');
|
||||
*/
|
||||
$query = $this->db->delete('users_simple', array('phone' => $id));
|
||||
|
||||
if ($query) {
|
||||
$data['alert'] = "ok";
|
||||
$data['success'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $id has been deleted!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
} else {
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $id couldn't been deleted!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $id couldn't been deleted! No data sent";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function modif()
|
||||
{
|
||||
if ($this->input->post('modifbtn')) {
|
||||
$nom = $this->input->post('nm');
|
||||
$prenom = $this->input->post('prnm');
|
||||
$Cpays = $this->input->post('cdpays');
|
||||
$Reso = $this->input->post('reso');
|
||||
$Cmbre = $this->input->post('cmbre');
|
||||
$emaill = $this->input->post('maill');
|
||||
$Catgry = $this->input->post('cat');
|
||||
$phoneNm = $this->input->post('tel');
|
||||
|
||||
|
||||
$data = array(
|
||||
'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'member_code' => $Cmbre,
|
||||
'email' => $emaill, 'category' => $Catgry
|
||||
);
|
||||
|
||||
$this->db->where('phone', $phoneNm);
|
||||
|
||||
$query = $this->db->update('users_simple', $data);
|
||||
if ($query) {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['success'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm has been updated!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
|
||||
//redirect('Listes_admin');
|
||||
} else {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm couldn't been updated!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
} else {
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The record couldn't been updated! No data sent.";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class List_users_s extends CI_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('Users_simple');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
if (!$this->session->userdata('token')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
$this->load->view('login', $data);
|
||||
} else {
|
||||
$data['active'] = "simple_members";
|
||||
$data['alert'] = "";
|
||||
$data['network'] = $this->session->userdata('network');
|
||||
$this->load->view('header_sup', $data);
|
||||
$this->load->view('list_user_s');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
public function ajoutbtn()
|
||||
{
|
||||
if ($this->input->post('ajbtn')) {
|
||||
$nom = $this->input->post('nm');
|
||||
$prenom = $this->input->post('prnm');
|
||||
$Cpays = $this->input->post('cdpays');
|
||||
$Reso = $this->input->post('reso');
|
||||
$Cmbre = $this->input->post('cmbre');
|
||||
$emaill = $this->input->post('maill');
|
||||
$Catgry = $this->input->post('cat');
|
||||
$phoneNm = $this->input->post('tel');
|
||||
|
||||
|
||||
$data = array(
|
||||
'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso,
|
||||
'membre_code' => $Cmbre, 'emaill' => $emaill, 'category' => $Catgry, 'phone' => $phoneNm
|
||||
|
||||
);
|
||||
|
||||
|
||||
$query = $this->db->insert('users_simple', $data);
|
||||
if ($query) {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['success'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm has been added!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
} else {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm couldn't been added!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "Database error!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
function suppr()
|
||||
{
|
||||
if ($this->input->get('recordId')) {
|
||||
$id = "+" . $this->input->get('recordId');
|
||||
$id = str_replace(' ', '', $id);
|
||||
|
||||
/*$this->db->where('phone', $id);
|
||||
$query = $this->db->delete('users');
|
||||
*/
|
||||
$query = $this->db->delete('users_simple', array('phone' => $id));
|
||||
|
||||
if ($query) {
|
||||
$data['alert'] = "ok";
|
||||
$data['success'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $id has been deleted!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
} else {
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $id couldn't been deleted!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $id couldn't been deleted! No data sent";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function modif()
|
||||
{
|
||||
if ($this->input->post('modifbtn')) {
|
||||
$nom = $this->input->post('nm');
|
||||
$prenom = $this->input->post('prnm');
|
||||
$Cpays = $this->input->post('cdpays');
|
||||
$Reso = $this->input->post('reso');
|
||||
$Cmbre = $this->input->post('cmbre');
|
||||
$emaill = $this->input->post('maill');
|
||||
$Catgry = $this->input->post('cat');
|
||||
$phoneNm = $this->input->post('tel');
|
||||
|
||||
|
||||
$data = array(
|
||||
'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'member_code' => $Cmbre,
|
||||
'email' => $emaill, 'category' => $Catgry
|
||||
);
|
||||
|
||||
$this->db->where('phone', $phoneNm);
|
||||
|
||||
$query = $this->db->update('users_simple', $data);
|
||||
if ($query) {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['success'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm has been updated!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
|
||||
//redirect('Listes_admin');
|
||||
} else {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm couldn't been updated!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
} else {
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The record couldn't been updated! No data sent.";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,196 +1,196 @@
|
|||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Liste_users_g extends CI_Controller
|
||||
{
|
||||
|
||||
public function _contruct()
|
||||
{
|
||||
parent::_contruct();
|
||||
$this->load->model('Users_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
if (!$this->session->userdata('token')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
$this->load->view('login', $data);
|
||||
} else {
|
||||
$data['active'] = "simple_members";
|
||||
$data['parrain'] = $this->session->userdata('parrain');
|
||||
$data['alert'] = "";
|
||||
$data['network'] = $this->session->userdata('network');
|
||||
$data['longitude'] = $this->session->userdata('longitude');
|
||||
$data['latitude'] = $this->session->userdata('latitude');
|
||||
$this->load->view('header_sup', $data);
|
||||
$this->load->view('list_user_s');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
public function ajoutbtn()
|
||||
{
|
||||
if ($this->input->post('ajbtn')) {
|
||||
$nom = $this->input->post('nm');
|
||||
$prenom = $this->input->post('prnm');
|
||||
$Cpays = $this->input->post('cdpays');
|
||||
$Reso = $this->input->post('reso');
|
||||
$Cmbre = $this->input->post('cmbre');
|
||||
$emaill = $this->input->post('maill');
|
||||
$Catgry = $this->input->post('cat');
|
||||
$phoneNm = $this->input->post('tel');
|
||||
|
||||
|
||||
$data = array(
|
||||
'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso,
|
||||
'membre_code' => $Cmbre, 'emaill' => $emaill, 'category' => $Catgry, 'phone' => $phoneNm
|
||||
|
||||
);
|
||||
|
||||
|
||||
$query = $this->db->insert('users_simple', $data);
|
||||
if ($query) {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['success'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm has been added!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
} else {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm couldn't been added!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "Database error!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
function suppr()
|
||||
{
|
||||
if ($this->input->get('recordId')) {
|
||||
$id = "+" . $this->input->get('recordId');
|
||||
$id = str_replace(' ', '', $id);
|
||||
|
||||
/*$this->db->where('phone', $id);
|
||||
$query = $this->db->delete('users');
|
||||
*/
|
||||
$query = $this->db->delete('users_simple', array('phone' => $id));
|
||||
|
||||
if ($query) {
|
||||
$data['alert'] = "ok";
|
||||
$data['success'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $id has been deleted!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
} else {
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $id couldn't been deleted!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $id couldn't been deleted! No data sent";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function modif()
|
||||
{
|
||||
if ($this->input->post('modifbtn')) {
|
||||
$nom = $this->input->post('nm');
|
||||
$prenom = $this->input->post('prnm');
|
||||
$Cpays = $this->input->post('cdpays');
|
||||
$Reso = $this->input->post('reso');
|
||||
$Cmbre = $this->input->post('cmbre');
|
||||
$emaill = $this->input->post('maill');
|
||||
$Catgry = $this->input->post('cat');
|
||||
$phoneNm = $this->input->post('tel');
|
||||
|
||||
|
||||
$data = array(
|
||||
'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'member_code' => $Cmbre,
|
||||
'email' => $emaill, 'category' => $Catgry
|
||||
);
|
||||
|
||||
$this->db->where('phone', $phoneNm);
|
||||
|
||||
$query = $this->db->update('users_simple', $data);
|
||||
if ($query) {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['success'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm has been updated!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
|
||||
//redirect('Listes_admin');
|
||||
} else {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm couldn't been updated!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
} else {
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The record couldn't been updated! No data sent.";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Liste_users_g extends CI_Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->load->model('Users_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
if (!$this->session->userdata('token')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
$this->load->view('login', $data);
|
||||
} else {
|
||||
$data['active'] = "simple_members";
|
||||
$data['parrain'] = $this->session->userdata('parrain');
|
||||
$data['alert'] = "";
|
||||
$data['network'] = $this->session->userdata('network');
|
||||
$data['longitude'] = $this->session->userdata('longitude');
|
||||
$data['latitude'] = $this->session->userdata('latitude');
|
||||
$this->load->view('header_sup', $data);
|
||||
$this->load->view('list_user_s');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
public function ajoutbtn()
|
||||
{
|
||||
if ($this->input->post('ajbtn')) {
|
||||
$nom = $this->input->post('nm');
|
||||
$prenom = $this->input->post('prnm');
|
||||
$Cpays = $this->input->post('cdpays');
|
||||
$Reso = $this->input->post('reso');
|
||||
$Cmbre = $this->input->post('cmbre');
|
||||
$emaill = $this->input->post('maill');
|
||||
$Catgry = $this->input->post('cat');
|
||||
$phoneNm = $this->input->post('tel');
|
||||
|
||||
|
||||
$data = array(
|
||||
'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso,
|
||||
'membre_code' => $Cmbre, 'emaill' => $emaill, 'category' => $Catgry, 'phone' => $phoneNm
|
||||
|
||||
);
|
||||
|
||||
|
||||
$query = $this->db->insert('users_simple', $data);
|
||||
if ($query) {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['success'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm has been added!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
} else {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm couldn't been added!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "Database error!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
function suppr()
|
||||
{
|
||||
if ($this->input->get('recordId')) {
|
||||
$id = "+" . $this->input->get('recordId');
|
||||
$id = str_replace(' ', '', $id);
|
||||
|
||||
/*$this->db->where('phone', $id);
|
||||
$query = $this->db->delete('users');
|
||||
*/
|
||||
$query = $this->db->delete('users_simple', array('phone' => $id));
|
||||
|
||||
if ($query) {
|
||||
$data['alert'] = "ok";
|
||||
$data['success'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $id has been deleted!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
} else {
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $id couldn't been deleted!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $id couldn't been deleted! No data sent";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function modif()
|
||||
{
|
||||
if ($this->input->post('modifbtn')) {
|
||||
$nom = $this->input->post('nm');
|
||||
$prenom = $this->input->post('prnm');
|
||||
$Cpays = $this->input->post('cdpays');
|
||||
$Reso = $this->input->post('reso');
|
||||
$Cmbre = $this->input->post('cmbre');
|
||||
$emaill = $this->input->post('maill');
|
||||
$Catgry = $this->input->post('cat');
|
||||
$phoneNm = $this->input->post('tel');
|
||||
|
||||
|
||||
$data = array(
|
||||
'firstname' => $nom, 'lastname' => $prenom, 'country_code' => $Cpays, 'network' => $Reso, 'member_code' => $Cmbre,
|
||||
'email' => $emaill, 'category' => $Catgry
|
||||
);
|
||||
|
||||
$this->db->where('phone', $phoneNm);
|
||||
|
||||
$query = $this->db->update('users_simple', $data);
|
||||
if ($query) {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['success'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm has been updated!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
|
||||
//redirect('Listes_admin');
|
||||
} else {
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The member $phoneNm couldn't been updated!";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
} else {
|
||||
$data['alert'] = "ok";
|
||||
$data['active'] = "simple_members";
|
||||
$data['message'] = "The record couldn't been updated! No data sent.";
|
||||
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -4,9 +4,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||
class Listes_admin extends CI_Controller
|
||||
{
|
||||
|
||||
public function _contruct()
|
||||
public function __construct()
|
||||
{
|
||||
parent::_contruct();
|
||||
parent::__construct();
|
||||
$this->load->model('user_model');
|
||||
|
||||
}
|
||||
|
|
|
@ -4,11 +4,13 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||
class Listes_members extends CI_Controller
|
||||
{
|
||||
|
||||
public function _contruct()
|
||||
public function __construct()
|
||||
{
|
||||
parent::_contruct();
|
||||
parent::__construct();
|
||||
$this->load->model('user_model');
|
||||
}
|
||||
$this->load->model('wallet_model');
|
||||
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
@ -34,7 +36,9 @@ class Listes_members extends CI_Controller
|
|||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['alert'] = "";
|
||||
$this->load->view('header', $data);
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('listemembers');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
@ -93,7 +97,9 @@ class Listes_members extends CI_Controller
|
|||
|
||||
function suppr()
|
||||
{
|
||||
if ($this->input->get('recordId')) {
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
|
||||
if ($this->input->get('recordId')) {
|
||||
$id = "+" . $this->input->get('recordId');
|
||||
$id = str_replace(' ', '', $id);
|
||||
|
||||
|
|
|
@ -4,10 +4,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||
class Member_code_admin extends CI_Controller
|
||||
{
|
||||
|
||||
public function _contruct()
|
||||
public function __construct()
|
||||
{
|
||||
parent::_contruct();
|
||||
parent::__construct();
|
||||
$this->load->model('user_model');
|
||||
$this->load->model('wallet_model');
|
||||
|
||||
}
|
||||
|
||||
|
@ -39,7 +40,9 @@ class Member_code_admin extends CI_Controller
|
|||
$data['email'] = $this->session->userdata('email');
|
||||
$data['alert'] = "";
|
||||
$data['pays'] = $this->user_model->getAllCountries();
|
||||
$this->load->view('header', $data);
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
|
||||
$this->load->view('header', $data);
|
||||
$this->load->view('membreCodeAdmin');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
@ -67,6 +70,8 @@ class Member_code_admin extends CI_Controller
|
|||
|
||||
$query = $this->db->insert('codemembre', $data);
|
||||
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
|
||||
if ($query && $rslt) {
|
||||
|
||||
$data['active'] = "members_code";
|
||||
|
@ -92,7 +97,9 @@ class Member_code_admin extends CI_Controller
|
|||
|
||||
public function delete()
|
||||
{
|
||||
if ($this->input->get('recordId')) {
|
||||
$data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('current_network_id'));
|
||||
|
||||
if ($this->input->get('recordId')) {
|
||||
$id = "+" . $this->input->get('recordId');
|
||||
$id = str_replace(' ', '', $id);
|
||||
|
||||
|
|
|
@ -612,4 +612,9 @@ $lang['nano_health_removal'] = 'Removal of nano health';
|
|||
$lang['activate_nano_health'] = 'Activate nano health';
|
||||
$lang['nano_health_deleted'] = 'Nano health deleted';
|
||||
$lang['phone_already_exists'] = "This phone number already exists";
|
||||
$lang['pay_commission_in_cash'] = "Pay commission in cash";
|
||||
$lang['payment_done'] = "Payment made";
|
||||
$lang['commission_payments_history'] = "Commission payment history";
|
||||
$lang['initial_commission'] = "Initial commission";
|
||||
$lang['final_commission'] = "Final commission";
|
||||
?>
|
||||
|
|
|
@ -624,4 +624,9 @@ $lang['nano_health_removal'] = 'Suppression du nano santé';
|
|||
$lang['activate_nano_health'] = 'Activation du nano santé';
|
||||
$lang['nano_health_deleted'] = 'Nano santé supprimé';
|
||||
$lang['phone_already_exists'] = "This phone number already exists";
|
||||
$lang['pay_commission_in_cash'] = "Payer la commission en espèce";
|
||||
$lang['payment_done'] = "Paiement effectué";
|
||||
$lang['commission_payments_history'] = "Historique des paiements de commission";
|
||||
$lang['initial_commission'] = "Commission initiale";
|
||||
$lang['final_commission'] = "Commission finale";
|
||||
?>
|
||||
|
|
|
@ -943,4 +943,40 @@ LEFT JOIn networks_operators nb ON nb.id_operator_country = bc.id AND nb.id_netw
|
|||
return date('Y-m-d H:i:s');
|
||||
}
|
||||
}
|
||||
|
||||
public function payCommissionInCash($montant, $id_wallet_agent,$id_network){
|
||||
try{
|
||||
$this->db->trans_begin();
|
||||
|
||||
$datetime = $this->getCurrentTimeByNetworkID($id_network);
|
||||
|
||||
$walletAgent = $this->db->get_where('wallets',['id' => $id_wallet_agent])->first_row();
|
||||
// Mise à jour du compte
|
||||
$sql = "UPDATE `wallets` SET balance_com = balance_com - ? WHERE (`id` = ? );";
|
||||
$this->db->query($sql , array($montant,$id_wallet_agent));
|
||||
|
||||
$data = array('amount' => $montant , 'initial_commission' => $walletAgent->balance_com ,
|
||||
'final_commission' => $walletAgent->balance_com + $montant, 'id_wallet_agent' => $id_wallet_agent , 'date'=> $datetime);
|
||||
$this->db->insert('commission_payments', $data);
|
||||
|
||||
$this->db->trans_commit();
|
||||
return true;
|
||||
|
||||
}catch (Throwable $e){
|
||||
$this->db->trans_rollback();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getCommissionPayments($debut, $fin, $id_network)
|
||||
{
|
||||
$chain = $debut ? " AND date BETWEEN '" . $debut . "' AND '" . $fin . "'" : "";
|
||||
$query = $this->db->query("SELECT cp.* , wa.lastname, wa.currency_code FROM commission_payments cp
|
||||
INNER JOIN wallet_agent wa ON cp.id_wallet_agent = wa.wallet_id WHERE wa.network_id =" . $id_network . $chain);
|
||||
if ($query->num_rows() > 0) {
|
||||
return $query;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,6 +80,11 @@
|
|||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php echo $this->lang->line('export_balance_statement') ?></h3>
|
||||
<div class="box-tools">
|
||||
<a class="btn btn-primary" href="<?php echo current_url().('?history=commission_payments')?>">
|
||||
<?php echo $this->lang->line('commission_payments_history'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body" style="overflow-x:auto;">
|
||||
<?php
|
||||
|
@ -102,6 +107,9 @@
|
|||
<th><?= $this->lang->line('Telephone') ?></th>
|
||||
<th><?= $this->lang->line('code membre') ?></th>
|
||||
<th>Agent</th>
|
||||
<?php if ($this->session->userdata('category') != 'super') { ?>
|
||||
<th align='center'>Action</th>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -117,6 +125,14 @@
|
|||
<td>" . $row->codeMembre . "</td>
|
||||
<td>" . $row->lastname . "</td>";
|
||||
?>
|
||||
<?php if ($this->session->userdata('category') != 'super') { ?>
|
||||
<td>
|
||||
<button data-toggle="modal" data-target="#payCommission" class="btn btn-danger payCommissionBtn"
|
||||
data-id_wallet_agent="<?=$row->wallet_id?>" <?php if($row->category != 'super') echo "style = 'display:none'"?> >
|
||||
<?= $this->lang->line('pay_commission_in_cash')?>
|
||||
</button>
|
||||
</td>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
@ -139,6 +155,53 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="payCommission" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title"><?php echo $this->lang->line('pay_commission_in_cash'); ?></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php if ($walletPassword != null) { ?>
|
||||
<form id="payCommissionForm">
|
||||
<div class="form-group">
|
||||
<label for="montant" class="col-form-label"><?php echo $this->lang->line('Montant') ?></label>
|
||||
<input type="text" required class="form-control" id="montant" name="montant" >
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo $this->lang->line('mot de passe') ?></label>
|
||||
<div class="input-group" id="show_hide_password">
|
||||
<input class="form-control" name="password" id="password" type="password">
|
||||
<div class="input-group-addon">
|
||||
<a href=""><i class="fa fa-eye-slash" aria-hidden="true"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<a href="#" id="resetPassword" class="pull-right forgot-password" data-wallet_password_id="<?php echo $walletPassword->id ?>" data-network="<?php echo $network ?>" data-country="<?php echo $country ?>"
|
||||
data-email="<?php echo $walletPassword->email ?>">
|
||||
<?php echo $this->lang->line('i_forgot_password') ?>
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
<?php }else{ ?>
|
||||
<div class="text-center">
|
||||
<h4> <?php echo $this->lang->line('no_wallet_password') ?></h4>
|
||||
<a href="<?php echo base_url('index.php/Hyperviseur_dash/walletPassword') ?>" alt="" class="btn btn-primary"><?php echo $this->lang->line('click_here') ?></a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||
<?php if ($walletPassword != null) { ?>
|
||||
<button type="button" class="btn btn-primary" data-salt="<?php echo $walletPassword->salt ?>" data-encrypted_password="<?php echo $walletPassword->encrypted_password ?>" id="pay" >
|
||||
<?php echo $this->lang->line('recharge'); ?>
|
||||
</button>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
|
@ -171,10 +234,25 @@
|
|||
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js"></script>
|
||||
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/autonumeric@4.5.4"></script>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
anElement = new AutoNumeric('#montant', '', {digitGroupSeparator: ' ', decimalPlaces:'0', minimumValue : '1' , maximumValue: '99999999999999999999999999'});
|
||||
$("#show_hide_password a").on('click', function(event) {
|
||||
event.preventDefault();
|
||||
if($('#show_hide_password input').attr("type") == "text"){
|
||||
$('#show_hide_password input').attr('type', 'password');
|
||||
$('#show_hide_password i').addClass( "fa-eye-slash" );
|
||||
$('#show_hide_password i').removeClass( "fa-eye" );
|
||||
}else if($('#show_hide_password input').attr("type") == "password"){
|
||||
$('#show_hide_password input').attr('type', 'text');
|
||||
$('#show_hide_password i').removeClass( "fa-eye-slash" );
|
||||
$('#show_hide_password i').addClass( "fa-eye" );
|
||||
}
|
||||
});
|
||||
|
||||
const lang = $('table').data('lang');
|
||||
var rows = $('table').data('rows');
|
||||
var currency = $('table').data('currency');
|
||||
|
@ -281,4 +359,101 @@
|
|||
table.buttons().container()
|
||||
.appendTo('#example_wrapper .col-sm-6:eq(0)');
|
||||
});
|
||||
|
||||
var id_wallet_agent = null;
|
||||
|
||||
$('.payCommissionBtn').click(function () {
|
||||
id_wallet_agent = $(this).data('id_wallet_agent');
|
||||
})
|
||||
|
||||
$('#resetPassword').click(function () {
|
||||
const wallet_password_id = $(this).data('wallet_password_id');
|
||||
const network = $(this).data('network');
|
||||
const country = $(this).data('country');
|
||||
const email = $(this).data('email');
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('index.php/Hyperviseur_dash/resetWalletPassword')?>',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
"wallet_password_id": wallet_password_id,
|
||||
"email": email,
|
||||
"network" : network ,
|
||||
"country" : country
|
||||
},
|
||||
success: function (data) {
|
||||
if(data=='200'){
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: "<?php echo $this->lang->line('password_has_been_reset')?>",
|
||||
text:"<?php echo $this->lang->line('informations_updated')?>",
|
||||
timer: 3000
|
||||
}).then(()=>{
|
||||
location.reload();
|
||||
});
|
||||
// alert("Les informations ont été mises à jour.") ? "" :
|
||||
}else{
|
||||
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
||||
}
|
||||
},
|
||||
|
||||
error: function (resultat, statut, error) {
|
||||
console.log(resultat + " " + error);
|
||||
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#pay').click(function () {
|
||||
|
||||
const salt = $(this).data('salt');
|
||||
const encrypted_password = $(this).data('encrypted_password');
|
||||
|
||||
if ($('#payCommissionForm')[0].checkValidity()) {
|
||||
const montant = anElement.getNumber(); //parseFloat($('#montant').val());
|
||||
const password = $('#password').val();
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('index.php/Hyperviseur_dash/pay_commission_in_cash')?>',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
"id_wallet_agent" : id_wallet_agent,
|
||||
"montant": montant ,
|
||||
"password": password,
|
||||
"salt" : salt,
|
||||
"encrypted_password" : encrypted_password
|
||||
},
|
||||
success: function (data) {
|
||||
if(data=='200'){
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: "<?php echo $this->lang->line('payment_done')?>",
|
||||
text: "<?php echo $this->lang->line('informations_updated')?>",
|
||||
timer: 3000
|
||||
}).then(()=>{
|
||||
location.reload();
|
||||
});
|
||||
// alert("Les informations ont été mises à jour.") ? "" :
|
||||
}else if(data == '400'){
|
||||
toastr.error("<?php echo $this->lang->line('incorrect_password')?>" , "<?php echo $this->lang->line('request_error')?>");
|
||||
}else{
|
||||
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
||||
}
|
||||
},
|
||||
|
||||
error: function (resultat, statut, error) {
|
||||
console.log(resultat + " " + error);
|
||||
toastr.error("<?php echo $this->lang->line('error_message')?>" , "<?php echo $this->lang->line('request_error')?>");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
$('#payCommissionForm')[0].reportValidity();
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,290 @@
|
|||
<!-- DataTables -->
|
||||
<link rel="stylesheet"
|
||||
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css">
|
||||
|
||||
<div class="content-wrapper">
|
||||
<?php
|
||||
|
||||
use Brick\Money\Context\AutoContext;
|
||||
use Brick\Money\CurrencyConverter;
|
||||
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
|
||||
use Brick\Money\ExchangeRateProvider\PDOProvider;
|
||||
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
|
||||
use Brick\Money\Money;
|
||||
|
||||
// set to whatever your rates are relative to
|
||||
$baseCurrency = 'USD';
|
||||
|
||||
// use your own credentials, or re-use your existing PDO connection
|
||||
$pdo = new PDO('mysql:host=' . $this->db->hostname . ';dbname=' . $this->db->database, $this->db->username, $this->db->password);
|
||||
|
||||
$configuration = new PDOProviderConfiguration();
|
||||
|
||||
$configuration->tableName = 'exchange_rate';
|
||||
$configuration->exchangeRateColumnName = 'exchange_rate';
|
||||
$configuration->targetCurrencyColumnName = 'target_currency';
|
||||
$configuration->sourceCurrencyCode = $baseCurrency;
|
||||
|
||||
// this provider loads exchange rates from your database
|
||||
$provider = new PDOProvider($pdo, $configuration);
|
||||
|
||||
// this provider calculates exchange rates relative to the base currency
|
||||
$provider = new BaseCurrencyProvider($provider, $baseCurrency);
|
||||
|
||||
// this currency converter can now handle any currency pair
|
||||
$converter = new CurrencyConverter($provider);
|
||||
$context = new AutoContext();
|
||||
|
||||
?>
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
|
||||
<h1>
|
||||
<?php echo $this->lang->line('commission_payments_history');
|
||||
echo ' ' . $network . ' - ' . $country; ?>
|
||||
<!-- <input type="button" class="btn btn-primary pull-right" id="Bactiver"-->
|
||||
<!-- value="Activer/Désactiver le(s) réseau(x)" />-->
|
||||
</h1>
|
||||
<?php
|
||||
$site_url = base_url();
|
||||
|
||||
if ($alert == "ok") {
|
||||
|
||||
if (!$success == "ok") {
|
||||
?>
|
||||
<div class='alert alert-danger alert-dismissible col-xs-6'>
|
||||
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
|
||||
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
|
||||
<?php echo $message; ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="alert alert-success alert-dismissible col-xs-6">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h4><i class="icon fa fa-check"></i> Success!</h4>
|
||||
<?php echo $message; ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</section>
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-aqua"><i class="ion ion-android-time"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text"><?php echo $this->lang->line('Période') ?> </span>
|
||||
<span class="info-box-number">
|
||||
<input id="picker"
|
||||
style="background: #fff; cursor: pointer; padding: 1px 1px; border: 1px solid #ccc; width: 100%"
|
||||
data-category="<?php echo isset($category) ? $category : null ?>"
|
||||
type="text" name="daterange"
|
||||
data-lang="<?php echo $this->session->userdata('site_lang') ?>"
|
||||
value="<?php echo ($startDate != null & $endDate != null) ? $startDate . ' - ' . $endDate : '' ?>"/>
|
||||
|
||||
</span>
|
||||
<span> Format : <?php echo $this->session->userdata('site_lang') === 'french' ? 'Jour - Mois - Année ' : 'Year - Month - Day' ?> </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php echo $this->lang->line('commission_payments_history'); ?></h3>
|
||||
</div>
|
||||
<div class="box-body" style="overflow-x:auto;">
|
||||
<?php
|
||||
if ($payments){
|
||||
$numrows = $payments->num_rows();
|
||||
$num = 0;
|
||||
if ($numrows > 0) {
|
||||
$fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||
?>
|
||||
|
||||
<table id="transactions" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align='center'>N°</th>
|
||||
<th>Agent</th>
|
||||
<th><?php echo $this->lang->line('Montant') ?></th>
|
||||
<th><?php echo $this->lang->line('initial_commission') ?></th>
|
||||
<th><?php echo $this->lang->line('final_commission') ?></th>
|
||||
<th align='center'>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
|
||||
foreach ($payments->result() as $row) {
|
||||
$num++;
|
||||
echo "<tr>
|
||||
<td align='center' >$num</td>
|
||||
<td>" . $row->lastname . "</td>
|
||||
<td>" . Money::of(round($row->amount, 2), $row->currency_code, $context)->formatTo('fr_FR') . "</td>
|
||||
<td>" . Money::of(round($row->initial_commission, 2), $row->currency_code, $context)->formatTo('fr_FR') . "</td>
|
||||
<td>" . Money::of(round($row->final_commission, 2), $row->currency_code, $context)->formatTo('fr_FR') . "</td>
|
||||
<td>" . $row->date . "</td>
|
||||
</tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
echo $this->lang->line('no_refund');
|
||||
}
|
||||
} else {
|
||||
echo $this->lang->line('no_refund');
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- jQuery 3 -->
|
||||
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
|
||||
<!-- DataTables -->
|
||||
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
|
||||
<!-- SlimScroll -->
|
||||
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
|
||||
<!-- FastClick -->
|
||||
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
|
||||
<!-- AdminLTE for demo purposes -->
|
||||
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
|
||||
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment-with-locales.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.19/sorting/datetime-moment.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.20/dataRender/datetime.js"></script
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.20/dataRender/datetime.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.html5.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.colVis.min.js"></script>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
const lang = $('#picker').data('lang');
|
||||
const format = lang === 'french' ? 'fr' : 'en';
|
||||
moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date
|
||||
$('#transactions').DataTable({
|
||||
"aaSorting": [[5, "desc"]],
|
||||
"columnDefs": [{
|
||||
targets: 5,
|
||||
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
|
||||
}],
|
||||
dom: 'Bfrtip',
|
||||
"buttons": [
|
||||
'pageLength',
|
||||
{
|
||||
"extend": 'excelHtml5',
|
||||
title: "<?= $this->lang->line('commission_payments_history') ?>",
|
||||
customizeData: function (data) {
|
||||
for (var i = 0; i < data.body.length; i++) {
|
||||
for (var j = 0; j < data.body[i].length; j++) {
|
||||
// data.body[i][j] = '\u200C' + data.body[i][j];
|
||||
if ([2,3,4].includes(j)) {
|
||||
// Get the value and strip the non numeric characters
|
||||
// var value = $(this).text();
|
||||
value = data.body[i][j].replace(',', ".")
|
||||
data.body[i][j] = Number(value.replace(/[^0-9\.-]+/g, ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
trim: false,
|
||||
},
|
||||
{
|
||||
extend: 'csvHtml5',
|
||||
title: "<?= $this->lang->line('commission_payments_history') ?>",
|
||||
customizeData: function (data) {
|
||||
for (var i = 0; i < data.body.length; i++) {
|
||||
for (var j = 0; j < data.body[i].length; j++) {
|
||||
// data.body[i][j] = '\u200C' + data.body[i][j];
|
||||
if ([2,3,4].includes(j)) {
|
||||
// Get the value and strip the non numeric characters
|
||||
// var value = $(this).text();
|
||||
value = data.body[i][j].replace(',', ".")
|
||||
data.body[i][j] = Number(value.replace(/[^0-9\.-]+/g, ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
trim: false,
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LEGAL',
|
||||
title: "<?= $this->lang->line('commission_payments_history') ?>",
|
||||
trim: false,
|
||||
},
|
||||
// 'colvis'
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var startDate;
|
||||
var endDate;
|
||||
|
||||
$(function () {
|
||||
const lang = $('#picker').data('lang');
|
||||
const category = $('#picker').data('category');
|
||||
const id_network = "<?= $id_network?>";
|
||||
$('input[name="daterange"]').daterangepicker({
|
||||
opens: 'left',
|
||||
autoUpdateInput: false,
|
||||
locale: {
|
||||
format: lang === 'french' ? 'DD-MM-YYYY' : 'YYYY-MM-DD',
|
||||
cancelLabel: 'Clear'
|
||||
}
|
||||
}, function (start, end, label) {
|
||||
const debut = start.format('YYYY-MM-DD');
|
||||
const fin = end.format('YYYY-MM-DD');
|
||||
if (category)
|
||||
window.location = "<?php echo current_url()?>" + "?history=commission_payments" + "&d=" + debut + "&f=" + fin;
|
||||
else
|
||||
window.location = "<?php echo current_url()?>" + "?id="+id_network+"&history=commission_payments" + "&d=" + debut + "&f=" + fin;
|
||||
|
||||
});
|
||||
|
||||
$('input[name="daterange"]').on('cancel.daterangepicker', function (ev, picker) {
|
||||
//do something, like clearing an input
|
||||
$('#daterange').val('');
|
||||
if (category)
|
||||
window.location = "<?php echo current_url()?>" + "?history=commission_payments";
|
||||
else
|
||||
window.location = "<?php echo current_url()?>" + "?id="+id_network+"&history=commission_payments";
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
}else{
|
||||
?>
|
||||
<td><span class="label label-danger"><?= $this->lang->line('Inactif'); ?></span></td>
|
||||
<td><button type="button" data-id-operator-country="<?= $row->id ?>" data-id-network="<?= $this->session->userdata('network_id') ?>" class="btn btn-primary activeOperator" ><?php echo $this->lang->line('Activer'); ?></button></td>
|
||||
<td><button type="button" data-id-operator-country="<?= $row->id ?>" data-id-network="<?= $network_id ?>" class="btn btn-primary activeOperator" ><?php echo $this->lang->line('Activer'); ?></button></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
@ -182,6 +182,7 @@
|
|||
$(document).on("click", ".activeOperator", function () {
|
||||
const id_operator_country = $(this).data('id-operator-country');
|
||||
const id_network = $(this).data('id-network');
|
||||
console.log(id_operator_country)
|
||||
$.ajax({
|
||||
url : '<?php echo base_url('index.php/Hyperviseur_dash/active_operator')?>',
|
||||
type : 'POST',
|
||||
|
|
|
@ -1,237 +1,285 @@
|
|||
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>iLink | Dashboard</title>
|
||||
<!-- Tell the browser to be responsive to screen width -->
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap/dist/css/bootstrap.min.css') ?>">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/font-awesome/css/font-awesome.min.css') ?>">
|
||||
<!-- Ionicons -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/Ionicons/css/ionicons.min.css') ?>">
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('dist/css/AdminLTE.css') ?>">
|
||||
<!-- AdminLTE Skins. Choose a skin from the css/skins
|
||||
folder instead of downloading all of them to reduce the load. -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('dist/css/skins/_all-skins.min.css') ?>">
|
||||
<link rel="shortcut icon" href="<?php echo base_url('favicon.ico') ?>" type="image/x-icon">
|
||||
<link rel="icon" href="<?php echo base_url('favicon.ico') ?>" type="image/x-icon">
|
||||
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<style media="screen">
|
||||
.img-dash {
|
||||
height: 50px !important;
|
||||
float: left !important;
|
||||
padding: 1% !important;
|
||||
}
|
||||
|
||||
.table_modified {
|
||||
font-size: 11px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<div class="wrapper">
|
||||
|
||||
<header class="main-header">
|
||||
<!-- Logo -->
|
||||
<a href="#" class="logo">
|
||||
<!-- mini logo for sidebar mini 50x50 pixels -->
|
||||
<span class="logo-mini"><b>iLink</b></span>
|
||||
<!-- logo for regular state and mobile devices -->
|
||||
<span class="logo-lg">
|
||||
<img class="img img-responsive img-dash" src="<?php echo base_url('images/logo.png') ?>">
|
||||
<b>iLink</b> World
|
||||
</span>
|
||||
</a>
|
||||
<!-- Header Navbar: style can be found in header.less -->
|
||||
<nav class="navbar navbar-static-top">
|
||||
|
||||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<!-- User Account: style can be found in dropdown.less -->
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<b><?php echo $this->session->userdata('current_network');?></b> -
|
||||
<b><?php echo $this->session->userdata('name_current_pays');?></b> -
|
||||
<b><?php echo $this->session->userdata('name_current_ville');?></b>
|
||||
- <?php echo $this->lang->line('Bienvenue'); ?> <span class="hidden-xs"><b><?php echo $lastname;?></b></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- User image -->
|
||||
<li class="user-header">
|
||||
<p>
|
||||
<?php echo $this->lang->line('administrateur'); ?>
|
||||
<small><?php echo $email;?></small>
|
||||
</p>
|
||||
</li>
|
||||
<li class="user-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-3 text-center">
|
||||
<?php echo $this->session->userdata('current_network');?>
|
||||
</div>
|
||||
<div class="col-xs-4 text-center">
|
||||
<?php echo $this->session->userdata('current_hyper');?>
|
||||
</div>
|
||||
<div class="col-xs-5 text-center">
|
||||
<?php echo $this->session->userdata('current_contact_hyper');?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
</li>
|
||||
<!-- Menu Footer-->
|
||||
<li class="user-footer">
|
||||
<div class="pull-left">
|
||||
<a href="#" data-toggle="modal" data-target="#modal-defaultSwitch" class="btn btn-default btn-flat"><?php echo $this->lang->line('Reseau'); ?></a>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a href="<?php echo base_url('index.php/Admin_dash/filter') ?>" class="btn btn-default btn-flat"><?php echo $this->lang->line('Terminer'); ?></a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<!-- Left side column. contains the logo and sidebar -->
|
||||
<aside class="main-sidebar">
|
||||
<!-- sidebar: style can be found in sidebar.less -->
|
||||
<section class="sidebar">
|
||||
<!-- sidebar menu: : style can be found in sidebar.less -->
|
||||
<ul class="sidebar-menu" data-widget="tree">
|
||||
|
||||
<li class="<?php if($active=="dash"){echo "active";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Admin_dash') ?>">
|
||||
<i class="fa fa-dashboard"></i> <span><?php echo $this->lang->line('Tableau de bord'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if($active=="members"){echo "active";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Admin/initGetAllUser_g') ?>">
|
||||
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Utilisateurs géolocalisés'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if($active=="simple_members"){echo "active";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Listes_members') ?>">
|
||||
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Utilisateurs simples'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if($active=="members_code"){echo "active";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Member_code_admin') ?>">
|
||||
<i class="fa fa-database"></i> <span><?php echo $this->lang->line('code membre'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<!--<li class="<?php //if($active=="demandes"){echo "active";} ?>">
|
||||
<a href="<?php //echo base_url('index.php/Admin/getAllDemandes') ?>">
|
||||
<i class="fa fa-ticket"></i> <span><?php //echo $this->lang->line('Demandes de crédits'); ?></span>
|
||||
</a>
|
||||
</li>-->
|
||||
<li class="<?php if($active=="deconnexion"){echo "active";} ?>">
|
||||
<a href="#" data-toggle="modal" data-target="#modal-disconnect">
|
||||
<i class="glyphicon glyphicon-off"></i> <span><?php echo $this->lang->line('Déconnexion'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
|
||||
<div class="modal fade" id="modal-defaultSwitch">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="<?php echo base_url('index.php/Admin/filtreData')?>" method="post">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title"><?php echo $this->lang->line('Appliquer un filtre'); ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$result=$pays;
|
||||
$numrows=$result->num_rows();
|
||||
if ($numrows > 0) { ?>
|
||||
<select class="form-control input-lg" name="pays" required id="pays">
|
||||
<?php foreach($result->result() as $row) {
|
||||
echo "<option value='".$row->id."'>".$row->name."</option>";
|
||||
} ?>
|
||||
</select>
|
||||
<?php }else{
|
||||
echo $this->lang->line('Aucun pays');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$result=$hyper;
|
||||
$numrows=$result->num_rows();
|
||||
if ($numrows > 0) { ?>
|
||||
<select class="form-control input-lg" name="hyper" required id="hyper">
|
||||
<?php foreach($result->result() as $row) {
|
||||
echo "<option value='".$row->code_membre."'>".$row->lastname."-".$row->network." (".$row->code_membre.")</option>";
|
||||
} ?>
|
||||
</select>
|
||||
<?php }else{
|
||||
echo $this->lang->line('Aucun hyperviseur');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$result=$ville;
|
||||
$numrows=$result->num_rows();
|
||||
if ($numrows > 0) { ?>
|
||||
<select class="form-control input-lg" name="ville" required id="ville">
|
||||
<?php foreach($result->result() as $row) {
|
||||
echo "<option value='".$row->town_id."'>".$row->town."</option>";
|
||||
} ?>
|
||||
</select>
|
||||
<?php }else{
|
||||
echo $this->lang->line('Aucune ville');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||
<button type="submit" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal-disconnect">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="<?php echo base_url('index.php/Users/logout') ?>">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title"><?php echo $this->lang->line('Déconnexion'); ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $this->lang->line('Vous allez être déconnecté'); ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||
<button type="submit" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>iLink | Dashboard</title>
|
||||
<!-- Tell the browser to be responsive to screen width -->
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap/dist/css/bootstrap.min.css') ?>">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/font-awesome/css/font-awesome.min.css') ?>">
|
||||
<!-- Ionicons -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/Ionicons/css/ionicons.min.css') ?>">
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('dist/css/AdminLTE.css') ?>">
|
||||
<!-- AdminLTE Skins. Choose a skin from the css/skins
|
||||
folder instead of downloading all of them to reduce the load. -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('dist/css/skins/_all-skins.min.css') ?>">
|
||||
<link rel="shortcut icon" href="<?php echo base_url('favicon.ico') ?>" type="image/x-icon">
|
||||
<link rel="icon" href="<?php echo base_url('favicon.ico') ?>" type="image/x-icon">
|
||||
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<style media="screen">
|
||||
.img-dash {
|
||||
height: 50px !important;
|
||||
float: left !important;
|
||||
padding: 1% !important;
|
||||
}
|
||||
|
||||
.table_modified {
|
||||
font-size: 11px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<div class="wrapper">
|
||||
|
||||
<header class="main-header">
|
||||
<!-- Logo -->
|
||||
<a href="#" class="logo">
|
||||
<!-- mini logo for sidebar mini 50x50 pixels -->
|
||||
<span class="logo-mini"><b>iLink</b></span>
|
||||
<!-- logo for regular state and mobile devices -->
|
||||
<span class="logo-lg">
|
||||
<img class="img img-responsive img-dash" src="<?php echo base_url('images/logo.png') ?>">
|
||||
<b>iLink</b> World
|
||||
</span>
|
||||
</a>
|
||||
<!-- Header Navbar: style can be found in header.less -->
|
||||
<nav class="navbar navbar-static-top">
|
||||
|
||||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<!-- User Account: style can be found in dropdown.less -->
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<b><?php echo $this->session->userdata('current_network');?></b> -
|
||||
<b><?php echo $this->session->userdata('name_current_pays');?></b> -
|
||||
<b><?php echo $this->session->userdata('name_current_ville');?></b>
|
||||
- <?php echo $this->lang->line('Bienvenue'); ?> <span class="hidden-xs"><b><?php echo $lastname;?></b></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" style="width: 400px">
|
||||
<!-- User image -->
|
||||
<li class="user-header">
|
||||
<p>
|
||||
<?php echo $this->lang->line('administrateur'); ?>
|
||||
<small><?php echo $email;?></small>
|
||||
</p>
|
||||
</li>
|
||||
<li class="user-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-3 text-center">
|
||||
<?php echo $this->session->userdata('current_network');?>
|
||||
</div>
|
||||
<div class="col-xs-4 text-center">
|
||||
<?php echo $this->session->userdata('current_hyper');?>
|
||||
</div>
|
||||
<div class="col-xs-5 text-center">
|
||||
<?php echo $this->session->userdata('current_contact_hyper');?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
</li>
|
||||
<!-- Menu Footer-->
|
||||
<li class="user-footer">
|
||||
<div class="pull-left">
|
||||
<a href="#" data-toggle="modal" data-target="#modal-defaultSwitch" class="btn btn-default btn-flat"><?php echo $this->lang->line('Reseau'); ?></a>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a href="<?php echo base_url('index.php/Admin_dash/filter') ?>" class="btn btn-default btn-flat"><?php echo $this->lang->line('Terminer'); ?></a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<!-- Left side column. contains the logo and sidebar -->
|
||||
<aside class="main-sidebar">
|
||||
<!-- sidebar: style can be found in sidebar.less -->
|
||||
<section class="sidebar">
|
||||
<!-- sidebar menu: : style can be found in sidebar.less -->
|
||||
<ul class="sidebar-menu" data-widget="tree">
|
||||
|
||||
<li class="<?php if($active=="dash"){echo "active";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Admin_dash') ?>">
|
||||
<i class="fa fa-dashboard"></i> <span><?php echo $this->lang->line('Tableau de bord'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if($active=="members"){echo "active";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Admin/initGetAllUser_g') ?>">
|
||||
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Utilisateurs géolocalisés'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if($active=="simple_members"){echo "active";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Listes_members') ?>">
|
||||
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Utilisateurs simples'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if($active=="members_code"){echo "active";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Member_code_admin') ?>">
|
||||
<i class="fa fa-database"></i> <span><?php echo $this->lang->line('code membre'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<!--<li class="<?php //if($active=="demandes"){echo "active";} ?>">
|
||||
<a href="<?php //echo base_url('index.php/Admin/getAllDemandes') ?>">
|
||||
<i class="fa fa-ticket"></i> <span><?php //echo $this->lang->line('Demandes de crédits'); ?></span>
|
||||
</a>
|
||||
</li>-->
|
||||
<?php if ($hasWallet) {?>
|
||||
<li class="<?= "treeview " . ((strpos($active, "wallet_") !== false) ? "active menu-open" : "") ?>"
|
||||
style="height: auto;">
|
||||
<a href="#">
|
||||
<i class="fa fa-credit-card-alt"></i>
|
||||
<span><?php echo $this->lang->line('wallet_management'); ?></span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu"
|
||||
style="<?= (strpos($active, "wallet_") !== false) ? "" : "display: none;" ?>">
|
||||
<li class="<?php if ($active == "wallet_wallet") {
|
||||
echo "active";
|
||||
} ?>">
|
||||
<a href="<?php echo base_url('index.php/Admin_dash/wallet') ?>">
|
||||
<i class="glyphicon glyphicon-credit-card"></i>
|
||||
<span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if ($active == "wallet_password") {
|
||||
echo "active";
|
||||
} ?>">
|
||||
<a href="<?php echo base_url('index.php/Admin_dash/walletPassword') ?>">
|
||||
<i class="glyphicon glyphicon-lock"></i>
|
||||
<span><?php echo $this->lang->line('menu_wallet_password'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
<?php if (($hasWallet->first_row()->type == 'ilink') && ($hasWallet->first_row()->has_nano_credit)) { ?>
|
||||
<li class="<?php if ($active == "nano_credit") {
|
||||
echo "active";
|
||||
} ?>">
|
||||
<a href="<?php echo base_url('index.php/Admin_dash/nano_credit') ?>">
|
||||
<i class="fa fa-money"></i> <span>Nano credit</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="<?php if($active=="operators"){echo "active";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Admin_dash/operators') ?>">
|
||||
<i class="fa fa-building"></i> <span><?php echo $this->lang->line('operators'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php }?>
|
||||
<?php } ?>
|
||||
<li class="<?php if($active=="deconnexion"){echo "active";} ?>">
|
||||
<a href="#" data-toggle="modal" data-target="#modal-disconnect">
|
||||
<i class="glyphicon glyphicon-off"></i> <span><?php echo $this->lang->line('Déconnexion'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
|
||||
<div class="modal fade" id="modal-defaultSwitch">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="<?php echo base_url('index.php/Admin_dash/firstFilter')?>" method="post">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title"><?php echo $this->lang->line('Appliquer un filtre'); ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$result=$pays;
|
||||
$numrows=$result->num_rows();
|
||||
if ($numrows > 0) { ?>
|
||||
<select class="form-control input-lg" name="pays" required id="pays">
|
||||
<?php foreach($result->result() as $row) {
|
||||
echo "<option value='".$row->id."'>".$row->name."</option>";
|
||||
} ?>
|
||||
</select>
|
||||
<?php }else{
|
||||
echo $this->lang->line('Aucun pays');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$result=$hyper;
|
||||
$numrows=$result->num_rows();
|
||||
if ($numrows > 0) { ?>
|
||||
<select class="form-control input-lg" name="hyper" required id="hyper">
|
||||
<?php foreach($result->result() as $row) {
|
||||
echo "<option value='".$row->code_membre."'>".$row->lastname."-".$row->network." (".$row->code_membre.")</option>";
|
||||
} ?>
|
||||
</select>
|
||||
<?php }else{
|
||||
echo $this->lang->line('Aucun Admin');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$result=$ville;
|
||||
$numrows=$result->num_rows();
|
||||
if ($numrows > 0) { ?>
|
||||
<select class="form-control input-lg" name="ville" required id="ville">
|
||||
<?php foreach($result->result() as $row) {
|
||||
echo "<option value='".$row->town_id."'>".$row->town."</option>";
|
||||
} ?>
|
||||
</select>
|
||||
<?php }else{
|
||||
echo $this->lang->line('Aucune ville');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||
<button type="submit" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal-disconnect">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="<?php echo base_url('index.php/Users/logout') ?>">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title"><?php echo $this->lang->line('Déconnexion'); ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<?php echo $this->lang->line('Vous allez être déconnecté'); ?>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||
<button type="submit" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -338,9 +338,9 @@
|
|||
<script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(window).load(function() {
|
||||
$(".loader").fadeOut("1000");
|
||||
})
|
||||
$(window).on('load', function(){
|
||||
$(".loader").fadeOut("1000");
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
|
Loading…
Reference in New Issue