+ Fix demande.php for Hyperviseur and Superviseur
This commit is contained in:
parent
09de7da955
commit
dc2e5f68be
|
@ -1549,11 +1549,7 @@ class Gestion extends CI_Controller
|
||||||
|
|
||||||
$network_id = $this->input->get('id');
|
$network_id = $this->input->get('id');
|
||||||
if($this->input->get('history')){
|
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'));
|
||||||
$this->historique($network_id,$this->input->get('d'),$this->input->get('f'));
|
|
||||||
}else{
|
|
||||||
$this->historique($network_id,null,null);
|
|
||||||
}
|
|
||||||
}else{
|
}else{
|
||||||
$taux = $this->user_model->getTaux($network_id);
|
$taux = $this->user_model->getTaux($network_id);
|
||||||
if ($taux != null) {
|
if ($taux != null) {
|
||||||
|
@ -1567,7 +1563,7 @@ class Gestion extends CI_Controller
|
||||||
$data['taux_bq_d'] = $taux->part_banque_depot;
|
$data['taux_bq_d'] = $taux->part_banque_depot;
|
||||||
$data['taux_bq_r'] = $taux->part_banque_retrait;
|
$data['taux_bq_r'] = $taux->part_banque_retrait;
|
||||||
$data['frais_d'] = $taux->frais_min_banque_depot;
|
$data['frais_d'] = $taux->frais_min_banque_depot;
|
||||||
$data['transactions'] = $this->user_model->getTransactions($network_id);
|
$data['transactions'] = $this->user_model->getTransactions(null,null,$network_id);
|
||||||
$totalCommissionBanque = 0;
|
$totalCommissionBanque = 0;
|
||||||
if($data['transactions']){
|
if($data['transactions']){
|
||||||
foreach ($data['transactions']->result() as $row) {
|
foreach ($data['transactions']->result() as $row) {
|
||||||
|
@ -1718,22 +1714,22 @@ class Gestion extends CI_Controller
|
||||||
private function historique($network_id ,$startDate ,$endDate)
|
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['startDate'] = $startDate;
|
||||||
$data['endDate'] = $endDate;
|
$data['endDate'] = $endDate;
|
||||||
$data['transactions'] = $transactions;
|
$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['active'] = "wallet";
|
||||||
$data['alert'] = "";
|
$data['alert'] = "";
|
||||||
$data['networks'] = $this->user_model->getAllActivatedNetworks();
|
$data['networks'] = $this->user_model->getAllActivatedNetworks();
|
||||||
|
|
|
@ -187,29 +187,28 @@ 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') or $this->input->get("u") !== null)
|
if($this->input->get("u") !== null)
|
||||||
{
|
{
|
||||||
$super = $this->input->post('super');
|
$super = $this->input->get("u");
|
||||||
$this->session->set_userdata("current_super_demande", $this->input->post('super'));
|
$this->session->set_userdata("current_super_demande", $super);
|
||||||
if($this->input->post('super') == null){
|
|
||||||
$super = $this->input->get("u");
|
|
||||||
$this->session->set_userdata("current_super_demande", $super);
|
|
||||||
}
|
|
||||||
|
|
||||||
$debut ="";
|
$debut ="";
|
||||||
$fin = "";
|
$fin = "";
|
||||||
if($this->input->get("d") !== null){
|
if($this->input->get("d") !== null){
|
||||||
|
|
||||||
$debut = $this->input->get("d");
|
$debut = $this->input->get("d");
|
||||||
$fin = $this->input->get("f");
|
$fin = $this->input->get("f");
|
||||||
}else{
|
}else{
|
||||||
$fin = date('Y-m-d H:i:s');
|
$fin = date('Y-m-d');
|
||||||
$debut = Date('Y-m-d H:i:s', strtotime("-3 days"));
|
$debut = Date('Y-m-d', strtotime("-5 days"));
|
||||||
}
|
}
|
||||||
|
$data['debut'] = $debut;
|
||||||
|
$data['fin'] = $fin;
|
||||||
|
$fin = Date('Y-m-d', strtotime($fin."+1 day"));
|
||||||
|
|
||||||
$ville = $this->session->userdata('ville');
|
$ville = $this->session->userdata('ville');
|
||||||
$data['active'] = "demandes";
|
$data['active'] = "demandes";
|
||||||
$data['type'] = $this->lang->line('crédits');
|
$data['type'] = $this->lang->line('crédits');
|
||||||
|
$data['demand_type'] = 'credit';
|
||||||
$data['alert'] = "";
|
$data['alert'] = "";
|
||||||
$data['token'] = $this->session->userdata('token');
|
$data['token'] = $this->session->userdata('token');
|
||||||
$data['email'] = $this->session->userdata('email');
|
$data['email'] = $this->session->userdata('email');
|
||||||
|
@ -262,7 +261,11 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
$this->load->view('login', $data);
|
$this->load->view('login', $data);
|
||||||
} else {
|
} else {
|
||||||
$network = $this->session->userdata('network');
|
$network = $this->session->userdata('network');
|
||||||
|
$debut = $this->input->get("d");
|
||||||
|
$fin = $this->input->get("f");
|
||||||
|
$data['debut'] = $debut;
|
||||||
|
$data['fin'] = $fin;
|
||||||
|
$data['demand_type'] = 'adhesion';
|
||||||
$data['active'] = "demandesAd";
|
$data['active'] = "demandesAd";
|
||||||
$data['alert'] = "";
|
$data['alert'] = "";
|
||||||
$data['token'] = $this->session->userdata('token');
|
$data['token'] = $this->session->userdata('token');
|
||||||
|
@ -274,10 +277,10 @@ class Hyperviseur_dash extends CI_Controller
|
||||||
$data['adresse'] = $this->session->userdata('adresse');
|
$data['adresse'] = $this->session->userdata('adresse');
|
||||||
$data['category'] = $this->session->userdata('category');
|
$data['category'] = $this->session->userdata('category');
|
||||||
$data['network'] = $this->session->userdata('network');
|
$data['network'] = $this->session->userdata('network');
|
||||||
$data['tab_fastDemande'] = $this->user_model->getRangeASCDemandesAd($this->session->userdata('member_code'));
|
$data['tab_fastDemande'] = $this->user_model->getRangeASCDemandesAd($debut, $fin ,$this->session->userdata('member_code'));
|
||||||
$data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandesAd($this->session->userdata('member_code'));
|
$data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandesAd($debut, $fin ,$this->session->userdata('member_code'));
|
||||||
$data['temp_moyen'] = $this->user_model->getTempsMoyenAd($this->session->userdata('member_code'));
|
$data['temp_moyen'] = $this->user_model->getTempsMoyenAd($debut, $fin ,$this->session->userdata('member_code'));
|
||||||
$data['list'] = $this->user_model->getDemandesAdForSuper($this->session->userdata('member_code'));
|
$data['list'] = $this->user_model->getDemandesAdForSuper($debut, $fin , $this->session->userdata('member_code'));
|
||||||
$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['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
|
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
|
||||||
|
|
|
@ -118,10 +118,14 @@ class Superviseur_dash extends CI_Controller
|
||||||
$user_geo = $this->input->get("u");
|
$user_geo = $this->input->get("u");
|
||||||
$debut = $this->input->get("d");
|
$debut = $this->input->get("d");
|
||||||
$fin = $this->input->get("f");
|
$fin = $this->input->get("f");
|
||||||
|
$data['debut'] = $debut;
|
||||||
|
$data['fin'] = $fin;
|
||||||
|
$fin = Date('Y-m-d', strtotime($fin."+1 day")); // Increment date because SQL BETWEEN
|
||||||
|
|
||||||
$network = $this->session->userdata('network');
|
$network = $this->session->userdata('network');
|
||||||
$data['active'] = "demandes";
|
$data['active'] = "demandes";
|
||||||
$data['type'] = $this->lang->line('crédits');
|
$data['type'] = $this->lang->line('crédits');
|
||||||
|
$data['demand_type'] = 'credit';
|
||||||
$data['alert'] = "";
|
$data['alert'] = "";
|
||||||
$data['token'] = $this->session->userdata('token');
|
$data['token'] = $this->session->userdata('token');
|
||||||
$data['email'] = $this->session->userdata('email');
|
$data['email'] = $this->session->userdata('email');
|
||||||
|
@ -165,9 +169,13 @@ class Superviseur_dash extends CI_Controller
|
||||||
$this->load->view('login', $data);
|
$this->load->view('login', $data);
|
||||||
} else {
|
} else {
|
||||||
$network = $this->session->userdata('network');
|
$network = $this->session->userdata('network');
|
||||||
|
$debut = $this->input->get("d");
|
||||||
|
$fin = $this->input->get("f");
|
||||||
|
$data['debut'] = $debut;
|
||||||
|
$data['fin'] = $fin;
|
||||||
$data['active'] = "demandesAd";
|
$data['active'] = "demandesAd";
|
||||||
$data['alert'] = "";
|
$data['alert'] = "";
|
||||||
|
$data['demand_type'] = 'adhesion';
|
||||||
$data['token'] = $this->session->userdata('token');
|
$data['token'] = $this->session->userdata('token');
|
||||||
$data['email'] = $this->session->userdata('email');
|
$data['email'] = $this->session->userdata('email');
|
||||||
$data['firstname'] = $this->session->userdata('firstname');
|
$data['firstname'] = $this->session->userdata('firstname');
|
||||||
|
@ -177,12 +185,14 @@ class Superviseur_dash extends CI_Controller
|
||||||
$data['adresse'] = $this->session->userdata('adresse');
|
$data['adresse'] = $this->session->userdata('adresse');
|
||||||
$data['category'] = $this->session->userdata('category');
|
$data['category'] = $this->session->userdata('category');
|
||||||
$data['network'] = $this->session->userdata('network');
|
$data['network'] = $this->session->userdata('network');
|
||||||
$data['tab_fastDemande'] = $this->user_model->getRangeASCDemandesAd($this->session->userdata('member_code'));
|
$data['tab_fastDemande'] = $this->user_model->getRangeASCDemandesAd($debut, $fin ,$this->session->userdata('member_code'));
|
||||||
$data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandesAd($this->session->userdata('member_code'));
|
$data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandesAd($debut, $fin ,$this->session->userdata('member_code'));
|
||||||
$data['mydem'] = $this->user_model->getDemandesHyperForSuper($this->session->userdata('member_code'));
|
$data['mydem'] = $this->user_model->getDemandesHyperForSuper($this->session->userdata('member_code'));
|
||||||
$data['temp_moyen'] = $this->user_model->getTempsMoyenAd($this->session->userdata('member_code'));
|
$data['temp_moyen'] = $this->user_model->getTempsMoyenAd($debut, $fin ,$this->session->userdata('member_code'));
|
||||||
$data['list'] = $this->user_model->getDemandesAdForSuper($this->session->userdata('member_code'));
|
$data['list'] = $this->user_model->getDemandesAdForSuper($debut, $fin ,$this->session->userdata('member_code'));
|
||||||
$data['type'] = 'adhésions';
|
$data['type'] = $this->lang->line('Adhésion');
|
||||||
|
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||||
|
$data['geolocated_user'] = $this->user_model->getSuperNameAndCodeForSup($this->session->userdata('member_code'));
|
||||||
$this->load->view('header_sup', $data);
|
$this->load->view('header_sup', $data);
|
||||||
$this->load->view('demande');
|
$this->load->view('demande');
|
||||||
$this->load->view('footer');
|
$this->load->view('footer');
|
||||||
|
|
|
@ -313,15 +313,15 @@ class User_model extends CI_Model
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDemandesAdForSuper($member_code){
|
public function getDemandesAdForSuper($debut , $fin , $member_code){
|
||||||
|
$chain = $debut ? "AND d.date_creation BETWEEN '".$debut."' AND '".$fin."'" : "";
|
||||||
$query = $this->db->query("SELECT *,
|
$query = $this->db->query("SELECT *,
|
||||||
(SELECT TIMESTAMPDIFF(SECOND,date_creation,date_modified)
|
(SELECT TIMESTAMPDIFF(SECOND,date_creation,date_modified)
|
||||||
FROM demandeAdhesion AS req_im
|
FROM demandeAdhesion AS req_im
|
||||||
WHERE req_im.id=d.id_demande) AS temps
|
WHERE req_im.id=d.id_demande) AS temps
|
||||||
FROM info_demandesAdhesion AS d
|
FROM info_demandesAdhesion AS d
|
||||||
WHERE d.code_membre='".$member_code."'
|
WHERE d.code_membre='".$member_code."'".$chain.
|
||||||
ORDER BY date_creation");
|
"ORDER BY date_creation");
|
||||||
|
|
||||||
if($query->num_rows()>0){
|
if($query->num_rows()>0){
|
||||||
return $query;
|
return $query;
|
||||||
|
@ -558,7 +558,7 @@ class User_model extends CI_Model
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRangeASCDemandesAd($codeParrain){
|
public function getRangeASCDemandesAd($debut , $fin , $codeParrain){
|
||||||
|
|
||||||
if($codeParrain=='all'){
|
if($codeParrain=='all'){
|
||||||
$query = $this->db->query("SELECT d.phone AS emetteur, d.code_membre AS superviseur, d.categorie AS montant,d.date_creation AS dateA,d.date_modified AS dateM,
|
$query = $this->db->query("SELECT d.phone AS emetteur, d.code_membre AS superviseur, d.categorie AS montant,d.date_creation AS dateA,d.date_modified AS dateM,
|
||||||
|
@ -570,14 +570,15 @@ class User_model extends CI_Model
|
||||||
ORDER BY temps
|
ORDER BY temps
|
||||||
LIMIT 5");
|
LIMIT 5");
|
||||||
}else{
|
}else{
|
||||||
|
$chain = $debut ? "AND d.date_creation BETWEEN '".$debut."' AND '".$fin."'" : "";
|
||||||
$query = $this->db->query("SELECT d.phone AS emetteur, d.code_membre AS superviseur, d.date_creation AS dateA,d.date_modified AS dateM,
|
$query = $this->db->query("SELECT d.phone AS emetteur, d.code_membre AS superviseur, d.date_creation AS dateA,d.date_modified AS dateM,
|
||||||
(SELECT TIMESTAMPDIFF(SECOND,date_creation,date_modified)
|
(SELECT TIMESTAMPDIFF(SECOND,date_creation,date_modified)
|
||||||
FROM demandeAdhesion AS req_im
|
FROM demandeAdhesion AS req_im
|
||||||
WHERE req_im.etat=1
|
WHERE req_im.etat=1
|
||||||
AND req_im.id=d.id_demande) AS temps
|
AND req_im.id=d.id_demande) AS temps
|
||||||
FROM info_demandesAdhesion AS d
|
FROM info_demandesAdhesion AS d
|
||||||
WHERE etat=1 AND d.code_membre='".$codeParrain."'
|
WHERE etat=1 AND d.code_membre='".$codeParrain."'". $chain
|
||||||
ORDER BY temps
|
."ORDER BY temps
|
||||||
LIMIT 5");
|
LIMIT 5");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -661,7 +662,7 @@ class User_model extends CI_Model
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRangeDESCDemandesAd($codeParrain){
|
public function getRangeDESCDemandesAd($debut, $fin , $codeParrain){
|
||||||
|
|
||||||
if($codeParrain=='all'){
|
if($codeParrain=='all'){
|
||||||
$query = $this->db->query("SELECT d.phone AS emetteur, d.code AS superviseur, d.categorie AS montant,d.dateAjout AS dateA,d.dateModif AS dateM,
|
$query = $this->db->query("SELECT d.phone AS emetteur, d.code AS superviseur, d.categorie AS montant,d.dateAjout AS dateA,d.dateModif AS dateM,
|
||||||
|
@ -673,14 +674,15 @@ class User_model extends CI_Model
|
||||||
ORDER BY temps DESC
|
ORDER BY temps DESC
|
||||||
LIMIT 5");
|
LIMIT 5");
|
||||||
}else{
|
}else{
|
||||||
|
$chain = $debut ? "AND d.date_creation BETWEEN '".$debut."' AND '".$fin."'" : "";
|
||||||
$query = $this->db->query("SELECT d.phone AS emetteur, d.code_membre AS superviseur, d.date_creation AS dateA,d.date_modified AS dateM,
|
$query = $this->db->query("SELECT d.phone AS emetteur, d.code_membre AS superviseur, d.date_creation AS dateA,d.date_modified AS dateM,
|
||||||
(SELECT TIMESTAMPDIFF(SECOND,date_creation,date_modified)
|
(SELECT TIMESTAMPDIFF(SECOND,date_creation,date_modified)
|
||||||
FROM demandeAdhesion AS req_im
|
FROM demandeAdhesion AS req_im
|
||||||
WHERE req_im.etat=1
|
WHERE req_im.etat=1
|
||||||
AND req_im.id=d.id_demande) AS temps
|
AND req_im.id=d.id_demande) AS temps
|
||||||
FROM info_demandesAdhesion AS d
|
FROM info_demandesAdhesion AS d
|
||||||
WHERE etat=1 AND d.code_membre='".$codeParrain."'
|
WHERE etat=1 AND d.code_membre='".$codeParrain."'".$chain.
|
||||||
ORDER BY temps DESC
|
"ORDER BY temps DESC
|
||||||
LIMIT 5");
|
LIMIT 5");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -744,12 +746,13 @@ class User_model extends CI_Model
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTempsMoyenAd($codeParrain){
|
public function getTempsMoyenAd($debut, $fin, $codeParrain){
|
||||||
|
|
||||||
if($codeParrain=='all'){
|
if($codeParrain=='all'){
|
||||||
$query = $this->db->query("SELECT AVG(TIMESTAMPDIFF(SECOND,dateAjout,dateModif)) AS temps FROM demande_superviseur WHERE statut=1");
|
$query = $this->db->query("SELECT AVG(TIMESTAMPDIFF(SECOND,dateAjout,dateModif)) AS temps FROM demande_superviseur WHERE statut=1");
|
||||||
}else{
|
}else{
|
||||||
$query = $this->db->query("SELECT AVG(TIMESTAMPDIFF(SECOND,date_creation,date_modified)) AS temps FROM info_demandesAdhesion WHERE etat=1 AND code_membre='".$codeParrain."'");
|
$chain = $debut ? "AND date_creation BETWEEN '".$debut."' AND '".$fin."'" : "";
|
||||||
|
$query = $this->db->query("SELECT AVG(TIMESTAMPDIFF(SECOND,date_creation,date_modified)) AS temps FROM info_demandesAdhesion WHERE etat=1 AND code_membre='".$codeParrain."'".$chain);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($query->num_rows()>0){
|
if($query->num_rows()>0){
|
||||||
|
@ -1868,10 +1871,11 @@ class User_model extends CI_Model
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTransactions($id_network){
|
public function getTransactions($debut , $fin , $id_network){
|
||||||
|
$chain = $debut ? " AND date_created BETWEEN '".$debut."' AND '".$fin."'" : "";
|
||||||
$query = $this->db->query("SELECT *
|
$query = $this->db->query("SELECT *
|
||||||
FROM infos_transaction
|
FROM infos_transaction
|
||||||
WHERE `network_id`=".$id_network);
|
WHERE `network_id`=".$id_network.$chain);
|
||||||
if($query->num_rows()>0){
|
if($query->num_rows()>0){
|
||||||
return $query;
|
return $query;
|
||||||
}else{
|
}else{
|
||||||
|
|
|
@ -86,18 +86,19 @@
|
||||||
</div>
|
</div>
|
||||||
<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">
|
||||||
<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-time"></i></span>
|
||||||
|
|
||||||
<div class="info-box-content">
|
<div class="info-box-content">
|
||||||
<?php
|
<?php
|
||||||
if($this->session->userdata('category') == "super"){
|
if($this->session->userdata('category') == "super"){
|
||||||
echo "<span class='info-box-number'>".$nameOfcurentGeolocatedUser."</span>";
|
if(isset($nameOfcurentGeolocatedUser))
|
||||||
|
echo "<span class='info-box-number'>".$nameOfcurentGeolocatedUser."</span>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<span class="info-box-text">Période </span>
|
<span class="info-box-text">Période </span>
|
||||||
<span class="info-box-number">
|
<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/2020 - 12/31/2020" />
|
<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') ?>"
|
||||||
|
value="<?php echo ($debut!=null & $fin != null) ? $debut. ' - '.$fin : ''?>"
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1438,27 +1439,35 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#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() {
|
$(function() {
|
||||||
|
const type = $('#picker').data('type');
|
||||||
|
const category = $('#picker').data('category');
|
||||||
$('input[name="daterange"]').daterangepicker({
|
$('input[name="daterange"]').daterangepicker({
|
||||||
opens: 'left'
|
opens: 'left',
|
||||||
|
autoUpdateInput: false,
|
||||||
|
locale: {
|
||||||
|
format: 'YYYY-MM-DD',
|
||||||
|
cancelLabel: 'Clear'
|
||||||
|
}
|
||||||
}, function(start, end, label) {
|
}, function(start, end, label) {
|
||||||
startDate = start;
|
const debut = start.format('YYYY-MM-DD');
|
||||||
endDate = end;
|
const fin = end.format('YYYY-MM-DD');
|
||||||
});
|
const user_geo = GetURLParameter("u");
|
||||||
});
|
if(category == 'super'){
|
||||||
|
if(type == 'credit'){
|
||||||
|
window.location.replace("<?php echo base_url('index.php/Superviseur_dash/getDemandes')?>"+"?d="+debut+"&f="+fin+"&u="+user_geo);
|
||||||
|
}else if (type == 'adhesion'){
|
||||||
|
window.location.replace("<?php echo base_url('index.php/Superviseur_dash/getDemandesAd')?>"+"?d="+debut+"&f="+fin);
|
||||||
|
}
|
||||||
|
}else if (category == 'hyper'){
|
||||||
|
if(type == 'credit'){
|
||||||
|
window.location.replace("<?php echo base_url('index.php/Hyperviseur_dash/getDemandes')?>"+"?d="+debut+"&f="+fin+"&u="+user_geo);
|
||||||
|
}else if (type == 'adhesion'){
|
||||||
|
window.location.replace("<?php echo base_url('index.php/Hyperviseur_dash/getDemandesAd')?>"+"?d="+debut+"&f="+fin);
|
||||||
|
}
|
||||||
|
|
||||||
$('#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>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
|
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
@ -202,44 +201,102 @@
|
||||||
|
|
||||||
<div class="modal fade" id="modal-default2">
|
<div class="modal fade" id="modal-default2">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<form action="<?php echo base_url('index.php/Hyperviseur_dash/getDemandes')?>" method="post">
|
<form action="#" method="post" id="getDemandes">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title"><?php echo $this->lang->line('Superviseur'); ?></h4>
|
<h4 class="modal-title"><?php echo $this->lang->line('Utilisateurs_géolocalisés'); ?></h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$result=$superviseurs;
|
$result=$superviseurs;;
|
||||||
|
|
||||||
$numrows=$result->num_rows();
|
$numrows=$result->num_rows();
|
||||||
|
|
||||||
if ($numrows > 0) { ?>
|
if ($numrows > 0) { ?>
|
||||||
<select class="form-control input-lg" name="super" required>
|
<label for="selected-super">Superviseur</label>
|
||||||
<?php foreach($result->result() as $row) {
|
<select class="form-control input-lg" name="geo_user" id="selected-super" required>
|
||||||
|
<?php foreach($result->result() as $row) {
|
||||||
|
|
||||||
echo "<option value='".$row->member_code."'>".$row->lastname." - ".$row->member_code."</option>";
|
echo "<option value='".$row->member_code."'>".$row->lastname." - ".$row->member_code."</option>";
|
||||||
} ?>
|
} ?>
|
||||||
</select>
|
</select>
|
||||||
<?php }else{
|
<?php }else{
|
||||||
echo "Aucun superviseur";
|
echo "Aucun utilisateur gééolocalisé";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="info-box-content">
|
||||||
|
<span class="info-box-text">Période </span>
|
||||||
|
<span class="info-box-number">
|
||||||
|
<div id="reportrange" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
|
||||||
|
<i class="fa fa-calendar"></i>
|
||||||
|
<span></span> <i class="fa fa-caret-down"></i>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<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" class="btn btn-default pull-left" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||||
<button type="submit" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
|
<button type="button" id="send-getDemandes" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.modal -->
|
<!-- /.modal -->
|
||||||
|
|
||||||
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.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 type="text/javascript">
|
||||||
|
var startDate;
|
||||||
|
var endDate;
|
||||||
|
|
||||||
|
$(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-super').find(":selected").val();
|
||||||
|
window.location.replace("<?php echo base_url('index.php/Hyperviseur_dash/getDemandes')?>"+"?d="+debut+"&f="+fin+"&u="+user_geo);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
|
@ -117,11 +117,11 @@
|
||||||
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Demandes de crédits'); ?></span>
|
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Demandes de crédits'); ?></span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<!-- <li class="<?php // if($active=="demandesAd"){echo "active ";} ?>">
|
<li class="<?php if($active=="demandesAd"){echo "active ";} ?>">
|
||||||
<a href="<?php // echo base_url('index.php/Superviseur_dash/getDemandesAd') ?>">
|
<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>Demandes d'adhésion</span>
|
||||||
</a>
|
</a>
|
||||||
</li>-->
|
</li>
|
||||||
<?php if($hasWallet){
|
<?php if($hasWallet){
|
||||||
?>
|
?>
|
||||||
<li class="<?php if($active=="wallet"){echo "active";} ?>">
|
<li class="<?php if($active=="wallet"){echo "active";} ?>">
|
||||||
|
|
|
@ -67,56 +67,59 @@
|
||||||
<h3 class="box-title">Historique des transactions</h3>
|
<h3 class="box-title">Historique des transactions</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$numrows = sizeof($transactions);
|
|
||||||
$num = 0;
|
if($transactions){
|
||||||
if ($numrows > 0) {
|
$numrows = $transactions->num_rows();
|
||||||
$fmt = new NumberFormatter( 'fr_FR', NumberFormatter::DECIMAL );
|
$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->result() as $row) {
|
||||||
|
$num++;
|
||||||
|
$type = $row->type_transac == 'credit' ? 'DEPOT' : 'RETRAIT';
|
||||||
|
echo "<tr>
|
||||||
|
<td align='center' >$row->id</td>
|
||||||
|
<td>".strtoupper($type)."</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');
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
echo $this->lang->line('Aucune transaction');
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<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++;
|
|
||||||
$type = $row->type_transac == 'credit' ? 'DEPOT' : 'RETRAIT';
|
|
||||||
echo "<tr>
|
|
||||||
<td align='center' >$row->id</td>
|
|
||||||
<td>".strtoupper($type)."</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>
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -162,12 +165,12 @@
|
||||||
opens: 'left',
|
opens: 'left',
|
||||||
autoUpdateInput: false,
|
autoUpdateInput: false,
|
||||||
locale: {
|
locale: {
|
||||||
format: 'DD-MM-YYYY',
|
format: 'YYYY-MM-DD',
|
||||||
cancelLabel: 'Clear'
|
cancelLabel: 'Clear'
|
||||||
}
|
}
|
||||||
}, function (start, end, label) {
|
}, function (start, end, label) {
|
||||||
const debut = start.format('DD-MM-YYYY');
|
const debut = start.format('YYYY-MM-DD');
|
||||||
const fin = end.format('DD-MM-YYYY');
|
const fin = end.format('YYYY-MM-DD');
|
||||||
window.location = "<?php echo current_url()?>" + "?id=118&history=true" + "&d=" + debut + "&f=" + fin;
|
window.location = "<?php echo current_url()?>" + "?id=118&history=true" + "&d=" + debut + "&f=" + fin;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue