This commit is contained in:
KANE LAZENI 2026-01-04 10:36:11 +00:00
parent b4a5aa57e8
commit 08608d9ae5
5 changed files with 141 additions and 131 deletions

View File

@ -1690,3 +1690,98 @@ function afficher_adherent_id()
window.location.assign($("#racineWeb" ).val()+"Ficheadherent/"+$("#idAdherent_C" ).val()+"/");
}
}
//Face KANE 26-09-2025
function re_init_photo_face()
{
var photo = document.getElementById('photo_face');
photo.setAttribute('src', "");
$('#message_face').html("");
$('#image_face').val("");
$("#div_wait_face_ebene").html('');
}
function ebene_init_photo_face() // OK
{
faceRegistered = $("#faceRegistered").val();
if(faceRegistered=="1")
{
v_msg="Cettte personne a déjà une face dans le système!";
v_msgEng="This person already has a face in the system!";
alert_ebene(v_msg, v_msgEng);
$('#message_face').html("");
return;
}
re_init_photo_face();
$("#btn_pop_save_face").click();
}
function ebene_enregistrer_photo_face() // OK
{
$("#ebene_confirmer_photo_face").prop('disabled', true);
$("#ebene_supprimer_photo_face").prop('disabled', true);
$("#ebene_take_photo_face").prop('disabled', true);
$("#motif").prop('disabled', true);
$("ebene_confirmer_photo_face").prop('disabled', true);
$("ebene_supprimer_photo_face").prop('disabled', true);
$("ebene_take_photo_face").prop('disabled', true);
$("motif").prop('disabled', true);
$('#message_face').html("");
$("#div_wait_face_ebene").html('');
$("#okId").val("-1");
$("#okId_face").val("-1");
$("#del_face").val("0");
image_face = $("#image_face").val();
if(image_face<=" ")
{
v_msg="Veuillez prendre une photo!";
v_msgEng="Please take a photo!";
alert_ebene(v_msg, v_msgEng);
return;
}
$("#div_wait_face_ebene").html('<div class="spinner-responsive">' + '<span><i class="fa fa-spinner"></i></span>' + '</div>');
compare_face = $("#compare_face").val();
v_idBeneficiaire=$("#idBeneficiaire_C").val();
var dataURL = canvas.toDataURL("image/jpeg");
$.ajax({
url: $("#racineWeb").val()+"Fichebeneficiaire/ebeneenregistrerface/",
type: 'POST',
data: {'image_face' : dataURL, 'compare_face' : compare_face , 'del_face' : "0"},
success: function(data) {
$("#ebene_take_photo_face").prop('disabled', false);
$("#div_wait_face_ebene").html('');
$("#message_face").html(data);
photo_succes = $("#photo_succes").val();
if(photo_succes=="1")
{
v_msg="Enrôlement effectué avec succès!";
v_msgEng="Enrollment completed successfully!!";
// alert_ebene(v_msg, v_msgEng);
setTimeout(() => {
window.location.assign($("#racineWeb" ).val()+"Fichebeneficiaire/"+v_idBeneficiaire);
}, 1000)
}
},
error: function(data) {
},
complete: function(data) {
$("#div_wait_face_ebene").html('');
}
});
}
function fiche_beneficiaire()
{
idBeneficiaire = $("#idBeneficiaire").val();
window.location.assign($("#racineWeb" ).val()+"Fichebeneficiaire/"+idBeneficiaire);
}

View File

@ -0,0 +1,6 @@
<H3>
<H2 style="background-color:yellow;">
<marquee behavior="scroll" direction="left" behavior=alternate scrollamount="25"> <?= $_SESSION['messageFace'] ?> </marquee>
</H2>
</H3>
<INPUT class="sr-only" TYPE="text" id="photo_succes" name="photo_succes" value="<?= $photo_succes ?>">

View File

