Merge branch 'main' of git.ebene.ovh:ebene/radiantrh
|
|
@ -173,6 +173,24 @@ body.sidebar-collapsed .app-sidebar .nav-link:hover::after {
|
|||
transform: translateY(-50%) translateX(5px);
|
||||
}
|
||||
|
||||
/* Cache les flèches de sous-menu quand c'est réduit */
|
||||
body.sidebar-collapsed .nav-arrow {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Empêche les sous-menus de s'ouvrir verticalement en mode réduit */
|
||||
/* (Ils resteraient visibles mais écrasés sinon) */
|
||||
body.sidebar-collapsed .nav-submenu {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Centrage des icônes pour un aspect "Barre d'outils" propre */
|
||||
body.sidebar-collapsed .nav-item .nav-link {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.sidebar-nav {
|
||||
padding: 24px 0;
|
||||
|
|
@ -829,7 +847,7 @@ body.sidebar-collapsed .nav-bar {
|
|||
right: -100%;
|
||||
}
|
||||
}
|
||||
|
||||
/**/
|
||||
/* Mobile — UNE SEULE définition */
|
||||
@media (max-width: 768px) {
|
||||
.app-sidebar { transform: translateX(-100%); width: var(--sidebar-width); }
|
||||
|
|
|
|||
|
|
@ -404,7 +404,11 @@ class ControleurFichebeneficiaire extends Controleur
|
|||
$faceMatches = count($result['FaceMatches']);
|
||||
if ($faceMatches==0)
|
||||
{
|
||||
$_SESSION['messageFace'] = "Les faces ne correspondent pas! / The faces do not match!";
|
||||
|
||||
$_SESSION['messageFace'] = est_anglophone()
|
||||
? "The faces do not match!"
|
||||
: "Les faces ne correspondent pas!";
|
||||
|
||||
$this->beneficiaire->resultat_traitement_face($username, '0', $_SESSION['messageFace']);
|
||||
$this->genererVueAjax(array('messageFace' => $_SESSION['messageFace'], 'msgErreur' => $_SESSION['messageFace'], 'photo_succes' => "0"));
|
||||
}
|
||||
|
|
@ -418,7 +422,10 @@ class ControleurFichebeneficiaire extends Controleur
|
|||
$idBeneficiaire = $_SESSION['idBeneficiaire_C'];
|
||||
$this->beneficiaire->supprimerPhoto($idBeneficiaire);
|
||||
$this->beneficiaire->unregisterface($username, $motif);
|
||||
$_SESSION['messageFace'] = "Face supprimée pour motif : $motif / Face removed for reason : $motif";
|
||||
|
||||
$_SESSION['messageFace'] = est_anglophone()
|
||||
? "Face removed for reason : $motif"
|
||||
: "Face supprimée pour motif : $motif";
|
||||
|
||||
$this->genererVueAjax(array('messageFace' => $_SESSION['messageFace'], 'photo_succes' => "1"));
|
||||
$_SESSION['lienPhoto_C']="";
|
||||
|
|
@ -428,7 +435,11 @@ class ControleurFichebeneficiaire extends Controleur
|
|||
$this->beneficiaire->resultat_traitement_face($username, '1', '');
|
||||
|
||||
$_SESSION['okId_face'] = "1";
|
||||
$_SESSION['messageFace'] = "Face confirmée! / Face confirmed!";
|
||||
|
||||
$_SESSION['messageFace'] = est_anglophone()
|
||||
? "Face confirmed!"
|
||||
: "Face confirmée!";
|
||||
|
||||
$this->genererVueAjax(array('messageFace' => $_SESSION['messageFace'], 'msgErreur' => $_SESSION['messageFace'], 'photo_succes' => "1"));
|
||||
}
|
||||
}
|
||||
|
|
@ -437,7 +448,7 @@ class ControleurFichebeneficiaire extends Controleur
|
|||
echo 'Message: ' .$e->getMessage();
|
||||
// exit();
|
||||
$msgErreur = $e->getMessage();
|
||||
// $_SESSION['messageFace'] = "Un problème lors du traitement! / A problem during treatment!";
|
||||
|
||||
$_SESSION['messageFace'] = $msgErreur;
|
||||
|
||||
$this->beneficiaire->resultat_traitement_face($username, '9', $msgErreur);
|
||||
|
|
@ -493,7 +504,10 @@ class ControleurFichebeneficiaire extends Controleur
|
|||
$idBeneficiaire = $_SESSION['idBeneficiaire_C'];
|
||||
$this->beneficiaire->changerPhoto($idBeneficiaire, $nomImage);
|
||||
|
||||
$_SESSION['messageFace'] = "Enrôlement effectué avec succès! / Enrollment completed successfully!!";
|
||||
$_SESSION['messageFace'] = est_anglophone()
|
||||
? "Enrollment completed successfully!"
|
||||
: "Enrôlement effectué avec succès!";
|
||||
|
||||
$this->genererVueAjax(array('messageFace' => $_SESSION['messageFace'], 'msgErreur' => $_SESSION['messageFace'], 'photo_succes' => "1"));
|
||||
}
|
||||
$this->beneficiaire->resultat_traitement_face($username, '1', '');
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ function raffraichier_gabarit()
|
|||
|
||||
if((codeSociete == undefined || codeSociete <= " ") && vue !="Connexion"){
|
||||
|
||||
window.location.assign($("#racineWeb" ).val()+"Connexion/");
|
||||
window.location.assign($("#racineWeb" ).val()+"Connexion/deconnecter/");
|
||||
}
|
||||
},
|
||||
error: function(errorData)
|
||||
|
|
@ -196,7 +196,7 @@ function baseSwal(options) {
|
|||
* ALERTE SIMPLE
|
||||
* Affiche une information bilingue.
|
||||
*/
|
||||
/* mis en commentaire le temps que cela fonctionne 04/01/2026
|
||||
|
||||
function alert_ebene(p_msg, p_msg_eng) {
|
||||
const codeLangue = $("#codeLangue").val();
|
||||
const message = (codeLangue === "en_US") ? p_msg_eng : p_msg;
|
||||
|
|
@ -207,24 +207,8 @@ function alert_ebene(p_msg, p_msg_eng) {
|
|||
confirmButtonText: codeLangue === "en_US" ? 'OK' : 'D\'accord'
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
function alert_ebene(p_msg, p_msg_eng)
|
||||
{
|
||||
codeLangue = $("#codeLangue").val();
|
||||
|
||||
if(codeLangue=="en_US")
|
||||
{
|
||||
alert(p_msg_eng);
|
||||
}
|
||||
else
|
||||
{
|
||||
alert(p_msg);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
function alert_ebene(msgFr, msgEn) {
|
||||
const codeLangue = document.querySelector("#codeLangue")?.value || "fr_FR";
|
||||
const message = (codeLangue === "en_US") ? msgEn : msgFr;
|
||||
|
|
@ -232,35 +216,6 @@ function alert_ebene(msgFr, msgEn) {
|
|||
// Bloquant : l'utilisateur doit cliquer sur OK
|
||||
window.alert(message);
|
||||
}
|
||||
|
||||
/*
|
||||
function alert_ebene(p_msg, p_msg_eng) {
|
||||
const codeLangue = document.querySelector("#codeLangue")?.value || "fr_FR";
|
||||
const message = (codeLangue === "en_US") ? p_msg_eng : p_msg;
|
||||
|
||||
return Swal.fire({
|
||||
text: message,
|
||||
icon: 'info',
|
||||
confirmButtonText: (codeLangue === "en_US") ? 'OK' : 'D\'accord'
|
||||
}).then(() => {
|
||||
// Ici tu mets l'action suivante, elle ne s'exécute qu'après clic sur OK
|
||||
console.log("Utilisateur a validé le message");
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
function alert_ebene(msgFr, msgEn) {
|
||||
const codeLangue = document.querySelector("#codeLangue")?.value || "fr_FR";
|
||||
const message = (codeLangue === "en_US") ? msgEn : msgFr;
|
||||
|
||||
return Swal.fire({
|
||||
text: message,
|
||||
icon: 'info',
|
||||
confirmButtonText: (codeLangue === "en_US") ? 'OK' : 'D\'accord'
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -515,11 +470,8 @@ function ajax_context_police_afficher(idPolice) {
|
|||
const msg = "Erreur lors de la préparation du dossier police.";
|
||||
const msgEng = "Error while preparing the policy file.";
|
||||
|
||||
if (typeof alert_ebene === "function") {
|
||||
alert_ebene(msg, msgEng);
|
||||
} else {
|
||||
alert(msg);
|
||||
}
|
||||
alert_ebene(msg, msgEng);
|
||||
|
||||
},
|
||||
complete: function() {
|
||||
// Redirection vers la fiche de la police après le traitement AJAX
|
||||
|
|
@ -606,11 +558,9 @@ function imprimer_quittance_client(idQuittance) {
|
|||
if (!idQuittance || parseInt(idQuittance) <= 0) {
|
||||
const v_msg = "Rien à imprimer !";
|
||||
const v_msgEng = "Nothing to print!";
|
||||
if (typeof alert_ebene === "function") {
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
} else {
|
||||
alert(v_msg);
|
||||
}
|
||||
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1864,7 +1814,8 @@ function ebene_enregistrer_photo_face() // OK
|
|||
{
|
||||
v_msg="Enrôlement effectué avec succès!";
|
||||
v_msgEng="Enrollment completed successfully!!";
|
||||
// alert_ebene(v_msg, v_msgEng);
|
||||
|
||||
//alert_ebene(v_msg, v_msgEng);
|
||||
setTimeout(() => {
|
||||
window.location.assign($("#racineWeb" ).val()+"Fichebeneficiaire/"+v_idBeneficiaire);
|
||||
}, 1000)
|
||||
|
|
@ -1977,7 +1928,7 @@ function ebene_confirmer_photo_face() // OK
|
|||
$("#okId_face").val("1");
|
||||
v_msg="Face confirmée!";
|
||||
v_msgEng="Face confirmed!";
|
||||
// alert_ebene(v_msg, v_msgEng);
|
||||
//alert_ebene(v_msg, v_msgEng);
|
||||
setTimeout(() => {
|
||||
prestations();
|
||||
}, 2000)
|
||||
|
|
@ -2094,7 +2045,7 @@ function ebene_supprimer_photo_face() // OK
|
|||
|
||||
v_msg="Face supprimée avec succès!";
|
||||
v_msgEng="Face removed successfully!";
|
||||
// alert_ebene(v_msg, v_msgEng);
|
||||
//alert_ebene(v_msg, v_msgEng);
|
||||
setTimeout(() => {
|
||||
prestations();
|
||||
}, 2000)
|
||||
|
|
@ -2803,7 +2754,7 @@ function importer_modele_assure(idAvenant) {
|
|||
// On attend un tout petit peu que le DOM soit stable avant de passer à la suite
|
||||
setTimeout(function(){
|
||||
maj_etape_3_import_assures();
|
||||
}, 500);
|
||||
}, 1000);
|
||||
} else {
|
||||
div_export.html(''); // On cache le spinner
|
||||
// Le message d'erreur est déjà affiché par $("#div_erreur_excel").html(data)
|
||||
|
|
@ -2869,12 +2820,12 @@ function calculer_prime_inmportation()
|
|||
type: 'POST',
|
||||
// data: donnees,
|
||||
success: function(data) {
|
||||
/*
|
||||
|
||||
v_msg="Calcul de primes terminée avec succès!";
|
||||
v_msgEng="Premium calculation completed successfully!";
|
||||
alert_ebene(v_msg, v_msgEng);
|
||||
alert("Calcul de primes terminée avec succès!");
|
||||
*/
|
||||
//alert("Calcul de primes terminée avec succès!");
|
||||
|
||||
},
|
||||
error: function(data) {
|
||||
},
|
||||
|
|
@ -5228,17 +5179,4 @@ function retirer_un_menu_vue_profil(codeMenu)
|
|||
afficher_menu_vue_profil();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function verifier_Echeance_ren()
|
||||
{
|
||||
codeTypeAvenant=$("#codeTypeAvenant").val();
|
||||
|
||||
if(codeTypeAvenant!="REN")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CalculerEcheanceRen();
|
||||
CalculerFinRen();
|
||||
}
|
||||
}
|
||||
|
|
@ -126,7 +126,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
|
|||
<link rel="manifest" href="<?= $racineWeb ?>manifest.json">
|
||||
|
||||
<!-- 4. VOS STYLES PERSONNALISÉS (en dernier pour qu'ils dominent) -->
|
||||
<link href="<?= $racineWeb ?>Bootstrap_new/css/style_office.css?ver=2026.01.13.00" rel="stylesheet">
|
||||
<link href="<?= $racineWeb ?>Bootstrap_new/css/style_office.css?ver=2026.01.19.00" rel="stylesheet">
|
||||
<link href="<?= $racineWeb ?>Bootstrap_new/css/ux_enhancements.css?ver=2025.12.21.02" rel="stylesheet">
|
||||
|
||||
<!-- Charts -->
|
||||
|
|
@ -134,6 +134,10 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
|
|||
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2.0.0"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-annotation@1.0.2"></script>
|
||||
|
||||
<!-- jsPDF -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
|
||||
|
||||
<!-- ============================================
|
||||
SCRIPTS ET CONFIGURATION
|
||||
============================================ -->
|
||||
|
|
@ -183,8 +187,6 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
|
|||
sheet.href && sheet.href.includes('override.css')
|
||||
);
|
||||
|
||||
|
||||
|
||||
if (!overrideLoaded) {
|
||||
|
||||
// Charger dynamiquement
|
||||
|
|
@ -217,7 +219,6 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
|
|||
<header class="app-header">
|
||||
<div class="header-content">
|
||||
<div class="logo-container">
|
||||
|
||||
<a href="Accueil" class="app-logo">
|
||||
<img src="/Bootstrap_new/images/new/favicon.png" alt="INTER-SANTE" width="36" height="36">
|
||||
<span class="ms-2">INTER-SANTE</span>
|
||||
|
|
@ -230,7 +231,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
|
|||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<i class="bi bi-list toggle-sidebar-btn"></i>
|
||||
<i class="bi bi-list toggle-sidebar-btn" onclick="toggleSidebar()" style="cursor: pointer;"></i>
|
||||
</div>
|
||||
|
||||
<!-- -->
|
||||
|
|
@ -414,18 +415,6 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
|
|||
<div class="card-body">
|
||||
<div id="contenu">
|
||||
<div id="div_test_gabarit"></div>
|
||||
<?php
|
||||
/*
|
||||
var_dump
|
||||
(
|
||||
array
|
||||
(
|
||||
"lienPhotoFace" => $_SESSION['lienPhotoFace'],
|
||||
"cheminPhoto" => $_SESSION['cheminPhoto'],
|
||||
)
|
||||
);
|
||||
*/
|
||||
?>
|
||||
|
||||
<?= $contenu ?>
|
||||
</div>
|
||||
|
|
@ -665,7 +654,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
|
|||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
<!-- Application Scripts -->
|
||||
<script src="/Js/fonctions.js?ver=2026.01.18.03"></script>
|
||||
<script src="/Js/fonctions.js?ver=2026.01.19.03"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
raffraichier_gabarit();
|
||||
|
|
|
|||
|
|
@ -437,7 +437,7 @@
|
|||
<input class="sr-only" type="text" id="racineWeb" name="racineWeb" value="<?= $racineWeb ?>">
|
||||
<div class="row" style="overflow-x: height: inherit;padding-top:5px">
|
||||
<div class="col-md-12 logo">
|
||||
<img src="assets/img/new/Intersante_assure.png" alt="logo intersante">
|
||||
<img src="assets/img/new/Intersante_rh.png" alt="logo intersante">
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 form-side" style="text-align: center; position: relative; min-height: 88vh;">
|
||||
|
|
|
|||
BIN
assets/img/new/Intersante_rh.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 1.5 MiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 344 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 2.0 MiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 799 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 1.8 MiB |
|
|
@ -1,181 +1,175 @@
|
|||
<?php
|
||||
$_SESSION['messageFace'] = "";
|
||||
?>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<div class="modal fade animate__animated animate__zoomIn" id="pop_rec_faciale" tabindex="-1" role="dialog" data-bs-backdrop="static" data-bs-keyboard="false">
|
||||
<div class="modal-dialog modal-lg modal-dialog-centered shadow-lg">
|
||||
<div class="modal-content border-0">
|
||||
|
||||
<div class="modal-header bg-primary text-white py-3">
|
||||
<div class="d-flex align-items-center w-100">
|
||||
<div class="bg-white bg-opacity-25 p-2 rounded-circle me-3">
|
||||
<i class="fas fa-face-viewfinder fa-lg text-white"></i>
|
||||
</div>
|
||||
<h5 class="modal-title fw-bold mb-0"><?= _("Reconnaissance Faciale") ?></h5>
|
||||
<button id="btn_close_pop_rec_faciale" type="button" class="btn-close btn-close-white ms-auto" data-bs-dismiss="modal" onclick="javascript:fiche_beneficiaire();"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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">
|
||||
<div class="d-flex justify-content-between align-items-center w-100">
|
||||
<h4 class="modal-title mb-0"><?= _("RECONNAISSANCE FACIALE") ?></h4>
|
||||
<button id="btn_close_pop_rec_faciale" name="btn_close_pop_rec_faciale" type="button" class="btn-close" data-bs-dismiss="modal" onclick="javascript:fiche_beneficiaire();" aria-label="<?= _("Fermer") ?>"></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body p-4 bg-light">
|
||||
<div class="row g-3 mb-4">
|
||||
<div class="col-md-6">
|
||||
<button id="ebene_take_photo_face" type="button" class="btn btn-primary w-100 py-3 fw-bold shadow-sm" onclick="takephoto();">
|
||||
<i class="fas fa-camera me-2"></i><?= _("CAPTURER L'IMAGE") ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<?php if ($faceRegistered == "1") : ?>
|
||||
<button disabled id="ebene_confirmer_photo_face" type="button" class="btn btn-success w-100 py-3 fw-bold shadow-sm" onclick="ebene_confirmer_photo_face();">
|
||||
<i class="fas fa-check-circle me-2"></i><?= _("VÉRIFIER L'IDENTITÉ") ?>
|
||||
</button>
|
||||
<?php else : ?>
|
||||
<button disabled id="ebene_enregistrer_photo_face" type="button" class="btn btn-info text-white w-100 py-3 fw-bold shadow-sm" onclick="ebene_enregistrer_photo_face();">
|
||||
<i class="fas fa-save me-2"></i><?= _("ENREGISTRER LA PHOTO") ?>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<!-- Boutons d'action - disposition responsive -->
|
||||
<div class="row g-2 mb-3">
|
||||
<div class="col-12 col-sm-6">
|
||||
<button id="ebene_take_photo_face" name="ebene_take_photo_face" type="button" class="btn btn-primary w-100 py-2 btn_autre" onclick="javascript:takephoto();">
|
||||
<i class="bi bi-camera me-2"></i><?= _("PRENDRE UNE PHOTO") ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<?php if ($faceRegistered == "1") : ?>
|
||||
<div class="col-12 col-sm-6">
|
||||
<button disabled id="ebene_confirmer_photo_face" name="ebene_confirmer_photo_face" type="button" class="btn btn-primary w-100 py-2 btn_autre" onclick="javascript:ebene_confirmer_photo_face();">
|
||||
<i class="bi bi-check-circle me-2"></i><?= _("CONFIRMER LA PHOTO") ?>
|
||||
</button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($faceRegistered != "1") : ?>
|
||||
<div class="col-12 col-sm-6">
|
||||
<button disabled id="ebene_enregistrer_photo_face" name="ebene_enregistrer_photo_face" type="button" class="btn btn-primary w-100 py-2 btn_autre" onclick="javascript:ebene_enregistrer_photo_face();">
|
||||
<i class="bi bi-save me-2"></i><?= _("ENREGISTRER LA PHOTO") ?>
|
||||
</button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6 text-center">
|
||||
<span class="badge bg-dark px-3 py-2 rounded-pill mb-2 small fw-bold text-uppercase"><?= _("Webcam en direct") ?></span>
|
||||
<div class="ratio ratio-4x3 bg-dark rounded shadow-inner overflow-hidden border border-3 border-white position-relative">
|
||||
<video id="video_face" autoplay playsinline class="w-100 h-100 object-fit-cover"></video>
|
||||
<div class="position-absolute top-50 start-50 translate-middle border border-2 border-primary border-opacity-25 rounded-circle" style="width: 65%; height: 85%; pointer-events: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Zone webcam et photo - disposition responsive -->
|
||||
<div class="row g-3">
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="text-center mb-2">
|
||||
<legend class="h6"><?= _("Webcam") ?></legend>
|
||||
</div>
|
||||
<div class="ratio ratio-4x3 bg-dark rounded">
|
||||
<video id="video_face" name="video_face" autoplay playsinline class="w-100 h-100 object-fit-cover"></video>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 text-center">
|
||||
<span class="badge bg-secondary px-3 py-2 rounded-pill mb-2 small fw-bold text-uppercase"><?= _("Capture figée") ?></span>
|
||||
<div id="container_photo" class="ratio ratio-4x3 bg-white border border-3 border-white rounded shadow-inner overflow-hidden d-flex align-items-center justify-content-center position-relative">
|
||||
|
||||
<div id="placeholder_icon" class="position-absolute text-muted opacity-25 text-center">
|
||||
<i class="fas fa-user-astronaut fa-5x"></i>
|
||||
<p class="small mt-2 fw-bold text-uppercase mb-0"><?= _("En attente") ?></p>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="text-center mb-2">
|
||||
<legend class="h6"><?= _("Photo") ?></legend>
|
||||
</div>
|
||||
<div class="ratio ratio-4x3 bg-light border rounded">
|
||||
<img id="photo_face" name="photo_face" src="" class="w-100 h-100 object-fit-cover" alt="<?= _("Photo capturée") ?>" />
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<img id="photo_face" src="" class="w-100 h-100 object-fit-cover position-relative"
|
||||
style="opacity: 0; transition: opacity 0.4s ease-in-out; z-index: 2;"
|
||||
onload="this.style.opacity=1; document.getElementById('placeholder_icon').style.display='none';" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Canvas caché -->
|
||||
<canvas id="canvas" name="canvas" style="display: none;" width="350" height="260"></canvas>
|
||||
<form id="form_face" class="visually-hidden">
|
||||
<input type="hidden" id="compare_face" value="<?= $faceRegistered ?>">
|
||||
<input type="hidden" id="image_face" name="image_face">
|
||||
</form>
|
||||
|
||||
<!-- Messages -->
|
||||
<div id="message_face" name="message_face" class="mt-3">
|
||||
<div class="alert alert-warning mb-0" role="alert">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="bi bi-info-circle me-2"></i>
|
||||
<marquee behavior="scroll" direction="left" scrollamount="3" class="flex-grow-1"></marquee>
|
||||
</div>
|
||||
</div>
|
||||
<input class="sr-only" type="text" id="photo_succes" name="photo_succes" value="0">
|
||||
</div>
|
||||
<div id="message_face" class="mt-4">
|
||||
<div class="alert alert-warning mb-0 shadow-xs border-0 rounded-pill d-flex align-items-center px-4">
|
||||
<i class="fas fa-info-circle me-3 text-primary"></i>
|
||||
<marquee behavior="scroll" direction="left" scrollamount="3" class="small fw-bold m-0">
|
||||
<?= _("Positionnez votre visage au centre du cadre pour une détection optimale.") ?>
|
||||
</marquee>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Zone d'attente -->
|
||||
<div id="div_wait_face_ebene" class="mt-3"></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: {
|
||||
facingMode: 'user',
|
||||
width: { ideal: 1280 },
|
||||
height: { ideal: 720 }
|
||||
}
|
||||
})
|
||||
.then(function (stream) {
|
||||
video.srcObject = stream;
|
||||
})
|
||||
.catch(function (e) {
|
||||
console.error("Erreur caméra:", e);
|
||||
alert("Erreur d'accès à la caméra: " + e.message);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
navigator.getMedia({
|
||||
video: {
|
||||
mandatory: {
|
||||
maxWidth: 350,
|
||||
maxHeight: 260
|
||||
}
|
||||
}
|
||||
}, function(stream) {
|
||||
video.src = stream;
|
||||
}, function(e) {
|
||||
console.error("Erreur caméra:", e);
|
||||
alert("Erreur d'accès à la caméra: " + e.message);
|
||||
});
|
||||
}
|
||||
|
||||
function takephoto() {
|
||||
$('#message_face').html("");
|
||||
$("#div_wait_face_ebene").html('');
|
||||
|
||||
// Ajustement de la taille du canvas pour mobile
|
||||
var context = canvas.getContext('2d');
|
||||
canvas.width = video.videoWidth;
|
||||
canvas.height = video.videoHeight;
|
||||
context.drawImage(video, 0, 0, canvas.width, canvas.height);
|
||||
|
||||
var data = canvas.toDataURL('image/jpeg', 0.8);
|
||||
photo.setAttribute('src', data);
|
||||
$("#image_face").val(data);
|
||||
|
||||
var faceRegistered = $("#faceRegistered").val();
|
||||
|
||||
// Activation des boutons
|
||||
$("#ebene_enregistrer_photo_face").prop('disabled', false);
|
||||
if(faceRegistered == "1") {
|
||||
$("#ebene_confirmer_photo_face").prop('disabled', false);
|
||||
$("#ebene_supprimer_photo_face").prop('disabled', false);
|
||||
$("#motif").prop('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
// Gestion du redimensionnement pour mobile
|
||||
$(window).on('resize', function() {
|
||||
if($(window).width() < 768) {
|
||||
$('.modal-dialog').addClass('modal-fullscreen-sm-down');
|
||||
} else {
|
||||
$('.modal-dialog').removeClass('modal-fullscreen-sm-down');
|
||||
}
|
||||
});
|
||||
|
||||
// Initialisation au chargement
|
||||
$(document).ready(function() {
|
||||
if($(window).width() < 768) {
|
||||
$('.modal-dialog').addClass('modal-fullscreen-sm-down');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button id="close_poprec_faciane" name="close_poprec_faciane" type="button" class="btn btn-secondary" data-bs-dismiss="modal" onclick="javascript:fiche_beneficiaire();">
|
||||
<i class="bi bi-x-circle me-2 btn_autre"></i><?= _("Fermer") ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<canvas id="canvas" style="display: none;"></canvas>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer bg-light border-0 p-3">
|
||||
<button type="button" class="btn btn-outline-secondary fw-bold px-4 rounded-pill" data-bs-dismiss="modal" onclick="fiche_beneficiaire();">
|
||||
<i class="fas fa-times me-2"></i><?= _("Fermer") ?>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
/* Styles spécifiques */
|
||||
#video_face { transform: scaleX(-1); } /* Effet miroir */
|
||||
.object-fit-cover { object-fit: cover; }
|
||||
.shadow-inner { box-shadow: inset 0 2px 8px rgba(0,0,0,0.15); }
|
||||
.shadow-xs { box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
|
||||
.modal-content { border-radius: 1.2rem; }
|
||||
|
||||
/* Animation de flash lors de la capture */
|
||||
.flash-effect {
|
||||
animation: flash 0.4s ease-out;
|
||||
}
|
||||
@keyframes flash {
|
||||
0% { filter: brightness(1); }
|
||||
50% { filter: brightness(2); }
|
||||
100% { filter: brightness(1); }
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
var video = document.getElementById('video_face');
|
||||
var canvas = document.getElementById('canvas');
|
||||
var photo = document.getElementById('photo_face');
|
||||
var image_input = document.getElementById('image_face');
|
||||
var placeholder = document.getElementById('placeholder_icon');
|
||||
|
||||
/**
|
||||
* Démarre la webcam
|
||||
*/
|
||||
async function initCamera() {
|
||||
try {
|
||||
const stream = await navigator.mediaDevices.getUserMedia({
|
||||
video: { facingMode: 'user', width: 640, height: 480 },
|
||||
audio: false
|
||||
});
|
||||
video.srcObject = stream;
|
||||
} catch (err) {
|
||||
console.error("Caméra inaccessible:", err);
|
||||
alert("Erreur : Impossible d'accéder à la caméra.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prend la photo
|
||||
*/
|
||||
function takephoto() {
|
||||
var context = canvas.getContext('2d');
|
||||
canvas.width = video.videoWidth;
|
||||
canvas.height = video.videoHeight;
|
||||
|
||||
// Capture
|
||||
context.drawImage(video, 0, 0, canvas.width, canvas.height);
|
||||
var data = canvas.toDataURL('image/jpeg', 0.8);
|
||||
|
||||
// Mise à jour de l'image (l'événement onload du HTML gère l'icône)
|
||||
photo.src = data;
|
||||
image_input.value = data;
|
||||
|
||||
// Effet visuel
|
||||
document.getElementById('container_photo').classList.add('flash-effect');
|
||||
setTimeout(() => document.getElementById('container_photo').classList.remove('flash-effect'), 400);
|
||||
|
||||
// Débloquer les boutons
|
||||
var isRegistered = document.getElementById('compare_face').value;
|
||||
$("#ebene_enregistrer_photo_face").prop('disabled', false);
|
||||
if(isRegistered === "1") {
|
||||
$("#ebene_confirmer_photo_face").prop('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
// Gestion de la modal Bootstrap
|
||||
var faceModal = document.getElementById('pop_rec_faciale');
|
||||
|
||||
faceModal.addEventListener('shown.bs.modal', function () {
|
||||
initCamera();
|
||||
});
|
||||
|
||||
faceModal.addEventListener('hidden.bs.modal', function () {
|
||||
if (video.srcObject) {
|
||||
video.srcObject.getTracks().forEach(track => track.stop());
|
||||
video.srcObject = null;
|
||||
}
|
||||
// Reset de l'aperçu si on ferme
|
||||
photo.src = "";
|
||||
photo.style.opacity = 0;
|
||||
placeholder.style.display = 'block';
|
||||
});
|
||||
</script>
|
||||