+ Update Time format and Traduction

This commit is contained in:
DJERY-TOM 2020-05-01 10:30:08 +01:00
parent dc2e5f68be
commit f0440ff466
15 changed files with 134 additions and 89 deletions

View File

@ -136,7 +136,7 @@ $config['subclass_prefix'] = 'MY_';
| Note: This will NOT disable or override the CodeIgniter-specific
| autoloading (application/config/autoload.php)
*/
$config['composer_autoload'] = FALSE;
$config['composer_autoload'] = FCPATH.'vendor/autoload.php';
/*
|--------------------------------------------------------------------------

View File

@ -1,5 +1,6 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
use Spatie\Async\Pool;
class Gestion extends CI_Controller
{
@ -1638,8 +1639,8 @@ class Gestion extends CI_Controller
if($method == 'create')
{
$res = $this->user_model->addConfigWallet($network_id , $taux_client_r , $taux_client_d , $taux_ag_r ,$taux_ag_d , $taux_sup_r , $taux_sup_d, $taux_bq_r , $taux_bq_d , $frais_d);
if($res)
$this->generateAllWallets($network_id);
// if($res)
// $this->generateAllWallets($network_id);
}
else if($method = 'update'){
@ -1686,50 +1687,39 @@ class Gestion extends CI_Controller
return true;
}
public function generateAllWallets($network_id){
// if($this->isLogged()) {
// if (isset($_POST)) {
//
// $network_id = $_POST['network_id'];
// Fetch all agents , hyperviseur , superviseur
$f_agents = $this->user_model->getAllAgentsForNetwork($network_id) ;
if ($f_agents){
foreach($f_agents->result() AS $row){
//Create wallet if it not exist
$res = $this->user_model->getWallet($row->agent_id);
if($res){
// Reinitialize the wallet
$this->user_model->reinitializeWallet($res->id_wallet);
}else{
$this->user_model->addWallet($row->agent_id);
}
public function generateAllWallets(){
// Asynchrous method
$network_id = $_POST['network_id'];
$pool = Pool::create();
$pool->add(function () use ($network_id) {
// Fetch all agents , hyperviseur , superviseur
$f_agents = $this->user_model->getAllAgentsForNetwork($network_id) ;
if ($f_agents){
foreach($f_agents->result() AS $row){
//Create wallet if it not exist
$res = $this->user_model->getWallet($row->agent_id);
if($res){
// Reinitialize the wallet
// $this->user_model->reinitializeWallet($res->first_row()->wallet_id);
}else{
$this->user_model->addWallet($row->agent_id);
}
}
}
})->then(function () {
// }
// }
});
await($pool);
}
private function historique($network_id ,$startDate ,$endDate)
{
$data['startDate'] = $startDate;
$data['endDate'] = $endDate;
$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->getTransactions($startDate , $endDate ,$network_id);
// if($res)
// $transactions = $res->result();
//
// if($startDate!=null & $endDate != null){
// if ($transactions){
// $transactions = array_filter($transactions, function ($trans) use ($endDate ,$startDate){
// $date = strtotime($trans->date_created);
// return $date >= strtotime($startDate) && $date <= strtotime($endDate) ;
// });
// }
// }
$data['active'] = "wallet";
$data['alert'] = "";
$data['networks'] = $this->user_model->getAllActivatedNetworks();

View File

@ -201,8 +201,9 @@ class Hyperviseur_dash extends CI_Controller
$fin = date('Y-m-d');
$debut = Date('Y-m-d', strtotime("-5 days"));
}
$data['debut'] = $debut;
$data['fin'] = $fin;
$format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d' ;
$data['debut'] = $debut ? date($format, strtotime($debut)) : null ;
$data['fin'] = $fin ?date($format, strtotime($fin)): null ;
$fin = Date('Y-m-d', strtotime($fin."+1 day"));
$ville = $this->session->userdata('ville');
@ -263,8 +264,9 @@ class Hyperviseur_dash extends CI_Controller
$network = $this->session->userdata('network');
$debut = $this->input->get("d");
$fin = $this->input->get("f");
$data['debut'] = $debut;
$data['fin'] = $fin;
$format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d' ;
$data['debut'] = $debut ? date($format, strtotime($debut)) : null ;
$data['fin'] = $fin ?date($format, strtotime($fin)): null ;
$data['demand_type'] = 'adhesion';
$data['active'] = "demandesAd";
$data['alert'] = "";

View File

@ -118,8 +118,9 @@ class Superviseur_dash extends CI_Controller
$user_geo = $this->input->get("u");
$debut = $this->input->get("d");
$fin = $this->input->get("f");
$data['debut'] = $debut;
$data['fin'] = $fin;
$format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d' ;
$data['debut'] = $debut ? date($format, strtotime($debut)) : null ;
$data['fin'] = $fin ?date($format, strtotime($fin)): null ;
$fin = Date('Y-m-d', strtotime($fin."+1 day")); // Increment date because SQL BETWEEN
$network = $this->session->userdata('network');
@ -171,8 +172,9 @@ class Superviseur_dash extends CI_Controller
$network = $this->session->userdata('network');
$debut = $this->input->get("d");
$fin = $this->input->get("f");
$data['debut'] = $debut;
$data['fin'] = $fin;
$format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d' ;
$data['debut'] = $debut ? date($format, strtotime($debut)) : null ;
$data['fin'] = $fin ?date($format, strtotime($fin)): null ;
$data['active'] = "demandesAd";
$data['alert'] = "";
$data['demand_type'] = 'adhesion';

View File

@ -220,6 +220,10 @@ $lang['Statut du compte'] = 'Account status';
$lang['Publicité'] = 'Publicity';
$lang['Gestion de la publicité'] = 'Advertising Management';
//GAME
$lang['Game'] = 'Game';
$lang['Utilisateurs'] = 'Users';
//Wallet
$lang['Gestion des wallets'] = 'Wallet Management';
$lang['Réseaux activés'] = 'Activated networks';
@ -230,7 +234,18 @@ $lang['Taux de commission agent géolocalisé sur retrait'] = 'Geolocated agent
$lang['Taux de commission agent géolocalisé sur dépot'] = 'Geolocated agent commission rate on deposit';
$lang['Taux de commission superviseur sur retrait'] = 'Supervisor commission rate on withdrawal';
$lang['Taux de commission superviseur sur dépot'] = 'Supervisor commission rate on deposit';
$lang['Part de la banque sur le retrait'] = 'Partner bank\'s share of withdrawal';
$lang['Part de la banque sur le dépot'] = 'Share of partner bank on deposit';
$lang['Frais minimun de la banque sur le dépot'] = 'Minimum bank charges on customer deposit';
$lang['Suppression du wallet'] = 'Removal of the wallet';
$lang['Modifier la configuration'] = 'Change configuration';
$lang['Historique des 12 derniers mois'] = 'Withdrawals and deposits from the last 12 months';
$lang['Historique'] = 'Historic';
$lang['Commission Hyperviseur'] = 'Hypervisor Commission';
$lang['Parts dépots & retraits'] = 'Deposit & withdrawal shares';
$lang['Historique des transactions'] = 'Transaction history';
$lang['Période'] = 'Period';
$lang['Aucune demande'] = 'No transactions';
$lang['Acceptée'] = 'Accepted';
$lang['Annulée'] = 'Canceled';
?>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -248,12 +248,19 @@
$lang['Taux de commission superviseur sur dépot'] = 'Taux de commission superviseur sur dépot';
$lang['Part de la banque sur le retrait'] = 'Part de la banque partenaire sur le retrait';
$lang['Part de la banque sur le dépot'] = 'Part de la banque partenaire sur le dépot';
$lang['Frais minimun de la banque sur le dépot'] = 'Frais minimun de la banque sur le dépot du client';
$lang['Frais minimun de la banque sur le dépot'] = 'Frais minimum de la banque sur le dépot du client';
$lang['Suppression du wallet'] = 'Suppression du wallet';
$lang['Modifier la configuration'] = 'Modifier la configuration';
$lang['Commissions Hyperviseur'] = 'Commissions Hyperviseur';
$lang['Commission Hyperviseur'] = 'Commissions Hyperviseur';
$lang['Commissions Superviseurs'] = 'Commissions Superviseurs';
$lang['Commissions Agents']= 'Commissions Agents';
$lang['Historique des 12 derniers mois'] = 'Retraits et dépots des 12 derniers mois';
$lang['Historique'] = 'Historique';
$lang['Historique des transactions'] = 'Historique des transactions';
$lang['Période'] = 'Période';
$lang['Parts dépots & retraits'] = 'Parts dépots & retraits';
$lang['Aucune transaction'] = 'Aucune transaction';
$lang['Acceptée'] = 'Acceptée';
$lang['Annulée'] = 'Annulée';
?>

View File

@ -303,7 +303,7 @@ class User_model extends CI_Model
$query = $this->db->query("SELECT *
FROM info_demandeCredits AS d
WHERE d.codeMembre='".$member_code."'
ORDER BY dateAjout");
ORDER BY dateAjout DESC");
if($query->num_rows()>0){
return $query;

View File

@ -94,13 +94,14 @@
echo "<span class='info-box-number'>".$nameOfcurentGeolocatedUser."</span>";
}
?>
<span class="info-box-text">Période </span>
<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%" type="text" name="daterange" data-type="<?php echo $demand_type?>" data-category="<?php echo $this->session->userdata('category') ?>"
<input id="picker" style="background: #fff; cursor: pointer; padding: 1px 1px; border: 1px solid #ccc; width: 100%" type="text" name="daterange" data-lang="<?php echo $this->session->userdata('site_lang') ?>"
data-type="<?php echo $demand_type?>" data-category="<?php echo $this->session->userdata('category') ?>"
value="<?php echo ($debut!=null & $fin != null) ? $debut. ' - '.$fin : ''?>"
/>
</span>
</span>
<span> Format : <?php echo $this->session->userdata('site_lang') === 'french' ? 'Jour - Mois - Année ' : 'Year - Month - Day'?> </span>
</div>
</div>
</div>
@ -233,7 +234,9 @@
</tr>";}else{
$etat = $this->lang->line("Non traitée");
if($row->statut==1){
$etat = $this->lang->line("traitée");
$etat = $this->lang->line("Acceptée");
}else if($row->statut == 2){
$etat = $this->lang->line("Annulée");
}
$origin = $row->codeMembre;
$destination = $row->codeParrain;
@ -378,7 +381,9 @@
</tr>";}else{
$etat = $this->lang->line("Non traitée");
if($row->statut==1){
$etat = $this->lang->line("traitée");
$etat = $this->lang->line("Acceptée");
}else if($row->statut == 2){
$etat = $this->lang->line("Annulée");
}
$origin = $row->codeMembre;
$destination = $row->codeParrain;
@ -1050,7 +1055,9 @@
</tr>";}else{
$etat = $this->lang->line("Non traitée");
if($row->statut==1){
$etat = $this->lang->line("traitée");
$etat = $this->lang->line("Acceptée");
}else if($row->statut == 2){
$etat = $this->lang->line("Annulée");
}
$origin = $row->codeMembre;
$destination = $row->codeParrain;
@ -1383,9 +1390,15 @@
<script>
$(function () {
$('#listeMembres').DataTable();
$('#listeMembres1').DataTable();
$('#listeMembres2').DataTable();
$('#listeMembres').DataTable({
"aaSorting": [[ 3, "desc" ]]
});
$('#listeMembres1').DataTable({
"aaSorting": [[ 3, "desc" ]]
});
$('#listeMembres2').DataTable({
"aaSorting": [[ 1, "desc" ]]
});
});
</script>
@ -1442,11 +1455,12 @@
$(function() {
const type = $('#picker').data('type');
const category = $('#picker').data('category');
const lang = $('#picker').data('lang');
$('input[name="daterange"]').daterangepicker({
opens: 'left',
autoUpdateInput: false,
locale: {
format: 'YYYY-MM-DD',
format: lang === 'french' ? 'DD-MM-YYYY' : 'YYYY-MM-DD',
cancelLabel: 'Clear'
}
}, function(start, end, label) {

View File

@ -139,7 +139,7 @@ if ($transactions != false) {
<section class="content-header">
<h1>
Gestion des wallets <?php echo $network .' - '.$country; ?>
<?php echo $this->lang->line('Gestion des wallets'). ' '. $network .' - '.$country; ?>
</h1>
<?php
$site_url = base_url();
@ -302,10 +302,11 @@ if ($transactions != false) {
<div class="col-xs-12">
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title">Retraits et dépots des 12 derniers
mois<?php //echo $this->lang->line('Souscription des 12 derniers mois'); ?></h3>
<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 ? '?id='.$network_id . '&history=true' : '')?>"> Historique </a>
<a class="btn btn-primary" href="<?php echo current_url().($network_id ? '?id='.$network_id . '&history=true' : '')?>">
<?php echo $this->lang->line('Historique'); ?></a>
</div>
</div>
<div class="box-body">
@ -318,8 +319,8 @@ if ($transactions != false) {
<div class="col-xs-6">
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">Parts dépots &
retraits<?php //echo $this->lang->line("Utilisateurs géolocalisés par ville"); ?></h3>
<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>
@ -330,7 +331,7 @@ if ($transactions != false) {
<div class="col-xs-6">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?php echo $this->lang->line('Commissions Hyperviseur') ?></h3>
<h3 class="box-title"><?php echo $this->lang->line('Commission Hyperviseur') ?></h3>
</div>
<div class="box-body">
<table id="example1" class="table table-bordered table-hover">

View File

@ -280,17 +280,17 @@
console.log(resultat+" "+error );
}
}).done(function () {
//$.ajax({
// url : '<?php //echo base_url('index.php/Gestion/generateAllWallets')?>//',
// type : 'POST',
// dataType : 'json',
// data : {"network_id": network_id},
// timeout : 0,
// async : true ,
// success : function () {
// console.log("All wallets are generated");
// }
//});
$.ajax({
url : '<?php echo base_url('index.php/Gestion/generateAllWallets')?>',
type : 'POST',
dataType : 'json',
data : {"network_id": network_id},
async : true ,
timeout : 0,
success : function () {
console.log("All wallets are generated");
}
});
});
}

View File

@ -119,7 +119,7 @@
</li>
<li class="<?php if($active=="demandesAd"){echo "active ";} ?>">
<a href="<?php echo base_url('index.php/Superviseur_dash/getDemandesAd') ?>">
<i class="fa fa-users"></i> <span>Demandes d'adhésion</span>
<i class="fa fa-users"></i> <span> <?php echo $this->lang->line('Demandes adhésion'); ?></span>
</a>
</li>
<?php if($hasWallet){

View File

@ -44,14 +44,13 @@
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<!-- <span id="change-periode" style="cursor: pointer;" class="info-box-icon bg-aqua"><i class="ion ion-android-arrow-right"></i></span>-->
<span class="info-box-icon bg-aqua"><i class="ion ion-android-arrow-down"></i></span>
<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">Période </span>
<span class="info-box-text"><?php echo $this->lang->line('Période') ?> </span>
<span class="info-box-number">
<input
style="background: #fff; cursor: pointer; padding: 1px 1px; border: 1px solid #ccc; width: 100%"
type="text" name="daterange"
type="text" name="daterange" data-lang="<?php echo $this->session->userdata('site_lang') ?>"
value="<?php echo ($startDate!=null & $endDate != null) ? $startDate. ' - '.$endDate : ''?>"/>
</span>
@ -64,7 +63,7 @@
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Historique des transactions</h3>
<h3 class="box-title"><?php echo $this->lang->line('Historique des transactions') ?></h3>
</div>
<div class="box-body">
<?php
@ -152,7 +151,9 @@
<script>
$(function () {
$('#transactions').DataTable();
$('#transactions').DataTable({
"aaSorting": [[ 0, "desc" ]]
});
});
</script>
@ -161,11 +162,12 @@
var endDate;
$(function () {
const lang = $('#picker').data('lang');
$('input[name="daterange"]').daterangepicker({
opens: 'left',
autoUpdateInput: false,
locale: {
format: 'YYYY-MM-DD',
format: lang === 'french' ? 'DD-MM-YYYY' : 'YYYY-MM-DD',
cancelLabel: 'Clear'
}
}, function (start, end, label) {

View File

@ -28,8 +28,8 @@
<div class="login-page">
<div class="img-container">
<div class="choice-lang">
<img src="<?php echo base_url('images/flag_french.png') ?>" class="img-circle img-responsive" onclick="javascript:window.location.href='<?php echo base_url(); ?>/index.php/LanguageSwitcher/switchLang/french';"/>
<img src="<?php echo base_url('images/flag_uk.jpg') ?>" class="img-circle img-responsive" onclick="javascript:window.location.href='<?php echo base_url(); ?>/index.php/LanguageSwitcher/switchLang/english';"/>
<img src="<?php echo base_url('images/flag_french.png') ?>" class="img-circle img-responsive" onclick="javascript:window.location.href ='<?php echo base_url(); ?>index.php/LanguageSwitcher/switchLang/french';"/>
<img src="<?php echo base_url('images/flag_uk.jpg') ?>" class="img-circle img-responsive" onclick="javascript:window.location.href ='<?php echo base_url(); ?>index.php/LanguageSwitcher/switchLang/english';"/>
<!--<a href='#modal-langue'data-toggle='modal'><?php echo $this->lang->line('langue'); ?> : <?php echo $this->session->userdata('site_lang') ?> </a>-->
</div>
<div class="text-center pull-right photo">

View File

@ -11,7 +11,8 @@
"source": "https://github.com/bcit-ci/CodeIgniter"
},
"require": {
"php": ">=5.4"
"php": ">=5.4",
"spatie/async": "^1.4"
},
"suggest": {
"paragonie/random_compat": "Provides better randomness in PHP 5.x"