+ Fix demandes de credits for Superviseur_dash
This commit is contained in:
parent
1460f920f0
commit
09de7da955
|
@ -4,168 +4,190 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
|||
class Superviseur_dash extends CI_Controller
|
||||
{
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->load->model('Users_simple');
|
||||
$this->load->model('User_model');
|
||||
}
|
||||
public function __construct(){
|
||||
parent::__construct();
|
||||
$this->load->model('Users_simple');
|
||||
$this->load->model('User_model');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
if (!$this->session->userdata('email')) {
|
||||
public function index()
|
||||
{
|
||||
if (!$this->session->userdata('email')) {
|
||||
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
redirect('index.php', $data);
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
redirect('index.php', $data);
|
||||
|
||||
} else {
|
||||
} else {
|
||||
|
||||
$count_g = $this->User_model->geolocatedCountByParrain($this->session->userdata('member_code'));
|
||||
$count_d = $this->User_model->getCountDemande($this->session->userdata('member_code'));
|
||||
$count_d_traite = $this->User_model->getCountDemandeByStatut($this->session->userdata('member_code'),1);
|
||||
$count_d_no_traite = $this->User_model->getCountDemandeByStatut($this->session->userdata('member_code'),0);
|
||||
$count_g = $this->User_model->geolocatedCountByParrain($this->session->userdata('member_code'));
|
||||
$count_d = $this->User_model->getCountDemande($this->session->userdata('member_code'));
|
||||
$count_d_traite = $this->User_model->getCountDemandeByStatut($this->session->userdata('member_code'),1);
|
||||
$count_d_no_traite = $this->User_model->getCountDemandeByStatut($this->session->userdata('member_code'),0);
|
||||
|
||||
$data['list_geolocated_users'] = $this->user_model->getUsersGeolocatedForSup($this->session->userdata('member_code'));
|
||||
$data['list_geolocated_users'] = $this->user_model->getUsersGeolocatedForSup($this->session->userdata('member_code'));
|
||||
|
||||
$data['active'] = "dash";
|
||||
$data['token'] = $this->session->userdata('token');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['member_code'] = $this->session->userdata('member_code');
|
||||
$data['phone'] = $this->session->userdata('phone');
|
||||
$data['adresse'] = $this->session->userdata('adresse');
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['network'] = $this->session->userdata('network');
|
||||
$data['code_parrain'] = $this->session->userdata('parrain');
|
||||
$data['listdem'] = $this->user_model->getDemandesForSuper($this->session->userdata('member_code'));
|
||||
$data['count_g_users'] = $count_g;
|
||||
$data['count_d_users'] = $count_d;
|
||||
$data['count_d_traite'] = $count_d_traite;
|
||||
$data['count_d_no_traite'] = $count_d_no_traite;
|
||||
$data['active'] = "dash";
|
||||
$data['token'] = $this->session->userdata('token');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['member_code'] = $this->session->userdata('member_code');
|
||||
$data['phone'] = $this->session->userdata('phone');
|
||||
$data['adresse'] = $this->session->userdata('adresse');
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['network'] = $this->session->userdata('network');
|
||||
$data['code_parrain'] = $this->session->userdata('parrain');
|
||||
$data['listdem'] = $this->user_model->getAllDemandesForSuper($this->session->userdata('member_code'));
|
||||
$data['geolocated_user'] = $this->user_model->getSuperNameAndCodeForSup($this->session->userdata('member_code'));
|
||||
$data['count_g_users'] = $count_g;
|
||||
$data['count_d_users'] = $count_d;
|
||||
$data['count_d_traite'] = $count_d_traite;
|
||||
$data['count_d_no_traite'] = $count_d_no_traite;
|
||||
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||
$this->load->view('header_sup', $data);
|
||||
$this->load->view('superviseur_dash');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
$this->load->view('header_sup', $data);
|
||||
$this->load->view('superviseur_dash');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
public function getAllUser_g(){
|
||||
/**
|
||||
* Affiche la table des points agents du superviseur
|
||||
*/
|
||||
public function getAllUser_g(){
|
||||
|
||||
if (!$this->session->userdata('email')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
if (!$this->session->userdata('email')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
|
||||
|
||||
redirect('index.php', $data);
|
||||
}
|
||||
else {
|
||||
redirect('index.php', $data);
|
||||
}
|
||||
else {
|
||||
|
||||
$position = $this->user_model->getAllpositions($this->session->userdata('network'),'geolocated',$this->session->userdata('member_code'));
|
||||
$position = $this->user_model->getAllpositions($this->session->userdata('network'),'geolocated',$this->session->userdata('member_code'));
|
||||
|
||||
$data['active'] = "geolocated";
|
||||
$data['positions']= $position;
|
||||
$numberGeo = $this->user_model->getNumberGeoBySuper($this->session->userdata('member_code'));
|
||||
if($numberGeo!=false){
|
||||
$data['numberGeo'] = $numberGeo;
|
||||
}else{
|
||||
$data['numberGeo'] = "";
|
||||
}
|
||||
$data['map_title'] = $this->lang->line('Utilisateurs géolocalisés');
|
||||
$data['total_points'] = $this->user_model->getCoutGeolocatedUsersForSuper($this->session->userdata('member_code'));
|
||||
$data['tab'] = $this->user_model->getUsersGeolocatedForSup($this->session->userdata('member_code'));
|
||||
$data['latitude'] = $this->session->userdata('latitude');
|
||||
$data['longitude'] = $this->session->userdata('longitude');
|
||||
$data['token'] = $this->session->userdata('token');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['code_parrain'] = $this->session->userdata('code_parrain');
|
||||
$data['phone'] = $this->session->userdata('phone');
|
||||
$data['adresse'] = $this->session->userdata('adresse');
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['network'] = $this->session->userdata('network');
|
||||
$data['alert'] = "";
|
||||
$data['active'] = "geolocated";
|
||||
$data['positions']= $position;
|
||||
$numberGeo = $this->user_model->getNumberGeoBySuper($this->session->userdata('member_code'));
|
||||
if($numberGeo!=false){
|
||||
$data['numberGeo'] = $numberGeo;
|
||||
}else{
|
||||
$data['numberGeo'] = "";
|
||||
}
|
||||
$data['map_title'] = $this->lang->line('Utilisateurs géolocalisés');
|
||||
$data['total_points'] = $this->user_model->getCoutGeolocatedUsersForSuper($this->session->userdata('member_code'));
|
||||
$data['tab'] = $this->user_model->getUsersGeolocatedForSup($this->session->userdata('member_code'));
|
||||
$data['latitude'] = $this->session->userdata('latitude');
|
||||
$data['longitude'] = $this->session->userdata('longitude');
|
||||
$data['token'] = $this->session->userdata('token');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['code_parrain'] = $this->session->userdata('code_parrain');
|
||||
$data['phone'] = $this->session->userdata('phone');
|
||||
$data['adresse'] = $this->session->userdata('adresse');
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['network'] = $this->session->userdata('network');
|
||||
$data['geolocated_user'] = $this->user_model->getSuperNameAndCodeForSup($this->session->userdata('member_code'));
|
||||
$data['alert'] = "";
|
||||
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||
$this->load->view('header_sup', $data);
|
||||
$this->load->view('listeadmin');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
$this->load->view('header_sup', $data);
|
||||
$this->load->view('listeadmin');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
public function getDemandes(){
|
||||
/**
|
||||
* Affiche les demandes de credits
|
||||
*/
|
||||
public function getDemandes(){
|
||||
|
||||
if (!$this->session->userdata('email')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
$this->load->view('login', $data);
|
||||
} else {
|
||||
$network = $this->session->userdata('network');
|
||||
if (!$this->session->userdata('email')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
$this->load->view('login', $data);
|
||||
} else {
|
||||
|
||||
$data['active'] = "demandes";
|
||||
$data['type'] = $this->lang->line('crédits');
|
||||
$data['alert'] = "";
|
||||
$data['token'] = $this->session->userdata('token');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['code_parrain'] = $this->session->userdata('code_parrain');
|
||||
$data['phone'] = $this->session->userdata('phone');
|
||||
$data['adresse'] = $this->session->userdata('adresse');
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['network'] = $this->session->userdata('network');
|
||||
$data['tab_fastDemande'] = $this->user_model->getRangeASCDemandes($this->session->userdata('member_code'));
|
||||
$data['tab_fastDemande_s'] = $this->user_model->getRangeASCDemandesOut($this->session->userdata('member_code'));
|
||||
$data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandes($this->session->userdata('member_code'));
|
||||
$data['tab_slowDemande_s'] = $this->user_model->getRangeDESCDemandesOut($this->session->userdata('member_code'));
|
||||
$data['mydem'] = $this->user_model->getDemandesHyperForSuper($this->session->userdata('member_code'));
|
||||
$data['temp_moyen'] = $this->user_model->getTempsMoyen($this->session->userdata('member_code'));
|
||||
$data['temp_moyen_mine'] = $this->user_model->getTempsMoyenDemandeSup($this->session->userdata('member_code'));
|
||||
$data['list'] = $this->user_model->getDemandesForSuper($this->session->userdata('member_code'));
|
||||
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||
$this->load->view('header_sup', $data);
|
||||
$this->load->view('demande');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
if($this->input->get("u") !== null){
|
||||
|
||||
public function getDemandesAd(){
|
||||
$user_geo = $this->input->get("u");
|
||||
$debut = $this->input->get("d");
|
||||
$fin = $this->input->get("f");
|
||||
|
||||
if (!$this->session->userdata('email')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
$this->load->view('login', $data);
|
||||
} else {
|
||||
$network = $this->session->userdata('network');
|
||||
$network = $this->session->userdata('network');
|
||||
$data['active'] = "demandes";
|
||||
$data['type'] = $this->lang->line('crédits');
|
||||
$data['alert'] = "";
|
||||
$data['token'] = $this->session->userdata('token');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['code_parrain'] = $this->session->userdata('code_parrain');
|
||||
$data['phone'] = $this->session->userdata('phone');
|
||||
$data['adresse'] = $this->session->userdata('adresse');
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['network'] = $this->session->userdata('network');
|
||||
$data['tab_fastDemande'] = $this->user_model->getRangeASCDemandes($user_geo,$debut,$fin,$this->session->userdata('member_code'));
|
||||
$data['tab_fastDemande_s'] = $this->user_model->getRangeASCDemandesOut($this->session->userdata('member_code'));
|
||||
$data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandes($user_geo,$debut,$fin,$this->session->userdata('member_code'));
|
||||
$data['tab_slowDemande_s'] = $this->user_model->getRangeDESCDemandesOut($this->session->userdata('member_code'));
|
||||
$data['mydem'] = $this->user_model->getDemandesHyperForSuper($this->session->userdata('member_code'));
|
||||
$data['temp_moyen'] = $this->user_model->getTempsMoyen($user_geo,$debut,$fin,$this->session->userdata('member_code'));
|
||||
$data['temp_moyen_mine'] = $this->user_model->getTempsMoyenDemandeSup($this->session->userdata('member_code'));
|
||||
$data['list'] = $this->user_model->getDemandesForSuper($user_geo,$debut,$fin,$this->session->userdata('member_code'));
|
||||
$data['geolocated_user'] = $this->user_model->getSuperNameAndCodeForSup($this->session->userdata('member_code'));
|
||||
$data['nameOfcurentGeolocatedUser'] = $this->user_model->nameOfCurrentGeolocatedUser_forSuper($user_geo);
|
||||
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||
$this->load->view('header_sup', $data);
|
||||
$this->load->view('demande');
|
||||
$this->load->view('footer');
|
||||
}else{
|
||||
|
||||
$data['active'] = "demandesAd";
|
||||
$data['alert'] = "";
|
||||
$data['token'] = $this->session->userdata('token');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['code_parrain'] = $this->session->userdata('code_parrain');
|
||||
$data['phone'] = $this->session->userdata('phone');
|
||||
$data['adresse'] = $this->session->userdata('adresse');
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['network'] = $this->session->userdata('network');
|
||||
$data['tab_fastDemande'] = $this->user_model->getRangeASCDemandesAd($this->session->userdata('member_code'));
|
||||
$data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandesAd($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['list'] = $this->user_model->getDemandesAdForSuper($this->session->userdata('member_code'));
|
||||
$data['type'] = 'adhésions';
|
||||
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
|
||||
$this->load->view('header_sup', $data);
|
||||
$this->load->view('demande');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Afficher les demandes d'adhesion
|
||||
*/
|
||||
public function getDemandesAd(){
|
||||
|
||||
if (!$this->session->userdata('email')) {
|
||||
$this->session->set_flashdata('error', 'log in first');
|
||||
$data['alert'] = "ok";
|
||||
$data['message'] = "Login first!";
|
||||
$this->load->view('login', $data);
|
||||
} else {
|
||||
$network = $this->session->userdata('network');
|
||||
|
||||
$data['active'] = "demandesAd";
|
||||
$data['alert'] = "";
|
||||
$data['token'] = $this->session->userdata('token');
|
||||
$data['email'] = $this->session->userdata('email');
|
||||
$data['firstname'] = $this->session->userdata('firstname');
|
||||
$data['lastname'] = $this->session->userdata('lastname');
|
||||
$data['code_parrain'] = $this->session->userdata('code_parrain');
|
||||
$data['phone'] = $this->session->userdata('phone');
|
||||
$data['adresse'] = $this->session->userdata('adresse');
|
||||
$data['category'] = $this->session->userdata('category');
|
||||
$data['network'] = $this->session->userdata('network');
|
||||
$data['tab_fastDemande'] = $this->user_model->getRangeASCDemandesAd($this->session->userdata('member_code'));
|
||||
$data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandesAd($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['list'] = $this->user_model->getDemandesAdForSuper($this->session->userdata('member_code'));
|
||||
$data['type'] = 'adhésions';
|
||||
$this->load->view('header_sup', $data);
|
||||
$this->load->view('demande');
|
||||
$this->load->view('footer');
|
||||
}
|
||||
}
|
||||
|
||||
// Wallet
|
||||
public function wallet(){
|
||||
|
@ -242,6 +264,7 @@ class Superviseur_dash extends CI_Controller
|
|||
$data['pays'] = $this->user_model->getAllGameCountries();
|
||||
$data['networks'] = $this->user_model->getActiveNetwork();
|
||||
$data['agentWalletInfos'] = $this->user_model->getInfosWalletAgentForHyper($id_network);
|
||||
$data['geolocated_user'] = $this->user_model->getSuperNameAndCodeForSup($this->session->userdata('member_code'));
|
||||
$this->load->view('header_sup',$data);
|
||||
$this->load->view('gestion_wallet_sup');
|
||||
$this->load->view('footer');
|
||||
|
|
|
@ -282,20 +282,21 @@ class User_model extends CI_Model
|
|||
|
||||
}
|
||||
|
||||
public function getDemandesForSuper($member_code){
|
||||
public function getDemandesForSuper($user_geo, $debut, $fin, $member_code){
|
||||
|
||||
$query = $this->db->query("SELECT *
|
||||
$query = $this->db->query("SELECT *
|
||||
FROM info_demandeCredits AS d
|
||||
WHERE d.codeParrain='".$member_code."'
|
||||
AND d.codeMembre='".$user_geo."'AND d.dateAjout BETWEEN '".$debut."' AND '".$fin."'
|
||||
ORDER BY dateAjout");
|
||||
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function getDemandesHyperForSuper($member_code){
|
||||
|
||||
|
@ -388,6 +389,19 @@ class User_model extends CI_Model
|
|||
}
|
||||
}
|
||||
|
||||
public function getAllDemandesForSuper($member_code){
|
||||
$query = $this->db->query("SELECT *
|
||||
FROM info_demandeCredits AS d
|
||||
WHERE d.codeParrain='".$member_code."'
|
||||
ORDER BY dateAjout");
|
||||
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getCountDemande($codeParrain){
|
||||
|
||||
if($codeParrain=='all'){
|
||||
|
@ -472,10 +486,10 @@ class User_model extends CI_Model
|
|||
}
|
||||
}
|
||||
|
||||
public function getRangeASCDemandes($codeParrain){
|
||||
public function getRangeASCDemandes($user_geo, $debut, $fin, $codeParrain){
|
||||
|
||||
if($codeParrain=='all'){
|
||||
$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,
|
||||
if($codeParrain=='all'){
|
||||
$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)
|
||||
FROM demande_credit AS req_im
|
||||
WHERE req_im.statut=1 AND req_im.id=d.id) AS temps
|
||||
|
@ -483,21 +497,22 @@ class User_model extends CI_Model
|
|||
WHERE statut=1
|
||||
ORDER BY temps
|
||||
LIMIT 5");
|
||||
}else{
|
||||
$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
|
||||
}else{
|
||||
$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
|
||||
WHERE statut=1 AND d.codeParrain='".$codeParrain."'
|
||||
WHERE statut=1 AND d.codeParrain='".$codeParrain."' AND d.codeMembre='".$user_geo."'
|
||||
AND d.dateAjout BETWEEN '".$debut."' AND '".$fin."'
|
||||
ORDER BY temps
|
||||
LIMIT 5");
|
||||
}
|
||||
}
|
||||
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function getRangeASCDemandesOut($codeParrain){
|
||||
|
||||
|
@ -574,10 +589,10 @@ class User_model extends CI_Model
|
|||
|
||||
}
|
||||
|
||||
public function getRangeDESCDemandes($codeParrain){
|
||||
public function getRangeDESCDemandes($user_geo, $debut, $fin, $codeParrain){
|
||||
|
||||
if($codeParrain=='all'){
|
||||
$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,
|
||||
if($codeParrain=='all'){
|
||||
$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)
|
||||
FROM demande_credit AS req_im
|
||||
WHERE req_im.statut=1 AND req_im.id=d.id) AS temps
|
||||
|
@ -585,21 +600,22 @@ class User_model extends CI_Model
|
|||
WHERE statut=1
|
||||
ORDER BY temps DESC
|
||||
LIMIT 5");
|
||||
}else{
|
||||
$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
|
||||
}else{
|
||||
$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
|
||||
WHERE statut=1 AND d.codeParrain='".$codeParrain."'
|
||||
WHERE statut=1 AND d.codeParrain='".$codeParrain."' AND d.codeMembre='".$user_geo."'
|
||||
AND d.dateAjout BETWEEN '".$debut."' AND '".$fin."'
|
||||
ORDER BY temps DESC
|
||||
LIMIT 5");
|
||||
}
|
||||
}
|
||||
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function getRangeDESCDemandesOut($codeParrain){
|
||||
|
||||
|
@ -676,21 +692,25 @@ class User_model extends CI_Model
|
|||
|
||||
}
|
||||
|
||||
public function getTempsMoyen($codeParrain){
|
||||
public function getTempsMoyen($user_geo, $debut, $fin, $codeParrain){
|
||||
|
||||
if($codeParrain=='all'){
|
||||
$query = $this->db->query("SELECT AVG(TIMESTAMPDIFF(SECOND,dateAjout,dateModif)) AS temps FROM demande_credit WHERE statut=1");
|
||||
}else{
|
||||
$query = $this->db->query("SELECT AVG(temps) AS temps FROM info_demandeCredits WHERE statut=1 AND codeParrain='".$codeParrain."'");
|
||||
}
|
||||
if($codeParrain=='all'){
|
||||
$query = $this->db->query("SELECT AVG(TIMESTAMPDIFF(SECOND,dateAjout,dateModif)) AS temps FROM demande_credit WHERE statut=1");
|
||||
}else{
|
||||
$query = $this->db->query("SELECT AVG(temps) AS temps
|
||||
FROM info_demandeCredits
|
||||
WHERE statut=1 AND codeParrain='".$codeParrain."'
|
||||
AND codeMembre='".$user_geo."'
|
||||
AND dateAjout BETWEEN '".$debut."' AND '".$fin."'");
|
||||
}
|
||||
|
||||
if($query->num_rows()>0){
|
||||
return $query->row()->temps;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
if($query->num_rows()>0){
|
||||
return $query->row()->temps;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function getTempsMoyenDemandeSup($codeParrain){
|
||||
|
||||
|
@ -2007,6 +2027,31 @@ class User_model extends CI_Model
|
|||
return $query;
|
||||
}
|
||||
|
||||
public function getSuperNameAndCodeForSup($codeSup){
|
||||
|
||||
$query = $this->db->query("SELECT child.lastname AS lastname, child.code_membre AS member_code
|
||||
FROM super_infos AS child
|
||||
INNER JOIN super_infos AS dad
|
||||
ON child.code_parrain='".$codeSup."'
|
||||
WHERE child.category='geolocated' AND dad.category='super' AND dad.code_membre='".$codeSup."'
|
||||
");
|
||||
|
||||
if($query->num_rows()>0){
|
||||
return $query;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function nameOfCurrentGeolocatedUser_forSuper($geolocatedUser_memberCode){
|
||||
$query = $this->db->query("SELECT lastname FROM `super_infos` WHERE `code_membre`='".$geolocatedUser_memberCode."' ");
|
||||
if($query->num_rows()>0){
|
||||
return $query->row()->lastname;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Wallet
|
||||
|
||||
public function getAllActivatedNetworks(){
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
?>
|
||||
<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" />
|
||||
<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" />
|
||||
|
||||
</span>
|
||||
</span>
|
||||
|
|
|
@ -1,136 +1,237 @@
|
|||
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>iLink | Superviseur</title>
|
||||
<!-- Tell the browser to be responsive to screen width -->
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap/dist/css/bootstrap.min.css') ?>">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/font-awesome/css/font-awesome.min.css') ?>">
|
||||
<!-- Ionicons -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/Ionicons/css/ionicons.min.css') ?>">
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('dist/css/AdminLTE.css') ?>">
|
||||
<!-- AdminLTE Skins. Choose a skin from the css/skins
|
||||
folder instead of downloading all of them to reduce the load. -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('dist/css/skins/_all-skins.min.css') ?>">
|
||||
<link rel="shortcut icon" href="<?php echo base_url('favicon.ico') ?>" type="image/x-icon">
|
||||
<link rel="icon" href="<?php echo base_url('favicon.ico') ?>" type="image/x-icon">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>iLink | Superviseur</title>
|
||||
<!-- Tell the browser to be responsive to screen width -->
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/bootstrap/dist/css/bootstrap.min.css') ?>">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/font-awesome/css/font-awesome.min.css') ?>">
|
||||
<!-- Ionicons -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('bower_components/Ionicons/css/ionicons.min.css') ?>">
|
||||
<!-- Theme style -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('dist/css/AdminLTE.css') ?>">
|
||||
<!-- AdminLTE Skins. Choose a skin from the css/skins
|
||||
folder instead of downloading all of them to reduce the load. -->
|
||||
<link rel="stylesheet" href="<?php echo base_url('dist/css/skins/_all-skins.min.css') ?>">
|
||||
<link rel="shortcut icon" href="<?php echo base_url('favicon.ico') ?>" type="image/x-icon">
|
||||
<link rel="icon" href="<?php echo base_url('favicon.ico') ?>" type="image/x-icon">
|
||||
|
||||
|
||||
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<style media="screen">
|
||||
.img-dash {
|
||||
height: 50px !important;
|
||||
float: left !important;
|
||||
padding: 1% !important;
|
||||
}
|
||||
<style media="screen">
|
||||
.img-dash {
|
||||
height: 50px !important;
|
||||
float: left !important;
|
||||
padding: 1% !important;
|
||||
}
|
||||
|
||||
.table_modified {
|
||||
font-size: 11px !important;
|
||||
}
|
||||
.table_modified {
|
||||
font-size: 11px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
</style>
|
||||
</head>
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<header class="main-header">
|
||||
<!-- Logo -->
|
||||
<a href="#" class="logo">
|
||||
<!-- mini logo for sidebar mini 50x50 pixels -->
|
||||
<span class="logo-mini"><b>iLink</b></span>
|
||||
<!-- logo for regular state and mobile devices -->
|
||||
<span class="logo-lg">
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<header class="main-header">
|
||||
<!-- Logo -->
|
||||
<a href="#" class="logo">
|
||||
<!-- mini logo for sidebar mini 50x50 pixels -->
|
||||
<span class="logo-mini"><b>iLink</b></span>
|
||||
<!-- logo for regular state and mobile devices -->
|
||||
<span class="logo-lg">
|
||||
<img class="img img-responsive img-dash" src="<?php echo base_url('images/logo.png') ?>">
|
||||
<b>iLink</b> World
|
||||
</span>
|
||||
</a>
|
||||
<!-- Header Navbar: style can be found in header.less -->
|
||||
<nav class="navbar navbar-static-top">
|
||||
<!-- Sidebar toggle button-->
|
||||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<!-- User Account: style can be found in dropdown.less -->
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<?php echo $this->lang->line('Bienvenue'); ?> <span class="hidden-xs"><b><?php echo $firstname.' '.$lastname;?></b></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- User image -->
|
||||
<li class="user-header">
|
||||
<p>
|
||||
<?php echo $network.' - '.$this->session->userdata('member_code');?>
|
||||
<small><?php echo $email;?></small>
|
||||
</p>
|
||||
</li>
|
||||
<li class="user-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 text-center">
|
||||
<?php echo $this->session->userdata('current_pays');?>
|
||||
</div>
|
||||
<div class="col-xs-6 text-center">
|
||||
<?php echo $this->session->userdata('phone');?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
</li>
|
||||
<li class="user-footer">
|
||||
<div class="pull-right">
|
||||
<a href="<?php echo base_url('index.php/Users/logout') ?>" class="btn btn-default btn-flat"><?php echo $this->lang->line('Déconnexion'); ?></a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<!-- Left side column. contains the logo and sidebar -->
|
||||
<aside class="main-sidebar">
|
||||
<!-- sidebar: style can be found in sidebar.less -->
|
||||
<section class="sidebar">
|
||||
<!-- sidebar menu: : style can be found in sidebar.less -->
|
||||
<ul class="sidebar-menu" data-widget="tree">
|
||||
<li class="<?php if($active=="dash"){echo "active ";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Superviseur_dash') ?>">
|
||||
<i class="fa fa-dashboard"></i> <span><?php echo $this->lang->line('Tableau de bord'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if($active=="geolocated"){echo "active ";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Superviseur_dash/getAllUser_g') ?>">
|
||||
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Utilisateurs géolocalisés'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if($active=="demandes"){echo "active ";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Superviseur_dash/getDemandes') ?>">
|
||||
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Demandes de crédits'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- <li class="<?php // if($active=="demandesAd"){echo "active ";} ?>">
|
||||
</a>
|
||||
<!-- Header Navbar: style can be found in header.less -->
|
||||
<nav class="navbar navbar-static-top">
|
||||
<!-- Sidebar toggle button-->
|
||||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<!-- User Account: style can be found in dropdown.less -->
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
<?php echo $this->lang->line('Bienvenue'); ?> <span class="hidden-xs"><b><?php echo $firstname.' '.$lastname;?></b></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<!-- User image -->
|
||||
<li class="user-header">
|
||||
<p>
|
||||
<?php echo $network.' - '.$this->session->userdata('member_code');?>
|
||||
<small><?php echo $email;?></small>
|
||||
</p>
|
||||
</li>
|
||||
<li class="user-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 text-center">
|
||||
<?php echo $this->session->userdata('current_pays');?>
|
||||
</div>
|
||||
<div class="col-xs-6 text-center">
|
||||
<?php echo $this->session->userdata('phone');?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
</li>
|
||||
<li class="user-footer">
|
||||
<div class="pull-right">
|
||||
<a href="<?php echo base_url('index.php/Users/logout') ?>" class="btn btn-default btn-flat"><?php echo $this->lang->line('Déconnexion'); ?></a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<!-- Left side column. contains the logo and sidebar -->
|
||||
<aside class="main-sidebar">
|
||||
<!-- sidebar: style can be found in sidebar.less -->
|
||||
<section class="sidebar">
|
||||
<!-- sidebar menu: : style can be found in sidebar.less -->
|
||||
<ul class="sidebar-menu" data-widget="tree">
|
||||
<li class="<?php if($active=="dash"){echo "active ";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Superviseur_dash') ?>">
|
||||
<i class="fa fa-dashboard"></i> <span><?php echo $this->lang->line('Tableau de bord'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if($active=="geolocated"){echo "active ";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Superviseur_dash/getAllUser_g') ?>">
|
||||
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Utilisateurs géolocalisés'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="<?php if($active=="demandes"){echo "active ";} ?>">
|
||||
<a href="#" data-toggle="modal" data-target="#modal-choix-geo-user">
|
||||
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Demandes de crédits'); ?></span>
|
||||
</a>
|
||||
</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>
|
||||
</a>
|
||||
</li>-->
|
||||
<?php if($hasWallet){
|
||||
<?php if($hasWallet){
|
||||
?>
|
||||
<li class="<?php if($active=="wallet"){echo "active";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Superviseur_dash/wallet') ?>">
|
||||
<i class="glyphicon glyphicon-credit-card"></i> <span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</section>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
|
||||
<div class="modal fade" id="modal-choix-geo-user">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="#" method="post" id="getDemandes">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title"><?php echo $this->lang->line('Utilisateurs_géolocalisés'); ?></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<?php
|
||||
$result=$geolocated_user;
|
||||
|
||||
$numrows=$result->num_rows();
|
||||
|
||||
if ($numrows > 0) { ?>
|
||||
<label for="selected-geo-user">Utilisateur géolocalisé</label>
|
||||
<select class="form-control input-lg" name="geo_user" id="selected-geo-user" required>
|
||||
<?php foreach($result->result() as $row) {
|
||||
|
||||
echo "<option value='".$row->member_code."'>".$row->lastname." - ".$row->member_code."</option>";
|
||||
} ?>
|
||||
</select>
|
||||
<?php }else{
|
||||
echo "Aucun utilisateur gééolocalisé";
|
||||
}
|
||||
?>
|
||||
<li class="<?php if($active=="wallet"){echo "active";} ?>">
|
||||
<a href="<?php echo base_url('index.php/Superviseur_dash/wallet') ?>">
|
||||
<i class="glyphicon glyphicon-credit-card"></i> <span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</section>
|
||||
<!-- /.sidebar -->
|
||||
</aside>
|
||||
|
||||
</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 class="modal-footer">
|
||||
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><?php echo $this->lang->line('Fermer'); ?></button>
|
||||
<button type="button" id="send-getDemandes" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.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-geo-user').find(":selected").val();
|
||||
window.location.replace("<?php echo base_url('index.php/Superviseur_dash/getDemandes')?>"+"?d="+debut+"&f="+fin+"&u="+user_geo);
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue