diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php index fcda618b..dfb63f0a 100755 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -30,8 +30,9 @@ class Hyperviseur_dash extends CI_Controller redirect('index.php', $data); } else { - $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_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_d_no_canceled = $this->user_model->getCountDemandeByStatut($this->session->userdata('member_code'), '2'); $count_d = $this->user_model->getCountDemande($this->session->userdata('member_code')); $data['active'] = "dash"; @@ -54,6 +55,7 @@ class Hyperviseur_dash extends CI_Controller $data['count_sup'] = $this->user_model->countUser("super", 'all', $this->session->userdata('member_code')); $data['count_d_traite'] = $count_d_traite; $data['count_d_no_traite'] = $count_d_no_traite; + $data['count_d_no_canceled'] = $count_d_no_canceled; $data['count_d_users'] = $count_d; $data['networks'] = $this->user_model->getNetworkByHyp($this->session->userdata('member_code')); $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); diff --git a/application/controllers/Superviseur_dash.php b/application/controllers/Superviseur_dash.php index 5f6af3db..4f0f19bd 100755 --- a/application/controllers/Superviseur_dash.php +++ b/application/controllers/Superviseur_dash.php @@ -30,8 +30,9 @@ class Superviseur_dash extends CI_Controller $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_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_d_no_canceled = $this->user_model->getCountDemandeByStatut($this->session->userdata('member_code'), '2'); $data['list_geolocated_users'] = $this->user_model->getUsersGeolocatedForSup($this->session->userdata('member_code')); @@ -52,6 +53,7 @@ class Superviseur_dash extends CI_Controller $data['count_d_users'] = $count_d; $data['count_d_traite'] = $count_d_traite; $data['count_d_no_traite'] = $count_d_no_traite; + $data['count_d_no_canceled'] = $count_d_no_canceled; $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); $this->load->view('header_sup', $data); $this->load->view('superviseur_dash'); diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index 69e862fe..609bb7ee 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -553,4 +553,6 @@ $lang['modify_operator'] = "Modify operator"; $lang['assign_operator_to_country'] = "Assign an operator to a country"; $lang['operator_type'] = "Operator type"; $lang['no_type'] = "No type"; +$lang['accepted_demands'] = "Requests accepted"; +$lang['canceled_demands'] = "Canceled requests"; ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index 79ebd8b6..688a7254 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -565,4 +565,6 @@ $lang['modify_operator'] = "Modifier l'opérateur"; $lang['assign_operator_to_country'] = "Assigner un opérateur à un pays"; $lang['operator_type'] = "Type d'opérateur"; $lang['no_type'] = "Aucun type"; +$lang['accepted_demands'] = "Demandes acceptées"; +$lang['canceled_demands'] = "Demandes annulées"; ?> diff --git a/application/views/demande_credit.php b/application/views/demande_credit.php index 188a17fb..f94c1e97 100755 --- a/application/views/demande_credit.php +++ b/application/views/demande_credit.php @@ -65,6 +65,17 @@ } } + function getDelayOfTreatmentInSeconds($time, $dateAjout){ + if ($time == null) { + $now = time(); + $date2 = strtotime($dateAjout); + return abs($now - $date2); + }else{ + return $time ; + } + + } + // function toLocateDate($date , $timezone){ // if($date){ // $carbon = Carbon::createFromFormat('Y-m-d H:i:s', $date, 'UTC'); @@ -213,6 +224,7 @@ " . $this->lang->line('Date de traitement') . " " . $this->lang->line('Statut') . " " . $this->lang->line('Délai de traitement') . " + " . $this->lang->line('Délai de traitement')."(en minutes)" . " "; ?> @@ -250,7 +262,7 @@ " . $row->dateModif . " $etat " . traitementTemps($row->temps, $row->dateAjout) . " - + " . getDelayOfTreatmentInSeconds($row->temps, $row->dateAjout)/60 . " "; } @@ -304,6 +316,7 @@ " . $this->lang->line('Date de traitement') . " " . $this->lang->line('Statut') . " " . $this->lang->line('Délai de traitement') . " + " . $this->lang->line('Délai de traitement')."(en minutes)" . " "; ?> @@ -339,6 +352,7 @@ " . $row->dateModif . " $etat " . traitementTemps($row->temps, $row->dateAjout) . " + " . getDelayOfTreatmentInSeconds($row->temps, $row->dateAjout)/60 . " "; @@ -725,6 +739,7 @@ " . $this->lang->line('Date de traitement') . " " . $this->lang->line('Statut') . " " . $this->lang->line('Délai de traitement') . " + " . $this->lang->line('Délai de traitement')."(en minutes)" . " "; ?> @@ -763,6 +778,7 @@ " . $row->dateModif . " $etat " . traitementTemps($row->temps, $row->dateAjout) . " + " . getDelayOfTreatmentInSeconds($row->temps, $row->dateAjout)/60 . " "; } @@ -994,7 +1010,12 @@ "columnDefs": [{ targets: [5, 6], render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format), - }], + }, + { + "targets": [ 9 ], + "visible": false + } + ], dom: 'Bfrtip', "buttons": [ 'pageLength', @@ -1020,7 +1041,12 @@ "columnDefs": [{ targets: [3, 4], render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format), - }], + }, + { + "targets": [ 7 ], + "visible": false + } + ], dom: 'Bfrtip', "buttons": [ 'pageLength', @@ -1045,7 +1071,12 @@ "columnDefs": [{ targets: [1, 2], render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format) - }], + }, + { + "targets": [ 5 ], + "visible": false + } + ], dom: 'Bfrtip', "buttons": [ 'pageLength', diff --git a/application/views/hyperviseur_dash.php b/application/views/hyperviseur_dash.php index 39608f99..ba1f1d55 100755 --- a/application/views/hyperviseur_dash.php +++ b/application/views/hyperviseur_dash.php @@ -182,7 +182,7 @@ if($users_geolocated_query!=false){

