67 lines
1.9 KiB
PHP
Executable File
67 lines
1.9 KiB
PHP
Executable File
<?php
|
|
$this->titre = "INTER-SANTE - "._("Recherche du patient par carte") ;
|
|
?>
|
|
|
|
<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>
|
|
|
|
<?php if (isset($msgErreur) && $msgErreur>" "): ?>
|
|
<div class="alert alert-danger" style="height:38px; padding:5px;" >
|
|
<H4><?= $msgErreur ?></H4>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<!--
|
|
<script type="text/javascript">
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
const input = document.getElementById('donneesCarte');
|
|
const form = document.getElementById('frmrechercheparcarte');
|
|
|
|
let buffer = '';
|
|
let timer = null;
|
|
|
|
// Capture globale (lecteur NFC = clavier)
|
|
document.addEventListener('keydown', function (e) {
|
|
|
|
// ENTER → soumission immédiate
|
|
if (e.key === 'Enter') {
|
|
if (buffer.length > 0) {
|
|
input.value = buffer;
|
|
buffer = '';
|
|
form.submit();
|
|
}
|
|
e.preventDefault();
|
|
return;
|
|
}
|
|
|
|
// Ignorer touches spéciales
|
|
if (e.key.length > 1) return;
|
|
|
|
// Accumuler caractères scannés
|
|
buffer += e.key;
|
|
|
|
// Reset après 300 ms d'inactivité (sécurité)
|
|
clearTimeout(timer);
|
|
timer = setTimeout(() => {
|
|
if (buffer.length > 0) {
|
|
input.value = buffer;
|
|
buffer = '';
|
|
form.submit();
|
|
}
|
|
}, 300);
|
|
});
|
|
});
|
|
</script>
|
|
-->
|
|
|
|
<script>
|
|
document.getElementById('donneesCarte').addEventListener('change', function () {
|
|
if (this.value.length > 3) {
|
|
alert("submit");
|
|
this.form.submit();
|
|
}
|
|
});
|
|
</script>
|