+ Add more informations on Historic of transactions

This commit is contained in:
DJERY-TOM 2020-04-24 11:40:34 +01:00
parent a44199c016
commit 2aa98a8316
11 changed files with 1929 additions and 1586 deletions

View File

@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| a PHP script and you can easily do that on your own. | a PHP script and you can easily do that on your own.
| |
*/ */
$config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/backofficeiLinkTest'; $config['base_url'] = 'https://'.$_SERVER['SERVER_NAME'].'/backofficeiLinkTest';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@ -77,7 +77,7 @@ $db['default'] = array(
'dsn' => '', 'dsn' => '',
'hostname' => 'localhost', 'hostname' => 'localhost',
'username' => 'root', 'username' => 'root',
'password' => '', 'password' => 'vps@2017GA',
'database' => 'iLink_test2', 'database' => 'iLink_test2',
'dbdriver' => 'mysqli', 'dbdriver' => 'mysqli',
'dbprefix' => '', 'dbprefix' => '',

View File

@ -1546,7 +1546,15 @@ class Gestion extends CI_Controller
} else { } else {
if ($this->input->get('id')) { if ($this->input->get('id')) {
$network_id = $this->input->get('id'); $network_id = $this->input->get('id');
if($this->input->get('history')){
if($this->input->get('d') & $this->input->get('f')){
$this->historique($network_id,$this->input->get('d'),$this->input->get('f'));
}else{
$this->historique($network_id,null,null);
}
}else{
$taux = $this->user_model->getTaux($network_id); $taux = $this->user_model->getTaux($network_id);
if ($taux != null) { if ($taux != null) {
$taux = $this->user_model->getTaux($network_id)->first_row(); $taux = $this->user_model->getTaux($network_id)->first_row();
@ -1585,7 +1593,11 @@ class Gestion extends CI_Controller
$hyper = $this->user_model->getNetworkHyper($network_id)->first_row(); $hyper = $this->user_model->getNetworkHyper($network_id)->first_row();
$data['walletHyper'] = $this->user_model->getWallet($hyper->agent_id); $data['walletHyper'] = $this->user_model->getWallet($hyper->agent_id);
$data['network_id'] = $network_id; $data['network_id'] = $network_id;
$data['network'] = $this->user_model->getNetworkName($network_id); $networkDetails = $this->user_model->getNetworkDetails($network_id);
if($networkDetails){
$data['network'] = $networkDetails->first_row()->network;
$data['country'] = $networkDetails->first_row()->country;
}
// $data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($network_id); // $data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($network_id);
$data['active'] = "wallet"; $data['active'] = "wallet";
$data['alert'] = ""; $data['alert'] = "";
@ -1595,6 +1607,9 @@ class Gestion extends CI_Controller
$this->load->view('header_gestion', $data); $this->load->view('header_gestion', $data);
$this->load->view('gestion_wallet'); $this->load->view('gestion_wallet');
$this->load->view('footer'); $this->load->view('footer');
}
} else { } else {
$data['active'] = "wallet"; $data['active'] = "wallet";
@ -1605,7 +1620,6 @@ class Gestion extends CI_Controller
$this->load->view('gestion_wallets'); $this->load->view('gestion_wallets');
$this->load->view('footer'); $this->load->view('footer');
} }
} }
} }
@ -1701,4 +1715,39 @@ class Gestion extends CI_Controller
} }
private function historique($network_id ,$startDate ,$endDate)
{
$transactions = array();
$res= $this->user_model->getTransactions($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['startDate'] = $startDate;
$data['endDate'] = $endDate;
$data['transactions'] = $transactions;
$data['active'] = "wallet";
$data['alert'] = "";
$data['networks'] = $this->user_model->getAllActivatedNetworks();
$data['game_pays'] = $this->user_model->getGameCountry();
$data['networks'] = $this->user_model->getAllActivatedNetworks();
$networkDetails = $this->user_model->getNetworkDetails($network_id);
if($networkDetails){
$data['network'] = $networkDetails->first_row()->network;
$data['country'] = $networkDetails->first_row()->country;
}
$this->load->view('header_gestion', $data);
$this->load->view('historique_transactions');
$this->load->view('footer');
}
} }

View File

