diff --git a/application/controllers/Hyperviseur_dash.php b/application/controllers/Hyperviseur_dash.php index 234f6366..0914d622 100755 --- a/application/controllers/Hyperviseur_dash.php +++ b/application/controllers/Hyperviseur_dash.php @@ -1411,6 +1411,134 @@ class Hyperviseur_dash extends CI_Controller $this->load->view('nano_credit/users_group_detail'); $this->load->view('footer'); } + + public function recherche() + { + + if ($this->isLogged()) { + + $data['active'] = "recherche"; + $data['alert'] = ""; + $data['firstname'] = $this->session->userdata('firstname'); + $data['lastname'] = $this->session->userdata('lastname'); + $data['email'] = $this->session->userdata('email'); + $data['network'] = $this->session->userdata('network'); + $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); + $data['networks'] = $this->user_model->getActiveNetwork(); + $data['currency_code'] = $this->session->userdata('currency_code'); + $data['category'] = $this->session->userdata('category'); + + $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); + $data['result_search'] = 0; + $data['default_phone'] = ''; + $data['default_transac'] = ''; + $data['default_code'] = ''; + $data['default_nom'] = ''; + + + $this->load->view('header_hyp', $data); + $this->load->view('gestion_recherche'); + $this->load->view('footer'); + } + } + + public function get_user() + { + + if ($this->isLogged()) { + + if (isset($_POST)) { + $nom = $this->input->post('nom'); + + $phone = $this->input->post('phone'); + $simple_users = null; + if ($phone != '' && $nom != '') { + $phone_condition = "phone LIKE '" . $phone . "%'"; + $nom_condition = "AND lastname LIKE '%" . $nom . "%'"; + $simple_users = $this->user_model->get_simple_user($phone, $nom,$this->session->userdata('current_pays')); + } elseif ($phone != '' && $nom == '') { + $phone_condition = "phone LIKE '" . $phone . "%'"; + $nom_condition = 'AND lastname IS NOT NULL'; + $simple_users = $this->user_model->get_simple_user($phone, '%',$this->session->userdata('current_pays')); + } elseif ($phone == '' && $nom != '') { + $phone_condition = 'phone IS NOT NULL'; + $nom_condition = "AND lastname LIKE '%" . $nom . "%'"; + $simple_users = $this->user_model->get_simple_user('%', $nom,$this->session->userdata('current_pays')); + } elseif ($phone == '' && $nom == '') { + $phone_condition = 'phone IS NOT NULL'; + $nom_condition = 'AND lastname IS NOT NULL'; + } + + $transac = $this->input->post('transac'); + if ($transac != '') { + $transac_condition = "AND transactionNumber LIKE'" . $transac . "%'"; + } else { + $transac_condition = 'AND transactionNumber IS NOT NULL'; + } + $code = $this->input->post('code'); + if ($code != '') { + $code_condition = "AND code_membre = '" . $code . "'"; + } else { + $code_condition = 'AND code_membre IS NOT NULL'; + } + + $network_condition = ' AND network_id = '.$this->session->userdata('network_id'); + $where_clause = "WHERE " . $phone_condition . ' ' . $transac_condition . ' ' . $code_condition . ' ' . $nom_condition.$network_condition; + + $res = $this->user_model->get_user($where_clause); + + $data['active'] = "recherche"; + $data['alert'] = ""; + $data['firstname'] = $this->session->userdata('firstname'); + $data['lastname'] = $this->session->userdata('lastname'); + $data['email'] = $this->session->userdata('email'); + $data['network'] = $this->session->userdata('network'); + $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); + $data['networks'] = $this->user_model->getActiveNetwork(); + $data['currency_code'] = $this->session->userdata('currency_code'); + $data['category'] = $this->session->userdata('category'); + $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); + + + if ($res != false) { + + $count_users = $res->num_rows(); + if ($simple_users != null) { + $count_users = $res->num_rows() + $simple_users->num_rows(); + } + + $data['result_search'] = 1; + $data['res_users'] = $res; + $data['res_simple_users'] = $simple_users; + $data['num_res'] = $count_users; + $data['default_phone'] = $phone; + $data['default_nom'] = $nom; + $data['default_transac'] = $transac; + $data['default_code'] = $code; + $data['game_pays'] = $this->user_model->getGameCountry(); + $data['networks'] = $this->user_model->getActiveNetwork(); + + $this->load->view('header_hyp', $data); + $this->load->view('gestion_recherche'); + $this->load->view('footer'); + } else { + + $data['result_search'] = 2; + $data['res_simple_users'] = $simple_users; + $data['default_phone'] = ''; + $data['default_transac'] = ''; + $data['default_code'] = ''; + $data['default_nom'] = ''; + $data['game_pays'] = $this->user_model->getGameCountry(); + $data['networks'] = $this->user_model->getActiveNetwork(); + + $this->load->view('header_hyp', $data); + $this->load->view('gestion_recherche'); + $this->load->view('footer'); + } + } + } + } } class Operation diff --git a/application/controllers/Superviseur_dash.php b/application/controllers/Superviseur_dash.php index bc47f28f..98613e80 100755 --- a/application/controllers/Superviseur_dash.php +++ b/application/controllers/Superviseur_dash.php @@ -332,7 +332,7 @@ class Superviseur_dash extends CI_Controller $data['network'] = $this->session->userdata('network'); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); $data['networks'] = $this->user_model->getActiveNetwork(); - $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); +// $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); $data['country'] = $this->session->userdata('current_pays'); $data['category'] = $this->session->userdata('category'); @@ -374,7 +374,7 @@ class Superviseur_dash extends CI_Controller $data['network'] = $this->session->userdata('network'); $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); $data['networks'] = $this->user_model->getActiveNetwork(); - $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); +// $data['superviseurs'] = $this->user_model->getSuperNameAndCodeForHyp($this->session->userdata('member_code')); $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); $data['country'] = $this->session->userdata('current_pays'); $data['category'] = $this->session->userdata('category'); @@ -399,4 +399,132 @@ class Superviseur_dash extends CI_Controller return true; } + public function recherche() + { + + if ($this->isLogged()) { + + $data['active'] = "recherche"; + $data['alert'] = ""; + $data['firstname'] = $this->session->userdata('firstname'); + $data['lastname'] = $this->session->userdata('lastname'); + $data['email'] = $this->session->userdata('email'); + $data['network'] = $this->session->userdata('network'); + $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); + $data['networks'] = $this->user_model->getActiveNetwork(); + $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); + $data['country'] = $this->session->userdata('current_pays'); + $data['category'] = $this->session->userdata('category'); + + $data['result_search'] = 0; + $data['default_phone'] = ''; + $data['default_transac'] = ''; + $data['default_code'] = ''; + $data['default_nom'] = ''; + + + $this->load->view('header_sup', $data); + $this->load->view('gestion_recherche'); + $this->load->view('footer'); + } + } + + public function get_user() + { + + if ($this->isLogged()) { + + if (isset($_POST)) { + $nom = $this->input->post('nom'); + + $phone = $this->input->post('phone'); + $simple_users = null; + if ($phone != '' && $nom != '') { + $phone_condition = "phone LIKE '" . $phone . "%'"; + $nom_condition = "AND lastname LIKE '%" . $nom . "%'"; + $simple_users = $this->user_model->get_simple_user($phone, $nom,$this->session->userdata('current_pays')); + } elseif ($phone != '' && $nom == '') { + $phone_condition = "phone LIKE '" . $phone . "%'"; + $nom_condition = 'AND lastname IS NOT NULL'; + $simple_users = $this->user_model->get_simple_user($phone, '%',$this->session->userdata('current_pays')); + } elseif ($phone == '' && $nom != '') { + $phone_condition = 'phone IS NOT NULL'; + $nom_condition = "AND lastname LIKE '%" . $nom . "%'"; + $simple_users = $this->user_model->get_simple_user('%', $nom,$this->session->userdata('current_pays')); + } elseif ($phone == '' && $nom == '') { + $phone_condition = 'phone IS NOT NULL'; + $nom_condition = 'AND lastname IS NOT NULL'; + } + + $transac = $this->input->post('transac'); + if ($transac != '') { + $transac_condition = "AND transactionNumber LIKE'" . $transac . "%'"; + } else { + $transac_condition = 'AND transactionNumber IS NOT NULL'; + } + $code = $this->input->post('code'); + if ($code != '') { + $code_condition = "AND code_membre = '" . $code . "'"; + } else { + $code_condition = 'AND code_membre IS NOT NULL'; + } + + $godfather_condition = " AND code_parrain = '".$this->session->userdata('member_code')."'"; + $where_clause = "WHERE " . $phone_condition . ' ' . $transac_condition . ' ' . $code_condition . ' ' . $nom_condition.$godfather_condition; + + $res = $this->user_model->get_user($where_clause); + + $data['active'] = "recherche"; + $data['alert'] = ""; + $data['firstname'] = $this->session->userdata('firstname'); + $data['lastname'] = $this->session->userdata('lastname'); + $data['email'] = $this->session->userdata('email'); + $data['network'] = $this->session->userdata('network'); + $data['villes'] = $this->user_model->getVilleByUserGeo($data['network'], $this->session->userdata('current_pays')); + $data['networks'] = $this->user_model->getActiveNetwork(); + $data['hasWallet'] = $this->wallet_model->getConfigWallet($this->session->userdata('network_id')); + $data['country'] = $this->session->userdata('current_pays'); + $data['category'] = $this->session->userdata('category'); + + + if ($res != false) { + + $count_users = $res->num_rows(); + if ($simple_users != null) { + $count_users = $res->num_rows() + $simple_users->num_rows(); + } + + $data['result_search'] = 1; + $data['res_users'] = $res; + $data['res_simple_users'] = $simple_users; + $data['num_res'] = $count_users; + $data['default_phone'] = $phone; + $data['default_nom'] = $nom; + $data['default_transac'] = $transac; + $data['default_code'] = $code; + $data['game_pays'] = $this->user_model->getGameCountry(); + $data['networks'] = $this->user_model->getActiveNetwork(); + + $this->load->view('header_sup', $data); + $this->load->view('gestion_recherche'); + $this->load->view('footer'); + } else { + + $data['result_search'] = 2; + $data['res_simple_users'] = $simple_users; + $data['default_phone'] = ''; + $data['default_transac'] = ''; + $data['default_code'] = ''; + $data['default_nom'] = ''; + $data['game_pays'] = $this->user_model->getGameCountry(); + $data['networks'] = $this->user_model->getActiveNetwork(); + + $this->load->view('header_sup', $data); + $this->load->view('gestion_recherche'); + $this->load->view('footer'); + } + } + } + } + } diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index cfd4e6c2..a99103fa 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -506,4 +506,13 @@ $lang['end_date'] = "End date"; $lang['cash_withdrawal'] = "Withdrawal in cash"; $lang['validation_date'] = "Date of validation"; $lang['repayment_date'] = "Repayment date"; +$lang['identified'] = 'Identified'; +$lang['document_image_front'] = 'Front side of the document'; +$lang['document_image_back'] = 'Back side of the document'; +$lang['birth_date'] = 'Date of birth'; +$lang['identity_document'] = "Identity document"; +$lang['id_identity_document'] = "Identity document number"; +$lang['expiry_date_document'] = "Document expiration date"; +$lang['user_image'] = "Profile picture"; +$lang['users_found'] = 'users found'; ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index 3a105f67..1d249f5f 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -518,4 +518,13 @@ $lang['end_date'] = "Date de fin"; $lang['cash_withdrawal'] = "Retrait en cash"; $lang['validation_date'] = "Date de la validation"; $lang['repayment_date'] = "Date de remboursement"; +$lang['identified'] = 'Identifié'; +$lang['document_image_front'] = 'Face avant du document'; +$lang['document_image_back'] = 'Face arrière du document'; +$lang['birth_date'] = 'Date de naissance'; +$lang['identity_document'] = "Pièce d'identité"; +$lang['id_identity_document'] = "Numero de la pièce d'identité"; +$lang['expiry_date_document'] = "Date d'expiration du document"; +$lang['user_image'] = "Photo de profil"; +$lang['users_found'] = 'utilisateurs trouvés'; ?> diff --git a/application/models/User_model.php b/application/models/User_model.php index b7f63efa..cdab1bd9 100755 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -1965,15 +1965,18 @@ class User_model extends CI_Model /** * @param $phone * @param $name - * @return |null + * @param Pays $country + * @return |null |null */ - public function get_simple_user($phone, $name){ + public function get_simple_user($phone, $name , $country = null){ + $end_query = $country ? "AND countries.name = '".$country."'" : ''; $query = $this->db->query("SELECT users.id AS id_user,users.active AS etat,users.lastname,users.phone,users.email,users.adresse,users.date_created, - networks.name AS network,countries.name AS country + networks.name AS network,countries.name AS country,i.firstname as id_firstname , i.lastname as id_lastname , i.birth_date , i.town as id_town , i.country as id_country, + i.identity_document , i.id_identity_document ,i.expiry_date_document , i.status, i.user_image , i.document_image_back , i.document_image_front FROM users INNER JOIN networks ON networks.id=users.network_id - INNER JOIN countries ON countries.id=networks.country_id - WHERE phone LIKE '".$phone."%' AND lastname LIKE '".$name."%'"); + INNER JOIN countries ON countries.id=networks.country_id LEFT JOIN identifications i ON i.id_user = users.id + WHERE users.phone LIKE '".$phone."%' AND users.lastname LIKE '".$name."%'".$end_query); if($query->num_rows()>0){ return $query; diff --git a/application/views/gestion_recherche.php b/application/views/gestion_recherche.php index 1e9a6b4d..176a5d55 100755 --- a/application/views/gestion_recherche.php +++ b/application/views/gestion_recherche.php @@ -1,423 +1,730 @@ - - - - - + + + +
- - -
+ + +
- +

+ lang->line('Rechercher un utilisateur'); ?> +

+ ">lang->line('Voir plus...'); ?> -
- - - - - - - num_rows(); - $num = 0; - if ($numrows > 0) { - foreach($simple_users->result() as $row) { - $num ++; - ?> - -
- -
-
- User profile picture + if ($alert == "ok") { -

lastname ?>

+ if (!$success == "ok") { + ?> +
+ +

Erreur!

+ +
-

lang->line('Utilisateur simple'); ?>

+ +
+ +

Success!

+ +
- + + - lang->line('Voir plus...'); ?> -
- -
- -
- - - - - - -

num_rows().' '.$this->lang->line('utilisateur trouvé'); ?>

-
-
- num_rows(); - $num = 0; - if ($numrows > 0) { - foreach($simple_users->result() as $row) { - $num ++; - ?> - -
- -
-
- User profile picture +
+
+
+
+
+ +
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+
+ +
+ +
+
+
+
+ '/> +
+
+
+
+
+
+
+ -

lastname ?>

+

lang->line($num_res == 1 ? 'utilisateur trouvé' : 'users_found') ?>

+
+
+ num_rows(); + $num = 0; + if ($numrows > 0) { + foreach ($users->result() as $row) { + $num++; + ?> -

lang->line('Utilisateur simple'); ?>

+
+ +
+
+ User profile picture - +

lastname ?>

- lang->line('Voir plus...'); ?> -
- -
- -
- - -
-
+

category ?>

- -

lang->line('Aucun utilisateur trouvé'); ?>

- - -
- icon search -
- -
-
-
+ + + lang->line('Voir plus...'); ?> +
+ +
+ +
+ + + num_rows(); + $num = 0; + if ($numrows > 0) { + foreach ($simple_users->result() as $row) { + $num++; + ?> + +
+ +
+
+ User profile picture + +

lastname ?>

+ +

lang->line('Utilisateur simple'); ?>

+ + + + lang->line('Voir plus...'); ?> +
+ +
+ +
+ + +
+
+ + +

num_rows().' '.$this->lang->line($simple_users->num_rows() == 1 ? 'utilisateur trouvé' : 'users_found') ?>

+
+
+ num_rows(); + $num = 0; + if ($numrows > 0) { + foreach ($simple_users->result() as $row) { + $num++; + ?> + +
+ +
+
+ User profile picture + +

lastname ?>

+ +

lang->line('Utilisateur simple'); ?>

+ + + + lang->line('Voir plus...'); ?> +
+ +
+ +
+ + +
+
+ + +

lang->line('Aucun utilisateur trouvé'); ?>

+ + +
+ icon search +
+ + + + @@ -445,210 +752,217 @@ diff --git a/application/views/header_hyp.php b/application/views/header_hyp.php index 117102a1..cd723768 100755 --- a/application/views/header_hyp.php +++ b/application/views/header_hyp.php @@ -203,6 +203,12 @@ + +
  • "> + + lang->line('Rechercher'); ?> + +
  • diff --git a/application/views/header_sup.php b/application/views/header_sup.php index 78768a3d..74043627 100755 --- a/application/views/header_sup.php +++ b/application/views/header_sup.php @@ -170,6 +170,11 @@ +
  • "> + + lang->line('Rechercher'); ?> + +
  • diff --git a/images/broken.png b/images/broken.png new file mode 100644 index 00000000..971b6a6a Binary files /dev/null and b/images/broken.png differ