diff --git a/application/config/config.php b/application/config/config.php index 13599c05..8541342d 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -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'; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php index fac37986..21027673 100644 --- a/application/controllers/Gestion.php +++ b/application/controllers/Gestion.php @@ -1,5 +1,6 @@ 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(); diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php index b856c7fd..36e4d0ab 100644 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -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'] = ""; diff --git a/application/controllers/Superviseur_dash.php b/application/controllers/Superviseur_dash.php index f7ac0776..114cecfe 100644 --- a/application/controllers/Superviseur_dash.php +++ b/application/controllers/Superviseur_dash.php @@ -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'; diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index d6ff1e5b..d136c425 100644 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -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'; ?> diff --git a/application/language/french/index.html b/application/language/french/index.html new file mode 100644 index 00000000..b702fbc3 --- /dev/null +++ b/application/language/french/index.html @@ -0,0 +1,11 @@ + + +
+Directory access is forbidden.
+ + + diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index dcdbe0e0..f7d6644b 100644 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -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'; ?> diff --git a/application/models/User_model.php b/application/models/User_model.php index 0ddad7df..69e1fc1a 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -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; diff --git a/application/views/demande.php b/application/views/demande.php index b0f0824b..bb0a531c 100644 --- a/application/views/demande.php +++ b/application/views/demande.php @@ -94,13 +94,14 @@ echo "".$nameOfcurentGeolocatedUser.""; } ?> - Période + lang->line('Période') ?> - - + Format : session->userdata('site_lang') === 'french' ? 'Jour - Mois - Année ' : 'Year - Month - Day'?> @@ -233,7 +234,9 @@ ";}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 @@ ";}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 @@ ";}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 @@ @@ -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) { diff --git a/application/views/gestion_wallet.php b/application/views/gestion_wallet.php index d6e722d4..86211a60 100644 --- a/application/views/gestion_wallet.php +++ b/application/views/gestion_wallet.php @@ -139,7 +139,7 @@ if ($transactions != false) {