diff --git a/Controleur/ControleurKinecso.php b/Controleur/ControleurKinecso.php index e0591c7..96b5cc6 100755 --- a/Controleur/ControleurKinecso.php +++ b/Controleur/ControleurKinecso.php @@ -234,4 +234,39 @@ class ControleurKinecso extends Controleur { 'contestation' => $contestation, 'prixActeModifiable' => $prixActeModifiable)); } } + + public function confirmerotp() + { + if ($this->requete->existeParametre("otpValue")) + { + $login = $_SESSION['p_login']; + $otpValueSaisi = $this->requete->getParametre("otpValue"); + $codeTypeFacture = "SEA"; + + $otpArray = $this->feuille->get_otp_value($codeTypeFacture); + + $otpValueRequis = $otpArray['otpValue']; + $idOtpFacturePrestation = $otpArray['idOtpFacturePrestation']; + + if ( (password_verify($otpValueSaisi, $otpValueRequis)) && (strlen($otpValueSaisi)=='6') ) + { + $this->feuille->maj_otp($idOtpFacturePrestation, '1'); // validé + } + else + { + $this->feuille->maj_otp($idOtpFacturePrestation, '9'); // incorrect + } + + $this->rediriger("Kinecso"); + } + } + + public function envoyerotp() + { + $codeTypeFacture = "SEA"; + $otpValue = mt_rand(100000, 999999); + $this->feuille->envoyer_otp($codeTypeFacture, $otpValue); + $this->rediriger("Kinecso"); + } + } \ No newline at end of file diff --git a/Js/fonctions.js b/Js/fonctions.js index 1a963cc..1904a9d 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -12022,6 +12022,35 @@ async function valider_seance_sea_cso() { return; } + const otpStatus = Number($("#otpStatus").val()); + + // 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 const isConfirmed = await confirm_ebene_sweet( "Confirmez-vous la facturation de ces séances?", @@ -12414,6 +12443,35 @@ async function valider_seance_sea() { return; } + const otpStatus = Number($("#otpStatus").val()); + + // 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 const isConfirmed = await confirm_ebene_sweet( "Confirmez-vous ces séances?", diff --git a/Vue/Kinecso/index.php b/Vue/Kinecso/index.php index 0bad2f1..3aaa394 100755 --- a/Vue/Kinecso/index.php +++ b/Vue/Kinecso/index.php @@ -19,6 +19,10 @@ $vueParent = $_SESSION['p_vueRetour']; $prixActeModifiable = $_SESSION['p_prixActeModifiable']; + + $activerOtp = $_SESSION['p_activerOtpFacturePrestations_C']; + + $token = $_SESSION['csrf_token_submieted']; ?> - +