+ Add Etats des comptes et Historiques des transferts de commission
This commit is contained in:
parent
52d6cd5cea
commit
9f2e7ffff3
|
@ -371,7 +371,6 @@ class Hyperviseur_dash extends CI_Controller
|
|||
|
||||
} elseif ($data['hasWallet']->first_row()->type == 'ilink') {
|
||||
|
||||
$data['taxes'] = $this->user_model->getTaxes($data['idConfig']);
|
||||
$transactions = $this->user_model->getNetworkIlinTransactions($id_network);
|
||||
$data["transactions"] = array();
|
||||
$totalCommissionBanque = 0;
|
||||
|
@ -454,6 +453,10 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$data['transactions'] = $this->user_model->getTransactions($startDate, $endDate, $network_id);
|
||||
else if ($type == 'transaction_ilink')
|
||||
$data['transactions'] = $this->user_model->getIlinkTransactions($startDate, $endDate, $network_id);
|
||||
else if ($type == 'commission_transfer')
|
||||
$data['transactions'] = $this->user_model->getCommissionTransfers($startDate, $endDate, $this->session->userdata('member_code'));
|
||||
else if ($type == 'balance_statement')
|
||||
$data['wallets'] = $this->user_model->getInfosWalletAgentForHyper($this->session->userdata('network_id'));
|
||||
else
|
||||
$data['transactions'] = $this->user_model->getRecharges($startDate, $endDate, $network_id);
|
||||
|
||||
|
@ -475,6 +478,10 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$this->load->view('historique_transactions');
|
||||
else if ($type == 'transaction_ilink')
|
||||
$this->load->view('historique_transactions_ilink');
|
||||
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
|
||||
$this->load->view('historique_recharges');
|
||||
$this->load->view('footer');
|
||||
|
@ -994,8 +1001,10 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$res = $this->user_model->getSharingRate($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;
|
||||
}
|
||||
$data['networks'][] = $network;
|
||||
}
|
||||
|
@ -1092,6 +1101,11 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$this->load->view('header_hyp', $data);
|
||||
$this->load->view('config_wallet_ilink_hyp/agent_send_cash_canal');
|
||||
break;
|
||||
case 'taxes':
|
||||
$data['taxes'] = $this->user_model->getTaxes($data['idConfig']);
|
||||
$this->load->view('header_hyp', $data);
|
||||
$this->load->view('config_wallet_ilink_hyp/taxes');
|
||||
break;
|
||||
}
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
@ -1124,8 +1138,8 @@ class Hyperviseur_dash extends CI_Controller
|
|||
$network_id = $_POST['network_id'];
|
||||
$config_id = $_POST['config_id'];
|
||||
$rate = $_POST['rate'];
|
||||
|
||||
$res = $this->user_model->setSharingRate($network_id,$config_id,$rate);
|
||||
$url = $_POST['url'];
|
||||
$res = $this->user_model->setSharingRate($network_id,$config_id,$rate,$url);
|
||||
|
||||
if ($res) {
|
||||
echo json_encode("200");
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<?php
|
||||
|
||||
use Brick\Money\Context\AutoContext;
|
||||
use Brick\Money\Money;
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Superviseur_dash extends CI_Controller
|
||||
|
@ -219,8 +223,10 @@ class Superviseur_dash extends CI_Controller
|
|||
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||
|
||||
if ($this->input->get('history')) {
|
||||
$this->historique($id_network, $this->input->get('d'), $this->input->get('f'), $this->session->userdata('member_code'));
|
||||
$this->historique($id_network, $this->input->get('d'), $this->input->get('f'), $this->session->userdata('member_code'),
|
||||
$this->input->get('history'));
|
||||
} else {
|
||||
$context = new AutoContext();
|
||||
//Create wallet if it not exist
|
||||
$res = $this->user_model->getWallet($agent_id );
|
||||
if($res == false){
|
||||
|
@ -232,8 +238,8 @@ class Superviseur_dash extends CI_Controller
|
|||
$res = $this->user_model->getWallet($agent_id);
|
||||
if ($res!=null){
|
||||
$row = $res->first_row();
|
||||
$data["commission"] = $row->balance_com;
|
||||
$data["principal"] = $row->balance_princ;
|
||||
$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');
|
||||
$agents_g = $this->user_model->getUsersGeolocatedForSup($this->session->userdata('member_code'));
|
||||
$data['agents_g'] = $agents_g;
|
||||
|
||||
|
@ -243,7 +249,11 @@ class Superviseur_dash extends CI_Controller
|
|||
foreach($agents_g->result() AS $row){
|
||||
$wallet = $this->user_model->getWallet($row->agent_id);
|
||||
if($wallet){
|
||||
$transactions = $this->user_model->getAgentTransactions($wallet->first_row()->wallet_id);
|
||||
if ($data['hasWallet']->first_row()->type == 'visa') {
|
||||
$transactions = $this->user_model->getAgentTransactions($wallet->first_row()->wallet_id);
|
||||
} elseif ($data['hasWallet']->first_row()->type == 'ilink') {
|
||||
$transactions = $this->user_model->getAgentiLinkTransactions($wallet->first_row()->wallet_id);
|
||||
}
|
||||
if($transactions){
|
||||
foreach($transactions->result() AS $trans){
|
||||
$trans->agent_id = $row->agent_id ; // Add agent id to transaction
|
||||
|
@ -261,6 +271,7 @@ class Superviseur_dash extends CI_Controller
|
|||
}
|
||||
|
||||
|
||||
$data['currency_code'] = $this->session->userdata('currency_code');
|
||||
$data['alert'] = "";
|
||||
$data['active'] = "wallet";
|
||||
$data['token'] = $this->session->userdata('token');
|
||||
|
@ -279,21 +290,31 @@ class Superviseur_dash extends CI_Controller
|
|||
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
|
||||
$data['geolocated_user'] = $this->user_model->getSuperNameAndCodeForSup($this->session->userdata('member_code'));
|
||||
$this->load->view('header_sup',$data);
|
||||
$this->load->view('gestion_wallet_sup');
|
||||
if ($data['hasWallet']->first_row()->type == 'visa')
|
||||
$this->load->view('gestion_wallet_sup');
|
||||
elseif ($data['hasWallet']->first_row()->type == 'ilink')
|
||||
$this->load->view('gestion_wallet_sup_ilink');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private function historique($network_id, $startDate, $endDate, $codeMembre)
|
||||
private function historique($network_id, $startDate, $endDate, $codeMembre, $type)
|
||||
{
|
||||
$data['configWallet'] = $this->user_model->getConfigWallet($network_id);
|
||||
$format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d';
|
||||
$data['startDate'] = $startDate ? date($format, strtotime($startDate)) : null;
|
||||
$data['endDate'] = $endDate ? date($format, strtotime($endDate)) : null;
|
||||
$endDate = Date('Y-m-d', strtotime($endDate . "+1 day"));
|
||||
$data['transactions'] = $this->user_model->getTransactionsSup($startDate, $endDate, $codeMembre);
|
||||
if ($type == 'transaction')
|
||||
$data['transactions'] = $this->user_model->getTransactionsSup($startDate, $endDate, $codeMembre);
|
||||
else if ($type == 'transaction_ilink')
|
||||
$data['transactions'] = $this->user_model->getIlinkTransactionsSup($startDate, $endDate, $codeMembre);
|
||||
else if ($type == 'commission_transfer')
|
||||
$data['transactions'] = $this->user_model->getCommissionTransfers($startDate, $endDate, $this->session->userdata('member_code'));
|
||||
else if ($type == 'balance_statement')
|
||||
$data['wallets'] = $this->user_model->getInfosWalletAgentForSuper($codeMembre);
|
||||
|
||||
$data['active'] = "wallet";
|
||||
$data['alert'] = "";
|
||||
|
@ -310,7 +331,14 @@ class Superviseur_dash extends CI_Controller
|
|||
$data['geolocated_user'] = $this->user_model->getSuperNameAndCodeForSup($this->session->userdata('member_code'));
|
||||
|
||||
$this->load->view('header_sup', $data);
|
||||
$this->load->view('historique_transactions');
|
||||
if ($type == 'transaction')
|
||||
$this->load->view('historique_transactions');
|
||||
else if ($type == 'transaction_ilink')
|
||||
$this->load->view('historique_transactions_ilink');
|
||||
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');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -317,21 +317,21 @@
|
|||
$lang['no_geolocated_agent'] = 'Aucun utilisateur géolocalisé';
|
||||
$lang['choose_wallet_type'] = 'Choisissez le type de wallet';
|
||||
$lang['rate'] = 'Taux';
|
||||
$lang['rate_com_user_wallet_wallet_international'] = 'Taux de commission utilisateur wallet à wallet pays etranger';
|
||||
$lang['rate_com_user_wallet_wallet_national'] = 'Taux de commission utilisateur wallet à wallet national';
|
||||
$lang['rate_com_user_wallet_wallet_international'] = 'Taux de commission du client sur opération d\'envoi de wallet à wallet pays etranger';
|
||||
$lang['rate_com_user_wallet_wallet_national'] = 'Taux de commission du client sur opération d\'envoi de wallet à wallet national';
|
||||
$lang['new_level'] = 'Nouveau palier';
|
||||
$lang['rate_com_user_wallet_cash_international'] = 'Taux de commission utilisateur wallet à cash pays etranger';
|
||||
$lang['rate_com_user_wallet_cash_national'] = 'Taux de commission utilisateur wallet à cash national';
|
||||
$lang['rate_com_user_wallet_cart'] = 'Taux de commission utilisateur wallet à carte';
|
||||
$lang['rate_com_user_cart_wallet'] = 'Taux de commission utilisateur carte à wallet';
|
||||
$lang['rate_com_user_wallet_cash_international'] = 'Taux de commission du client sur opération d\'envoi de wallet à cash pays etranger';
|
||||
$lang['rate_com_user_wallet_cash_national'] = 'Taux de commission du client sur opération d\'envoi de wallet à cash national';
|
||||
$lang['rate_com_user_wallet_cart'] = 'Taux de commission du client sur opération d\'envoi de wallet à carte';
|
||||
$lang['rate_com_user_cart_wallet'] = 'Taux de commission du client sur opération d\'envoi de carte à wallet';
|
||||
$lang['rate_com_user_cart_cash'] = 'Taux de commission utilisateur carte à cash';
|
||||
$lang['rate_com_agent_depot_wallet_national'] = 'Taux de commission agent depot vers wallet iLink national';
|
||||
$lang['rate_com_agent_depot_wallet_international'] = 'Taux de commission agent depot vers wallet iLink etranger';
|
||||
$lang['rate_com_agent_depot_autre_wallet_national'] = 'Taux de commission agent depot vers autre wallet national';
|
||||
$lang['rate_com_agent_depot_autre_wallet_international'] = 'Taux de commission agent depot vers autre wallet etranger';
|
||||
$lang['rate_com_agent_depot_cash_cart'] = 'Taux de commission agent depot cash vers carte';
|
||||
$lang['rate_com_agent_cash_cash_national'] = 'Taux de commission agent envoi cash vers cash national';
|
||||
$lang['rate_com_agent_cash_cash_international'] = 'Taux de commission agent envoi cash vers cash pays etranger';
|
||||
$lang['rate_com_agent_depot_wallet_national'] = 'Taux de commission du client sur opération d\'envoi vers wallet iLink national';
|
||||
$lang['rate_com_agent_depot_wallet_international'] = 'Taux de commission du client sur opération d\'envoi vers wallet iLink etranger';
|
||||
$lang['rate_com_agent_depot_autre_wallet_national'] = 'Taux de commission du client sur opération d\'envoi vers autre wallet national';
|
||||
$lang['rate_com_agent_depot_autre_wallet_international'] = 'Taux de commission du client sur opération d\'envoi vers autre wallet etranger';
|
||||
$lang['rate_com_agent_depot_cash_cart'] = 'Taux de commission du client sur opération d\'envoi de cash vers carte';
|
||||
$lang['rate_com_agent_cash_cash_national'] = 'Taux de commission du client sur opération d\'envoi de cash vers cash national';
|
||||
$lang['rate_com_agent_cash_cash_international'] = 'Taux de commission du client sur opération d\'envoi cash vers cash pays etranger';
|
||||
$lang['rate_com_agent_send_cash'] = 'Taux de commission de l\'agent géolocalisé sur operation d\'envoi d\'argent ';
|
||||
$lang['rate_com_sup_send_cash'] = 'Taux de commission du superviseur sur operation d\'envoi d\'argent ';
|
||||
$lang['rate_com_hyp_send_cash'] = 'Taux de commission de l\'hyperviseur sur operation d\'envoi d\'argent ';
|
||||
|
@ -346,7 +346,7 @@
|
|||
$lang['rate_com_sup_remove_cart'] = 'Taux de commission superviseur sur operation de retrait dans carte ';
|
||||
$lang['rate_com_hyp_remove_cart'] = 'Taux de commission hyperviseur sur operation de retrait dans carte ';
|
||||
$lang['rate_com_bq_remove_cart'] = 'Taux de commission de la banque sur operation de retrait dans carte ';
|
||||
$lang['rate_com_agent_cart_cash'] = 'Taux de commission de l\'agent géolocalisé sur retrait carte à cash ';
|
||||
$lang['rate_com_agent_cart_cash'] = 'Taux de commission du client chez l\'agent géolocalisé sur retrait carte à cash ';
|
||||
$lang['rate_com_agent_cash_cart'] = 'Taux de commission de l\'agent géolocalisé sur depot cash vers carte ';
|
||||
$lang['rate_com_hyp_remove_cart_ilink'] = 'Taux de commission hyperviseur sur operation de retrait dans carte pour utilisateur iLink ';
|
||||
$lang['rate_com_bq_remove_cart_ilink'] = 'Taux de commission banque sur operation de retrait dans carte pour utilisateur iLink ';
|
||||
|
@ -428,6 +428,19 @@ $lang['config_ilink_agent_remove_cash'] = 'Retrait d’argent';
|
|||
$lang['config_ilink_agent_remove_carte_cash'] = 'Retrait de la carte vers cash';
|
||||
$lang['config_ilink_agent_send_cash_carte'] = 'Envoi de cash vers une carte visa';
|
||||
$lang['config_ilink_agent_send_cash_canal'] = 'Envoi de cash vers un autre canal ( Wallet ou cash)';
|
||||
$lang['config_user'] = 'Configuration utilisateur';
|
||||
$lang['config_user'] = 'Configuration client';
|
||||
$lang['config_agent'] = 'Configuration agent';
|
||||
$lang['config_ilink_note'] = 'Le partage des commissions se fait entre l\'hyperviseur et le réseau payeur !';
|
||||
$lang['configure_paying_network'] = 'Configurer le réseau payeur';
|
||||
$lang['paying_network_updated'] = 'Réseau payeur mis à jour';
|
||||
$lang['commission_transfer_historic'] = 'Historique des transferts de commission';
|
||||
$lang['init_balance_princ'] = 'Solde principal initial';
|
||||
$lang['init_balance_com'] = 'Solde commission initial';
|
||||
$lang['final_balance_princ'] = 'Solde principal final';
|
||||
$lang['final_balance_com'] = 'Solde commission final';
|
||||
$lang['export_commission_transfer_history'] = 'Exporter l\'historique des transferts de commission affichés';
|
||||
$lang['export_transaction_history'] = 'Exporter l\'historique des transactions affichées';
|
||||
$lang['export_balance_statement'] = 'Exporter l\'état actuel des comptes';
|
||||
$lang['balance_statement'] = 'État des comptes';
|
||||
$lang['created_date'] ='Date de creation';
|
||||
?>
|
||||
|
|
|
@ -2152,6 +2152,17 @@ class User_model extends CI_Model
|
|||
}
|
||||
}
|
||||
|
||||
public function getAgentiLinkTransactions($id_wallet){
|
||||
$query = $this->db->query("SELECT *
|
||||
FROM infos_ilink_transaction
|
||||
WHERE `id_wallet_ag`= '".$id_wallet."'");
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getNetworkHyper($id_network){
|
||||
$sql = "SELECT * FROM `hyper_infos` WHERE network_id = ?";
|
||||
$query = $this->db->query($sql , array($id_network));
|
||||
|
@ -2474,21 +2485,21 @@ class User_model extends CI_Model
|
|||
}
|
||||
}
|
||||
|
||||
public function setSharingRate($network_id,$config_id,$rate){
|
||||
public function setSharingRate($network_id,$config_id,$rate, $url){
|
||||
$sql = "SELECT * FROM `paying_networks` WHERE `id_network` = ? AND id_configWallet = ? ;";
|
||||
$query = $this->db->query($sql , array($network_id,$config_id));
|
||||
if($query->num_rows()>0){
|
||||
$sql = "UPDATE `paying_networks` SET `taux_partage` = ? WHERE `id_network` = ? AND id_configWallet = ? ;";
|
||||
$this->db->query($sql , array($rate,$network_id,$config_id));
|
||||
$sql = "UPDATE `paying_networks` SET `taux_partage` = ? ,`url` = ? WHERE `id_network` = ? AND id_configWallet = ? ;";
|
||||
$this->db->query($sql , array($rate, $url, $network_id,$config_id));
|
||||
}else{
|
||||
$sql = "INSERT INTO `paying_networks` (`id_network`, `taux_partage`, `id_configWallet`) VALUES ( ?, ? ,?); ;";
|
||||
$this->db->query($sql , array($network_id,$rate,$config_id));
|
||||
$sql = "INSERT INTO `paying_networks` (`id_network`, `taux_partage`, `url`, `id_configWallet`) VALUES ( ?, ?, ? ,?); ;";
|
||||
$this->db->query($sql , array($network_id,$rate,$url,$config_id));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getSharingRate($id_network ,$idConfig){
|
||||
$sql = "SELECT taux_partage FROM `paying_networks` WHERE `id_network` = ? AND id_configWallet = ? ;";
|
||||
$sql = "SELECT taux_partage , url FROM `paying_networks` WHERE `id_network` = ? AND id_configWallet = ? ;";
|
||||
$query = $this->db->query($sql , array($id_network,$idConfig));
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
|
@ -2571,4 +2582,39 @@ class User_model extends CI_Model
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getCommissionTransfers($debut , $fin , $codeMembre){
|
||||
$chain = $debut ? " AND date BETWEEN '".$debut."' AND '".$fin."'" : "";
|
||||
$query = $this->db->query("SELECT *
|
||||
FROM infos_transferts_commission
|
||||
WHERE `codeParrain`='".$codeMembre."'".$chain);
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getIlinkTransactionsSup($debut , $fin , $codeMembre){
|
||||
$chain = $debut ? " AND date BETWEEN '".$debut."' AND '".$fin."'" : "";
|
||||
$query = $this->db->query("SELECT *
|
||||
FROM infos_ilink_transaction
|
||||
WHERE `code_parrain`='".$codeMembre."'".$chain);
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getInfosWalletAgentForSuper($codeMembre){
|
||||
$query = $this->db->query("SELECT *
|
||||
FROM wallet_agent
|
||||
WHERE `codeParrain`='".$codeMembre."'");
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,212 @@
|
|||
<!-- 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">
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
|
||||
<div class="content-wrapper">
|
||||
<?php
|
||||
|
||||
use Brick\Money\Context\AutoContext;
|
||||
use Brick\Money\Context\CustomContext;
|
||||
use Carbon\Carbon;
|
||||
use Brick\Money\CurrencyConverter;
|
||||
use Brick\Money\ExchangeRateProvider\PDOProvider;
|
||||
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
|
||||
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
|
||||
use Brick\Math\RoundingMode;
|
||||
use Brick\Money\Money;
|
||||
|
||||
function toLocateDate($date , $timezone){
|
||||
if($date){
|
||||
$carbon = Carbon::createFromFormat('Y-m-d H:i:s', $date, 'UTC');
|
||||
$carbon->setTimezone($timezone);
|
||||
return $carbon->toDateTimeString();
|
||||
}
|
||||
return $date;
|
||||
}
|
||||
?>
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
|
||||
<h1>
|
||||
<?php echo isset($category) ? 'Wallet' : $this->lang->line('Gestion des wallets') ; echo ' '.$network.' - '.$country
|
||||
.' :: '.$this->lang->line('balance_statement'); ?>
|
||||
<!-- <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
|
||||
}
|
||||
}
|
||||
// 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();
|
||||
?>
|
||||
</section>
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php echo $this->lang->line('export_balance_statement') ?></h3>
|
||||
</div>
|
||||
<div class="box-body" style="overflow-x:auto;">
|
||||
<?php
|
||||
if($wallets){
|
||||
$numrows = $wallets->num_rows();
|
||||
$num = 0;
|
||||
if ($numrows > 0) {
|
||||
$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
|
||||
?>
|
||||
|
||||
<table id="transactions" class="table table-bordered table-striped" data-lang="<?php echo $this->session->userdata('site_lang') ?>">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align='center'>ID</th>
|
||||
<th><?=$this->lang->line('Solde Principal')?></th>
|
||||
<th><?=$this->lang->line('Solde Commission')?></th>
|
||||
<th><?=$this->lang->line('Telephone')?></th>
|
||||
<th><?=$this->lang->line('code membre')?></th>
|
||||
<th>Agent</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
foreach ($wallets->result() as $row) {
|
||||
$num++;
|
||||
echo "<tr>
|
||||
<td align='center' >$num</td>
|
||||
<td>".Money::of(round($row->balance_princ,2), $row->currency_code,$context)->formatTo('fr_FR')."</td>
|
||||
<td>".Money::of(round($row->balance_com,2), $row->currency_code,$context)->formatTo('fr_FR')."</td>
|
||||
<td>".$row->transactionNumber."</td>
|
||||
<td>".$row->codeMembre."</td>
|
||||
<td>".$row->lastname."</td>";
|
||||
?>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
echo $this->lang->line('Aucune transaction');
|
||||
}
|
||||
}else {
|
||||
echo $this->lang->line('Aucune transaction');
|
||||
}
|
||||
?>
|
||||
|
||||
</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/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 src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
const lang = $('table').data('lang');
|
||||
const format = lang === 'french' ? 'fr' : 'en';
|
||||
moment.updateLocale(moment.locale(format), { invalidDate: "" }); // Blank text when is invalid date
|
||||
var table = $('#transactions').DataTable({
|
||||
"aaSorting": [[ 0, "asc" ]],
|
||||
dom: 'Bfrtip',
|
||||
"buttons": [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
title: 'Etat des soldes - Date : '+moment().format("dddd, Do MMMM YYYY, h:mm:ss")
|
||||
},
|
||||
{
|
||||
extend: 'csvHtml5',
|
||||
title: 'Etat des soldes - Date : '+moment().format("dddd, Do MMMM YYYY, h:mm:ss")
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'portrait',
|
||||
pageSize: 'LEGAL',
|
||||
title: 'Etat des soldes - Date : '+moment().format("dddd, Do MMMM YYYY, h:mm:ss")
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
table.buttons().container()
|
||||
.appendTo( '#example_wrapper .col-sm-6:eq(0)' );
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,430 @@
|
|||
<link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>">
|
||||
<link rel="stylesheet"
|
||||
href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>">
|
||||
<link rel="stylesheet"
|
||||
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round|Open+Sans">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
|
||||
<style type="text/css">
|
||||
.table-wrapper {
|
||||
width: 700px;
|
||||
margin: 30px auto;
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
|
||||
}
|
||||
|
||||
.table-title {
|
||||
padding-bottom: 10px;
|
||||
margin: 0 0 10px;
|
||||
}
|
||||
|
||||
.table-title h2 {
|
||||
margin: 6px 0 0;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.table-title .add-new {
|
||||
float: right;
|
||||
height: 30px;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
text-shadow: none;
|
||||
min-width: 100px;
|
||||
border-radius: 50px;
|
||||
line-height: 13px;
|
||||
}
|
||||
|
||||
.table-title .add-new i {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
table.table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
table.table tr th, table.table tr td {
|
||||
border-color: #e9e9e9;
|
||||
}
|
||||
|
||||
table.table th i {
|
||||
font-size: 13px;
|
||||
margin: 0 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
table.table th:last-child {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
table.table td a {
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
min-width: 24px;
|
||||
}
|
||||
|
||||
table.table td a.add {
|
||||
color: #27C46B;
|
||||
}
|
||||
|
||||
table.table td a.edit {
|
||||
color: #FFC107;
|
||||
}
|
||||
|
||||
table.table td a.delete {
|
||||
color: #E34724;
|
||||
}
|
||||
|
||||
table.table td i {
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
table.table td a.add i {
|
||||
font-size: 24px;
|
||||
margin-right: -1px;
|
||||
position: relative;
|
||||
top: 3px;
|
||||
}
|
||||
|
||||
table.table .form-control {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
box-shadow: none;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
/*table.table .form-control.error {*/
|
||||
/* border-color: #f50000;*/
|
||||
/*}*/
|
||||
.error {
|
||||
border-color: #f50000;
|
||||
}
|
||||
|
||||
table.table td .add {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
<?php
|
||||
|
||||
use Brick\Money\Context\CustomContext;
|
||||
use Brick\Money\Money;
|
||||
|
||||
$context = new \Brick\Money\Context\AutoContext();
|
||||
$fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
||||
?>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
|
||||
<h1>
|
||||
<?php echo $this->lang->line('edit_tax'); ?>
|
||||
</h1>
|
||||
<?php
|
||||
$site_url = base_url();
|
||||
|
||||
if ($alert == "ok") {
|
||||
|
||||
if (!$success == "ok") {
|
||||
?>
|
||||
<div class='alert alert-danger alert-dismissible col-xs-6'>
|
||||
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
|
||||
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
|
||||
<?php echo $message; ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="alert alert-success alert-dismissible col-xs-6">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h4><i class="icon fa fa-check"></i> Success!</h4>
|
||||
<?php echo $message; ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="margin">
|
||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal-tax"
|
||||
style="width: 100%"><?php echo $this->lang->line('Modifier la configuration') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row centered">
|
||||
<div class="col-lg-6 col-lg-offset-3 col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php echo $this->lang->line('transaction_taxes'); ?></h3>
|
||||
</div>
|
||||
<div class="box-body table-responsive" style="overflow-x:auto;">
|
||||
<table class="table table-hover" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $this->lang->line('Nom') ; ?> </th>
|
||||
<th>Type</th>
|
||||
<th>Valeur</th>
|
||||
<th>Destination</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if($taxes!=false){
|
||||
foreach($taxes->result() as $row) {
|
||||
echo "<tr>
|
||||
<td>".$row->nom."</td>
|
||||
<td>".$row->type."</td>
|
||||
<td>".$row->valeur."</td>
|
||||
<td>".$row->destination."</td>".'
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="modal-tax">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h3 class="modal-title"><?php echo $this->lang->line('configuration_of_tax'); ?></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="taxForm">
|
||||
<div class="form-group" style="overflow-x:auto;">
|
||||
<div class="table-title">
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<label for="nom"
|
||||
class="col-form-label"><?php echo $this->lang->line('transaction_taxes') ; ?></label>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" class="btn btn-info add-new new5"><i class="fa fa-plus"></i> <?php echo $this->lang->line('new_tax') ; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="transactions_taxes" class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $this->lang->line('Nom') ; ?> </th>
|
||||
<th>Type</th>
|
||||
<th>Valeur</th>
|
||||
<th>Destination</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if($taxes!=false){
|
||||
foreach($taxes->result() as $row) {
|
||||
echo "<tr>
|
||||
<td>".$row->nom."</td>
|
||||
<td>".$row->type."</td>
|
||||
<td>".$row->valeur."</td>
|
||||
<td>".$row->destination."</td>".'
|
||||
<td>
|
||||
<a class="add add5" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>
|
||||
<a class="edit edit5" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>
|
||||
<a class="delete delete5" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
// ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left"
|
||||
data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||
<button type="button" id="saveTaxes" data-network-id="<?= $network_id ?>" data-id-config="<?= $idConfig ?>"
|
||||
class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<!-- jQuery 3 -->
|
||||
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
|
||||
<!-- DataTables -->
|
||||
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
|
||||
<!-- Slimscroll -->
|
||||
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
|
||||
<!-- FastClick -->
|
||||
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
|
||||
<!-- AdminLTE for demo purposes -->
|
||||
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
|
||||
|
||||
<script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
|
||||
<!-- ChartJS -->
|
||||
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
|
||||
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
|
||||
|
||||
<script>
|
||||
toastr.options.closeButton = true;
|
||||
toastr.options.closeMethod = 'fadeOut';
|
||||
toastr.options.closeDuration = 5000;
|
||||
toastr.options.closeEasing = 'swing';
|
||||
|
||||
$('#saveTaxes').click(function () {
|
||||
const network_id = $(this).data('network-id');
|
||||
const id_config = $(this).data('id-config');
|
||||
// Paliers
|
||||
var taxes = [];
|
||||
|
||||
$('#transactions_taxes tr').has('td').each(function() {
|
||||
var arrayItem = {};
|
||||
$('td', $(this)).each(function(index, item) {
|
||||
if(index < 4){
|
||||
if(index == 2)
|
||||
arrayItem[index] = parseFloat($(item).html());
|
||||
arrayItem[index] = $(item).html();
|
||||
}
|
||||
});
|
||||
taxes.push(arrayItem);
|
||||
});
|
||||
|
||||
if ($('#taxForm')[0].checkValidity()) {
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('index.php/Gestion/saveTaxes')?>',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
"network_id": network_id,"id_config" : id_config,
|
||||
"taxes" : taxes ,
|
||||
},
|
||||
success: function (data) {
|
||||
if(data=='200'){
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: "<?php echo $this->lang->line('wallet_update')?>",
|
||||
text:"<?php echo $this->lang->line('informations_updated')?>",
|
||||
timer: 3000
|
||||
}).then(()=>{
|
||||
location.reload();
|
||||
});
|
||||
|
||||
}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 {
|
||||
$('#taxForm')[0].reportValidity();
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
// Taxes
|
||||
$(document).ready(function() {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
var actions5 = $("#transactions_taxes td:last-child").html();
|
||||
// Append table with add row form on add new button click
|
||||
$(".new5").click(function(){
|
||||
if(!actions5){
|
||||
actions5 = '<a class="add add5" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>\n' +
|
||||
' <a class="edit edit5" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>\n' +
|
||||
' <a class="delete delete5" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>';
|
||||
}
|
||||
$(this).attr("disabled", "disabled");
|
||||
var index = $("#transactions_taxes tbody tr:last-child").index();
|
||||
var row = "<tr> <td><input type='text' required class='form-control' name='nom' id='nom'></td> " +
|
||||
"<td> <select class='form-control' id='type' required> <option value='%'> % </option> <option value='fixe'> fixe </option> </select> </td> "+
|
||||
"<td><input type='number' required class='form-control' min='0' name='valeur' id='valeur'></td>" +
|
||||
"<td> <select class='form-control' id='destination' required> <option value='national'> national </option> <option value='international'> international </option> </select> </td>" +
|
||||
"<td>" + actions5 + "</td>" +
|
||||
"</tr>";
|
||||
$("#transactions_taxes").append(row);
|
||||
$("#transactions_taxes tbody tr").eq(index + 1).find(".add, .edit").toggle();
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
});
|
||||
// Add row on add button click
|
||||
$(document).on("click", ".add5", function(){
|
||||
var empty = false;
|
||||
var input = $(this).parents("tr").find('input');
|
||||
var select = $(this).parents("tr").find('select');
|
||||
input.each(function(){
|
||||
if(!$(this)[0].checkValidity()){
|
||||
$(this).addClass("error");
|
||||
$(this)[0].reportValidity();
|
||||
empty = true;
|
||||
} else{
|
||||
$(this).removeClass("error");
|
||||
}
|
||||
|
||||
});
|
||||
$(this).parents("tr").find(".error").first().focus();
|
||||
if(!empty){
|
||||
select.each(function(){
|
||||
$(this).parent("td").html($(this).val());
|
||||
});
|
||||
input.each(function(){
|
||||
$(this).parent("td").html($(this).val());
|
||||
});
|
||||
$(this).parents("tr").find(".add, .edit").toggle();
|
||||
$(".new5").removeAttr("disabled");
|
||||
}
|
||||
});
|
||||
// Edit row on edit button click
|
||||
$(document).on("click", ".edit5", function(){
|
||||
$(this).parents("tr").find("td:not(:last-child)").each(function(index){
|
||||
if(index == 0)
|
||||
$(this).html('<input type="text" required class="form-control" value="' + $(this).text() + '">');
|
||||
if(index == 1)
|
||||
$(this).html("<select class='form-control' id='type' required> <option value='%' > % </option> <option value='fixe'> fixe </option> </select>");
|
||||
if(index == 2)
|
||||
$(this).html('<input type="number" required class="form-control" min="0" value="' + $(this).text() + '">');
|
||||
if(index == 3)
|
||||
$(this).html("<select class='form-control' id='destination' required> <option value='national'> national </option> <option value='international'> international </option> </select>");
|
||||
});
|
||||
$(this).parents("tr").find(".add, .edit").toggle();
|
||||
$(".new5").attr("disabled", "disabled");
|
||||
});
|
||||
// Delete row on delete button click
|
||||
$(document).on("click", ".delete5", function(){
|
||||
$(this).parents("tr").remove();
|
||||
$(".new5").removeAttr("disabled");
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -229,8 +229,10 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="callout callout-info">
|
||||
<p>Note</p>
|
||||
<h4><?php echo $this->lang->line('config_ilink_note') ?></h4>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="modal fade" id="modal-update">
|
||||
<div class="modal-dialog" style="max-width: 1200px; width: 100%;">
|
||||
|
|
|
@ -228,7 +228,10 @@ $fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="callout callout-info">
|
||||
<p>Note</p>
|
||||
<h4><?php echo $this->lang->line('config_ilink_note') ?></h4>
|
||||
</div>
|
||||
<div class="modal fade" id="modal-update">
|
||||
<div class="modal-dialog" style="max-width: 1200px; width: 100%;">
|
||||
<div class="modal-content">
|
||||
|
|
|
@ -60,7 +60,8 @@
|
|||
<th align='center'>N°</th>
|
||||
<th><?php echo $this->lang->line('Nom'); ?></th>
|
||||
<th align='center'>Wallet</th>
|
||||
<th align='center'> <?php echo $this->lang->line('share_rate')?></th>
|
||||
<th align='center'> <?php echo $this->lang->line('share_rate') ?></th>
|
||||
<th align='center'> URL</th>
|
||||
<th align='center'> Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -73,30 +74,65 @@
|
|||
echo "<tr>
|
||||
<td align='center'>$num</td>
|
||||
<td>$row->name</td>
|
||||
<td><span class='label label-success'>".strtoupper($row->type)."</span></td>";
|
||||
<td><span class='label label-success'>" . strtoupper($row->type) . "</span></td>";
|
||||
?>
|
||||
<?php
|
||||
if ($row->rate != null ) {
|
||||
if ($row->rate != null) {
|
||||
?>
|
||||
<td>
|
||||
<span class="label label-success" style="font-size: 1.1em;"><?= $row->rate . ' %'?></span>
|
||||
<span class="label label-success"
|
||||
style="font-size: 1.1em;"><?= $row->rate . ' %' ?></span>
|
||||
</td>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<td>
|
||||
<span class="label label-danger" style="font-size: 1em;" ><?php echo $this->lang->line('not_defined'); ?></span>
|
||||
<span class="label label-danger"
|
||||
style="font-size: 1em;"><?php echo $this->lang->line('not_defined'); ?></span>
|
||||
</td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<td><?= $row->url ?></td>
|
||||
<td>
|
||||
<button type="button" data-network-id="<?php echo $row->id ?>" data-config-id="<?=$idConfig?>"
|
||||
data-toggle="modal" data-target="#configureRate"
|
||||
<button type="button" data-network-id="<?php echo $row->id ?>"
|
||||
data-config-id="<?= $idConfig ?>" data-num ="<?=$num?>"
|
||||
data-toggle="modal" data-target="<?='#configureRate'.$num?>"
|
||||
class="btn btn-primary btn-block openModal">
|
||||
<b><?php echo $this->lang->line('configure_share_rate'); ?></b>
|
||||
<b><?php echo $this->lang->line('configure_paying_network'); ?></b>
|
||||
</button>
|
||||
</td>
|
||||
<div class="modal fade" id="<?='configureRate'.$num?>" 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('configure_share_rate'); ?></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="<?='rateForm'.$num?>">
|
||||
<div class="form-group">
|
||||
<label for="rate"
|
||||
class="col-form-label"><?php echo $this->lang->line('share_rate') . ' (%)'; ?></label>
|
||||
<input type="number" min="0" step=".01" max="100" required class="form-control"
|
||||
name="rate" id="<?='rate'.$num?>" value="<?=$row->rate?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="url"
|
||||
class="col-form-label">URL</label>
|
||||
<input type="text" required class="form-control" value="<?=$row->url?>"
|
||||
id="<?='url'.$num?>" name="url">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary"
|
||||
data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||
<button type="button" class="btn btn-primary enableRate">
|
||||
<?php echo $this->lang->line('Valider'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
@ -116,31 +152,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="configureRate" 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('configure_share_rate'); ?></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="rateForm">
|
||||
<div class="form-group">
|
||||
<label for="rate"
|
||||
class="col-form-label"><?php echo $this->lang->line('share_rate') . ' (%)'; ?></label>
|
||||
<input type="number" min="0" step=".01" max="100" required class="form-control"
|
||||
name="rate" id="rate" value="0">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary"
|
||||
data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||
<button type="button" class="btn btn-primary"
|
||||
id="enableRate"> <?php echo $this->lang->line('Valider'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
|
@ -177,25 +188,27 @@
|
|||
|
||||
var network_id = null;
|
||||
var config_id = null;
|
||||
var num = null;
|
||||
$(document).on("click", ".openModal", function () {
|
||||
network_id = $(this).data('network-id');
|
||||
config_id = $(this).data('config-id');
|
||||
num = $(this).data('num');
|
||||
})
|
||||
|
||||
$(document).on("click", "#enableRate", function () {
|
||||
// const network_id = $(this).data('network-id');
|
||||
if ($('#rateForm')[0].checkValidity()) {
|
||||
const rate = parseFloat($('#rate').val());
|
||||
$(document).on("click", ".enableRate", function () {
|
||||
if ($('#rateForm'+num)[0].checkValidity()) {
|
||||
const rate = parseFloat($('#rate'+num).val());
|
||||
const url = $('#url'+num).val();
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('index.php/Hyperviseur_dash/config_sharing_rate')?>',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {"network_id": network_id, "rate": rate , "config_id" : config_id},
|
||||
data: {"network_id": network_id, "rate": rate, "url": url, "config_id": config_id},
|
||||
success: function (data) {
|
||||
if (data == '200') {
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: "<?php echo $this->lang->line('sharing_updated')?>",
|
||||
title: "<?php echo $this->lang->line('paying_network_updated')?>",
|
||||
text: "<?php echo $this->lang->line('informations_updated')?>",
|
||||
timer: 3000
|
||||
}).then(() => {
|
||||
|
@ -212,8 +225,9 @@
|
|||
}
|
||||
});
|
||||
} else {
|
||||
$('#rateForm')[0].reportValidity();
|
||||
};
|
||||
$('#rateForm'+num)[0].reportValidity();
|
||||
}
|
||||
;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -306,8 +306,8 @@ $context = new \Brick\Money\Context\AutoContext();
|
|||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="margin">
|
||||
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#modal-tax"
|
||||
style="width: 100%"><?php echo $this->lang->line('edit_tax') ?></button>
|
||||
<a class="btn btn-info" href="<?php echo current_url().($network_id ? '?config=taxes' : '')?>"
|
||||
style="width: 100%"><?php echo $this->lang->line('edit_tax') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
|
@ -378,19 +378,19 @@ $context = new \Brick\Money\Context\AutoContext();
|
|||
</div>
|
||||
<div class="col-lg-3 col-xs-6">
|
||||
<a class="small-box bg-blue-active"
|
||||
href="<?php echo current_url() . ($network_id ? '?config=agent_send_cash_carte' : '') ?>">
|
||||
href="<?php echo current_url() . ($network_id ? '?config=agent_send_cash_canal' : '') ?>">
|
||||
<div class="inner">
|
||||
<h5><?php echo $this->lang->line('config_agent')?></h5>
|
||||
<h4><?php echo $this->lang->line('config_ilink_agent_send_cash_carte') ?></h4>
|
||||
<h4><?php echo $this->lang->line('config_ilink_agent_send_cash_canal') ?></h4>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-lg-3 col-xs-6">
|
||||
<a class="small-box bg-blue-active"
|
||||
href="<?php echo current_url() . ($network_id ? '?config=agent_send_cash_canal' : '') ?>">
|
||||
href="<?php echo current_url() . ($network_id ? '?config=agent_send_cash_carte' : '') ?>">
|
||||
<div class="inner">
|
||||
<h5><?php echo $this->lang->line('config_agent')?></h5>
|
||||
<h4><?php echo $this->lang->line('config_ilink_agent_send_cash_canal') ?></h4>
|
||||
<h4><?php echo $this->lang->line('config_ilink_agent_send_cash_carte') ?></h4>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
@ -436,6 +436,14 @@ $context = new \Brick\Money\Context\AutoContext();
|
|||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php echo $this->lang->line('Commissions Superviseurs') ?></h3>
|
||||
<div class="box-tools">
|
||||
<a class="btn btn-primary" href="<?php echo current_url().($network_id ? '?history=commission_transfer' : '')?>">
|
||||
<?php echo $this->lang->line('commission_transfer_historic'); ?>
|
||||
</a>
|
||||
<a class="btn btn-success" href="<?php echo current_url().($network_id ? '?history=balance_statement' : '')?>">
|
||||
<?php echo $this->lang->line('balance_statement'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body" style="overflow-x:auto;">
|
||||
<table id="example1" class="table table-bordered table-hover">
|
||||
|
@ -501,71 +509,6 @@ $context = new \Brick\Money\Context\AutoContext();
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="modal-tax">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h3 class="modal-title"><?php echo $this->lang->line('configuration_of_tax'); ?></h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="taxForm">
|
||||
<div class="form-group" style="overflow-x:auto;">
|
||||
<div class="table-title">
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<label for="nom"
|
||||
class="col-form-label"><?php echo $this->lang->line('transaction_taxes') ; ?></label>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<button type="button" class="btn btn-info add-new new5"><i class="fa fa-plus"></i> <?php echo $this->lang->line('new_tax') ; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="transactions_taxes" class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $this->lang->line('Nom') ; ?> </th>
|
||||
<th>Type</th>
|
||||
<th>Valeur</th>
|
||||
<th>Destination</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if($taxes!=false){
|
||||
foreach($taxes->result() as $row) {
|
||||
echo "<tr>
|
||||
<td>".$row->nom."</td>
|
||||
<td>".$row->type."</td>
|
||||
<td>".$row->valeur."</td>
|
||||
<td>".$row->destination."</td>".'
|
||||
<td>
|
||||
<a class="add add5" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>
|
||||
<a class="edit edit5" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>
|
||||
<a class="delete delete5" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
// ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left"
|
||||
data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||
<button type="button" id="saveTaxes" data-network-id="<?= $network_id ?>" data-id-config="<?= $idConfig ?>"
|
||||
class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="rechargeAccount" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
|
@ -714,105 +657,12 @@ $context = new \Brick\Money\Context\AutoContext();
|
|||
Pie = JSON.parse(Pie);
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
var serializeArray = function (form) {
|
||||
// Setup our serialized data
|
||||
var serialized = [];
|
||||
|
||||
// Loop through each field in the form
|
||||
var elements = document.getElementById(form).elements;
|
||||
for (var i = 0, field; field = elements[i++];) {
|
||||
|
||||
// Don't serialize fields without a name, submits, buttons, file and reset inputs, and disabled fields
|
||||
if (!field.name || field.disabled || field.type === 'file' || field.type === 'reset' || field.type === 'submit' || field.type === 'button') continue;
|
||||
|
||||
// If a multi-select, get all selections
|
||||
if (field.type === 'select-multiple') {
|
||||
for (var n = 0; n < field.options.length; n++) {
|
||||
if (!field.options[n].selected) continue;
|
||||
serialized.push({
|
||||
name: field.name,
|
||||
value: field.options[n].value
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Convert field data to a query string
|
||||
else if ((field.type !== 'checkbox' && field.type !== 'radio') || field.checked) {
|
||||
serialized.push({
|
||||
name: field.name,
|
||||
value: field.value
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return serialized;
|
||||
};
|
||||
|
||||
</script>
|
||||
<script>
|
||||
toastr.options.closeButton = true;
|
||||
toastr.options.closeMethod = 'fadeOut';
|
||||
toastr.options.closeDuration = 5000;
|
||||
toastr.options.closeEasing = 'swing';
|
||||
|
||||
$('#saveTaxes').click(function () {
|
||||
const network_id = $(this).data('network-id');
|
||||
const id_config = $(this).data('id-config');
|
||||
// Paliers
|
||||
var taxes = [];
|
||||
|
||||
$('#transactions_taxes tr').has('td').each(function() {
|
||||
var arrayItem = {};
|
||||
$('td', $(this)).each(function(index, item) {
|
||||
if(index < 4){
|
||||
if(index == 2)
|
||||
arrayItem[index] = parseFloat($(item).html());
|
||||
arrayItem[index] = $(item).html();
|
||||
}
|
||||
});
|
||||
taxes.push(arrayItem);
|
||||
});
|
||||
|
||||
if ($('#taxForm')[0].checkValidity()) {
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url('index.php/Gestion/saveTaxes')?>',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
"network_id": network_id,"id_config" : id_config,
|
||||
"taxes" : taxes ,
|
||||
},
|
||||
success: function (data) {
|
||||
if(data=='200'){
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: "<?php echo $this->lang->line('wallet_update')?>",
|
||||
text:"<?php echo $this->lang->line('informations_updated')?>",
|
||||
timer: 3000
|
||||
}).then(()=>{
|
||||
location.reload();
|
||||
});
|
||||
|
||||
}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 {
|
||||
$('#taxForm')[0].reportValidity();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('#resetPassword').click(function () {
|
||||
const wallet_password_id = $(this).data('wallet_password_id');
|
||||
const network = $(this).data('network');
|
||||
|
@ -904,79 +754,5 @@ $context = new \Brick\Money\Context\AutoContext();
|
|||
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// Taxes
|
||||
$(document).ready(function() {
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
var actions5 = $("#transactions_taxes td:last-child").html();
|
||||
// Append table with add row form on add new button click
|
||||
$(".new5").click(function(){
|
||||
if(!actions5){
|
||||
actions5 = '<a class="add add5" title="Add" data-toggle="tooltip"><i class="material-icons"></i></a>\n' +
|
||||
' <a class="edit edit5" title="Edit" data-toggle="tooltip"><i class="material-icons"></i></a>\n' +
|
||||
' <a class="delete delete5" title="Delete" data-toggle="tooltip"><i class="material-icons"></i></a>';
|
||||
}
|
||||
$(this).attr("disabled", "disabled");
|
||||
var index = $("#transactions_taxes tbody tr:last-child").index();
|
||||
var row = "<tr> <td><input type='text' required class='form-control' name='nom' id='nom'></td> " +
|
||||
"<td> <select class='form-control' id='type' required> <option value='%'> % </option> <option value='fixe'> fixe </option> </select> </td> "+
|
||||
"<td><input type='number' required class='form-control' min='0' name='valeur' id='valeur'></td>" +
|
||||
"<td> <select class='form-control' id='destination' required> <option value='national'> national </option> <option value='international'> international </option> </select> </td>" +
|
||||
"<td>" + actions5 + "</td>" +
|
||||
"</tr>";
|
||||
$("#transactions_taxes").append(row);
|
||||
$("#transactions_taxes tbody tr").eq(index + 1).find(".add, .edit").toggle();
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
});
|
||||
// Add row on add button click
|
||||
$(document).on("click", ".add5", function(){
|
||||
var empty = false;
|
||||
var input = $(this).parents("tr").find('input');
|
||||
var select = $(this).parents("tr").find('select');
|
||||
input.each(function(){
|
||||
if(!$(this)[0].checkValidity()){
|
||||
$(this).addClass("error");
|
||||
$(this)[0].reportValidity();
|
||||
empty = true;
|
||||
} else{
|
||||
$(this).removeClass("error");
|
||||
}
|
||||
|
||||
});
|
||||
$(this).parents("tr").find(".error").first().focus();
|
||||
if(!empty){
|
||||
select.each(function(){
|
||||
$(this).parent("td").html($(this).val());
|
||||
});
|
||||
input.each(function(){
|
||||
$(this).parent("td").html($(this).val());
|
||||
});
|
||||
$(this).parents("tr").find(".add, .edit").toggle();
|
||||
$(".new5").removeAttr("disabled");
|
||||
}
|
||||
});
|
||||
// Edit row on edit button click
|
||||
$(document).on("click", ".edit5", function(){
|
||||
$(this).parents("tr").find("td:not(:last-child)").each(function(index){
|
||||
if(index == 0)
|
||||
$(this).html('<input type="text" required class="form-control" value="' + $(this).text() + '">');
|
||||
if(index == 1)
|
||||
$(this).html("<select class='form-control' id='type' required> <option value='%' > % </option> <option value='fixe'> fixe </option> </select>");
|
||||
if(index == 2)
|
||||
$(this).html('<input type="number" required class="form-control" min="0" value="' + $(this).text() + '">');
|
||||
if(index == 3)
|
||||
$(this).html("<select class='form-control' id='destination' required> <option value='national'> national </option> <option value='international'> international </option> </select>");
|
||||
});
|
||||
$(this).parents("tr").find(".add, .edit").toggle();
|
||||
$(".new5").attr("disabled", "disabled");
|
||||
});
|
||||
// Delete row on delete button click
|
||||
$(document).on("click", ".delete5", function(){
|
||||
$(this).parents("tr").remove();
|
||||
$(".new5").removeAttr("disabled");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- Page script -->
|
||||
<script src="<?php echo base_url('dist/js/custom.js') ?>"></script>
|
||||
|
|
|
@ -0,0 +1,391 @@
|
|||
<link rel="stylesheet" href="<?php echo base_url('bower_components/jvectormap/jquery-jvectormap.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo base_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css') ?>">
|
||||
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
|
||||
|
||||
<?php
|
||||
use Brick\Money\Context\CustomContext;
|
||||
use Brick\Money\Money;
|
||||
$context = new \Brick\Money\Context\AutoContext();
|
||||
function convertDate($date){
|
||||
$month = null;
|
||||
switch ($date) {
|
||||
case "Jan":
|
||||
$month = 1;
|
||||
break;
|
||||
case "Feb":
|
||||
$month = 2;
|
||||
break;
|
||||
case "Mar":
|
||||
$month = 3;
|
||||
break;
|
||||
case "Apr":
|
||||
$month = 4;
|
||||
break;
|
||||
case "May":
|
||||
$month = 5;
|
||||
break;
|
||||
case "Jun":
|
||||
$month = 6;
|
||||
break;
|
||||
case "Jul":
|
||||
$month = 7;
|
||||
break;
|
||||
case "Aug":
|
||||
$month = 8;
|
||||
break;
|
||||
case "Sep":
|
||||
$month = 9;
|
||||
break;
|
||||
case "Oct":
|
||||
$month = 10;
|
||||
break;
|
||||
case "Nov":
|
||||
$month = 11;
|
||||
break;
|
||||
case "Dec":
|
||||
$month = 12;
|
||||
break;
|
||||
}
|
||||
return $month;
|
||||
}
|
||||
|
||||
$month = time();
|
||||
$months[]=convertDate(date("M"));
|
||||
$label_months [] = date("M")." ".date("Y");
|
||||
$years[]= date("Y");
|
||||
for ($i = 1; $i <= 11; $i++) {
|
||||
$month = strtotime('last month', $month);
|
||||
$months [] = convertDate(date("M", $month));
|
||||
$years[] = date("Y", $month);
|
||||
$label_months [] = date("M", $month)." ".date("Y", $month);
|
||||
}
|
||||
|
||||
/**
|
||||
** Retraits
|
||||
**/
|
||||
$date = date("Y");
|
||||
|
||||
$retraits_data[] = '';
|
||||
$retraits_data =array();
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$retraits_query_mounth = array_filter($transactions, function ($trans) use ($i, $months ,$years){
|
||||
$month = date("m",strtotime($trans->date));
|
||||
$year = date("Y",strtotime($trans->date));
|
||||
return $month == $months[$i-1] && $year == $years[$i-1] && $trans->type_transaction == 'retrait' ;
|
||||
});
|
||||
$retraits_data[] = sizeof($retraits_query_mounth);
|
||||
}
|
||||
|
||||
$startDate = (new DateTime('01-'.$months[11].'-'.$years[11]))-> format('Y-m-d H:i:s');
|
||||
$endDate = date_create_from_format ('m/Y',$months[0].'/'.$years[0])-> format('Y-m-d H:i:s');
|
||||
|
||||
$retraits = array_filter($transactions, function ($trans) use ($i, $endDate ,$startDate){
|
||||
$date = strtotime($trans->date);
|
||||
// return $date >= strtotime($startDate) && $date <= strtotime($endDate) && $trans->type == 'debit' ;
|
||||
return $trans->type_transaction == 'retrait' ;
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
** Dépots
|
||||
**/
|
||||
$date = date("Y");
|
||||
|
||||
$depots_data[] = '';
|
||||
$depots_data =array();
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$depots_query_mounth= array_filter($transactions, function ($trans) use ($i, $months ,$years){
|
||||
$month = date("m",strtotime($trans->date));
|
||||
$year = date("Y",strtotime($trans->date));
|
||||
return $month == $months[$i-1] && $year == $years[$i-1] && $trans->type_transaction == 'depot' ;
|
||||
});
|
||||
$depots_data[] = sizeof($depots_query_mounth);
|
||||
}
|
||||
$depots = array_filter($transactions, function ($trans) use ($i, $endDate ,$startDate){
|
||||
$date = strtotime($trans->date);
|
||||
// return $date >= strtotime($startDate) && $date <= strtotime($endDate) && $trans->type == 'credit' ;
|
||||
return $trans->type_transaction == 'depot' ;
|
||||
|
||||
});
|
||||
|
||||
if($transactions!=false){
|
||||
$transac=sizeof($transactions);
|
||||
$array_transac = array();
|
||||
$num = 0;
|
||||
if ($transac > 0) {
|
||||
foreach($transactions as $row) {
|
||||
$num++;
|
||||
$array_transac[] = $row->type_transaction;
|
||||
}
|
||||
$vals_transac = array_count_values($array_transac);
|
||||
$pieChart = array();
|
||||
foreach(array_keys($vals_transac) as $paramName) {
|
||||
$color = dechex(rand(0x000000, 0xFFFFFF));
|
||||
$trash = array("value" => $vals_transac[$paramName],
|
||||
"color" => "#".$color,
|
||||
"highlight" => "#".$color,
|
||||
"label" => $paramName);
|
||||
|
||||
$pieChart[]= $trash;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$pieChart = array();
|
||||
}
|
||||
$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
|
||||
?>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
|
||||
<h1>
|
||||
Wallet <?php echo $network; ?>
|
||||
</h1>
|
||||
<?php
|
||||
$site_url = base_url();
|
||||
|
||||
if($alert=="ok") {
|
||||
|
||||
if(!$success=="ok"){
|
||||
?>
|
||||
<div class='alert alert-danger alert-dismissible col-xs-6'>
|
||||
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
|
||||
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
|
||||
<?php echo $message; ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<div class="alert alert-success alert-dismissible col-xs-6">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h4><i class="icon fa fa-check"></i> Success!</h4>
|
||||
<?php echo $message; ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</section>
|
||||
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-xs-6">
|
||||
<div class="small-box bg-aqua">
|
||||
<div class="inner">
|
||||
<h3><?php echo $principal; ?></h3>
|
||||
<p><?php echo $this->lang->line('Solde Principal') ?></p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-cash"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-xs-6">
|
||||
<div class="small-box bg-green">
|
||||
<div class="inner">
|
||||
<h3><?php echo $commission; ?></h3>
|
||||
<p><?php echo $this->lang->line('Solde Commission') ?></p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-cash"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title"><?php echo $this->lang->line('Historique des 12 derniers mois'); ?></h3>
|
||||
<div class="box-tools">
|
||||
<a class="btn btn-primary" href="<?php echo current_url().($network_id ? '?history=transaction_ilink' : '')?>">
|
||||
<?php echo $this->lang->line('transactions_historic'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="chart" id="chart">
|
||||
<canvas id="barChart" style="height:230px"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<div class="box box-danger">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title"><?php echo $this->lang->line("Parts dépots & retraits"); ?></h3>
|
||||
</div>
|
||||
<div class="box-body" id="chart2">
|
||||
<canvas id="pieChart" style="height:250px"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php echo $this->lang->line('Commissions Agents') ?></h3>
|
||||
<div class="box-tools">
|
||||
<a class="btn btn-primary" href="<?php echo current_url().($network_id ? '?history=commission_transfer' : '')?>">
|
||||
<?php echo $this->lang->line('commission_transfer_historic'); ?>
|
||||
</a>
|
||||
<a class="btn btn-success" href="<?php echo current_url().($network_id ? '?history=balance_statement' : '')?>">
|
||||
<?php echo $this->lang->line('balance_statement'); ?>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body" style="overflow-x:auto;">
|
||||
<table id="example1" class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
echo "<th>".$this->lang->line('Nom')."</th>
|
||||
<th>".$this->lang->line('Solde Principal')."</th>
|
||||
<th>".$this->lang->line('Solde Commission')."</th>
|
||||
<th>".$this->lang->line('DEPOT'). 's'."</th>
|
||||
<th>".$this->lang->line('RETRAIT').'s'."</th>";
|
||||
?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
if($agents_g){
|
||||
foreach($agents_g->result() as $row) {
|
||||
$wallet = null;
|
||||
foreach ($agentWalletInfos->result() as $value) {
|
||||
if ($value->agent_id == $row->agent_id) {
|
||||
$wallet = $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$com = 0;
|
||||
$princ = 0;
|
||||
if($wallet) {
|
||||
$com = $wallet->balance_com;
|
||||
$princ = $wallet->balance_princ;
|
||||
}
|
||||
echo "<tr>
|
||||
<td>".$row->lastname."</td>
|
||||
<td>".Money::of(round($princ,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR')."</td>
|
||||
<td>".Money::of(round($com,2), $this->session->userdata('currency_code'),$context)->formatTo('fr_FR')."</td>";
|
||||
$nb_depots = 0;
|
||||
$nb_retraits = 0;
|
||||
foreach($depots as $depot){
|
||||
if($depot->agent_id == $row->agent_id) {
|
||||
$nb_depots ++;
|
||||
}
|
||||
}
|
||||
foreach($retraits as $retrait){
|
||||
if($retrait->agent_id == $row->agent_id) {
|
||||
$nb_retraits ++;
|
||||
}
|
||||
}
|
||||
echo "<td>".$nb_depots."</td>
|
||||
<td>".$nb_retraits."</td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
<!-- jQuery 3 -->
|
||||
<script src="<?php echo base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<script src="<?php echo base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
|
||||
<!-- DataTables -->
|
||||
<script src="<?php echo base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
|
||||
<!-- Slimscroll -->
|
||||
<script src="<?php echo base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
|
||||
<!-- FastClick -->
|
||||
<script src="<?php echo base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
|
||||
<!-- AdminLTE App -->
|
||||
<script src="<?php echo base_url('dist/js/adminlte.min.js') ?>"></script>
|
||||
<!-- AdminLTE for demo purposes -->
|
||||
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
|
||||
|
||||
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
|
||||
|
||||
<script src="<?php echo base_url('bower_components/moment/min/moment.min.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/bootstrap-daterangepicker/daterangepicker.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js') ?>"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
|
||||
<!-- ChartJS -->
|
||||
<script src="<?php echo base_url('bower_components/chart.js/Chart.js') ?>"></script>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$('#example1').DataTable();
|
||||
// $('#example1').DataTable({
|
||||
// "aLengthMenu": [[5, 10, 15, -1], [5, 10, 5, "All"]],
|
||||
// "iDisplayLength": 5
|
||||
// });
|
||||
// $('#example2').DataTable({
|
||||
// 'paging' : true,
|
||||
// 'lengthChange': false,
|
||||
// 'searching' : false,
|
||||
// 'ordering' : true,
|
||||
// 'info' : true,
|
||||
// 'autoWidth' : false
|
||||
// })
|
||||
})
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var areaChartData = {
|
||||
labels : <?php echo json_encode($label_months) ?>,
|
||||
datasets: [
|
||||
{
|
||||
label : 'Electronics',
|
||||
fillColor : 'rgba(255, 162, 0, 1)',
|
||||
strokeColor : 'rgba(255, 162, 0, 1)',
|
||||
pointColor : 'rgba(255, 162, 0, 1)',
|
||||
pointStrokeColor : '#ffa200',
|
||||
pointHighlightFill : '#fff',
|
||||
pointHighlightStroke: 'rgba(220,220,220,1)',
|
||||
data: <?php echo json_encode($depots_data) ?>
|
||||
},
|
||||
{
|
||||
label : 'Digital Goods',
|
||||
fillColor : 'rgba(0, 187, 255, 1)',
|
||||
strokeColor : 'rgba(0, 187, 255, 1)',
|
||||
pointColor : '#00bbff',
|
||||
pointStrokeColor : 'rgba(0, 187, 255, 1)',
|
||||
pointHighlightFill : '#fff',
|
||||
pointHighlightStroke: 'rgba(0, 187, 255, 1)',
|
||||
data : <?php echo json_encode($retraits_data) ?>
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
var Pie = '<?php echo json_encode($pieChart) ?>';
|
||||
if(Pie==='[]'){
|
||||
var select = document.getElementById('chart2');
|
||||
$(select.children).hide();
|
||||
$(select).append("<p>Aucune transaction</p>");
|
||||
}else{
|
||||
Pie = JSON.parse(Pie);
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
|
||||
</script>
|
||||
<!-- Page script -->
|
||||
<script src="<?php echo base_url('dist/js/custom.js') ?>"></script>
|
|
@ -2,8 +2,8 @@
|
|||
<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">
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
|
||||
|
||||
<div class="content-wrapper">
|
||||
<?php
|
||||
|
||||
|
@ -30,7 +30,8 @@ use Brick\Money\Money;
|
|||
<section class="content-header">
|
||||
|
||||
<h1>
|
||||
<?php echo isset($category) ? 'Wallet' : $this->lang->line('Gestion des wallets') ; echo ' '.$network.' - '.$country; ?>
|
||||
<?php echo isset($category) ? 'Wallet' : $this->lang->line('Gestion des wallets') ; echo ' '.$network.' - '.$country
|
||||
.' :: '.$this->lang->line('Historique des transactions'); ?>
|
||||
<!-- <input type="button" class="btn btn-primary pull-right" id="Bactiver"-->
|
||||
<!-- value="Activer/Désactiver le(s) réseau(x)" />-->
|
||||
</h1>
|
||||
|
@ -107,7 +108,7 @@ use Brick\Money\Money;
|
|||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><?php echo $this->lang->line('Historique des transactions') ?></h3>
|
||||
<h3 class="box-title"><?php echo $this->lang->line('export_transaction_history') ?></h3>
|
||||
</div>
|
||||
<div class="box-body" style="overflow-x:auto;">
|
||||
<?php
|
||||
|
@ -245,6 +246,12 @@ use Brick\Money\Money;
|
|||
<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/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 src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
|
||||
|
||||
|
@ -254,13 +261,33 @@ use Brick\Money\Money;
|
|||
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({
|
||||
var table = $('#transactions').DataTable({
|
||||
"aaSorting": [[ 17, "desc" ]],
|
||||
"columnDefs": [ {
|
||||
targets: 17,
|
||||
render: $.fn.dataTable.render.moment( 'YYYY-MM-DD HH:mm:ss' , 'D MMMM YYYY HH:mm:ss', format)
|
||||
}]
|
||||
}],
|
||||
dom: 'Bfrtip',
|
||||
"buttons": [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
title: 'Histrotique des transactions'
|
||||
},
|
||||
{
|
||||
extend: 'csvHtml5',
|
||||
title: 'Histrotique des transactions'
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LEGAL',
|
||||
title: 'Histrotique des transactions'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
table.buttons().container()
|
||||
.appendTo( '#example_wrapper .col-sm-6:eq(0)' );
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -0,0 +1,273 @@
|
|||
<!-- 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">
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
|
||||
<div class="content-wrapper">
|
||||
<?php
|
||||
|
||||
use Brick\Money\Context\AutoContext;
|
||||
use Brick\Money\Context\CustomContext;
|
||||
use Carbon\Carbon;
|
||||
use Brick\Money\CurrencyConverter;
|
||||
use Brick\Money\ExchangeRateProvider\PDOProvider;
|
||||
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
|
||||
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
|
||||
use Brick\Math\RoundingMode;
|
||||
use Brick\Money\Money;
|
||||
|
||||
function toLocateDate($date , $timezone){
|
||||
if($date){
|
||||
$carbon = Carbon::createFromFormat('Y-m-d H:i:s', $date, 'UTC');
|
||||
$carbon->setTimezone($timezone);
|
||||
return $carbon->toDateTimeString();
|
||||
}
|
||||
return $date;
|
||||
}
|
||||
?>
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
|
||||
<h1>
|
||||
<?php echo isset($category) ? 'Wallet' : $this->lang->line('Gestion des wallets') ; echo ' '.$network.' - '.$country
|
||||
.' :: '.$this->lang->line('commission_transfer_historic'); ?>
|
||||
<!-- <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
|
||||
}
|
||||
}
|
||||
// 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();
|
||||
?>
|
||||
</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('export_commission_transfer_history') ?></h3>
|
||||
</div>
|
||||
<div class="box-body" style="overflow-x:auto;">
|
||||
<?php
|
||||
if($transactions){
|
||||
$numrows = $transactions->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'>ID</th>
|
||||
<th><?= $this->lang->line('init_balance_princ').' ' ?></th>
|
||||
<th><?= $this->lang->line('init_balance_com') ?></th>
|
||||
<th><?= $this->lang->line('final_balance_princ') ?></th>
|
||||
<th><?= $this->lang->line('final_balance_com') ?></th>
|
||||
<th><?= $this->session->userdata('category') == 'super' ? 'Agent': $this->lang->line('Superviseur') ?></th>
|
||||
<th align='center'>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
foreach ($transactions->result() as $row) {
|
||||
$num++;
|
||||
echo "<tr>
|
||||
<td align='center' >$num</td>
|
||||
<td>".Money::of(round($row->balance_princ_init,2), $row->currency_code,$context)->formatTo('fr_FR')."</td>
|
||||
<td>".Money::of(round($row->balance_com_init,2), $row->currency_code,$context)->formatTo('fr_FR')."</td>
|
||||
<td>".Money::of(round($row->balance_princ_final,2), $row->currency_code,$context)->formatTo('fr_FR')."</td>
|
||||
<td>".Money::of(round($row->balance_com_final,2), $row->currency_code,$context)->formatTo('fr_FR')."</td>
|
||||
<td>".$row->agent."</td>
|
||||
<td>".toLocateDate($row->date,$this->session->userdata('timezone'))."</td>";
|
||||
?>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
} else {
|
||||
echo $this->lang->line('Aucune transaction');
|
||||
}
|
||||
}else {
|
||||
echo $this->lang->line('Aucune transaction');
|
||||
}
|
||||
?>
|
||||
|
||||
</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/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 src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
|
||||
<script src="<?php echo base_url('bower_components/toastr/toastr.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
|
||||
var table = $('#transactions').DataTable({
|
||||
"aaSorting": [[ 6, "desc" ]],
|
||||
"columnDefs": [ {
|
||||
targets: 6,
|
||||
render: $.fn.dataTable.render.moment( 'YYYY-MM-DD HH:mm:ss' , 'D MMMM YYYY HH:mm:ss', format)
|
||||
}],
|
||||
dom: 'Bfrtip',
|
||||
"buttons": [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
title: 'Histrotique des transferts de commission'
|
||||
},
|
||||
{
|
||||
extend: 'csvHtml5',
|
||||
title: 'Histrotique des transferts de commission'
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
orientation: 'landscape',
|
||||
pageSize: 'LEGAL',
|
||||
title: 'Histrotique des transferts de commission'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
table.buttons().container()
|
||||
.appendTo( '#example_wrapper .col-sm-6:eq(0)' );
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var startDate;
|
||||
var endDate;
|
||||
|
||||
$(function () {
|
||||
const lang = $('#picker').data('lang');
|
||||
const category = $('#picker').data('category');
|
||||
$('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_transfer" + "&d=" + debut + "&f=" + fin;
|
||||
else
|
||||
window.location = "<?php echo current_url()?>" + "?id=118&history=commission_transfer" + "&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_transfer";
|
||||
else
|
||||
window.location = "<?php echo current_url()?>" + "?id=118&history=commission_transfer";
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue