This commit is contained in:
KANE LAZENI 2026-02-08 02:02:23 +00:00
parent 38219c989f
commit 9c658d86dc
3 changed files with 23 additions and 13 deletions

View File

@ -27,7 +27,7 @@ class ControleurRechercheparcarte extends Controleur {
}
public function index($donneesCarte="")
public function index($donneesCarte="", $msgErreur=null)
{
$this->beneficiaire->getModeBiometrie();
@ -45,7 +45,7 @@ class ControleurRechercheparcarte extends Controleur {
$_SESSION['p_dEntente_C'] = isset($_SESSION['p_dEntente_C']) ? $_SESSION['p_dEntente_C'] : $_SESSION['p_debutMois_C'] ;
$_SESSION['etatEntente'] = isset($_SESSION['etatEntente']) ? $_SESSION['etatEntente'] : '2';
if (isset($_POST['donneesCarte']))
if(isset($_POST['donneesCarte']))
{
// IS1 => Inter-Sante V1
$donneesCarte = $_POST['donneesCarte']; // ex: "IS1|ebene|ESI6936000602"
@ -55,7 +55,8 @@ class ControleurRechercheparcarte extends Controleur {
// exit();
if (count($parts) !== 3 || $parts[0] !== 'IS1') {
die("Carte invalide");
// die("Carte invalide");
$msgErreur = 'Carte invalide / Invalid card';
}
$codeEntite = $parts[1];
@ -75,8 +76,9 @@ class ControleurRechercheparcarte extends Controleur {
if($codeEntite<=" " || $numeroBeneficiaireCarte<=" ")
{
$this->rediriger("Rechercheparcarte");
exit();
// $this->rediriger("Rechercheparcarte");
// exit();
$msgErreur = 'Carte invalide / Invalid card';
}
else
{
@ -90,13 +92,15 @@ class ControleurRechercheparcarte extends Controleur {
if($nbLignes==0)
{
$this->rediriger("Recherche");
exit();
// $this->rediriger("Recherche");
// exit();
$msgErreur = 'Carte introuvable / Card not found';
}
else
{
$beneficiaire = $beneficiaires->fetch();
/*
var_dump(
array(
@ -112,9 +116,8 @@ class ControleurRechercheparcarte extends Controleur {
$this->rediriger("Fichebeneficiaire");
}
}
}
$this->genererVue();
}
$this->genererVue(array('msgErreur' => $msgErreur));
}
}

View File

@ -22,7 +22,7 @@
</tbody>
</table>
<?php if (isset($msgErreur)): ?>
<?php if (): ?>
<?php if ($codeEtatBon=="1"): ?>
<div id ="msgErreur" class="alert alert-success" style="height:38px; padding:5px;">
<H4><?= $msgErreur ?></H4>

View File

@ -5,4 +5,11 @@
<form id="frmrechercheparcarte" name="frmrechercheparcarte" method="post" action="Rechercheparcarte/index/">
<INPUT style='font-size:40pt;height: 50px;' class="form-control" TYPE="text" id="donneesCarte" name="donneesCarte" autofocus AUTOCOMPLETE="OFF" placeholder="<?= _("Veuillez scanner la carte NFC!")?>">
<input id="lancerrechercheparcarte" name="lancerrechercheparcarte" class="sr-only" type="submit" value="<?= _("Rechercher") ?>" >
</form>
</form>
<?php if (isset($msgErreur)): ?>
<div class="alert alert-danger" style="height:38px; padding:5px;" >
<H4><?= $msgErreur ?></H4>
</div>
<?php endif; ?>