@ -187,9 +187,25 @@ class Hyperviseur_dash extends CI_Controller
$data['message'] = "Login first!"; $data['message'] = "Login first!";
$this->load->view('login', $data); $this->load->view('login', $data);
} else { } else {
if($this->input->post('super')) if($this->input->post('super') or $this->input->get("u") !== null)
{ {
//$this->session->set_userdata('current_demande_ville', $this->input->post('ville')); $super = $this->input->post('super');
$this->session->set_userdata("current_super_demande", $this->input->post('super'));
if($this->input->post('super') == null){
$super = $this->input->get("u");
$this->session->set_userdata("current_super_demande", $super);
}
$debut ="";
$fin = "";
if($this->input->get("d") !== null){
$debut = $this->input->get("d");
$fin = $this->input->get("f");
}else{
$fin = date('Y-m-d H:i:s');
$debut = Date('Y-m-d H:i:s', strtotime("-3 days"));
}
$ville = $this->session->userdata('ville'); $ville = $this->session->userdata('ville');
$data['active'] = "demandes"; $data['active'] = "demandes";
@ -206,10 +222,10 @@ class Hyperviseur_dash extends CI_Controller
$data['network'] = $this->session->userdata('network'); $data['network'] = $this->session->userdata('network');
$data['villes'] = $this->user_model->getVilleByUserGeo($data['network'],$this->session->userdata('current_pays')); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'],$this->session->userdata('current_pays'));
$data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code'));
$data['tab_fastDemande'] = $this->user_model->getRangeASCDemandesByNetwork($this->session->userdata('member_code'),$this->session->userdata('current_demande_ville'),$this->input->post('super')); $data['tab_fastDemande'] = $this->user_model->getRangeASCDemandesByNetwork($debut,$fin,$this->session->userdata('member_code'),$this->session->userdata('current_demande_ville'),$super);
$data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandesByNetwork($this->session->userdata('member_code'),$this->session->userdata('current_demande_ville'),$this->input->post('super')); $data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandesByNetwork($debut,$fin,$this->session->userdata('member_code'),$this->session->userdata('current_demande_ville'),$super);
$data['list'] = $this->user_model->getDemandesBySuper($this->session->userdata('member_code'),$this->input->post('super')); $data['list'] = $this->user_model->getDemandesBySuper($debut,$fin,$this->session->userdata('member_code'),$super);
$data['temp_moyen'] = $this->user_model->getTempsMoyenByVille($this->session->userdata('member_code'),$this->input->post('super')); $data['temp_moyen'] = $this->user_model->getTempsMoyenByVille($this->session->userdata('member_code'),$super,$this->session->userdata('network'));
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code')); $data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id')); $data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
$this->load->view('header_hyp', $data); $this->load->view('header_hyp', $data);

View File

@ -231,4 +231,6 @@ $lang['Taux de commission agent géolocalisé sur dépot'] = 'Geolocated agent c
$lang['Taux de commission superviseur sur retrait'] = 'Supervisor commission rate on withdrawal'; $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['Taux de commission superviseur sur dépot'] = 'Supervisor commission rate on deposit';
$lang['Suppression du wallet'] = 'Removal of the wallet'; $lang['Suppression du wallet'] = 'Removal of the wallet';
$lang['Aucune demande'] = 'No transactions';
?> ?>

View File

@ -254,4 +254,6 @@
$lang['Commissions Hyperviseur'] = 'Commissions Hyperviseur'; $lang['Commissions Hyperviseur'] = 'Commissions Hyperviseur';
$lang['Commissions Superviseurs'] = 'Commissions Superviseurs'; $lang['Commissions Superviseurs'] = 'Commissions Superviseurs';
$lang['Commissions Agents']= 'Commissions Agents'; $lang['Commissions Agents']= 'Commissions Agents';
$lang['Aucune transaction'] = 'Aucune transaction';
?> ?>

View File

@ -515,21 +515,22 @@ class User_model extends CI_Model
} }
public function getRangeASCDemandesByNetwork($codeParrain,$ville,$super){ public function getRangeASCDemandesByNetwork($debut, $fin, $codeParrain, $ville, $super){
if($codeParrain=='all'){ if($codeParrain=='all'){
$query = $this->db->query("SELECT d.codeMembre AS emetteur, d.ref_operateur AS ref_operateur, d.montant AS montant, d.montant_allowed AS montant_allowed,d.dateAjout AS dateA,d.dateModif AS dateM, $query = $this->db->query("SELECT d.codeMembre AS emetteur, d.codeParrain AS superviseur, d.montant AS montant,d.dateAjout AS dateA,d.dateModif AS dateM,
(SELECT TIMESTAMPDIFF(SECOND,dateAjout,dateModif) (SELECT TIMESTAMPDIFF(SECOND,dateAjout,dateModif)
FROM demande_credit AS req_im FROM demande_credit AS req_im
WHERE req_im.statut=1 AND req_im.id=d.id) AS temps WHERE req_im.statut=1 AND req_im.id=d.id) AS temps
FROM demande_credit AS d FROM demande_credit AS d
WHERE statut=1 AND d.reseau='".$ville."' WHERE statut=1 AND d.reseau='".$ville."' AND date_creation BETWEEN '".$debut."' AND '".$fin."'
ORDER BY temps ORDER BY temps
LIMIT 5"); LIMIT 5");
}else{ }else{
$query = $this->db->query("SELECT d.codeMembre AS emetteur, d.ref_operateur AS ref_operateur, d.montant AS montant, d.montant_allowed AS montant_allowed,d.dateAjout AS dateA,d.dateModif AS dateM,d.temps AS temps $query = $this->db->query("SELECT d.codeMembre AS emetteur, d.codeParrain AS superviseur, d.montant AS montant,d.dateAjout AS dateA,d.dateModif AS dateM,d.temps AS temps
FROM info_demandeCredits AS d FROM info_demandeCredits AS d
WHERE statut=1 AND d.codeParrain='".$codeParrain."' AND d.codeMembre='".$super."' WHERE statut=1 AND d.codeParrain='".$codeParrain."' AND d.codeMembre='".$super."'
AND dateAjout BETWEEN '".$debut."' AND '".$fin."'
ORDER BY temps ORDER BY temps
LIMIT 5"); LIMIT 5");
} }
@ -616,21 +617,22 @@ class User_model extends CI_Model
} }
public function getRangeDESCDemandesBynetwork($codeParrain,$ville,$super){ public function getRangeDESCDemandesBynetwork($debut, $fin, $codeParrain, $ville, $super){
if($codeParrain=='all'){ if($codeParrain=='all'){
$query = $this->db->query("SELECT d.codeMembre AS emetteur, d.ref_operateur AS ref_operateur, d.montant AS montant, d.montant_allowed AS montant_allowed,d.dateAjout AS dateA,d.dateModif AS dateM, $query = $this->db->query("SELECT d.codeMembre AS emetteur, d.codeParrain AS superviseur, d.montant AS montant,d.dateAjout AS dateA,d.dateModif AS dateM,
(SELECT TIMESTAMPDIFF(SECOND,dateAjout,dateModif) (SELECT TIMESTAMPDIFF(SECOND,dateAjout,dateModif)
FROM demande_credit AS req_im FROM demande_credit AS req_im
WHERE req_im.statut=1 AND req_im.id=d.id) AS temps WHERE req_im.statut=1 AND req_im.id=d.id) AS temps
FROM demande_credit AS d FROM demande_credit AS d
WHERE statut=1 AND d.reseau='".$ville."' WHERE statut=1 AND d.reseau='".$ville."' AND date_creation BETWEEN '".$debut."' AND '".$fin."'
ORDER BY temps DESC ORDER BY temps DESC
LIMIT 5"); LIMIT 5");
}else{ }else{
$query = $this->db->query("SELECT d.codeMembre AS emetteur, d.ref_operateur AS ref_operateur, d.montant AS montant, d.montant_allowed AS montant_allowed,d.dateAjout AS dateA,d.dateModif AS dateM,d.temps AS temps $query = $this->db->query("SELECT d.codeMembre AS emetteur, d.codeParrain AS superviseur, d.montant AS montant,d.dateAjout AS dateA,d.dateModif AS dateM,d.temps AS temps
FROM info_demandeCredits AS d FROM info_demandeCredits AS d
WHERE statut=1 AND d.codeParrain='".$codeParrain."' AND d.codeMembre='".$super."' WHERE statut=1 AND d.codeParrain='".$codeParrain."' AND d.codeMembre='".$super."'
AND dateAjout BETWEEN '".$debut."' AND '".$fin."'
ORDER BY temps DESC ORDER BY temps DESC
LIMIT 5"); LIMIT 5");
} }
@ -1837,19 +1839,17 @@ class User_model extends CI_Model
} }
} }
public function getNetworkName($id_network){ public function getNetworkDetails($id_network){
$query = $this->db->query("SELECT networks.name $query = $this->db->query("SELECT n.name AS network , c.name AS country FROM networks n INNER JOIN countries c ON n.country_id = c.id WHERE n.id = ".$id_network);
FROM networks
WHERE `id`=".$id_network);
if($query->num_rows()>0){ if($query->num_rows()>0){
return $query->row()->name; return $query;
}else{ }else{
return null; return null;
} }
} }
public function getTransactions($id_network){ public function getTransactions($id_network){
$query = $this->db->query("SELECT id,type_transac , commission_banque $query = $this->db->query("SELECT *
FROM infos_transaction FROM infos_transaction
WHERE `network_id`=".$id_network); WHERE `network_id`=".$id_network);
if($query->num_rows()>0){ if($query->num_rows()>0){

View File

@ -1,6 +1,6 @@
<!-- DataTables --> <!-- DataTables -->
<link rel="stylesheet" href="bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css"> <link rel="stylesheet" href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<div class="content-wrapper"> <div class="content-wrapper">
@ -84,6 +84,26 @@
</div> </div>
</div> </div>
</div> </div>
<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>
<div class="info-box-content">
<?php
if($this->session->userdata('category') == "super"){
echo "<span class='info-box-number'>".$nameOfcurentGeolocatedUser."</span>";
}
?>
<span class="info-box-text">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" value="01/01/2018 - 01/15/2018" />
</span>
</span>
</div>
</div>
</div>
<?php if($this->session->userdata('category')=='super' && $type!=$this->lang->line('Adhésion')){ ?> <?php if($this->session->userdata('category')=='super' && $type!=$this->lang->line('Adhésion')){ ?>
<div class="col-md-4 col-sm-6 col-xs-12"> <div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box"> <div class="info-box">
@ -173,8 +193,7 @@
echo "<tr class='label-primary'> echo "<tr class='label-primary'>
<th>".$this->lang->line('Telephone')."</th> <th>".$this->lang->line('Telephone')."</th>
<th>".$this->lang->line('Emetteur')."</th> <th>".$this->lang->line('Emetteur')."</th>
<th>Montant demandé</th> <th>".$this->lang->line('Montant')."</th>
<th>Montant envoyé</th>
<th>".$this->lang->line('Date de la demande')."</th> <th>".$this->lang->line('Date de la demande')."</th>
<th>".$this->lang->line('Date de traitement')."</th> <th>".$this->lang->line('Date de traitement')."</th>
<th>".$this->lang->line('Statut')."</th> <th>".$this->lang->line('Statut')."</th>
@ -216,19 +235,18 @@
$etat = $this->lang->line("traitée"); $etat = $this->lang->line("traitée");
} }
$origin = $row->codeMembre; $origin = $row->codeMembre;
$destination = $row->ref_operateur; $destination = $row->codeParrain;
if($row->codeMembre==$this->session->userdata('member_code')){ if($row->codeMembre==$this->session->userdata('member_code')){
$origin = $this->lang->line('Vous'); $origin = $this->lang->line('Vous');
} }
if($row->ref_operateur=="0"){ if($row->codeParrain==$this->session->userdata('member_code')){
$destination = "XXX_XXX"; $destination = $this->lang->line('Vous');
} }
echo "<tr> echo "<tr>
<td> $row->phone</td> <td> $row->phone</td>
<td >$origin </td> <td >$origin </td>
<td > $row->montant</td> <td > $row->montant</td>
<td > $row->montant_allowed</td>
<td>$row->dateAjout </td> <td>$row->dateAjout </td>
<td > $row->dateModif</td> <td > $row->dateModif</td>
<td>$etat</td> <td>$etat</td>
@ -319,8 +337,7 @@
<th>".$this->lang->line('Délai de traitement')."</th> <th>".$this->lang->line('Délai de traitement')."</th>
</tr>"; }else{ </tr>"; }else{
echo "<tr class='label-primary'> echo "<tr class='label-primary'>
<th>Montant demandé</th> <th>".$this->lang->line('Montant')."</th>
<th>Montant envoyé</th>
<th>".$this->lang->line('Date de la demande')."</th> <th>".$this->lang->line('Date de la demande')."</th>
<th>".$this->lang->line('Date de traitement')."</th> <th>".$this->lang->line('Date de traitement')."</th>
<th>".$this->lang->line('Statut')."</th> <th>".$this->lang->line('Statut')."</th>
@ -363,17 +380,16 @@
$etat = $this->lang->line("traitée"); $etat = $this->lang->line("traitée");
} }
$origin = $row->codeMembre; $origin = $row->codeMembre;
$destination = $row->ref_operateur; $destination = $row->codeParrain;
if($row->codeMembre==$this->session->userdata('member_code')){ if($row->codeMembre==$this->session->userdata('member_code')){
$origin = $this->lang->line('Vous'); $origin = $this->lang->line('Vous');
} }
if($row->ref_operateur=="0"){ if($row->codeParrain==$this->session->userdata('member_code')){
$destination = "XXX_XXX"; $destination = $this->lang->line('Vous');
} }
echo "<tr> echo "<tr>
<td > $row->montant</td> <td > $row->montant</td>
<td > $row->montant_allowed</td>
<td>$row->dateAjout </td> <td>$row->dateAjout </td>
<td > $row->dateModif</td> <td > $row->dateModif</td>
<td>$etat</td> <td>$etat</td>
@ -463,8 +479,8 @@
echo "<tr class='label-primary'> echo "<tr class='label-primary'>
<th></th> <th></th>
<th>".$this->lang->line('Membre')."</th> <th>".$this->lang->line('Membre')."</th>
<th>Ref. Opérateur</th> <th>".$this->lang->line('Parrain')."</th>
<th>Montant demandé</th> <th>".$this->lang->line('Montant')."</th>
<th>".$this->lang->line('Date de la demande')."</th> <th>".$this->lang->line('Date de la demande')."</th>
<th>".$this->lang->line('Date de traitement')."</th> <th>".$this->lang->line('Date de traitement')."</th>
<th>".$this->lang->line('Délai de traitement')."</th> <th>".$this->lang->line('Délai de traitement')."</th>
@ -481,7 +497,10 @@
// output data of each row // output data of each row
foreach($result->result() as $row) { foreach($result->result() as $row) {
$num++; $num++;
$superviseur = $row->superviseur;
if($row->superviseur==$this->session->userdata('member_code')){
$superviseur = $this->lang->line('Vous');
}
if($type==$this->lang->line('Adhésion')){ if($type==$this->lang->line('Adhésion')){
$etat = $this->lang->line("Non traitée"); $etat = $this->lang->line("Non traitée");
if($row->etat==1){ if($row->etat==1){
@ -502,9 +521,8 @@
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$row->ref_operateur</td> <td>$superviseur</td>
<td>$row->montant</td> <td>$row->montant</td>
<td>$row->montant_allowed</td>
<td>$row->dateA</td> <td>$row->dateA</td>
<td>$row->dateM</td> <td>$row->dateM</td>
<td>".duree($row->temps)."</td> <td>".duree($row->temps)."</td>
@ -595,9 +613,8 @@
echo "<tr class='label-primary'> echo "<tr class='label-primary'>
<th></th> <th></th>
<th>".$this->lang->line('Membre')."</th> <th>".$this->lang->line('Membre')."</th>
<th>Ref. Opérateur</th> <th>".$this->lang->line('Parrain')."</th>
<th>Montant demandé</th> <th>".$this->lang->line('Montant')."</th>
<th>Montant envoyé</th>
<th>".$this->lang->line('Date de la demande')."</th> <th>".$this->lang->line('Date de la demande')."</th>
<th>".$this->lang->line('Date de traitement')."</th> <th>".$this->lang->line('Date de traitement')."</th>
<th>".$this->lang->line('Délai de traitement')."</th> <th>".$this->lang->line('Délai de traitement')."</th>
@ -614,7 +631,10 @@
// output data of each row // output data of each row
foreach($result->result() as $row) { foreach($result->result() as $row) {
$num++; $num++;
$superviseur = $row->superviseur;
if($row->superviseur==$this->session->userdata('member_code')){
$superviseur = $this->lang->line('Vous');
}
if($type==$this->lang->line('Adhésion')){ if($type==$this->lang->line('Adhésion')){
echo "<tr> echo "<tr>
@ -631,9 +651,8 @@
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$row->ref_operateur</td> <td>$superviseur</td>
<td>$row->montant</td> <td>$row->montant</td>
<td>$row->montant_allowed</td>
<td>$row->dateA</td> <td>$row->dateA</td>
<td>$row->dateM</td> <td>$row->dateM</td>
<td>".duree($row->temps)."</td> <td>".duree($row->temps)."</td>
@ -726,9 +745,8 @@
echo "<tr class='label-primary'> echo "<tr class='label-primary'>
<th></th> <th></th>
<th>".$this->lang->line('Membre')."</th> <th>".$this->lang->line('Membre')."</th>
<th>Ref. Opérateur</th> <th>".$this->lang->line('Parrain')."</th>
<th>Montant demandé</th> <th>".$this->lang->line('Montant')."</th>
<th>Montant envoyé</th>
<th>".$this->lang->line('Date de la demande')."</th> <th>".$this->lang->line('Date de la demande')."</th>
<th>".$this->lang->line('Date de traitement')."</th> <th>".$this->lang->line('Date de traitement')."</th>
<th>".$this->lang->line('Délai de traitement')."</th> <th>".$this->lang->line('Délai de traitement')."</th>
@ -745,7 +763,10 @@
// output data of each row // output data of each row
foreach($result->result() as $row) { foreach($result->result() as $row) {
$num++; $num++;
$superviseur = $row->superviseur;
if($row->superviseur==$this->session->userdata('member_code')){
$superviseur = $this->lang->line('Vous');
}
if($type==$this->lang->line('Adhésion')){ if($type==$this->lang->line('Adhésion')){
echo "<tr> echo "<tr>
@ -761,9 +782,8 @@
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$row->ref_operateur</td> <td>$superviseur</td>
<td>$row->montant</td> <td>$row->montant</td>
<td>$row->montant_allowed</td>
<td>$row->dateA</td> <td>$row->dateA</td>
<td>$row->dateM</td> <td>$row->dateM</td>
<td>".duree($row->temps)."</td> <td>".duree($row->temps)."</td>
@ -854,9 +874,8 @@
echo "<tr class='label-primary'> echo "<tr class='label-primary'>
<th></th> <th></th>
<th>".$this->lang->line('Membre')."</th> <th>".$this->lang->line('Membre')."</th>
<th>Ref. Opérateur</th> <th>".$this->lang->line('Parrain')."</th>
<th>Montant demandé</th> <th>".$this->lang->line('Montant')."</th>
<th>Montant envoyé</th>
<th>".$this->lang->line('Date de la demande')."</th> <th>".$this->lang->line('Date de la demande')."</th>
<th>".$this->lang->line('Date de traitement')."</th> <th>".$this->lang->line('Date de traitement')."</th>
<th>".$this->lang->line('Délai de traitement')."</th> <th>".$this->lang->line('Délai de traitement')."</th>
@ -873,7 +892,10 @@
// output data of each row // output data of each row
foreach($result->result() as $row) { foreach($result->result() as $row) {
$num++; $num++;
$superviseur = $row->superviseur;
if($row->superviseur==$this->session->userdata('member_code')){
$superviseur = $this->lang->line('Vous');
}
if($type==$this->lang->line('Adhésion')){ if($type==$this->lang->line('Adhésion')){
echo "<tr> echo "<tr>
@ -889,9 +911,8 @@
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$row->ref_operateur</td> <td>$superviseur</td>
<td>$row->montant</td> <td>$row->montant</td>
<td>$row->montant_allowed</td>
<td>$row->dateA</td> <td>$row->dateA</td>
<td>$row->dateM</td> <td>$row->dateM</td>
<td>".duree($row->temps)."</td> <td>".duree($row->temps)."</td>
@ -988,9 +1009,8 @@
<th>".$this->lang->line('Reseau')."</th> <th>".$this->lang->line('Reseau')."</th>
<th>".$this->lang->line('Téléphone utilisateur')."</th> <th>".$this->lang->line('Téléphone utilisateur')."</th>
<th>".$this->lang->line('Emetteur')."</th> <th>".$this->lang->line('Emetteur')."</th>
<th>Ref. Opérateur</th> <th>".$this->lang->line('Parrain')."</th>
<th>Montant demandé</th> <th>".$this->lang->line('Montant')."</th>
<th>Montant envoyé</th>
<th>".$this->lang->line('Date de la demande')."</th> <th>".$this->lang->line('Date de la demande')."</th>
<th>".$this->lang->line('Date de traitement')."</th> <th>".$this->lang->line('Date de traitement')."</th>
<th>".$this->lang->line('Statut')."</th> <th>".$this->lang->line('Statut')."</th>
@ -1032,12 +1052,12 @@
$etat = $this->lang->line("traitée"); $etat = $this->lang->line("traitée");
} }
$origin = $row->codeMembre; $origin = $row->codeMembre;
$destination = $row->ref_operateur; $destination = $row->codeParrain;
if($row->codeMembre==$this->session->userdata('member_code')){ if($row->codeMembre==$this->session->userdata('member_code')){
$origin = $this->lang->line('Vous'); $origin = $this->lang->line('Vous');
} }
if($row->ref_operateur=="0"){ if($row->codeParrain==$this->session->userdata('member_code')){
$destination = "XXX_XXX"; $destination = $this->lang->line('Vous');
} }
echo "<tr> echo "<tr>
@ -1046,7 +1066,6 @@
<td >$origin </td> <td >$origin </td>
<td>$destination</td> <td>$destination</td>
<td > $row->montant</td> <td > $row->montant</td>
<td > $row->montant_allowed</td>
<td>$row->dateAjout </td> <td>$row->dateAjout </td>
<td > $row->dateModif</td> <td > $row->dateModif</td>
<td>$etat</td> <td>$etat</td>
@ -1133,9 +1152,8 @@
echo "<tr class='label-primary'> echo "<tr class='label-primary'>
<th></th> <th></th>
<th>".$this->lang->line('Membre')."</th> <th>".$this->lang->line('Membre')."</th>
<th>Ref. Opérateur</th> <th>".$this->lang->line('Parrain')."</th>
<th>Montant demandé</th> <th>".$this->lang->line('Montant')."</th>
<th>Montant envoyé</th>
<th>".$this->lang->line('Date de la demande')."</th> <th>".$this->lang->line('Date de la demande')."</th>
<th>".$this->lang->line('Date de traitement')."</th> <th>".$this->lang->line('Date de traitement')."</th>
<th>".$this->lang->line('Délai de traitement')."</th> <th>".$this->lang->line('Délai de traitement')."</th>
@ -1152,14 +1170,17 @@
// output data of each row // output data of each row
foreach($result->result() as $row) { foreach($result->result() as $row) {
$num++; $num++;
$superviseur = $row->superviseur;
if($row->superviseur==$this->session->userdata('member_code')){
$superviseur = $this->lang->line('Vous');
}
if($type==$this->lang->line('Adhésion')){ if($type==$this->lang->line('Adhésion')){
echo "<tr> echo "<tr>
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$row->superviseur</td> <td>$superviseur</td>
<td>$row->dateA</td> <td>$row->dateA</td>
<td>$row->dateM</td> <td>$row->dateM</td>
<td>".duree($row->temps)."</td> <td>".duree($row->temps)."</td>
@ -1169,9 +1190,8 @@
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$row->ref_operateur</td> <td>$superviseur</td>
<td>$row->montant</td> <td>$row->montant</td>
<td>$row->montant_allowed</td>
<td>$row->dateA</td> <td>$row->dateA</td>
<td>$row->dateM</td> <td>$row->dateM</td>
<td>".duree($row->temps)."</td> <td>".duree($row->temps)."</td>
@ -1262,9 +1282,8 @@
echo "<tr class='label-primary'> echo "<tr class='label-primary'>
<th></th> <th></th>
<th>".$this->lang->line('Membre')."</th> <th>".$this->lang->line('Membre')."</th>
<th>Ref. Opérateur</th> <th>".$this->lang->line('Parrain')."</th>
<th>Montant demandé</th> <th>".$this->lang->line('Montant')."</th>
<th>Montant envoyé</th>
<th>".$this->lang->line('Date de la demande')."</th> <th>".$this->lang->line('Date de la demande')."</th>
<th>".$this->lang->line('Date de traitement')."</th> <th>".$this->lang->line('Date de traitement')."</th>
<th>".$this->lang->line('Délai de traitement')."</th> <th>".$this->lang->line('Délai de traitement')."</th>
@ -1281,13 +1300,16 @@
// output data of each row // output data of each row
foreach($result->result() as $row) { foreach($result->result() as $row) {
$num++; $num++;
$superviseur = $row->superviseur;
if($row->superviseur==$this->session->userdata('member_code')){
$superviseur = $this->lang->line('Vous');
}
if($type==$this->lang->line('Adhésion')){ if($type==$this->lang->line('Adhésion')){
echo "<tr> echo "<tr>
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$row->superviseur</td> <td>$superviseur</td>
<td>$row->dateA</td> <td>$row->dateA</td>
<td>$row->dateM</td> <td>$row->dateM</td>
<td>".duree($row->temps)."</td> <td>".duree($row->temps)."</td>
@ -1297,9 +1319,8 @@
<td>$num</td> <td>$num</td>
<td>$row->emetteur</td> <td>$row->emetteur</td>
<td>$row->ref_operateur</td> <td>$superviseur</td>
<td>$row->montant</td> <td>$row->montant</td>
<td>$row->montant_allowed</td>
<td>$row->dateA</td> <td>$row->dateA</td>
<td>$row->dateM</td> <td>$row->dateM</td>
<td>".duree($row->temps)."</td> <td>".duree($row->temps)."</td>
@ -1355,13 +1376,91 @@
<!-- AdminLTE for demo purposes --> <!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url('dist/js/demo.js') ?>"></script> <script src="<?php echo base_url('dist/js/demo.js') ?>"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
<script> <script>
$(function () { $(function () {
$('#listeMembres').DataTable(); $('#listeMembres').DataTable();
$('#listeMembres1').DataTable(); $('#listeMembres1').DataTable();
$('#listeMembres2').DataTable(); $('#listeMembres2').DataTable();
}) });
</script>
<script type="text/javascript">
var startDate;
var endDate;
function GetURLParameter(sParam)
{
var sPageURL = window.location.search.substring(1);
var sURLVariables = sPageURL.split('&');
for (var i = 0; i < sURLVariables.length; i++)
{
var sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] == sParam)
{
return decodeURIComponent(sParameterName[1]);
}
}
}
$(function() {
var start = moment().subtract(29, 'days');
var end = moment();
startDate = start;
endDate = end;
function cb(start, end) {
$('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
startDate = start;
endDate = end;
}
$('#reportrange').daterangepicker({
startDate: start,
endDate: end,
ranges: {
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
}
}, cb);
cb(start, end);
});
$('#send-getDemandes').click(function(){
var debut = startDate.format('YYYY-MM-DD');
var fin = endDate.format('YYYY-MM-DD');
var user_geo = $('#selected-geo-user').find(":selected").val();
window.location.replace("<?php echo base_url('index.php/Superviseur_dash/getDemandes')?>"+"?d="+debut+"&f="+fin+"&u="+user_geo);
});
$(function() {
$('input[name="daterange"]').daterangepicker({
opens: 'left'
}, function(start, end, label) {
startDate = start;
endDate = end;
});
});
$('#change-periode').click(function(){
var debut = startDate.format('YYYY-MM-DD');
var fin = endDate.format('YYYY-MM-DD');
var user_geo = GetURLParameter("u");
window.location.replace("<?php echo base_url('index.php/Superviseur_dash/getDemandes')?>"+"?d="+debut+"&f="+fin+"&u="+user_geo);
});
</script> </script>
<script type='text/javascript'> <script type='text/javascript'>

View File

@ -139,7 +139,7 @@ if ($transactions != false) {
<section class="content-header"> <section class="content-header">
<h1> <h1>
Gestion des wallets <?php echo $network; ?> Gestion des wallets <?php echo $network .' - '.$country; ?>
</h1> </h1>
<?php <?php
$site_url = base_url(); $site_url = base_url();
@ -305,7 +305,7 @@ if ($transactions != false) {
<h3 class="box-title">Retraits et dépots des 12 derniers <h3 class="box-title">Retraits et dépots des 12 derniers
mois<?php //echo $this->lang->line('Souscription des 12 derniers mois'); ?></h3> mois<?php //echo $this->lang->line('Souscription des 12 derniers mois'); ?></h3>
<div class="box-tools"> <div class="box-tools">
<a class="btn btn-primary" href=""> Historique </a> <a class="btn btn-primary" href="<?php echo current_url().($network_id ? '?id='.$network_id . '&history=true' : '')?>"> Historique </a>
</div> </div>
</div> </div>
<div class="box-body"> <div class="box-body">

View File

@ -212,7 +212,6 @@
<script> <script>
$(function() { $(function() {
$('#unvalidated').DataTable();
$('#validated').DataTable(); $('#validated').DataTable();
}) })
</script> </script>

View File

@ -0,0 +1,176 @@
<!-- 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"/>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?php echo $this->lang->line('Gestion des wallets') . ' '.$network.' - '.$country; ?>
<!-- <input type="button" class="btn btn-primary pull-right" id="Bactiver"-->
<!-- value="Activer/Désactiver le(s) réseau(x)" />-->
</h1>
<?php
$site_url = base_url();
if ($alert == "ok") {
if (!$success == "ok") {
?>
<div class='alert alert-danger alert-dismissible col-xs-6'>
<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>
<h4><i class='icon fa fa-ban'></i> Erreur!</h4>
<?php echo $message; ?>
</div>
<?php
} else {
?>
<div class="alert alert-success alert-dismissible col-xs-6">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<h4><i class="icon fa fa-check"></i> Success!</h4>
<?php echo $message; ?>
</div>
<?php
}
}
?>
</section>
<section class="content">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<!-- <span 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>
<div class="info-box-content">
<span class="info-box-text">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"
value="<?php echo ($startDate!=null & $endDate != null) ? $startDate. ' - '.$endDate : ''?>"/>
</span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title">Historique des transactions</h3>
</div>
<div class="box-body">
<?php
$numrows = sizeof($transactions);
$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 align='center'> Type</th>
<th> Montant</th>
<th>Commission de la banque</th>
<th>Commission de l'hyperviseur</th>
<th>Commission du superviseur</th>
<th>Commission de l'agent</th>
<th align='center'>Date</th>
</tr>
</thead>
<tbody>
<?php
foreach ($transactions as $row) {
$num++;
echo "<tr>
<td align='center' >$row->id</td>
<td>".strtoupper($row->type_transac)."</td>
<td>".$fmt->format($row->montant)."</td>
<td>".$fmt->format( $row->commission_banque)."</td>
<td>".$fmt->format( $row->commission_hyp)."</td>
<td>".$fmt->format( $row->commission_sup)."</td>
<td>".$fmt->format( $row->commission_ag)."</td>
<td> $row->date_created</td>
</tr>";
}
?>
</tbody>
<?php
} 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.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script>
$(function () {
$('#transactions').DataTable();
});
</script>
<script type="text/javascript">
var startDate;
var endDate;
$(function () {
$('input[name="daterange"]').daterangepicker({
opens: 'left',
autoUpdateInput: false,
locale: {
format: 'DD-MM-YYYY',
cancelLabel: 'Clear'
}
}, function (start, end, label) {
const debut = start.format('DD-MM-YYYY');
const fin = end.format('DD-MM-YYYY');
window.location = "<?php echo current_url()?>" + "?id=118&history=true" + "&d=" + debut + "&f=" + fin;
});
});
</script>