+ Distinction of outgoing credit requests from incoming requests

This commit is contained in:
Djery-Tom 2020-08-04 09:08:30 +01:00
parent a299394c77
commit 43dae70858
8 changed files with 1019 additions and 1062 deletions

View File

@ -196,19 +196,9 @@ class Hyperviseur_dash extends CI_Controller
$data['message'] = "Login first!";
$this->load->view('login', $data);
} else {
if ($this->input->get("u") !== 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');
$debut = Date('Y-m-d', strtotime("-5 days"));
}
$format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d';
$data['debut'] = $debut ? date($format, strtotime($debut)) : null;
$data['fin'] = $fin ? date($format, strtotime($fin)) : null;
@ -216,7 +206,7 @@ class Hyperviseur_dash extends CI_Controller
$ville = $this->session->userdata('ville');
$data['active'] = "demandes";
$data['type'] = $this->lang->line('crédits');
$data['type'] = 'incoming';
$data['demand_type'] = 'credit';
$data['alert'] = "";
$data['token'] = $this->session->userdata('token');
@ -230,17 +220,16 @@ class Hyperviseur_dash extends CI_Controller
$data['network'] = $this->session->userdata('network');
$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['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($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'), $super);
$data['temp_moyen'] = $this->user_model->getTempsMoyenByVille($this->session->userdata('member_code'), $super, $this->session->userdata('network'));
$data['tab_fastDemande'] = $this->user_model->getRangeASCDemandesByNetwork($debut, $fin, $this->session->userdata('member_code'), $this->session->userdata('current_demande_ville'));
$data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandesByNetwork($debut, $fin, $this->session->userdata('member_code'), $this->session->userdata('current_demande_ville'));
$data['list'] = $this->user_model->getDemandesBySuper($debut, $fin, $this->session->userdata('member_code'));
$data['temp_moyen'] = $this->user_model->getTempsMoyenByVille($this->session->userdata('member_code'), $this->session->userdata('network'));
$data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code'));
$data['hasWallet'] = $this->user_model->getConfigWallet($this->session->userdata('network_id'));
$data['nameOfcurentGeolocatedUser'] = $this->user_model->nameOfCurrentGeolocatedUser_forSuper($super);
$this->load->view('header_hyp', $data);
$this->load->view('demande_credit');
$this->load->view('footer');
}
}
}

View File

