This commit is contained in:
KANE LAZENI 2026-07-27 11:11:09 +00:00
parent 0dd75d71d5
commit ed065511cb
2 changed files with 37 additions and 1 deletions

View File

@ -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");
}
}

View File

@ -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'];