diff --git a/Controleur/ControleurAjaxdetailpharmacien.php b/Controleur/ControleurAjaxdetailpharmacien.php
index ef14b9d..d47c152 100755
--- a/Controleur/ControleurAjaxdetailpharmacien.php
+++ b/Controleur/ControleurAjaxdetailpharmacien.php
@@ -149,6 +149,13 @@ class ControleurAjaxdetailpharmacien extends Controleur {
public function enregistrerpharmacie()
{
+ $csrf_token = trim($this->requete->getParametreFormulaire("csrf_token"));
+
+ if (!Csrf::validateToken($csrf_token)) {
+ $_SESSION['flash_error'] = 'Votre session a expiré. Veuillez réessayer.';
+ exit;
+ }
+
$this->prescription->facturerpharmacie();
$this->executerAction("index");
diff --git a/Js/fonctions.js b/Js/fonctions.js
index 0a43d68..f0b4dcc 100755
--- a/Js/fonctions.js
+++ b/Js/fonctions.js
@@ -5534,9 +5534,6 @@ function facturer_pha()
donnees = charger_csrf_token("");
- alert(donnees);
- return;
-
$.ajax({
url: $("#racineWeb").val()+"Ajaxdetailpharmacien/enregistrerpharmacie/",
type: 'POST',
@@ -5612,6 +5609,37 @@ async function valider_pharmacie_pha() {
}
}
+ const otpStatus = Number($("#otpStatus").val());
+
+ alert("otpStatus => "+otpStatus);
+
+ // Gestion OTP facturation
+ let o_msg = "";
+ let o_msgEng = "";
+
+ switch (otpStatus) {
+ case 0:
+ o_msg = "Veuillez envoyer un code de vérification à l'assuré!";
+ o_msgEng = "Please send a verification code to the insured.!";
+ break;
+ case 2:
+ o_msg = "Veuillez saisir le code de vérification reçu par l'assuré sur son téléphone portable ou son adresse e-mail!";
+ o_msgEng = "Please enter the verification code received by the insured person on their mobile phone or at their email address!";
+ break;
+ case 9:
+ o_msg = "Code incorrect, veuillez réessayer!";
+ o_msgEng = "Incorrect code, please try again!";
+ break;
+ default:
+ o_msg = "Veuillez envoyer un code de vérification à l'assuré!";
+ o_msgEng = "Please send a verification code to the insured!";
+ }
+
+ if (otpStatus!=1 && otpStatus!=-1) {
+ alert_ebene(o_msg, o_msgEng);
+ return;
+ }
+
// Confirmation dialog
const isConfirmed = await confirm_ebene_sweet(
"Confirmez-vous cette facturation?",
diff --git a/Vue/gabarit.php b/Vue/gabarit.php
index 0cf1237..4dc1093 100755
--- a/Vue/gabarit.php
+++ b/Vue/gabarit.php
@@ -885,7 +885,7 @@
-
+