@ -117,10 +117,9 @@ class Superviseur_dash extends CI_Controller
$data['message'] = "Login first!";
$this->load->view('login', $data);
} else {
$type = $this->input->get("type");
$data['type'] = $type;
if($this->input->get("u") !== null){
$user_geo = $this->input->get("u");
$debut = $this->input->get("d");
$fin = $this->input->get("f");
$format = $this->session->userdata('site_lang') === 'french' ? 'd-m-Y' : 'Y-m-d';
@ -129,8 +128,7 @@ class Superviseur_dash extends CI_Controller
$fin = Date('Y-m-d', strtotime($fin . "+1 day")); // Increment date because SQL BETWEEN
$network = $this->session->userdata('network');
$data['active'] = "demandes";
$data['type'] = $this->lang->line('crédits');
// $data['type'] = $this->lang->line('crédits');
$data['demand_type'] = 'credit';
$data['alert'] = "";
$data['token'] = $this->session->userdata('token');
@ -142,23 +140,26 @@ class Superviseur_dash extends CI_Controller
$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'));
if ($type == 'incoming') {
$data['active'] = "demandes_credits_entrantes";
$data['tab_fastDemande'] = $this->user_model->getRangeASCDemandes($debut, $fin, $this->session->userdata('member_code'));
$data['tab_slowDemande'] = $this->user_model->getRangeDESCDemandes($debut, $fin, $this->session->userdata('member_code'));
$data['temp_moyen'] = $this->user_model->getTempsMoyen($debut, $fin, $this->session->userdata('member_code'));
$data['list'] = $this->user_model->getDemandesForSuper($debut, $fin, $this->session->userdata('member_code'));
} else if ($type = 'outgoing') {
$data['active'] = "demandes_credits_sortantes";
$data['tab_fastDemande_s'] = $this->user_model->getRangeASCDemandesOut($debut, $fin, $this->session->userdata('member_code'));
$data['tab_slowDemande_s'] = $this->user_model->getRangeDESCDemandesOut($debut, $fin, $this->session->userdata('member_code'));
$data['mydem'] = $this->user_model->getDemandesHyperForSuper($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_credit');
$this->load->view('footer');
}else{
}
}
}

View File

@ -440,4 +440,8 @@ $lang ['remaining_amount'] = 'Remaining amount';
$lang ['amount_greater_than_balance'] = 'Amount greater than the compensation balance';
$lang['no_refund'] = 'No refund';
$lang['final_currency'] = 'Currency of the country of arrival';
$lang['incoming_requests'] = 'Incoming requests';
$lang['outgoing_requests'] = 'Outgoing requests';
$lang['incoming_credits_requests'] = 'Incoming credit requests';
$lang['outgoing_credits_requests'] = 'Outgoing credit requests';
?>

View File

@ -452,5 +452,9 @@ $lang['remaining_amount'] = 'Montant restant';
$lang['amount_greater_than_balance'] = 'Montant supérieur au solde de compensation';
$lang['no_refund'] = 'Aucun remboursement';
$lang['final_currency'] = 'Monnaie du pays d\'arrivée';
$lang['incoming_requests'] = 'Demandes entrantes';
$lang['outgoing_requests'] = 'Demandes sortantes';
$lang['incoming_credits_requests'] = 'Demandes de crédits entrantes';
$lang['outgoing_credits_requests'] = 'Demandes de crédits sortantes';
?>

View File

@ -282,12 +282,13 @@ class User_model extends CI_Model
}
public function getDemandesForSuper($user_geo, $debut, $fin, $member_code){
public function getDemandesForSuper($debut, $fin, $member_code)
{
$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."'
AND d.dateAjout BETWEEN '" . $debut . "' AND '" . $fin . "'
ORDER BY dateAjout");
if ($query->num_rows() > 0) {
@ -298,11 +299,12 @@ class User_model extends CI_Model
}
public function getDemandesHyperForSuper($member_code){
public function getDemandesHyperForSuper($debut, $fin, $member_code)
{
$query = $this->db->query("SELECT *
FROM info_demandeCredits AS d
WHERE d.codeMembre='".$member_code."'
WHERE d.codeMembre='" . $member_code . "' AND d.dateAjout BETWEEN '" . $debut . "' AND '" . $fin . "'
ORDER BY dateAjout DESC");
if ($query->num_rows() > 0) {
@ -486,10 +488,11 @@ class User_model extends CI_Model
}
}
public function getRangeASCDemandes($user_geo, $debut, $fin, $codeParrain){
public function getRangeASCDemandes($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,
$query = $this->db->query("SELECT d.agent , 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
@ -498,9 +501,9 @@ class User_model extends CI_Model
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
$query = $this->db->query("SELECT d.agent, 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."' AND d.codeMembre='".$user_geo."'
WHERE statut='1' AND d.codeParrain='" . $codeParrain . "'
AND d.dateAjout BETWEEN '" . $debut . "' AND '" . $fin . "'
ORDER BY temps
LIMIT 5");
@ -514,11 +517,13 @@ class User_model extends CI_Model
}
public function getRangeASCDemandesOut($codeParrain){
public function getRangeASCDemandesOut($debut, $fin, $codeParrain)
{
$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.codeMembre='" . $codeParrain . "'
AND d.dateAjout BETWEEN '" . $debut . "' AND '" . $fin . "'
ORDER BY temps
LIMIT 5");
@ -530,7 +535,8 @@ class User_model extends CI_Model
}
public function getRangeASCDemandesByNetwork($debut, $fin, $codeParrain, $ville, $super){
public function getRangeASCDemandesByNetwork($debut, $fin, $codeParrain, $ville)
{
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,
@ -544,7 +550,7 @@ class User_model extends CI_Model
} 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."' AND d.codeMembre='".$super."'
WHERE statut='1' AND d.codeParrain='" . $codeParrain . "'
AND dateAjout BETWEEN '".$debut."' AND '".$fin."'
ORDER BY temps
LIMIT 5");
@ -590,10 +596,11 @@ class User_model extends CI_Model
}
public function getRangeDESCDemandes($user_geo, $debut, $fin, $codeParrain){
public function getRangeDESCDemandes($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,
$query = $this->db->query("SELECT d.agent, 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
@ -602,9 +609,9 @@ class User_model extends CI_Model
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
$query = $this->db->query("SELECT d.agent, 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."' AND d.codeMembre='".$user_geo."'
WHERE statut='1' AND d.codeParrain='" . $codeParrain . "'
AND d.dateAjout BETWEEN '" . $debut . "' AND '" . $fin . "'
ORDER BY temps DESC
LIMIT 5");
@ -618,11 +625,13 @@ class User_model extends CI_Model
}
public function getRangeDESCDemandesOut($codeParrain){
public function getRangeDESCDemandesOut($debut, $fin, $codeParrain)
{
$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.codeMembre='" . $codeParrain . "'
AND d.dateAjout BETWEEN '" . $debut . "' AND '" . $fin . "'
ORDER BY temps DESC
LIMIT 5");
@ -634,7 +643,8 @@ class User_model extends CI_Model
}
public function getRangeDESCDemandesBynetwork($debut, $fin, $codeParrain, $ville, $super){
public function getRangeDESCDemandesBynetwork($debut, $fin, $codeParrain, $ville)
{
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,
@ -648,7 +658,7 @@ class User_model extends CI_Model
} 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."' AND d.codeMembre='".$super."'
WHERE statut='1' AND d.codeParrain='" . $codeParrain . "'
AND dateAjout BETWEEN '".$debut."' AND '".$fin."'
ORDER BY temps DESC
LIMIT 5");
@ -694,7 +704,8 @@ class User_model extends CI_Model
}
public function getTempsMoyen($user_geo, $debut, $fin, $codeParrain){
public function getTempsMoyen($debut, $fin, $codeParrain)
{
if ($codeParrain == 'all') {
$query = $this->db->query("SELECT AVG(TIMESTAMPDIFF(SECOND,dateAjout,dateModif)) AS temps FROM demande_credit WHERE statut='1'");
@ -702,7 +713,6 @@ class User_model extends CI_Model
$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 . "'");
}
@ -730,12 +740,13 @@ class User_model extends CI_Model
}
public function getTempsMoyenByVille($codeParrain,$super){
public function getTempsMoyenByVille($codeParrain, $network)
{
if ($codeParrain == 'all') {
$query = $this->db->query("SELECT AVG(TIMESTAMPDIFF(SECOND,dateAjout,dateModif)) AS temps FROM demande_credit WHERE statut='1'AND reseau='" . $network . "' ");
} else {
$query = $this->db->query("SELECT AVG(temps) AS temps FROM info_demandeCredits WHERE statut='1' AND codeParrain='".$codeParrain."' AND codeMembre='".$super."' ");
$query = $this->db->query("SELECT AVG(temps) AS temps FROM info_demandeCredits WHERE statut='1' AND codeParrain='" . $codeParrain . "' ");
}
if ($query->num_rows() > 0) {
@ -1700,11 +1711,12 @@ class User_model extends CI_Model
}
}
public function getDemandesBySuper($code_parrain, $code_membre){
public function getDemandesBySuper($debut, $fin, $code_parrain)
{
$query = $this->db->query("SELECT *
FROM info_demandeCredits AS d
WHERE d.codeParrain='".$code_parrain."' AND d.codeMembre='".$code_membre."'
WHERE d.codeParrain='" . $code_parrain . "' AND d.dateAjout BETWEEN '" . $debut . "' AND '" . $fin . "'
ORDER BY dateAjout");
if ($query->num_rows() > 0) {

View File

@ -1,10 +1,14 @@
<!-- DataTables -->
<link rel="stylesheet"
href="<?php echo base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" href="<?php echo base_url('bower_components/toastr/toastr.css') ?>">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css">
<div class="content-wrapper">
<?php
use Carbon\Carbon;
function duree($time)
{
$tabTemps = array("jours" => 86400,
@ -75,7 +79,7 @@
<section class="content-header">
<h1>
<?php echo $this->lang->line('Demandes de crédits'); ?>
<?php echo $type == 'outgoing' ? $this->lang->line('outgoing_credits_requests') : $this->lang->line('incoming_credits_requests'); ?>
</h1>
<?php
$site_url = base_url();
@ -107,6 +111,7 @@
</section>
<section class="content">
<div class="row">
<?php if (($type == 'incoming') || ($this->session->userdata('category') == 'hyper')) { ?>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-aqua"><i class="ion ion-android-arrow-down"></i></span>
@ -129,16 +134,11 @@
</div>
</div>
</div>
<?php } ?>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-aqua"><i class="ion ion-android-time"></i></span>
<div class="info-box-content">
<?php
// if ($this->session->userdata('category') == "super") {
if (isset($nameOfcurentGeolocatedUser))
echo "<span class='info-box-number'>" . $nameOfcurentGeolocatedUser . "</span>";
// }
?>
<span class="info-box-text"> <?php echo $this->lang->line('Période') ?> </span>
<span class="info-box-number">
<input id="picker"
@ -154,7 +154,7 @@
</div>
</div>
</div>
<?php if ($this->session->userdata('category') == 'super') { ?>
<?php if (($this->session->userdata('category') == 'super') && ($type == 'outgoing')) { ?>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-green"><i class="ion ion-android-arrow-up"></i></span>
@ -183,10 +183,11 @@
</div>
<?php if ($this->session->userdata('category') == 'super') { ?>
<div class="row">
<div class="col-md-6">
<?php if ($type == 'incoming') { ?>
<div class="col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('entrantes'); ?> </h3>
<h3 class="box-title"><?php echo $this->lang->line('incoming_credits_requests'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
@ -226,12 +227,14 @@
foreach ($result->result() as $row) {
$num++;
$etat = $this->lang->line("Non traitée");
$disabled = "disabled";
if ($row->statut == 1) {
$disabled = "";
$etat = $this->lang->line("Acceptée");
} else if ($row->statut == 2) {
$etat = $this->lang->line("Annulée");
}
$origin = $row->codeMembre;
$origin = $row->agent;
$destination = $row->codeParrain;
if ($row->codeMembre == $this->session->userdata('member_code')) {
$origin = $this->lang->line('Vous');
@ -247,6 +250,7 @@
<td > " . toLocateDate($row->dateModif, $this->session->userdata('timezone')) . "</td>
<td>$etat</td>
<td>" . traitementTemps($row->temps, $row->dateAjout) . "</td>
</tr>";
}
@ -271,12 +275,13 @@
</div>
</div>
</div>
<div class="col-md-6">
<?php } else { ?>
<div class="col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('Sortantes'); ?></h3>
<h3 class="box-title"><?php echo $this->lang->line('outgoing_credits_requests'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<div class="box-body">
<?php
@ -357,15 +362,17 @@
</div>
</div>
</div>
<?php } ?>
</div>
<div class="row">
<div class="col-md-6">
<?php if ($type == 'incoming') { ?>
<div class="col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('entrantes'); ?> <?php echo $this->lang->line('les plus rapidement traitées'); ?></h3>
<h3 class="box-title"><?php echo $this->lang->line('incoming_credits_requests'); ?><?php echo $this->lang->line('les plus rapidement traitées'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<div class="box-body">
<?php
@ -378,7 +385,8 @@
?>
<table id="listeDemandesRapides" class="table table-bordered table-striped table-modified">
<table id="listeDemandesRapides"
class="table table-bordered table-striped table-modified">
<thead>
<?php
echo "<tr class='label-primary'>
@ -410,7 +418,7 @@
echo "<tr>
<td>$num</td>
<td>$row->emetteur</td>
<td>$row->agent</td>
<td>$superviseur</td>
<td>$row->montant</td>
<td>" . toLocateDate($row->dateA, $this->session->userdata('timezone')) . "</td>
@ -440,12 +448,13 @@
</div>
</div>
</div>
<div class="col-md-6">
<?php } else { ?>
<div class="col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('Sortantes'); ?> <?php echo $this->lang->line('les plus rapidement traitées'); ?></h3>
<h3 class="box-title"><?php echo $this->lang->line('outgoing_credits_requests'); ?><?php echo $this->lang->line('les plus rapidement traitées'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<div class="box-body">
<?php
@ -458,13 +467,12 @@
?>
<table id="listeDemandesRapides" class="table table-bordered table-striped table-modified">
<table id="listeDemandesRapides_s"
class="table table-bordered table-striped table-modified">
<thead>
<?php
echo "<tr class='label-primary'>
<th></th>
<th>" . $this->lang->line('Membre') . "</th>
<th>" . $this->lang->line('Parrain') . "</th>
<th>" . $this->lang->line('Montant') . "</th>
<th>" . $this->lang->line('Date de la demande') . "</th>
<th>" . $this->lang->line('Date de traitement') . "</th>
@ -490,8 +498,6 @@
echo "<tr>
<td>$num</td>
<td>$row->emetteur</td>
<td>$superviseur</td>
<td>$row->montant</td>
<td>" . toLocateDate($row->dateA, $this->session->userdata('timezone')) . "</td>
<td> " . toLocateDate($row->dateM, $this->session->userdata('timezone')) . "</td>
@ -521,14 +527,16 @@
</div>
</div>
</div>
<?php } ?>
</div>
<div class="row">
<div class="col-md-6">
<?php if ($type == 'incoming') { ?>
<div class="col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('entrantes'); ?> <?php echo $this->lang->line('les plus tardivement traitées'); ?></h3>
<h3 class="box-title"><?php echo $this->lang->line('incoming_credits_requests'); ?><?php echo $this->lang->line('les plus tardivement traitées'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<div class="box-body">
<?php
@ -541,7 +549,8 @@
?>
<table id="listeDemandesTardives" class="table table-bordered table-striped table-modified">
<table id="listeDemandesTardives"
class="table table-bordered table-striped table-modified">
<thead>
<?php
echo "<tr class='label-primary'>
@ -572,7 +581,7 @@
echo "<tr>
<td>$num</td>
<td>$row->emetteur</td>
<td>$row->agent</td>
<td>$superviseur</td>
<td>$row->montant</td>
<td>" . toLocateDate($row->dateA, $this->session->userdata('timezone')) . "</td>
@ -603,12 +612,13 @@
</div>
</div>
</div>
<div class="col-md-6">
<?php } else { ?>
<div class="col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('Sortantes'); ?> <?php echo $this->lang->line('les plus tardivement traitées'); ?></h3>
<h3 class="box-title"><?php echo $this->lang->line('outgoing_credits_requests'); ?><?php echo $this->lang->line('les plus tardivement traitées'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<div class="box-body">
<?php
@ -621,30 +631,17 @@
?>
<table id="listeDemandesTardives" class="table table-bordered table-striped table-modified">
<table id="listeDemandesTardives_s"
class="table table-bordered table-striped table-modified">
<thead>
<?php
if ($type == $this->lang->line('Adhésion')) {
echo "
<tr class='label-primary'>
<th></th>
<th>" . $this->lang->line('Contact') . "</th>
<th>" . $this->lang->line('Parrain') . "</th>
<th>" . $this->lang->line('Date de la demande') . "</th>
<th>" . $this->lang->line('Date de traitement') . "</th>
<th>" . $this->lang->line('Délai de traitement') . "</th>
</tr>";
} else {
echo "<tr class='label-primary'>
<th></th>
<th>" . $this->lang->line('Membre') . "</th>
<th>" . $this->lang->line('Parrain') . "</th>
<th>" . $this->lang->line('Montant') . "</th>
<th>" . $this->lang->line('Date de la demande') . "</th>
<th>" . $this->lang->line('Date de traitement') . "</th>
<th>" . $this->lang->line('Délai de traitement') . "</th>
</tr>";
}
?>
</thead>
<tbody>
@ -664,8 +661,6 @@
echo "<tr>
<td>$num</td>
<td>$row->emetteur</td>
<td>$superviseur</td>
<td>$row->montant</td>
<td>" . toLocateDate($row->dateA, $this->session->userdata('timezone')) . "</td>
<td> " . toLocateDate($row->dateM, $this->session->userdata('timezone')) . "</td>
@ -694,13 +689,15 @@
</div>
</div>
</div>
<?php } ?>
</div>
<?php } else { ?>
<div class="row">
<div class="col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?></h3>
<h3 class="box-title"><?php echo $this->lang->line('incoming_credits_requests'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
@ -739,13 +736,15 @@
// output data of each row
foreach ($result->result() as $row) {
$num++;
$disabled = "disabled";
$etat = $this->lang->line("Non traitée");
if ($row->statut == 1) {
$disabled = "";
$etat = $this->lang->line("Acceptée");
} else if ($row->statut == 2) {
$etat = $this->lang->line("Annulée");
}
$origin = $row->codeMembre;
$origin = $row->agent;
$destination = $row->codeParrain;
if ($row->codeMembre == $this->session->userdata('member_code')) {
$origin = $this->lang->line('Vous');
@ -786,13 +785,15 @@
</div>
</div>
</div>
<div class="col-md-6">
</div>
<div class="row">
<div class="col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('les plus rapidement traitées'); ?></h3>
<h3 class="box-title"><?php echo $this->lang->line('incoming_credits_requests'); ?><?php echo $this->lang->line('les plus rapidement traitées'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<div class="box-body">
<?php
@ -866,12 +867,14 @@
</div>
</div>
</div>
<div class="col-md-6">
</div>
<div class="row">
<div class="col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><?php echo $this->lang->line('Demandes'); ?> <?php echo $type ?> <?php echo $this->lang->line('les plus tardivement traitées'); ?></h3>
<h3 class="box-title"><?php echo $this->lang->line('incoming_credits_requests'); ?><?php echo $this->lang->line('les plus tardivement traitées'); ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<div class="box-body">
<?php
@ -943,6 +946,7 @@
</div>
</div>
</div>
</div>
<?php } ?>
</section>
@ -969,6 +973,15 @@
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.19/sorting/datetime-moment.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.20/dataRender/datetime.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.html5.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.20/dataRender/datetime.js"></script>
<script src="<?php echo base_url('dist/js/sweetalert2.js') ?>"></script>
<script src="<?php echo base_url('bower_components/toastr/toastr.js') ?>"></script>
<script>
$(function () {
@ -981,7 +994,34 @@
"columnDefs": [{
targets: [5, 6],
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format),
}]
}],
dom: 'Bfrtip',
"buttons": [
'pageLength',
{
extend: 'excelHtml5',
title: "<?=$this->lang->line('incoming_credits_requests')?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7]
}
},
{
extend: 'csvHtml5',
title: "<?=$this->lang->line('incoming_credits_requests')?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7]
}
},
{
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'LEGAL',
title: "<?=$this->lang->line('incoming_credits_requests')?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5, 6, 7]
}
}
]
});
$('#listeMembres1').DataTable({
@ -989,14 +1029,68 @@
"columnDefs": [{
targets: [3, 4],
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format),
}]
}],
dom: 'Bfrtip',
"buttons": [
'pageLength',
{
extend: 'excelHtml5',
title: "<?=$this->lang->line('incoming_credits_requests')?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
}
},
{
extend: 'csvHtml5',
title: "<?=$this->lang->line('incoming_credits_requests')?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
}
},
{
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'LEGAL',
title: "<?=$this->lang->line('incoming_credits_requests')?>",
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
}
}
]
});
$('#listeMembres2').DataTable({
"aaSorting": [[1, "desc"]],
"columnDefs": [{
targets: [1, 2],
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
}]
}],
dom: 'Bfrtip',
"buttons": [
'pageLength',
{
extend: 'excelHtml5',
title: "<?=$this->lang->line('outgoing_credits_requests')?>",
exportOptions: {
columns: [0, 1, 2, 3]
}
},
{
extend: 'csvHtml5',
title: "<?=$this->lang->line('outgoing_credits_requests')?>",
exportOptions: {
columns: [0, 1, 2, 3]
}
},
{
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'LEGAL',
title: "<?=$this->lang->line('outgoing_credits_requests')?>",
exportOptions: {
columns: [0, 1, 2, 3]
}
}
]
});
$('#listeDemandesRapides').DataTable({
@ -1017,6 +1111,24 @@
}]
});
$('#listeDemandesRapides_s').DataTable({
searching: false, paging: false, info: false,
"aaSorting": [[2, "desc"]],
"columnDefs": [{
targets: [2, 3],
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
}]
});
$('#listeDemandesTardives_s').DataTable({
searching: false, paging: false, info: false,
"aaSorting": [[2, "desc"]],
"columnDefs": [{
targets: [2, 3],
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
}]
});
});
</script>
@ -1080,10 +1192,11 @@
const debut = start.format('YYYY-MM-DD');
const fin = end.format('YYYY-MM-DD');
const user_geo = GetURLParameter("u");
const type = GetURLParameter("type");
if (category == 'super') {
window.location.replace("<?php echo base_url('index.php/Superviseur_dash/getDemandes')?>" + "?d=" + debut + "&f=" + fin + "&u=" + user_geo);
window.location.replace("<?php echo base_url('index.php/Superviseur_dash/getDemandes?type=')?>" + type + "&d=" + debut + "&f=" + fin);
} else if (category == 'hyper') {
window.location.replace("<?php echo base_url('index.php/Hyperviseur_dash/getDemandes')?>" + "?d=" + debut + "&f=" + fin + "&u=" + user_geo);
window.location.replace("<?php echo base_url('index.php/Hyperviseur_dash/getDemandes')?>" + "?d=" + debut + "&f=" + fin);
}
});
$('input[name="daterange"]').on('cancel.daterangepicker', function (ev, picker) {
@ -1094,113 +1207,35 @@
</script>
<script type='text/javascript'>
$(document).ready(function () {
$('#pays').change(function () {
var pays = $(this).val();
<script>
$(document).on("click", ".cancelBtn", function () {
const id_demand = $(this).data('id-demand');
$.ajax({
url: '<?php echo base_url('index.php/Admin/getHypByPays')?>',
type: 'post',
data: {pays: pays},
url: '<?php echo base_url('index.php/Hyperviseur_dash/cancelCreditRequest')?>',
type: 'POST',
dataType: 'json',
data: {"id_demand": id_demand},
async: true,
success: function (data) {
var len = data.length;
if (len > 0) {
var select = document.getElementById('hyper');
if (select === null) {
var grpPays = document.getElementById('grp-pays');
$(grpPays).empty();
$(grpPays).append("<select class='form-control input-lg' name='hyper' required id='hyper'></select>");
select = document.getElementById('hyper');
}
$(select).empty();
for (var i in data) {
$(select).append('<option value=' + data[i].code_membre + '>' + data[i].lastname + '-' + data[i].network + ' (' + data[i].code_membre + ')</option>');
}
var code = data[0].code_membre;
$.ajax({
url: '<?php echo base_url('index.php/Admin/getVilleByHyp')?>',
type: 'post',
data: {code: code, pays: pays},
dataType: 'json',
success: function (list) {
var len = list.length;
if (len > 0) {
var select = document.getElementById('ville');
if (select === null) {
var grpVille = document.getElementById('grp-ville');
$(grpVille).empty();
$(grpVille).append("<select class='form-control input-lg' name='ville' required id='ville'></select>");
select = document.getElementById('ville');
}
$(select).empty();
for (var i in list) {
$(select).append('<option value=' + list[i].town_id + '>' + list[i].town + '</option>');
}
if (data == '200') {
Swal.fire({
icon: 'success',
title: "<?php echo $this->lang->line('canceled_credit_request')?>",
text: "<?php echo $this->lang->line('informations_updated')?>",
timer: 3000
}).then(() => {
location.reload();
});
// alert("Les informations ont été mises à jour.") ? "" : location.reload();
} else {
var select = document.getElementById('ville');
$(select).empty();
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
}
},
error: function (resultat, statut, erreur) {
console.log(resultat + " " + erreur);
toastr.error("<?php echo $this->lang->line('error_message')?>", "<?php echo $this->lang->line('request_error')?>");
}
});
} else {
var select = document.getElementById('hyper');
$(select).empty();
var select2 = document.getElementById('ville');
$(select2).empty();
}
}
});
});
$('#hyper').change(function () {
var code = $(this).val();
$.ajax({
url: '<?php echo base_url('index.php/Admin/getVilleByHyp')?>',
type: 'post',
data: {code: code},
dataType: 'json',
success: function (list) {
var len = list.length;
if (len > 0) {
var select = document.getElementById('ville');
$(select).empty();
for (var i in list) {
$(select).append('<option value=' + list[i].town_id + '>' + list[i].town + '</option>');
}
} else {
var select = document.getElementById('ville');
$(select).empty();
}
}
});
});
});
</script>

View File

@ -121,30 +121,39 @@
<li class="<?php if($active=="geolocated"){echo "active ";} ?>">
<a href="#" data-toggle="modal" data-target="#modal-default">
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Utilisateurs géolocalisés'); ?></span>
<i class="fa fa-users"></i>
<span><?php echo $this->lang->line('Utilisateurs géolocalisés'); ?></span>
</a>
</li>
<li class="<?php if($active=="super"){echo "active ";} ?>">
<li class="<?php if ($active == "super") {
echo "active ";
} ?>">
<a href="<?php echo base_url('index.php/Hyperviseur_dash/getAllSupervisor') ?>">
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Superviseur'); ?></span>
</a>
</li>
<li class="<?php if($active=="demandes"){echo "active ";} ?>">
<a href="#" data-toggle="modal" data-target="#modal-default2">
<li class="<?php if ($active == "demandes") {
echo "active ";
} ?>">
<a href="<?php echo base_url('index.php/Hyperviseur_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 ";} ?>">
<li class="<?php if ($active == "demandesAd") {
echo "active ";
} ?>">
<a href="<?php echo base_url('index.php/Hyperviseur_dash/getDemandesAd') ?>">
<i class="fa fa-users"></i> <span><?php echo $this->lang->line('Demandes adhésion'); ?></span>
</a>
</li>
<?php if ($hasWallet) {
?>
<li class="<?php if($active=="wallet"){echo "active";} ?>">
<li class="<?php if ($active == "wallet") {
echo "active";
} ?>">
<a href="<?php echo base_url('index.php/Hyperviseur_dash/wallet') ?>">
<i class="glyphicon glyphicon-credit-card"></i> <span>Wallet<?php //echo $this->lang->line('Game'); ?></span>
</a>
@ -211,64 +220,7 @@
</div>
</div>
<div class="modal fade" id="modal-default2">
<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">&times;</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=$superviseurs;;
if($result){
$numrows=$result->num_rows();
if ($numrows > 0) { ?>
<label for="selected-super"><?php echo $this->lang->line('Superviseur'); ?></label>
<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>";
} ?>
</select>
<?php }else{
echo $this->lang->line('no_supervisor');
}
?>
<?php } else {
echo $this->lang->line('no_supervisor');
} ?>
</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>&nbsp;
<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>
<?php if($result){ ?>
<button type="button" id="send-getDemandes" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
<?php } ?>
</div>
</form>
</div>
</div>
</div>
<!-- /.modal -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/latest/jquery.min.js"></script>
@ -311,11 +263,4 @@
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>

View File

@ -102,29 +102,59 @@
<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 ";} ?>">
<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 ";} ?>">
<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>
<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>
</li>
<li class="<?= "treeview " . ((strpos($active, "demandes_credits") !== false) ? "active menu-open" : "") ?>"
style="height: auto;">
<a href="#">
<i class="fa fa-users"></i>
<span><?php echo $this->lang->line('Demandes de crédits'); ?></span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu"
style="<?= (strpos($active, "demandes_credits") !== false) ? "" : "display: none;" ?>">
<li class="<?php if ($active == "demandes_credits_entrantes") {
echo "active ";
} ?>">
<a href="<?php echo base_url('index.php/Superviseur_dash/getDemandes?type=incoming') ?>"><i
class="fa fa-arrow-down"></i><?php echo $this->lang->line('incoming_requests'); ?>
</a></li>
<li class="<?php if ($active == "demandes_credits_sortantes") {
echo "active ";
} ?>">
<a href="<?php echo base_url('index.php/Superviseur_dash/getDemandes?type=outgoing') ?>"><i
class="fa fa-arrow-up"></i><?php echo $this->lang->line('outgoing_requests'); ?>
</a></li>
</ul>
</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> --><?php //echo $this->lang->line('Demandes adhésion'); ?><!--</span>-->
<!-- <a href="-->
<?php // echo base_url('index.php/Superviseur_dash/getDemandesAd') ?><!--">-->
<!-- <i class="fa fa-users"></i> <span> -->
<?php //echo $this->lang->line('Demandes adhésion'); ?><!--</span>-->
<!-- </a>-->
<!-- </li>-->
<?php if ($hasWallet) {
?>
<li class="<?php if($active=="wallet"){echo "active";} ?>">
<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>
@ -135,63 +165,6 @@
<!-- /.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">&times;</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;
if($result){
$numrows=$result->num_rows();
if ($numrows > 0) { ?>
<label for="selected-geo-user"><?php echo $this->lang->line('Utilisateurs géolocalisés'); ?></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 $this->lang->line('no_geolocated_agent');
}
?>
<?php }else {
echo $this->lang->line('no_geolocated_agent');
}?>
</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>&nbsp;
<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>
<?php if($result){ ?>
<button type="button" id="send-getDemandes" class="btn btn-primary"><?php echo $this->lang->line('Continuer'); ?></button>
<?php } ?>
</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>
@ -233,10 +206,4 @@
});
$('#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>