diff --git a/Controleur/ControleurLaboratoire.php b/Controleur/ControleurLaboratoire.php index 8c59d3b..b126e72 100755 --- a/Controleur/ControleurLaboratoire.php +++ b/Controleur/ControleurLaboratoire.php @@ -210,4 +210,39 @@ class ControleurLaboratoire extends Controleur { 'geds' => $geds, 'msgErreur' => $msgErreur, 'contestation' => $contestation, 'prixActeModifiable' => $prixActeModifiable)); } } + + public function confirmerotp() + { + if ($this->requete->existeParametre("otpValue")) + { + $login = $_SESSION['p_login']; + $otpValueSaisi = $this->requete->getParametre("otpValue"); + $codeTypeFacture = "LAB"; + + $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("Pharmacien"); + } + } + + public function envoyerotp() + { + $codeTypeFacture = "LAB"; + $otpValue = mt_rand(100000, 999999); + $this->feuille->envoyer_otp($codeTypeFacture, $otpValue); + $this->rediriger("Pharmacien"); + } + } \ No newline at end of file diff --git a/Controleur/ControleurPharmacien.php b/Controleur/ControleurPharmacien.php index 593814b..7e685ec 100755 --- a/Controleur/ControleurPharmacien.php +++ b/Controleur/ControleurPharmacien.php @@ -233,8 +233,9 @@ class ControleurPharmacien extends Controleur { { $login = $_SESSION['p_login']; $otpValueSaisi = $this->requete->getParametre("otpValue"); + $codeTypeFacture = "PHAR"; - $otpArray = $this->feuille->get_otp_value("PHAR"); + $otpArray = $this->feuille->get_otp_value($codeTypeFacture); $otpValueRequis = $otpArray['otpValue']; $idOtpFacturePrestation = $otpArray['idOtpFacturePrestation'];