lang->line('Utilisateurs géolocalisés'); ?>

- +
lang->line("Plus d'informations"); ?> @@ -197,7 +197,7 @@ if($users_geolocated_query!=false){

lang->line('Superviseur'); ?>

- +
lang->line("Plus d'informations"); ?> @@ -211,7 +211,7 @@ if($users_geolocated_query!=false){

lang->line('Demandes de crédits'); ?>

- +
lang->line("Plus d'informations"); ?> @@ -222,28 +222,42 @@ if($users_geolocated_query!=false){

-

lang->line("Demandes traitées"); ?>

+

lang->line("accepted_demands"); ?>

- +
lang->line("Plus d'informations"); ?>
-
+

lang->line("Demandes non traitées"); ?>

- +
lang->line("Plus d'informations"); ?>
+
+ +
+
+

+ +

lang->line("canceled_demands"); ?>

+
+
+ +
+ lang->line("Plus d'informations"); ?> +
+
diff --git a/application/views/superviseur_dash.php b/application/views/superviseur_dash.php index ccdf4894..4173d328 100755 --- a/application/views/superviseur_dash.php +++ b/application/views/superviseur_dash.php @@ -1,408 +1,422 @@ - - - - - - - - - - - - - db->query("SELECT demande_id FROM info_demandeCredits - WHERE MONTH(dateAjout) = '".$months[$i-1]."' AND YEAR(dateAjout) = ".$years[$i-1]." - AND codeParrain='".$this->session->userdata('member_code')."'" - ); - $demandes_data[] = $demandes_query_mounth->num_rows(); - } - - $demandes_query = $listdem; - - if($demandes_query!=false){ - $demandes=$demandes_query->num_rows(); - // Count networks for simple users - $array_simple = array(); - $num = 0; - if ($demandes > 0) { - foreach($demandes_query->result() as $row) { - $num++; - $array_simple[] = $row->codeMembre; - } - - $vals_simple = array_count_values($array_simple); - //echo 'No. of NON Duplicate Items: '.count($vals_simple).'

'; - //print_r($vals_simple); - $pieChart2 = array(); - foreach(array_keys($vals_simple) as $paramName2) { - $color2 = dechex(rand(0x000000, 0xFFFFFF)); - $trash2 = array("value" => $vals_simple[$paramName2], - "color" => "#".$color2, - "highlight" => "#".$color2, - "label" => $paramName2); - - $pieChart2[]= $trash2; - - } - } - }else{ - $pieChart2 = array(); - } - - /** - ** Geolocated User Treatment - **/ - $users_geolocated_query = $list_geolocated_users; - // Geolocated Users by month replace 2016 by NOW() - $users_geolocated_data[] = ''; - $users_geolocated_data =array(); - for ($i = 1; $i <= 12; $i++) { - $users_geolocated_query_january = $this->db->query("SELECT agent_id FROM super_infos - WHERE MONTH(date_created) = '".$months[$i-1]."' AND YEAR(date_created) = ".$years[$i-1]." - AND category='geolocated' AND code_parrain='".$this->session->userdata('member_code')."'"); - $users_geolocated_data[] = $users_geolocated_query_january->num_rows(); - } - - if($users_geolocated_query!=false){ - - $users_geolocated=$users_geolocated_query->num_rows(); - //$users_geolocated_query = json_encode($users_geolocated_query->result()); - // Counts network for geolocated users - $array_geolocated = array(); - $num = 0; - if ($users_geolocated > 0) { - foreach($users_geolocated_query->result() as $row) { - $num++; - $array_geolocated[] = date("M", strtotime($row->date_created)); - } - $vals_geolocated = array_count_values($array_geolocated); - //echo 'No. of NON Duplicate Items: '.count($vals_geolocated).'

'; - //print_r($vals_geolocated); - $pieChart = array(); - foreach(array_keys($vals_geolocated) as $paramName) { - $color = dechex(rand(0x000000, 0xFFFFFF)); - $trash = array("value" => $vals_geolocated[$paramName], - "color" => "#".$color, - "highlight" => "#".$color, - "label" => $paramName); - - $pieChart[]= $trash; - } - } - }else{ - $pieChart = array(); - } - ?> - -
- - -
-

- lang->line('Superviseur'); ?> - lang->line('Tableau de bord'); ?> -

-
- -
- -
- -
- -
-
-

- -

lang->line('Utilisateurs géolocalisés'); ?>

-
-
- -
- lang->line("Plus d'informations"); ?> -
-
-
- -
-
-

- -

lang->line('Demandes de crédits'); ?>

-
-
- -
- lang->line("Plus d'informations"); ?> -
-
-
- -
-
-

- -

lang->line('Demandes traitées'); ?>

-
-
- -
- lang->line("Plus d'informations"); ?> -
-
-
- -
-
-

- -

lang->line('Demandes non traitées'); ?>

-
-
- -
- lang->line("Plus d'informations"); ?> -
-
- -
- -
-
-

lang->line('Adhésions'); ?>

-
-
-
- -
-
- -
- -
- -
- -
-
-

lang->line('Adhésions par mois sur une année'); ?>

-
-
- -
- -
- -
-
- -
-
-

lang->line('Demande de crédits par utilisateurs'); ?>

-
-
- -
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + db->query("SELECT demande_id FROM info_demandeCredits + WHERE MONTH(dateAjout) = '".$months[$i-1]."' AND YEAR(dateAjout) = ".$years[$i-1]." + AND codeParrain='".$this->session->userdata('member_code')."'" + ); + $demandes_data[] = $demandes_query_mounth->num_rows(); + } + + $demandes_query = $listdem; + + if($demandes_query!=false){ + $demandes=$demandes_query->num_rows(); + // Count networks for simple users + $array_simple = array(); + $num = 0; + if ($demandes > 0) { + foreach($demandes_query->result() as $row) { + $num++; + $array_simple[] = $row->codeMembre; + } + + $vals_simple = array_count_values($array_simple); + //echo 'No. of NON Duplicate Items: '.count($vals_simple).'

'; + //print_r($vals_simple); + $pieChart2 = array(); + foreach(array_keys($vals_simple) as $paramName2) { + $color2 = dechex(rand(0x000000, 0xFFFFFF)); + $trash2 = array("value" => $vals_simple[$paramName2], + "color" => "#".$color2, + "highlight" => "#".$color2, + "label" => $paramName2); + + $pieChart2[]= $trash2; + + } + } + }else{ + $pieChart2 = array(); + } + + /** + ** Geolocated User Treatment + **/ + $users_geolocated_query = $list_geolocated_users; + // Geolocated Users by month replace 2016 by NOW() + $users_geolocated_data[] = ''; + $users_geolocated_data =array(); + for ($i = 1; $i <= 12; $i++) { + $users_geolocated_query_january = $this->db->query("SELECT agent_id FROM super_infos + WHERE MONTH(date_created) = '".$months[$i-1]."' AND YEAR(date_created) = ".$years[$i-1]." + AND category='geolocated' AND code_parrain='".$this->session->userdata('member_code')."'"); + $users_geolocated_data[] = $users_geolocated_query_january->num_rows(); + } + + if($users_geolocated_query!=false){ + + $users_geolocated=$users_geolocated_query->num_rows(); + //$users_geolocated_query = json_encode($users_geolocated_query->result()); + // Counts network for geolocated users + $array_geolocated = array(); + $num = 0; + if ($users_geolocated > 0) { + foreach($users_geolocated_query->result() as $row) { + $num++; + $array_geolocated[] = date("M", strtotime($row->date_created)); + } + $vals_geolocated = array_count_values($array_geolocated); + //echo 'No. of NON Duplicate Items: '.count($vals_geolocated).'

'; + //print_r($vals_geolocated); + $pieChart = array(); + foreach(array_keys($vals_geolocated) as $paramName) { + $color = dechex(rand(0x000000, 0xFFFFFF)); + $trash = array("value" => $vals_geolocated[$paramName], + "color" => "#".$color, + "highlight" => "#".$color, + "label" => $paramName); + + $pieChart[]= $trash; + } + } + }else{ + $pieChart = array(); + } + ?> + +
+ + +
+

+ lang->line('Superviseur'); ?> + lang->line('Tableau de bord'); ?> +

+
+ +
+ +
+ +
+ +
+
+

+ +

lang->line('Utilisateurs géolocalisés'); ?>

+
+
+ +
+ lang->line("Plus d'informations"); ?> +
+
+
+ +
+
+

+ +

lang->line('Demandes de crédits'); ?>

+
+
+ +
+ lang->line("Plus d'informations"); ?> +
+
+
+ +
+
+

+ +

lang->line('Demandes traitées'); ?>

+
+
+ +
+ lang->line("Plus d'informations"); ?> +
+
+
+ +
+
+

+ +

lang->line('Demandes non traitées'); ?>

+
+
+ +
+ lang->line("Plus d'informations"); ?> +
+
+
+ +
+
+

+ +

lang->line("canceled_demands"); ?>

+
+
+ +
+ lang->line("Plus d'informations"); ?> +
+
+ +
+ +
+
+

lang->line('Adhésions'); ?>

+
+
+
+ +
+
+ +
+ +
+ +
+ +
+
+

lang->line('Adhésions par mois sur une année'); ?>

+
+
+ +
+ +
+ +
+
+ +
+
+

lang->line('Demande de crédits par utilisateurs'); ?>

+
+
+ +
+ +
+ +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +