From d2a824376e1a697b8cecfc9ec6babae8a29e2178 Mon Sep 17 00:00:00 2001 From: Djery-Tom Date: Fri, 5 Nov 2021 17:15:59 +0100 Subject: [PATCH] Add awaiting more information while reject insurances subscription --- application/controllers/Gestion.php | 2 +- .../controllers/NanoHealthController.php | 1 + application/language/english/message_lang.php | 5 ++ application/language/french/message_lang.php | 5 ++ application/models/User_model.php | 2 +- application/views/gestion_recherche.php | 20 ++++- .../hyper/infos_insurance_subscription.php | 85 ++++++++++++++++++- 7 files changed, 112 insertions(+), 8 deletions(-) diff --git a/application/controllers/Gestion.php b/application/controllers/Gestion.php index a8667a28..7c4b1c9b 100755 --- a/application/controllers/Gestion.php +++ b/application/controllers/Gestion.php @@ -1134,7 +1134,7 @@ if($this->isLogged()) { public function get_user() { -if($this->isLogged()) { + if($this->isLogged()) { if (isset($_POST)) { $nom = $this->input->post('nom'); diff --git a/application/controllers/NanoHealthController.php b/application/controllers/NanoHealthController.php index f5392a81..6eeee092 100644 --- a/application/controllers/NanoHealthController.php +++ b/application/controllers/NanoHealthController.php @@ -215,6 +215,7 @@ class NanoHealthController extends CI_Controller $body = new \stdClass(); $body->agent_id = $this->input->post('agent_id'); $body->nh_validating_agent_id = $this->input->post('nh_validating_agent_id'); + $body->type = $this->input->post('type'); $body->reason = $this->input->post('reason'); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body)); diff --git a/application/language/english/message_lang.php b/application/language/english/message_lang.php index 0f6da6b7..973367c6 100755 --- a/application/language/english/message_lang.php +++ b/application/language/english/message_lang.php @@ -742,4 +742,9 @@ $lang['manage_insured'] = "Insured management"; $lang['PAID'] = "Paid"; $lang['insured_id'] = "Insured ID"; $lang['subscription_id'] = "Subscription ID"; +$lang['more_information'] = "More information"; +$lang['more_information_subscription'] = "More information for the subscription"; +$lang['message_rule'] = "The message must not exceed 500 characters"; +$lang['subscription_more_information'] = "Subscription awaiting additional information"; +$lang['AWAITING_FURTHER_INFORMATION'] = "Awaiting further information"; ?> diff --git a/application/language/french/message_lang.php b/application/language/french/message_lang.php index c5b5e4ab..b248b3f1 100755 --- a/application/language/french/message_lang.php +++ b/application/language/french/message_lang.php @@ -754,4 +754,9 @@ $lang['manage_insured'] = "Gestion des assurés"; $lang['PAID'] = "Payée"; $lang['insured_id'] = "ID de l'assuré"; $lang['souscription_id'] = "ID de la souscription"; +$lang['more_information'] = "Complément d'informations"; +$lang['more_information_subscription'] = "Complément d'informations pour la subscription"; +$lang['message_rule'] = "Le message ne doit pas dépasser 500 caractères"; +$lang['subscription_more_information'] = "Souscription en attente de complement d'informations"; +$lang['AWAITING_FURTHER_INFORMATION'] = "En attente d'informations complémentaires" ?> diff --git a/application/models/User_model.php b/application/models/User_model.php index 4d4ed004..be1b5a47 100755 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -1749,7 +1749,7 @@ class User_model extends CI_Model 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,i.firstname as id_firstname , i.lastname as id_lastname , i.birth_date , i.town as id_town , i.country as id_country, + networks.name AS network,countries.name AS country,i.firstname as id_firstname , i.lastname as id_lastname , i.birth_date , i.gender, 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 diff --git a/application/views/gestion_recherche.php b/application/views/gestion_recherche.php index 06f539a7..50fa0230 100755 --- a/application/views/gestion_recherche.php +++ b/application/views/gestion_recherche.php @@ -413,18 +413,24 @@ ?>
-
+
-
+
+
+ + +
@@ -616,19 +622,25 @@ ?>
-
+
-
+
+
+ + +
diff --git a/application/views/nano_health/hyper/infos_insurance_subscription.php b/application/views/nano_health/hyper/infos_insurance_subscription.php index b59a17f1..1b04bf2f 100755 --- a/application/views/nano_health/hyper/infos_insurance_subscription.php +++ b/application/views/nano_health/hyper/infos_insurance_subscription.php @@ -17,10 +17,15 @@ lang->line('subscriptions') . ' :: ' . $this->lang->line('subscription_detail') . ' - ' . $insurance_subscription_id; ?>
- state == 'UNDER_VALIDATION') { ?> + state,['UNDER_VALIDATION','AWAITING_FURTHER_INFORMATION'])) { ?> + state == 'UNDER_VALIDATION') { ?> + + @@ -326,6 +331,36 @@
+
@@ -472,7 +507,8 @@ "agent_id": "session->userdata('agent_id') ?>", - "reason": reason + "reason": reason, + "type" : "NORMAL" }, success: function (data) { if (data.status === 200) { @@ -499,4 +535,49 @@ } }); + $('#more-information-subscription').click(function () { + if ($('#more-information-form')[0].checkValidity()) { + let message = $("textarea[name=message]").val(); + if(message.length > 500 ){ + toastr.warning( "lang->line('message_rule')?>", "lang->line('management_rule')?>"); + }else{ + $.ajax({ + url: '', + type: 'POST', + dataType: 'json', + data: { + "subscription_id": "id ?>", + + "nh_validating_agent_id": "session->userdata('agent_id') ?>", + + "agent_id": "session->userdata('agent_id') ?>", + + "reason": message, + "type" : "MORE_INFORMATION" + }, + success: function (data) { + if (data.status === 200) { + Swal.fire({ + icon: 'success', + title: "lang->line('subscription_more_information')?>", + text: "lang->line('informations_updated')?>", + timer: 3000 + }).then(() => { + location.reload(); + }); + } else { + toastr.error(data.error, "lang->line('request_error')?>"); + } + }, + error: function (resultat, statut, error) { + console.log(resultat + " " + error); + toastr.error("lang->line('error_message')?>", "lang->line('request_error')?>"); + } + }); + } + } else { + $('#more-information-form')[0].reportValidity(); + } + }); +