@ -50,6 +50,11 @@
$photoAssureCrypte = $_SESSION['photoAssureCrypte'];
$faceRegistered = $this->nettoyer($beneficiaire['faceRegistered']);
$face_confirmee = $_SESSION['okId_face'];
$fingerActif = $_SESSION['fingerActif'];
$faceActif = $_SESSION['faceActif'];
?>
<script type="text/javascript">
@ -58,6 +63,36 @@
<INPUT class="sr-only" TYPE="text" id="garantieArchive_C" name="garantieArchive_C" value="<?= $_SESSION['garantieArchive_C'] ?>">
<INPUT class="sr-only" TYPE="text" id="primeArchive" name="primeArchive" value="<?= $beneficiaire['primeArchive'] ?>" >
<INPUT class="sr-only" TYPE="text" id="finger_id_C" name="finger_id_C" value="<?= $_SESSION['finger_id_C'] ?>">
<INPUT class="sr-only" TYPE="text" id="faceRegistered" name="faceRegistered" value="<?= $faceRegistered ?>">
<button class="sr-only" id="btn_pop_save_face" name="btn_pop_save_face" type="button" data-toggle="modal" data-target="#pop_rec_faciale" > </button>
<div id="div_urlFace">
<input class="sr-only" type="text" id="urlFace" name="urlFace" value="">
</div>
<div id="div_wait_face">
</div>
<table class="table table-responsive table-condensed">
<tbody>
<?php if ($faceRegistered=="1") : ?>
<tr>
<td>
<input style='font-size:15pt;' class="form-control btn btn-primary" type="button" value="<?= _("CONFIRMER OU SUPPRIMER LA FACE") ?>" onClick="javascript:ebene_init_confirm_photo_face();">
</td>
</tr>
<?php else: ?>
<tr>
<td>
<input style='font-size:15pt;' class="form-control btn btn-primary" type="button" value="<?= _("ENREGISTRER LA FACE") ?>" onClick="javascript:ebene_init_photo_face();">
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<FORM name= "formfichebeneficiaire" id ="formfichebeneficiaire" method="POST">
<fieldset>
@ -333,3 +368,4 @@
<?php endif; ?>
</form>
<?php include 'faceebene/ebenetraitementimage.php'; ?>

View File

@ -399,13 +399,15 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
<div class="card-body">
<div id="contenu">
<div id="div_test_gabarit"></div>
<?php
var_dump
(
array
(
"lienPhotoFace" => $_SESSION['lienPhotoFace'],
"okId_face" => $_SESSION['okId_face'],
"fingerActif" => $_SESSION['fingerActif'],
"faceActif" => $_SESSION['faceActif'],
)
);
?>
@ -633,7 +635,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- Application Scripts -->
<script src="/Js/fonctions.js?ver=2026.01.04.24"></script>
<script src="/Js/fonctions.js?ver=2026.01.04.25"></script>
<script type="text/javascript">
raffraichier_gabarit();

View File

@ -1,129 +0,0 @@
<?php
$_SESSION['p_messageFace'] = "";
?>
<div class="modal fade" id="pop_rec_faciale" role="dialog" data-backdrop="static" data-keyboard="false" >
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button id="btn_close_pop_rec_faciale" name="btn_close_pop_rec_faciale" type="button" class="close" data-bs-dismiss="modal" onclick="javascript:fiche_beneficiaire();"> <?= _("Fermer") ?> </button>
<h4 class="modal-title"> <?= _("RECONNAISSANCE FACIALE") ?> </h4>
</div>
<div class="modal-body">
<table class="table table-responsive table-condensed">
<tbody>
<tr>
<td width="48%">
<button id="ebene_take_photo_face" name="ebene_take_photo_face" style='font-size:15pt;' type="button" class="form-control btn btn-primary" onclick="javascript:takephoto();"> <?= _("PRENDRE UNE PHOTO") ?> </button>
</td>
<td > </td>
<?php if ($faceRegistered=="1") : ?>
<td width="48%">
<button disabled id="ebene_confirmer_photo_face" name="ebene_confirmer_photo_face" style='font-size:15pt;' type="button" class="form-control btn btn-primary" onclick="javascript:ebene_confirmer_photo_face();"> <?= _("CONFIRMER LA PHOTO") ?> </button>
</td>
<?php endif; ?>
<?php if ($faceRegistered!="1") : ?>
<td width="48%">
<button disabled id="ebene_enregistrer_photo_face" name="ebene_enregistrer_photo_face" style='font-size:15pt;' type="button" class="form-control btn btn-primary" onclick="javascript:ebene_enregistrer_photo_face();"> <?= _("ENREGISTRER LA PHOTO") ?> </button>
</td>
<?php endif; ?>
</tr>
</tbody>
</table>
<div class="row">
<div class="col-6" >
<legend style="text-align:center" >Webcam</legend>
<video id="video_face" name="video_face" autoplay 350="450" height="250" align="center"></video><br />
</div>
<div class="col-6" >
<legend style="text-align:center" >Photo</legend>
<img id="photo_face" name="photo_face" src="" />
<form id="form_face" name="form_face" enctype="multipart/form-data" method="post" action="Fichebeneficiaire/ebeneenregistrerface">
<INPUT class="sr-only" TYPE="text" id="compare_face" name="compare_face" value="<?= $faceRegistered ?>">
<INPUT class="sr-only" TYPE="text" id="del_face" name="del_face" value="0">
<INPUT class="image-tag" TYPE="hidden" id="image_face" name="image_face" >
</form>
</div>
</div>
<canvas id="canvas" name="canvas" style="display: none;" width="350" height="260"></canvas>
<div id="message_face" name="message_face" >
<H2 style="background-color:yellow;">
<marquee behavior="scroll" direction="left" scrollamount="10"> </marquee>
</H2>
<INPUT class="sr-only" TYPE="text" id="photo_succes" name="photo_succes" value="0">
</div>
<div id="div_wait_face_ebene">
</div>
<script type="text/javascript">
var video = document.getElementById('video_face');
var canvas = document.getElementById('canvas');
var photo = document.getElementById('photo_face');
var image_face = document.getElementById('image_face');
navigator.getMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.mediaDevices.getUserMedia || navigator.moxGetUserMedia;
if (navigator.mediaDevices.getUserMedia)
{
navigator.mediaDevices.getUserMedia({video: true })
.then(function (stream) {
video.srcObject = stream;
})
.catch(function (e) { alert(e.name + ": " + e.message); });
}
else
{
navigator.getMedia({ video: { mandatory: { maxWidth: 350, maxHeight: 260 } } }, function(stream) {
video.src = stream;
}, function(e) {
alert(e);
console.log("Failed!", e);
});
}
function takephoto() {
$('#message_face').html("");
$("#div_wait_face_ebene").html('');
// var ctx = canvas.getContext("2d").drawImage(video, 0, 0, 350, 260, 0, 0, 350, 260);
var ctx = canvas.getContext("2d").drawImage(video, 0, 0, 350, 260);
var data = canvas.toDataURL('image/jpeg');
// var data = canvas.toDataURL('image/jpeg', 0.7);
photo.setAttribute('src', data);
$("#image_face").val(data);
var faceRegistered = $("#faceRegistered").val();
$("#ebene_enregistrer_photo_face").enable();
if(faceRegistered=="1")
{
$("#ebene_confirmer_photo_face").enable();
$("#ebene_supprimer_photo_face").enable();
$("#motif").enable();
}
}
</script>
</div>
<div class="modal-footer">
<button id="close_poprec_faciane" name="close_poprec_faciane" type="button" class="btn btn-default" data-bs-dismiss="modal" onclick="javascript:fiche_beneficiaire();" > <?= _("Fermer") ?> </button>
</div>
</div>
</div>
</div>