a
This commit is contained in:
parent
6980b71fbd
commit
95f136b028
|
|
@ -166,4 +166,40 @@ class ControleurOpticien extends Controleur {
|
|||
'contestation' => $contestation));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function confirmerotp()
|
||||
{
|
||||
if ($this->requete->existeParametre("otpValue"))
|
||||
{
|
||||
$login = $_SESSION['p_login'];
|
||||
$otpValueSaisi = $this->requete->getParametre("otpValue");
|
||||
$codeTypeFacture = "OPT";
|
||||
|
||||
$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("Opticien");
|
||||
}
|
||||
}
|
||||
|
||||
public function envoyerotp()
|
||||
{
|
||||
$codeTypeFacture = "OPT";
|
||||
$otpValue = mt_rand(100000, 999999);
|
||||
$this->feuille->envoyer_otp($codeTypeFacture, $otpValue);
|
||||
$this->rediriger("Opticien");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -384,17 +384,60 @@
|
|||
<?php if($statutGarantie=="1"):?>
|
||||
<?php if ($idDemandeAccord == "0") :?>
|
||||
|
||||
<table class="table table-responsive table-condensed" style='font-size:10pt;' >
|
||||
<tbody>
|
||||
<tr>
|
||||
<td > <button type="button" class="form-control btn btn-primary" data-bs-toggle="modal" data-bs-target="#popAjoutVerre" style='font-size:12pt;' > <?= _("Sélectionner un acte"). "..." ?> </button> </td>
|
||||
<td width="2%"></td>
|
||||
<td width="35%"> <INPUT class="form-control btn btn-info" value="<?= _("GED Optique...") ?>" onclick="javascript:pop_ged_optique();" style='font-size:10pt;' ></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- 26/07/2026 => DEBUT gérer les OTP ici -->
|
||||
<?php if($otpStatus=="-1" || $otpStatus=="1"): ?>
|
||||
|
||||
|
||||
<table class="table table-responsive table-condensed" style='font-size:10pt;' >
|
||||
<tbody>
|
||||
<tr>
|
||||
<td > <button type="button" class="form-control btn btn-primary" data-bs-toggle="modal" data-bs-target="#popAjoutVerre" style='font-size:12pt;' > <?= _("Sélectionner un acte"). "..." ?> </button> </td>
|
||||
<td width="2%"></td>
|
||||
<td width="35%"> <INPUT class="form-control btn btn-info" value="<?= _("GED Optique...") ?>" onclick="javascript:pop_ged_optique();" style='font-size:10pt;' ></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php else:
|
||||
switch ($otpStatus) {
|
||||
case 0:
|
||||
$messageOtp = "Veuillez envoyer un code de vérification à l'assuré!";
|
||||
break;
|
||||
case 2:
|
||||
$messageOtp = "Veuillez saisir le code de vérification reçu par l'assuré sur son téléphone portable ou son adresse e-mail!";
|
||||
break;
|
||||
case 9:
|
||||
$messageOtp = "Code incorrect, veuillez réessayer!";
|
||||
break;
|
||||
default:
|
||||
$messageOtp = "Veuillez envoyer un code de vérification à l'assuré!";
|
||||
}
|
||||
?>
|
||||
<h5 class="alert alert-danger" style="height:35px; padding:5px; text-align:center; margin-bottom:5px;"> <?= $messageOtp ?> </h5>
|
||||
|
||||
<?php if($otpStatus=='0') : ?>
|
||||
<form action="Opticien/envoyerotp" method="post">
|
||||
<?php else: ?>
|
||||
<form action="Opticien/confirmerotp" method="post">
|
||||
<?php endif; ?>
|
||||
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<?php if($otpStatus=='0') : ?>
|
||||
<td> <input style='font-size:10pt;' class="form-control btn btn-info" type="submit" name="submit" value="<?= _("Envoyer Code") ?>" /> </td>
|
||||
<?php elseif($otpStatus=='2'): ?>
|
||||
<td> <INPUT style='font-size:10pt; text-align:center;' class="form-control" type="text" id="otpValue" name="otpValue" required AUTOCOMPLETE="OFF" autofocus > </td>
|
||||
<td> <input style='font-size:10pt;' class="form-control btn btn-primary" type="submit" name="submit" value="<?= _("Vérifier Code") ?>" /> </td>
|
||||
<?php else: ?>
|
||||
<td> <INPUT style='font-size:10pt; text-align:center;' class="form-control" type="text" id="otpValue" name="otpValue" required AUTOCOMPLETE="OFF" autofocus > </td>
|
||||
<td> <input style='font-size:10pt;' class="form-control btn btn-warning" type="submit" name="submit" value="<?= _("Vérifier Code à nouveau") ?>" /> </td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<!-- 26/07/2026 => FIN gérer les OTP ici -->
|
||||
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user