This commit is contained in:
KANE LAZENI 2026-04-21 01:37:38 +00:00
commit f5ff153f08
15 changed files with 819 additions and 626 deletions

14
.gitignore vendored Normal file
View File

@ -0,0 +1,14 @@
Config/
Config
Config/dev.ini
vendor/
vendor
logs/
logs
Cron/prod.ini
Temp/
Temp
*.ssh
.ssh/
Gettext/
Gettext

View File

@ -30,4 +30,19 @@ class ControleurAjaxcontextbeneficiaire extends Controleur {
$this->finger->saveenroleur($user_id);
}
public function majmobile()
{
$idBeneficiaire = $_SESSION['idBeneficiaire_C'];
$telephonePortable = $this->requete->getParametreFormulaire("telephonePortable");
$this->finger->majmobilebeneficiaire($idBeneficiaire, $telephonePortable);
}
public function majemail()
{
$idBeneficiaire = $_SESSION['idBeneficiaire_C'];
$emailBeneficiaire = $this->requete->getParametreFormulaire("emailBeneficiaire");
$this->finger->majemailbeneficiaire($idBeneficiaire, $emailBeneficiaire);
}
}

View File

@ -28,14 +28,14 @@ class ControleurAjaxlisteprestataireparametrage extends Controleur
public function prestatairesactifs()
{
$codeTypePrestataire = $this->requete->getParametreFormulaire("codeTypePrestataire");
// $codeReseau = $this->requete->getParametreFormulaire("codeReseau");
$codeReseau = $this->requete->getParametreFormulaire("codeReseau");
$libelle = $this->requete->getParametreFormulaire("libelle");
$codePays = $this->requete->getParametreFormulaire("codePays");
$codeVille = $this->requete->getParametreFormulaire("codeVille");
$codeLocalite = $this->requete->getParametreFormulaire("codeLocalite");
$prestataires = $this->prestataire->getprestataireparametrageactif($codeTypePrestataire, $libelle, $codePays, $codeVille, $codeLocalite) ;
$prestataires = $this->prestataire->getprestataireparametrageactif($codeTypePrestataire, $codeReseau, $libelle, $codePays, $codeVille, $codeLocalite) ;
$this->genererVueAjax(array('prestataires' => $prestataires));
}

View File

@ -1,11 +1,9 @@
<?php
require_once 'Framework/Controleur.php';
// require_once 'Modele/Prestataire.php';
require_once 'Modele/Pays.php';
require_once 'Modele/Ville.php';
require_once 'Modele/Localite.php';
require_once 'Modele/Typeprestataire.php';
require_once 'Modele/Reseausoins.php';
require_once 'Modele/Menuvueutilisateur.php';
@ -19,6 +17,7 @@ class ControleurPrestataires extends Controleur
private $ville;
private $localite;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue("Prestataires");
@ -40,7 +39,7 @@ class ControleurPrestataires extends Controleur
// $typeprestataire = $this->typeprestataire->getListeTous();
$typeprestataire = $this->typeprestataire->getListeReseau();
// $reseausoins = $this->reseausoins->getReseausoinsFamille();
$reseausoins = $this->reseausoins->getListe();
// $codeReseau = $this->reseausoins->getReseauFamille();
@ -56,7 +55,7 @@ class ControleurPrestataires extends Controleur
'ville' => $ville,
'listelocalite' => $localite,
'typeprestataire' => $typeprestataire,
// 'reseausoins' => $reseausoins,
'reseausoins' => $reseausoins
// 'codeReseau' => $codeReseau
)
);

View File

@ -16672,6 +16672,8 @@ function afficher_garantiebeneficiaire_entete_contrat()
function afficher_liste_prestataires_actifs()
{
debugger;
donnees = "";
donnees_retour = "";
@ -16708,6 +16710,7 @@ function afficher_liste_prestataires_actifs()
donnees_retour = data;
},
complete: function() {
debugger;
$("#div_liste_prestataire").html(donnees_retour);
dataTableSpeciale();
// $("#nbligne").val("Lignes : "+$("#nbligne_info").val());
@ -17981,10 +17984,26 @@ function affichelisteprestataires(libelle)
});
}else{
$("#div_selection_prestataire").hide();
$("#codePrestataire").val(""); // On vide le code car la recherche est annulée
updateRdvButton();
return false;
}
}
function updateRdvButton() {
// On récupère les valeurs
var codeDesk = $("#codePrestataire").val();
var codeMob = $("#codePrestataireMobile").val();
// Si l'un des deux a une valeur, on active le bouton
if (codeDesk !== "" || (codeMob !== "" && codeMob !== null && codeMob !== "0")) {
$(".btn_autre").prop("disabled", false);
} else {
$(".btn_autre").prop("disabled", true);
}
}
function selectPrestataire(code, libelle, rdvPossible){
nomForm = $("#nomForm").val();
$("#searchInputPrestataire").val(libelle);
@ -17992,6 +18011,8 @@ function selectPrestataire(code, libelle, rdvPossible){
$("#codePrestataire").val(code);
$("#rdvPossible").val(rdvPossible);
updateRdvButton();
// alert("rdvPossible selectPrestataire Desktop => "+rdvPossible);
if(rdvPossible == "1")
{
@ -18942,3 +18963,36 @@ function enregistrer_compte_bancaire_assure(){
}
});
}
function maj_mobile_beneficiaire()
{
donnees = 'telephonePortable='+$("#telephonePortable").val();
$.ajax({
url: $("#racineWeb").val()+"Ajaxcontextbeneficiaire/majmobile/",
type : 'post',
data: donnees,
error: function(errorData) {
alert("Erreur : "+errorData);
},
complete: function() {
}
});
}
function maj_email_beneficiaire()
{
donnees = 'emailBeneficiaire='+$("#emailBeneficiaire").val();
$.ajax({
url: $("#racineWeb").val()+"Ajaxcontextbeneficiaire/majemail/",
type : 'post',
data: donnees,
error: function(errorData) {
alert("Erreur : "+errorData);
},
complete: function() {
}
});
}

View File

@ -34,4 +34,18 @@ class Finger extends Modele {
$this->executerRequete($sql, array($user_id, $codePrestataire, $user));
}
public function majmobilebeneficiaire($idBeneficiaire, $telephonePortable)
{
$sql = 'CALL sp_maj_mobile_beneficiaire(?, ?);';
$this->executerRequete($sql, array($idBeneficiaire, $telephonePortable));
}
public function majemailbeneficiaire($idBeneficiaire, $emailBeneficiaire)
{
$sql = 'CALL sp_maj_email_beneficiaire(?, ?);';
$this->executerRequete($sql, array($idBeneficiaire, $emailBeneficiaire));
}
}

View File

@ -356,17 +356,18 @@ class Prestataire extends Modele {
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getprestataireparametrageactif($codeTypePrestataire, $libelle, $codePays, $codeVille, $codeLocalite)
public function getprestataireparametrageactif($codeTypePrestataire, $codeReseau, $libelle, $codePays, $codeVille, $codeLocalite)
{
$codeTypePrestataire = contruireParamLike($codeTypePrestataire);
$codeReseau = contruireParamLike($codeReseau);
$libelle = contruireParamLike($libelle);
$codePays = contruireParamLike($codePays);
$codeVille = contruireParamLike($codeVille);
$codeLocalite = contruireParamLike($codeLocalite);
$sql = 'call sp_a_liste_prestataires_localite_actif(?, ?, ?, ?, ?, ?)';
$sql = 'call sp_a_liste_prestataires_localite_actif(?, ?, ?, ?, ?, ?, ?);';
$resultat = $this->executerRequete($sql, array($_SESSION['idCollege_C'], $codeTypePrestataire, $libelle, $codePays, $codeVille ,$codeLocalite));
$resultat = $this->executerRequete($sql, array($_SESSION['idCollege_C'], $codeTypePrestataire, $codeReseau, $libelle, $codePays, $codeVille ,$codeLocalite));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
@ -384,9 +385,9 @@ class Prestataire extends Modele {
$libelle = contruireParamLike($libelle);
$sql = 'call sp_a_get_prestataires_rdv(?, ?)';
$sql = 'call sp_a_get_prestataires_rdv(?, ?, ?)';
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete'], $libelle));
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete'], $_SESSION['idCollege_C'], $libelle));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
@ -394,9 +395,9 @@ class Prestataire extends Modele {
public function getprestatairerdvmobile()
{
$sql = 'call sp_a_get_prestataires_rdv_mobile(?)';
$sql = 'call sp_a_get_prestataires_rdv_mobile(?, ?)';
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete']));
$resultat = $this->executerRequete($sql, array($_SESSION['codeSociete'], $_SESSION['idCollege_C']));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}

View File

@ -55,12 +55,33 @@ class Reseausoins extends Modele {
public function getListe()
{
$sql = 'SELECT codeReseau as code, libelle FROM reseausoins WHERE (codeSociete=?)
AND (typeSysteme != "1") AND (actif = "1") order by libelle';
if (est_anglophone())
{
$sql = 'SELECT r.codeReseau AS `code`,
r.libelleEng AS libelle
FROM reseausoins r
INNER JOIN prestationcollege p
ON r.codeReseau = p.codeReseau
WHERE r.codeSociete = ? AND r.typeSysteme <> "1"
AND r.actif = "1" AND p.idCollege = ?
ORDER BY r.libelleEng;';
}
else
{
$sql = 'SELECT r.codeReseau AS `code`,
r.libelle
FROM reseausoins r
INNER JOIN prestationcollege p
ON r.codeReseau = p.codeReseau
WHERE r.codeSociete = ? AND r.typeSysteme <> "1"
AND r.actif = "1" AND p.idCollege = ?
ORDER BY r.libelle;';
}
$liste = $this->executerRequete($sql,array($_SESSION['codeSociete']));
$liste = $this->executerRequete($sql,array($_SESSION['codeSociete'], $_SESSION['idCollege_C']));
return $liste->fetchAll(PDO::FETCH_ASSOC);
}
}
public function getReseausoinsFamille()
{

View File

@ -89,7 +89,7 @@
<td align="center"> <?= (isset($_SESSION['affichagedynamique']['Région'])) ? _($_SESSION['affichagedynamique']['Région']) : _("Région") ?> </td>
<td><INPUT class="form-control" TYPE="text" value="<?=$this->nettoyer($adherent['ville'])?>" readonly></td>
<td align="center"> <?= (isset($_SESSION['affichagedynamique']['Commune'])) ? _($_SESSION['affichagedynamique']['Commune']) : _("Commune") ?> </td>
<td align="center"> <?= (isset($_SESSION['affichagedynamique']['District'])) ? _($_SESSION['affichagedynamique']['District']) : _("District") ?> </td>
<td><INPUT class="form-control" TYPE="text" value="<?=$this->nettoyer($adherent['localite'])?>" readonly></td>
</tr>

View File

@ -89,7 +89,7 @@
<td align="center"> <?= (isset($_SESSION['affichagedynamique']['Région'])) ? _($_SESSION['affichagedynamique']['Région']) : _("Région") ?> </td>
<td><INPUT class="form-control" TYPE="text" value="<?=$this->nettoyer($adherent['ville'])?>" readonly></td>
<td align="center"> <?= (isset($_SESSION['affichagedynamique']['Commune'])) ? _($_SESSION['affichagedynamique']['Commune']) : _("Commune") ?> </td>
<td align="center"> <?= (isset($_SESSION['affichagedynamique']['District'])) ? _($_SESSION['affichagedynamique']['District']) : _("District") ?> </td>
<td><INPUT class="form-control" TYPE="text" value="<?=$this->nettoyer($adherent['localite'])?>" readonly></td>
</tr>

View File

@ -22,7 +22,7 @@
<table class="table table-striped table-bordered table-hover table-condensed table-responsive tabspeciale compact" style="font-size:9pt; white-space: nowrap;">
<thead class="table-dark">
<tr>
<th style="text-align:center" > <?= _("Commune") ?> </th>
<th style="text-align:center" > <?= _("District") ?> </th>
<th > <?= _("Nom") ?> </th>
<th style="text-align:center" > <?= _("Type") ?> </th>

View File

@ -13,12 +13,13 @@
$estcouvert = ($estcouvert && ($dateSortieBeneficiaire>$datejour));
}
$dateEffetCouvert = $_SESSION['dateEffetCouvert'];
$dateEffetCouvert = $_SESSION['dateEffetCouvert'];
if (est_anglophone())
{
$produit = $beneficiaire['produitEng'];
$naturepiece = $beneficiaire['naturepieceEng'];
$lienparente = $beneficiaire['lienparenteEng'];
$motifsortie = $beneficiaire['motifsortieEng'];
$etatbeneficiaire = $beneficiaire['etatbeneficiaireEng'];
@ -33,9 +34,10 @@
{
$produit = $beneficiaire['produit'];
$naturepiece = $beneficiaire['naturepiece'];
$lienparente = $beneficiaire['lienparente'];
$motifsortie = $beneficiaire['motifsortie'];
$etatbeneficiaire = $beneficiaire['etatbeneficiaire'];
$etatbeneficiaire = $beneficiaire['etatbeneficiaire'];
if($beneficiaire['sexe']=="M"){
$sexe = "Masculin";
@ -45,6 +47,7 @@
}
$codeEtatBeneficiaire = $beneficiaire['codeEtatBeneficiaire'];
$codeLienParente = $beneficiaire['codeLienParente'];
$produit = $beneficiaire['produit'];
@ -54,72 +57,126 @@
// $imgData = $_SESSION['photoAssureCrypte'];
$photoAssureCrypte = $_SESSION['photoAssureCrypte'];
function verifierTelephone($numero)
{
// On prend les 3 premiers caractères du numéro
$prefixe = substr($numero, 0, 3);
// Vérification si le préfixe est égal à "250"
if ($prefixe === "250") {
return "0";
} else {
return "1";
}
}
$telephone = $beneficiaire['telephonePortable'];
$format = strlen($telephone) > "4" ? verifierTelephone($telephone) : "0";
?>
<style>
.form-check-card {
cursor: pointer;
transition: all 0.2s ease;
border: 2px solid #dee2e6 !important;
}
.form-check-card:hover {
border-color: #0d6efd !important;
background-color: #f8f9fa;
}
.form-check-input:checked + .form-check-label {
color: #0d6efd;
}
.form-check-input {
border-color: #0d6efd !important;
}
.form-check-card:has(.form-check-input:checked) {
border-color: #0d6efd !important;
background-color: #e7f1ff;
}
/* Amélioration tactile pour mobile */
@media (max-width: 768px) {
.mx-auto[style*="max-width: 400px"] {
max-width: 95% !important;
padding: 5px 10px;
}
.form-check-label, .form-check-label i {
font-size: 1.8rem !important;
.form-check-card {
cursor: pointer;
transition: all 0.2s ease;
border: 2px solid #dee2e6 !important;
}
.form-check-card {
padding: 1rem !important;
min-height: 54px;
}
.btn, .form-control-lg {
min-height: 54px;
font-size: 1.1rem;
}
.fs-5 {
font-size: 1.2rem !important;
}
}
/* Pour les très petits écrans */
@media (max-width: 480px) {
.form-check-card {
padding: 0.75rem !important;
min-height: 50px;
}
.btn, .form-control-lg {
min-height: 50px;
font-size: 1rem;
}
}
.form-check-card:hover {
border-color: #0d6efd !important;
background-color: #f8f9fa;
}
.form-check-input:checked + .form-check-label {
color: #0d6efd;
}
.form-check-input {
border-color: #0d6efd !important;
}
.form-check-card:has(.form-check-input:checked) {
border-color: #0d6efd !important;
background-color: #e7f1ff;
}
/* Amélioration tactile pour mobile */
@media (max-width: 768px) {
.mx-auto[style*="max-width: 400px"] {
max-width: 95% !important;
padding: 5px 10px;
}
.form-check-label, .form-check-label i {
font-size: 1.8rem !important;
}
.form-check-card {
padding: 1rem !important;
min-height: 54px;
}
.btn, .form-control-lg {
min-height: 54px;
font-size: 1.1rem;
}
.fs-5 {
font-size: 1.2rem !important;
}
}
/* Pour les très petits écrans */
@media (max-width: 480px) {
.form-check-card {
padding: 0.75rem !important;
min-height: 50px;
}
.btn, .form-control-lg {
min-height: 50px;
font-size: 1rem;
}
}
/* Le Cercle Parfait */
.avatar-circle {
width: 130px;
height: 130px;
border-radius: 50% !important;
overflow: hidden; /* Coupe ce qui dépasse */
transition: all 0.3s ease;
}
.avatar-circle img {
width: 100%;
height: 100%;
object-fit: cover; /* Remplit le cercle sans déformer */
}
.avatar-circle:hover {
border-color: var(--bs-primary) !important;
transform: scale(1.02);
}
/* Bordure responsive uniquement sur large écran */
@media (min-width: 992px) {
.border-end-lg {
border-right: 1px solid #dee2e6 !important;
}
}
/* Zone d'ombre légère pour les blocs d'info */
.info-box {
border-left: 3px solid transparent;
transition: background 0.2s;
}
.info-box:hover {
background-color: #f8f9fa;
border-left-color: var(--bs-primary);
}
</style>
<div class="container-fluid mt-3">
@ -154,336 +211,293 @@
</div>
</div>
<div class="card-body">
<!-- Photo et informations principales -->
<div class="row">
<!-- Photo -->
<div class="col-12 col-md-3 text-center mb-4">
<?php if ($beneficiaire['faceRegistered']=="1"): ?>
<img
src="<?=$photoAssureCrypte?>"
class="img-fluid rounded-circle shadow"
style="width: 120px; height: 120px; object-fit: cover; cursor:pointer;"
data-bs-toggle="modal"
data-bs-target="#pop_photo"
alt="Photo du bénéficiaire">
<?php else: ?>
<div class="bg-light rounded-circle d-flex align-items-center justify-content-center mx-auto mb-2"
style="width: 120px; height: 120px; border:1px solid #000 !important;">
<i class="fas fa-user fa-3x text-secondary photo-vide"></i>
</div>
<?php if ($faceRegistered!="1" && $_SESSION['assureAjoutPhoto']=="1"):
?>
<!-- Boutons radios - Version mobile first avec largeur réduite -->
<div class="mb-3">
<div class="d-grid gap-2 mx-auto" style="max-width: 400px;">
<div class="form-check form-check-card py-2 px-3 rounded border">
<input class="form-check-input" type="radio" name="photo_choice" id="prendre_photo_radio" value="" checked>
<label class="form-check-label w-100 d-block fw-medium" for="prendre_photo_radio">
<i class="fas fa-camera me-2 text-primary"></i><?= _("Prendre une photo") ?>
</label>
</div>
<div class="form-check form-check-card py-2 px-3 rounded border">
<input class="form-check-input" type="radio" name="photo_choice" id="choisir_photo_radio" value="choisir">
<label class="form-check-label w-100 d-block fw-medium" for="choisir_photo_radio">
<i class="fas fa-folder-open me-2 text-primary"></i><?= _("Choisir une photo") ?>
</label>
</div>
</div>
<div class="card-body p-4">
<div class="row g-4">
<div class="col-12 col-lg-3 border-end-lg text-center">
<div class="position-relative mb-3">
<div class="avatar-circle mx-auto shadow-sm border d-flex align-items-center justify-content-center bg-light">
<?php if ($beneficiaire['faceRegistered'] == "1"): ?>
<img src="<?= $photoAssureCrypte ?>"
class="img-fluid"
data-bs-toggle="modal"
data-bs-target="#pop_photo"
alt="Photo du bénéficiaire">
<?php else: ?>
<i class="fas fa-user fa-3x text-secondary"></i>
<?php endif; ?>
</div>
<div class="mt-3">
<span class="badge rounded-pill <?= $estcouvert ? 'bg-success' : 'bg-danger' ?> px-3 py-2">
<i class="fas <?= $estcouvert ? 'fa-check-circle' : 'fa-times-circle' ?> me-1"></i>
<?= $estcouvert ? $etatbeneficiaire : _("Non couvert") ?>
</span>
</div>
</div>
<?php if ($beneficiaire['faceRegistered'] != "1" && $_SESSION['assureAjoutPhoto'] == "1"): ?>
<div class="mt-4">
<div class="btn-group btn-group-sm w-100 mb-3" role="group">
<input type="radio" class="btn-check" name="photo_choice" id="radio_cam" checked onchange="togglePhotoSource('cam')">
<label class="btn btn-outline-primary" for="radio_cam"><i class="fas fa-camera me-1"></i><?= _("Appareil") ?></label>
<input type="radio" class="btn-check" name="photo_choice" id="radio_file" onchange="togglePhotoSource('file')">
<label class="btn btn-outline-primary" for="radio_file"><i class="fas fa-folder-open me-1"></i><?= _("Fichier") ?></label>
</div>
<!-- Div pour "Prendre une photo" -->
<div id="div_prendre_photo" class="mt-2 mb-2">
<div class="mx-auto" style="max-width: 400px;">
<button class="sr-only" id="btn_pop_save_face" name="btn_pop_save_face" type="button" data-bs-toggle="modal" data-bs-target="#pop_rec_faciale"></button>
<button class="btn btn-primary w-100 py-3 fw-bold btn_autre" type="button" onClick="javascript:ebene_init_photo_face();">
<i class="fas fa-camera me-2 fs-5"></i><?= _("Lancer l'appareil photo") ?>
</button>
</div>
<div id="area_prendre_photo" class="photo-zone">
<button class="btn btn-primary w-100 py-2 fw-bold" type="button" onClick="ebene_init_photo_face();">
<i class="fas fa-video me-2"></i><?= _("Lancer") ?>
</button>
<button class="d-none" id="btn_pop_save_face" data-bs-toggle="modal" data-bs-target="#pop_rec_faciale"></button>
</div>
<!-- Div pour "Choisir une photo" -->
<div id="div_choisir_photo" class="d-none">
<div class="mx-auto" style="max-width: 400px;">
<div class="d-grid gap-2 mt-2 mb-2">
<form enctype="multipart/form-data" action="Fichebeneficiaire/<?= $_SESSION['idBeneficiaire_C'] ?>/" method="post">
<input class="form-control form-control-lg" name="fichier_upload" type="file" id="fichier_upload" accept="image/*" />
<button type="submit" name="submit" class="btn btn-success btn-lg w-100 py-3 btn_autre">
<i class="fas fa-upload me-2 fs-5"></i><?= _("Envoyer la photo") ?>
</button>
</form>
</div>
<h4 style="text-align: center">
<?php if ($message>" "): ?>
<div class="col-12 alert alert-danger">
<?= $message ?>
</div>
<?php endif; ?>
</h4>
</div>
<div id="area_choisir_photo" class="photo-zone d-none">
<form enctype="multipart/form-data" action="Fichebeneficiaire/<?= $_SESSION['idBeneficiaire_C'] ?>/" method="post">
<input class="form-control form-control-sm mb-2" name="fichier_upload" type="file" accept="image/*" onchange="this.form.submit()">
<button type="submit" name="submit" class="btn btn-success w-100 btn-sm"><i class="fas fa-upload me-2"></i><?= _("Envoyer") ?></button>
</form>
</div>
<?php endif;?>
<?php endif; ?>
</div>
<!-- Informations personnelles -->
<div class="col-12 col-md-9">
<div class="row">
<div class="col-12 mb-2">
<h3 class="text-primary mb-1"><?= $beneficiaire['nomBeneficiaire'] . ' ' . $beneficiaire['prenomsBeneficiaire'] ?></h3>
<p class="text-muted mb-0"><?= _("Né(e) le").": ".dateLang($this->nettoyer($beneficiaire['dateNaissance']))." => ".$this->nettoyer($beneficiaire['age'])." "._("an(s)") ?></p>
</div>
<div class="col-12 col-md-6">
<div class="mb-2">
<small class="text-muted"><?= _("N° Adhérent") ?></small>
<p class="fw-bold mb-0"><?= $beneficiaire['numeroAdherent'] ?></p>
</div>
<div class="mb-2">
<small class="text-muted"><?= _("Lien Parenté") ?></small>
<p class="fw-bold mb-0"><?= $lienparente ?></p>
</div>
<div class="mb-2">
<small class="text-muted"><?= _("Genre") ?></small>
<p class="fw-bold mb-0"><?= $sexe ?></p>
</div>
</div>
<div class="col-12 col-md-6">
<div class="mb-2">
<small class="text-muted"><?= _("Téléphone") ?></small>
<p class="fw-bold mb-0"><?= $beneficiaire['telephonePortable'] ?></p>
</div>
<div class="mb-2">
<small class="text-muted"><?= _("État") ?></small>
<?php if ($estcouvert) : ?>
<span class="badge bg-success"><?= $etatbeneficiaire ?></span>
<?php else: ?>
<span class="badge bg-danger"><?= _("Non couvert") ?></span>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
<hr>
<!-- Informations de police -->
<div class="row">
<div class="col-12 col-md-6">
<div class="mb-2">
<small class="text-muted"><?= _("Souscripteur") ?></small>
<p class="fw-bold mb-0"><?= $beneficiaire['nomClient'] ?></p>
</div>
</div>
<div class="col-12 col-md-6">
<div class="mb-2">
<small class="text-muted"><?= _("Collège / N° Police") ?></small>
<p class="fw-bold mb-0"><?= $beneficiaire['libelleCollege'] ?> / <?= $beneficiaire['numeroPolice'] ?></p>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>
<div class="col-12 col-lg-9">
<div class="d-flex justify-content-between align-items-start mb-3 border-bottom pb-2">
<div>
<h2 class="h4 text-primary mb-0 fw-bold"><?= $beneficiaire['nomBeneficiaire'] . ' ' . $beneficiaire['prenomsBeneficiaire'] ?></h2>
<small class="text-muted fw-semibold"><?= _("N° Adhérent") ?> : <?= $beneficiaire['numeroAdherent'] ?></small>
</div>
<div class="text-end">
<span class="d-block text-muted small"><?= _("Âge") ?></span>
<span class="badge bg-light text-dark border fw-bold"><?= $this->nettoyer($beneficiaire['age']) ?> ans</span>
</div>
</div>
<div class="row g-3">
<div class="col-md-6">
<div class="info-box p-2 rounded bg-light-subtle">
<label class="text-muted small d-block mb-1"><i class="fas fa-calendar-alt me-1 text-primary"></i> <?= _("Né(e) le") ?></label>
<span class="fw-medium"><?= dateLang($this->nettoyer($beneficiaire['dateNaissance'])) ?></span>
</div>
<div class="info-box p-2 rounded mt-2">
<label class="text-muted small d-block mb-1"><i class="fas fa-users me-1 text-primary"></i> <?= _("Lien Parenté") ?></label>
<span class="fw-medium"><?= $lienparente ?></span>
</div>
<div class="info-box p-2 rounded mt-2">
<label class="text-muted small d-block mb-1"><i class="fas fa-venus-mars me-1 text-primary"></i> <?= _("Genre") ?></label>
<span class="fw-medium"><?= $sexe ?></span>
</div>
</div>
<div class="col-md-6">
<?php if($codeLienParente == "A"): ?>
<div class="mb-3">
<div class="d-flex justify-content-between align-items-center mb-2">
<label class="form-label text-muted small mb-0">
<i class="fas fa-mobile-alt me-1 text-primary"></i> <?= _("Téléphone Mobile") ?>
</label>
<div class="form-check form-switch small">
<input class="form-check-input"
type="checkbox"
id="ignorerFormat"
name="ignorerFormat"
<?= ($format === "1") ? 'checked' : '' ?>>
<label class="form-check-label text-muted" for="ignorerFormat">
<?= est_anglophone() ? "Free format" : "Format libre"; ?>
</label>
</div>
</div>
<div class="input-group">
<span class="input-group-text bg-white text-muted"><i class="fas fa-phone"></i></span>
<input type="tel"
class="form-control"
id="telephonePortable"
name="telephonePortable"
value="<?= $this->nettoyer($telephone) ?>"
onchange="javascript:maj_mobile_beneficiaire();"
oninvalid="validerMessageTelephone(this)"
oninput="this.setCustomValidity('')">
</div>
<div id="aideTelephone" class="form-text small mt-1 <?= ($format === "1") ? 'd-none' : '' ?>">
<i class="fas fa-info-circle text-info"></i>
<?= est_anglophone() ? 'Required format: 250XXXXXXXXX' : 'Format requis : 250XXXXXXXXX'; ?>
</div>
</div>
<div class="mb-3">
<label class="text-muted small mb-1"><i class="fas fa-envelope me-1 text-primary"></i> <?= _("E-mail") ?></label>
<div class="input-group input-group-sm">
<span class="input-group-text">@</span>
<input type="email" class="form-control" id="emailBeneficiaire"
value="<?= $beneficiaire['emailBeneficiaire'] ?>"
onchange="maj_email_beneficiaire();">
</div>
</div>
<?php else: ?>
<div class="info-box p-2 rounded bg-light-subtle">
<label class="text-muted small d-block mb-1"><i class="fas fa-mobile-alt me-1 text-primary"></i> <?= _("Mobile") ?></label>
<span class="fw-medium"><?= $beneficiaire['telephonePortable'] ?: '-' ?></span>
</div>
<div class="info-box p-2 rounded mt-2">
<label class="text-muted small d-block mb-1"><i class="fas fa-envelope me-1 text-primary"></i> <?= _("E-mail") ?></label>
<span class="fw-medium text-break"><?= $beneficiaire['emailBeneficiaire'] ?: '-' ?></span>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<div class="row mt-4 pt-3 border-top g-3">
<div class="col-6 col-lg-3">
<div class="p-2 bg-light rounded border-bottom border-primary border-4 shadow-sm h-100 d-flex flex-column justify-content-center text-center align-items-center">
<small class="text-muted d-block text-uppercase lh-1 mb-1" style="font-size: 0.65rem;">
<i class="fas fa-handshake me-1 opacity-75"></i><?= _("Souscripteur") ?>
</small>
<span class="fw-bold text-dark small w-100 text-truncate" title="<?= $beneficiaire['nomClient'] ?>">
<?= $beneficiaire['nomClient'] ?>
</span>
</div>
</div>
<div class="col-6 col-lg-3">
<div class="p-2 bg-light rounded border-bottom border-info border-4 shadow-sm h-100 d-flex flex-column justify-content-center text-center align-items-center">
<small class="text-muted d-block text-uppercase lh-1 mb-1" style="font-size: 0.65rem;">
<i class="fas fa-users me-1 opacity-75"></i><?= _("Collège") ?>
</small>
<span class="fw-bold text-dark small w-100 text-truncate" title="<?= $beneficiaire['libelleCollege'] ?>">
<?= $beneficiaire['libelleCollege'] ?>
</span>
</div>
</div>
<div class="col-6 col-lg-3">
<div class="p-2 bg-light rounded border-bottom border-secondary border-4 shadow-sm h-100 d-flex flex-column justify-content-center text-center align-items-center">
<small class="text-muted d-block text-uppercase lh-1 mb-1" style="font-size: 0.65rem;">
<i class="fas fa-file-contract me-1 opacity-75"></i><?= _("N° Police") ?>
</small>
<span class="fw-bold text-secondary small w-100">
<?= $beneficiaire['numeroPolice'] ?>
</span>
</div>
</div>
<div class="col-6 col-lg-3">
<div class="p-2 bg-light rounded border-bottom border-warning border-4 shadow-sm h-100 d-flex flex-column justify-content-center text-center align-items-center">
<small class="text-muted d-block text-uppercase lh-1 mb-1" style="font-size: 0.65rem;">
<i class="fas fa-calendar-check me-1 opacity-75"></i><?= _("Exercice") ?>
</small>
<span class="fw-bold text-dark small w-100">
<?= $_SESSION['exercieReference_C'] ?>
</span>
</div>
</div>
</div>
</div>
</div>
<!-- Section des plafonds et consommations -->
<div class="row">
<!-- Plafond Famille -->
<div class="col-12 col-lg-9 mb-4">
<div class="card shadow-sm h-100">
<div class="d-none d-md-block">
<div class="card-header bg-secondary py-2">
<h6 class="mb-0 text-center text-light">
<i class="fa fa-file-invoice-dollar me-2"></i><i class="fas fa-users me-2"></i>
<?= _("Dépenses familiales")." ".$_SESSION['exercieReference_C'] ?>
</h6>
<!-- Section des plafonds et consommations -->
<?php
// --- 1. CALCULS FAMILLE (Police) ---
$plafondGlobalFamilleOut = $this->nettoyer($police['plafondOut']) ?: 0;
$consommationGlobaleFamilleOut = $this->nettoyer($police['consommationOut']) ?: 0;
$soldeConsommationOut = $this->nettoyer($police['soldeConsommationOut']) ?: 0;
$niveauGlobalConsoFamilleOut = ($plafondGlobalFamilleOut > 0) ? ($consommationGlobaleFamilleOut * 100) / $plafondGlobalFamilleOut : 0;
$plafondGlobalFamilleInp = $this->nettoyer($police['plafondInp']) ?: 0;
$consommationGlobaleFamilleInp = $this->nettoyer($police['consommationInp']) ?: 0;
$soldeConsommationInp = $this->nettoyer($police['soldeConsommationInp']) ?: 0;
$niveauGlobalConsoFamilleInp = ($plafondGlobalFamilleInp > 0) ? ($consommationGlobaleFamilleInp * 100) / $plafondGlobalFamilleInp : 0;
// --- 2. CALCULS INDIVIDUELS (Bénéficiaire) ---
$consommationGlobaleBenefOut = $this->nettoyer($college['consommation_individuOut']) ?: 0;
$niveauGlobalConsoBenefOut = ($plafondGlobalFamilleOut > 0) ? ($consommationGlobaleBenefOut * 100) / $plafondGlobalFamilleOut : 0;
$consommationGlobaleBenefInp = $this->nettoyer($college['consommation_individuInp']) ?: 0;
$niveauGlobalConsoBenefInp = ($plafondGlobalFamilleInp > 0) ? ($consommationGlobaleBenefInp * 100) / $plafondGlobalFamilleInp : 0;
?>
<div class="row g-4">
<div class="col-12 col-xl-8">
<div class="card shadow-sm border-0 h-100">
<div class="card-header bg-dark text-white py-3">
<div class="d-flex justify-content-between align-items-center">
<h6 class="mb-0 fw-bold"><i class="fas fa-users-cog me-2 text-info"></i><?= _("Consommation Familiale") ?></h6>
<span class="badge bg-secondary"><?= $_SESSION['exercieReference_C'] ?></span>
</div>
</div>
<!-- Affichage mobile (cartes) -->
<div class="d-md-none">
<div class="card-header bg-dark py-2">
<h6 class="mb-0 text-center text-light">
<i class="fa fa-file-invoice-dollar me-2"></i><i class="fas fa-users me-2"></i>
<?= _("Dépenses familiales")." ".$_SESSION['exercieReference_C'] ?>
</h6>
</div>
</div>
<div class="card-body text-center">
<?php
/*
plafondOut
consommationOut
soldeConsommationOut
consommation_individuOut
plafondInp
consommationInp
soldeConsommationInp
consommation_individuInp
*/
$plafondGlobalFamilleOut = $this->nettoyer($police['plafondOut']);
$consommationGlobaleFamilleOut = $this->nettoyer($police['consommationOut']);
$niveauGlobalConsoFamilleOut = ($consommationGlobaleFamilleOut*100)/$plafondGlobalFamilleOut;
$soldeConsommationOut = $this->nettoyer($police['soldeConsommationOut']);
$consommationGlobaleBenefOut = $this->nettoyer($college['consommation_individuOut']);
$niveauGlobalConsoBenefOut = ($consommationGlobaleBenefOut*100)/$plafondGlobalFamilleOut;
$plafondGlobalFamilleInp = $this->nettoyer($police['plafondInp']);
$consommationGlobaleFamilleInp = $this->nettoyer($police['consommationInp']);
$niveauGlobalConsoFamilleInp = ($consommationGlobaleFamilleInp*100)/$plafondGlobalFamilleInp;
$soldeConsommationInp = $this->nettoyer($police['soldeConsommationInp']);
$consommationGlobaleBenefInp = $this->nettoyer($college['consommation_individuInp']);
$niveauGlobalConsoBenefInp = ($consommationGlobaleBenefInp*100)/$plafondGlobalFamilleInp;
?>
<!-- OUTPATIENT -->
<div class="row mb-2 mt-2">
<div class="col-4">
<div class="rounded p-2 border border-primary">
<small class="text-muted d-block"><?= _("Dépenses OUTPATIENT") ?></small>
<h4 class="text-primary mb-0"><?= format_N($consommationGlobaleFamilleOut) ?></h4>
</div>
</div>
<div class="col-4">
<div class="rounded p-2 border border-success">
<small class="text-muted d-block"><?= _("Plafond") ?></small>
<h4 class="text-success mb-0"><?= format_N($plafondGlobalFamilleOut) ?></h4>
</div>
</div>
<div class="col-4">
<div class="rounded p-2 border border-danger">
<small class="text-muted d-block"><?= _("Solde") ?></small>
<h4 class="text-danger mb-0"><?= format_N($soldeConsommationOut) ?></h4>
</div>
</div>
</div>
<div class="progress mb-3" >
<div class="progress-bar <?= $niveauGlobalConsoFamilleOut >= 80 ? 'bg-danger' : ($niveauGlobalConsoFamilleOut >= 50 ? 'bg-warning' : 'bg-success') ?>"
style="width: <?= min($niveauGlobalConsoFamilleOut, 100) ?>%">
<?= number_format($niveauGlobalConsoFamilleOut, 1) ?>%
</div>
</div>
<?php if($police['soldeConsommationOut']<="0") :?>
<div class="alert alert-danger py-1 mb-0">
<i class="fas fa-exclamation-triangle me-1"></i>
<?= _("Plafond familial atteint!") ?>
<div class="card-body p-4">
<div class="consumption-block mb-5">
<?php $colorOut = ($niveauGlobalConsoFamilleOut >= 90) ? 'danger' : (($niveauGlobalConsoFamilleOut >= 70) ? 'warning' : 'success'); ?>
<div class="d-flex justify-content-between align-items-end mb-2">
<h6 class="text-uppercase fw-bold text-muted small mb-0"><?= _("Soins Ambulatoires (OUT)") ?></h6>
<span class="fw-bold text-<?= $colorOut ?>"><?= number_format((float)$niveauGlobalConsoFamilleOut, 1) ?>%</span>
</div>
<?php endif; ?>
<!-- INPATIENT -->
<div class="row mb-2 mt-2">
<div class="col-4">
<div class="rounded p-2 border border-primary">
<small class="text-muted d-block"><?= _("Dépenses INPATIENT") ?></small>
<h4 class="text-primary mb-0"><?= format_N($consommationGlobaleFamilleInp) ?></h4>
</div>
</div>
<div class="col-4">
<div class="rounded p-2 border border-success">
<small class="text-muted d-block"><?= _("Plafond") ?></small>
<h4 class="text-success mb-0"><?= format_N($plafondGlobalFamilleInp) ?></h4>
</div>
</div>
<div class="col-4">
<div class="rounded p-2 border border-danger">
<small class="text-muted d-block"><?= _("Solde") ?></small>
<h4 class="text-danger mb-0"><?= format_N($soldeConsommationInp) ?></h4>
</div>
</div>
</div>
<div class="progress mb-3" >
<div class="progress-bar <?= $niveauGlobalConsoFamilleInp >= 80 ? 'bg-danger' : ($niveauGlobalConsoFamilleInp >= 50 ? 'bg-warning' : 'bg-success') ?>"
style="width: <?= min($niveauGlobalConsoFamilleInp, 100) ?>%">
<?= number_format($niveauGlobalConsoFamilleInp, 1) ?>%
</div>
</div>
<?php if($police['soldeConsommationInp']<="0") :?>
<div class="alert alert-danger py-1 mb-0">
<i class="fas fa-exclamation-triangle me-1"></i>
<?= _("Plafond familial atteint!") ?>
<div class="progress mb-3" style="height: 10px;">
<div class="progress-bar bg-<?= $colorOut ?> progress-bar-striped progress-bar-animated" style="width: <?= min($niveauGlobalConsoFamilleOut, 100) ?>%"></div>
</div>
<?php endif; ?>
<div class="row g-2 text-center">
<div class="col-4"><div class="p-2 border rounded bg-light"><small class="text-muted d-block"><?= _("Consommé") ?></small><span class="fw-bold"><?= format_N($consommationGlobaleFamilleOut) ?></span></div></div>
<div class="col-4"><div class="p-2 border rounded bg-light"><small class="text-muted d-block"><?= _("Plafond") ?></small><span class="fw-bold text-dark"><?= format_N($plafondGlobalFamilleOut) ?></span></div></div>
<div class="col-4"><div class="p-2 border rounded border-<?= $colorOut ?>-subtle bg-<?= $colorOut ?>-subtle"><small class="text-<?= $colorOut ?> d-block fw-bold"><?= _("Solde") ?></small><span class="fw-bold text-<?= $colorOut ?>"><?= format_N($soldeConsommationOut) ?></span></div></div>
</div>
</div>
</div>
</div>
</div>
<!-- Plafond Bénéficiaire -->
<div class="col-12 col-lg-3 mb-4">
<div class="card shadow-sm h-100">
<div class="d-none d-md-block">
<div class="card-header bg-secondary py-2">
<h6 class="mb-0 text-center text-light">
<i class="fa fa-file-invoice-dollar me-2"></i><i class="fas fa-user me-2"></i>
<?= _("Dépenses individuelles") ?>
</h6>
<div class="consumption-block">
<?php $colorInp = ($niveauGlobalConsoFamilleInp >= 90) ? 'danger' : (($niveauGlobalConsoFamilleInp >= 70) ? 'warning' : 'success'); ?>
<div class="d-flex justify-content-between align-items-end mb-2">
<h6 class="text-uppercase fw-bold text-muted small mb-0"><?= _("Hospitalisation (INP)") ?></h6>
<span class="fw-bold text-<?= $colorInp ?>"><?= number_format((float)$niveauGlobalConsoFamilleInp, 1) ?>%</span>
</div>
<div class="progress mb-3" style="height: 10px;">
<div class="progress-bar bg-<?= $colorInp ?> progress-bar-striped progress-bar-animated" style="width: <?= min($niveauGlobalConsoFamilleInp, 100) ?>%"></div>
</div>
<div class="row g-2 text-center">
<div class="col-4"><div class="p-2 border rounded bg-light"><small class="text-muted d-block"><?= _("Consommé") ?></small><span class="fw-bold"><?= format_N($consommationGlobaleFamilleInp) ?></span></div></div>
<div class="col-4"><div class="p-2 border rounded bg-light"><small class="text-muted d-block"><?= _("Plafond") ?></small><span class="fw-bold text-dark"><?= format_N($plafondGlobalFamilleInp) ?></span></div></div>
<div class="col-4"><div class="p-2 border rounded border-<?= $colorInp ?>-subtle bg-<?= $colorInp ?>-subtle"><small class="text-<?= $colorInp ?> d-block fw-bold"><?= _("Solde") ?></small><span class="fw-bold text-<?= $colorInp ?>"><?= format_N($soldeConsommationInp) ?></span></div></div>
</div>
</div>
</div>
<!-- Affichage mobile (cartes) -->
<div class="d-md-none">
<div class="card-header bg-dark py-2">
<h6 class="mb-0 text-center text-light">
<i class="fa fa-file-invoice-dollar me-2"></i><i class="fas fa-user me-2"></i>
<?= _("Dépenses individuelles") ?>
</h6>
</div>
</div>
</div>
<div class="col-12 col-xl-4">
<div class="card shadow-sm border-0 border-top border-primary border-4 h-100">
<div class="card-header bg-white py-3">
<h6 class="mb-0 fw-bold text-primary"><i class="fas fa-user-tag me-2"></i><?= _("Dépenses Individuelles") ?></h6>
</div>
<div class="card-body text-center">
<!-- OUPATIENT-->
<div class="row mb-2 mt-2">
<div class="col-12">
<div class="border rounded p-2 border-primary">
<small class="text-muted d-block"><?= _("Dépenses OUPATIENT") ?></small>
<h4 class="text-primary mb-0"><?= format_N($consommationGlobaleBenefOut) ?></h4>
</div>
</div>
</div>
<div class="progress mb-3">
<div class="progress-bar <?= $niveauGlobalConsoBenefOut >= 80 ? 'bg-danger' : ($niveauGlobalConsoBenefOut >= 50 ? 'bg-warning' : 'bg-success') ?>"
style="width: <?= min($niveauGlobalConsoBenefOut, 100) ?>%">
<?= number_format($niveauGlobalConsoBenefOut, 1) ?>%
</div>
</div>
<!-- INPATIENT -->
<div class="row mb-2 mt-2">
<div class="col-12">
<div class="border rounded p-2 border-primary">
<small class="text-muted d-block"><?= _("Dépenses INPATIENT") ?></small>
<h4 class="text-primary mb-0"><?= format_N($consommationGlobaleBenefInp) ?></h4>
</div>
</div>
</div>
<div class="progress mb-3">
<div class="progress-bar <?= $niveauGlobalConsoBenefInp >= 80 ? 'bg-danger' : ($niveauGlobalConsoBenefInp >= 50 ? 'bg-warning' : 'bg-success') ?>"
style="width: <?= min($niveauGlobalConsoBenefInp, 100) ?>%">
<?= number_format($niveauGlobalConsoBenefInp, 1) ?>%
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card-body">
<?php
$indiv = [
['label' => 'OUTPATIENT', 'val' => $consommationGlobaleBenefOut, 'percent' => $niveauGlobalConsoBenefOut],
['label' => 'INPATIENT', 'val' => $consommationGlobaleBenefInp, 'percent' => $niveauGlobalConsoBenefInp]
];
foreach($indiv as $item):
?>
<div class="mb-4 p-3 border rounded shadow-xs bg-light-subtle">
<div class="d-flex justify-content-between mb-1">
<small class="fw-bold"><?= $item['label'] ?></small>
<small class="text-primary fw-bold"><?= format_N($item['val']) ?></small>
</div>
<div class="progress" style="height: 6px;">
<div class="progress-bar bg-primary" style="width: <?= min($item['percent'], 100) ?>%"></div>
</div>
<div class="text-end mt-1">
<small class="text-muted" style="font-size: 0.75rem;">
<?= _("Part du plafond familial") ?> : <?= number_format((float)$item['percent'], 1) ?>%
</small>
</div>
</div>
<?php endforeach; ?>
<div class="alert alert-info border-0 small shadow-sm"><i class="fas fa-info-circle me-1"></i><?= _("Consommation personnelle incluse dans le plafond familial.") ?></div>
</div>
</div>
</div>
</div>
<!-- Message si aucune donnée -->
<div class="card shadow-sm mb-4">
@ -973,7 +987,6 @@ document.addEventListener('DOMContentLoaded', function() {
}
}
if(prendreRadio){
// Événements sur les boutons radios
prendreRadio.addEventListener('change', togglePhotoDivs);
@ -983,4 +996,86 @@ document.addEventListener('DOMContentLoaded', function() {
togglePhotoDivs();
}
});
</script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const inputTel = document.getElementById('telephonePortable');
const checkIgnorer = document.getElementById('ignorerFormat');
const aideTel = document.getElementById('aideTelephone');
const msgErreur = "<?= est_anglophone() ? 'The number must start with 250 and contain at least 12 digits.' : 'Le numéro doit commencer par 250 et comporter au moins 12 chiffres.'; ?>";
/**
* Validation native
*/
window.validerMessageTelephone = function(input) {
if (!checkIgnorer.checked) {
input.setCustomValidity(msgErreur);
} else {
input.setCustomValidity('');
}
};
/**
* Mise à jour de l'interface (Appelé par le switch)
*/
function rafraichirEtatTelephone() {
if (checkIgnorer.checked) {
inputTel.removeAttribute('pattern');
inputTel.removeAttribute('title');
aideTel.classList.add('d-none');
inputTel.classList.remove('is-invalid');
inputTel.placeholder = "<?= _('Entrez le numéro'); ?>";
} else {
inputTel.setAttribute('pattern', '^250[0-9]{9,}$');
inputTel.setAttribute('title', msgErreur);
aideTel.classList.remove('d-none');
inputTel.placeholder = "Ex: 250700000001";
validerVisuellement();
}
}
/**
* Validation visuelle Bootstrap
*/
function validerVisuellement() {
// En mode libre, on ne met pas d'erreur visuelle
if (checkIgnorer.checked) {
inputTel.classList.remove('is-invalid');
if (inputTel.value !== "") inputTel.classList.add('is-valid');
return;
}
// En mode strict, on vérifie le pattern 250...
const pattern = /^250[0-9]{9,}$/;
if (inputTel.value === "") {
inputTel.classList.remove('is-valid', 'is-invalid');
} else if (pattern.test(inputTel.value)) {
inputTel.classList.replace('is-invalid', 'is-valid');
} else {
inputTel.classList.replace('is-valid', 'is-invalid');
}
}
// Écouteurs
checkIgnorer.addEventListener('change', rafraichirEtatTelephone);
inputTel.addEventListener('input', validerVisuellement);
// Lancement initial
rafraichirEtatTelephone();
});
function togglePhotoSource(source) {
const areaCam = document.getElementById('area_prendre_photo');
const areaFile = document.getElementById('area_choisir_photo');
if (source === 'cam') {
areaCam.classList.remove('d-none');
areaFile.classList.add('d-none');
} else {
areaCam.classList.add('d-none');
areaFile.classList.remove('d-none');
}
}
</script>

View File

@ -1,222 +1,174 @@
<?php $this->titre = "Intersanté - Réseau de soins"; ?>
<div class="card shadow-lg border-0 mb-4" style="border-radius: 15px;">
<div class="card-header bg-primary text-white py-3" style="border-radius: 15px 15px 0 0;">
<div class="row align-items-center">
<div class="col-8">
<h4 id="h4_titre" class="mb-2 text-center">
<i class="fas fa-project-diagram"></i>
<span id="id_titre_page"><?= _("Réseau des prestataires") ?></span>
</h4>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<!-- Filtres de recherche -->
<div class="card shadow-sm mb-8">
<div class="card-body">
<div class="row g-3">
<!-- Type Prestataire -->
<div class="col-12 col-md-6 col-lg-4">
<label class="form-label fw-bold"><?= _("Type du prestataire") ?></label>
<SELECT class="form-select mobile-select" data-live-search="true" id="codeTypePrestataire" NAME="codeTypePrestataire" autofocus>
<?php liste_options_consultation($typeprestataire, ""); ?>
</SELECT>
<div class="card shadow-lg border-0 mb-4 main-container-card">
<div class="card-header bg-primary text-white py-3">
<div class="d-flex align-items-center justify-content-center">
<i class="fas fa-project-diagram fa-lg me-3"></i>
<h4 id="h4_titre" class="mb-0 fw-bold">
<span id="id_titre_page"><?= _("Réseau des prestataires") ?></span>
</h4>
</div>
</div>
<div class="card-body bg-light-subtle">
<div class="card shadow-sm border-0 mb-4 search-filter-card">
<div class="card-body p-4">
<div class="row g-3">
<div class="col-12 col-md-6 col-lg-4">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Type du prestataire") ?></label>
<select class="form-select select2-enable" id="codeTypePrestataire" name="codeTypePrestataire" autofocus>
<?php liste_options_consultation($typeprestataire, ""); ?>
</select>
</div>
<div class="col-12 col-md-6 col-lg-4">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Catégorie du réseau") ?></label>
<select class="form-select" id="codeReseau" name="codeReseau">
<?php liste_options_consultation($reseausoins, ""); ?>
</select>
</div>
<div class="col-12 col-md-6 col-lg-4">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Nom du prestataire") ?></label>
<input class="form-control" type="text" id="libelle" name="libelle"
placeholder="<?= _("Ex: Clinique...") ?>"
onkeypress="javascript:ctrlkeypress_liste_prestataires_actif(event);">
</div>
<div class="col-12 col-md-6 col-lg-4">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Pays") ?></label>
<select onChange="ajaxListerVilleConsultation();" class="form-select" id="codePays" name="codePays">
<?php liste_options_consultation($pays, $_SESSION['codePaysSociete']); ?>
</select>
</div>
<div class="col-12 col-md-6 col-lg-4">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Région") ?></label>
<div id="listeville">
<select onChange="ajaxListerLocaliteConsultation();" class="form-select" id="codeVille" name="codeVille">
<?php liste_options_consultation($ville, ""); ?>
</select>
</div>
<!-- Nom -->
<div class="col-12 col-md-6 col-lg-4">
<label class="form-label fw-bold"><?= _("Nom du prestataire") ?></label>
<INPUT class="form-control form-control-sm" type="text" id="libelle" name="libelle"
onkeypress="javascript:ctrlkeypress_liste_prestataires_actif(event);">
</div>
<!-- Pays -->
<div class="col-12 col-md-6 col-lg-4 hide-on-mobile">
<label class="form-label fw-bold"><?= _("Pays") ?></label>
<SELECT onChange="ajaxListerVilleConsultation();" class="form-select mobile-select" data-live-search="true" id="codePays" NAME="codePays">
<?php liste_options_consultation($pays, $_SESSION['codePaysSociete']); ?>
</SELECT>
</div>
<!-- Région -->
<div class="col-12 col-md-6 col-lg-4">
<label class="form-label fw-bold"><?= _("Région") ?></label>
<div id="listeville">
<SELECT onChange="ajaxListerLocaliteConsultation();" class="form-select mobile-select" data-live-search="true" id="codeVille" NAME="codeVille">
<?php liste_options_consultation($ville, ""); ?>
</SELECT>
</div>
</div>
<!-- Ville -->
<div class="col-12 col-md-6 col-lg-4">
<label class="form-label fw-bold"><?= _("Commune") ?></label>
<div id="listelocalite">
<SELECT class="form-select mobile-select" data-live-search="true" id="codeLocalite" NAME="codeLocalite">
<?php liste_options_consultation($listelocalite, "" ); ?>
</SELECT>
</div>
</div>
<!-- Bouton Afficher -->
<div class="col-12 col-md-6 col-lg-4 d-flex align-items-end">
<button id="btn_filtre" type="button" class="btn btn-primary w-100 mt-3 mt-md-0"
onclick="javascript:afficher_liste_prestataires_actifs();">
<i class="fas fa-search me-2"></i> <?= _("Afficher les résultats") ?>
</button>
</div>
<div class="col-12 col-md-6 col-lg-4">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("District") ?></label>
<div id="listelocalite">
<select class="form-select" id="codeLocalite" name="codeLocalite">
<?php liste_options_consultation($listelocalite, "" ); ?>
</select>
</div>
</div>
<div class="col-12 mt-4">
<button id="btn_filtre" type="button" class="btn btn-primary btn-lg w-100 shadow-sm transition-all"
onclick="handleSearchClick();">
<span id="btn_text"><i class="fas fa-search me-2"></i> <?= _("Afficher les résultats") ?></span>
<span id="btn_spinner" class="d-none spinner-border spinner-border-sm me-2" role="status"></span>
</button>
</div>
</div>
</div>
<!-- Résultats -->
<div class="card shadow-sm">
<div class="card-body p-0">
<div id="div_liste_prestataire" class="table-responsive">
</div>
<div id="container_resultats" class="card shadow-sm border-0 d-none">
<div class="card-body p-0">
<div id="div_liste_prestataire" class="table-responsive">
</div>
</div>
</div>
</div>
</div>
</div>
<style>
.card {
border: none;
border-radius: 10px;
}
:root {
--primary-soft: #e7f1ff;
--transition-speed: 0.3s;
}
.form-label {
font-size: 0.9rem;
}
.main-container-card {
border-radius: 15px !important;
overflow: hidden;
}
.table th {
font-size: 0.9rem;
font-weight: 600;
}
.search-filter-card {
border-radius: 12px !important;
transition: transform var(--transition-speed);
}
.table td {
font-size: 0.9rem;
vertical-align: middle;
}
.form-control, .form-select {
border-radius: 8px;
padding: 0.6rem 1rem;
border: 1px solid #dee2e6;
transition: all var(--transition-speed);
}
/* Améliorations pour mobile */
@media (max-width: 768px) {
.card-body {
padding: 1rem;
.form-control:focus, .form-select:focus {
border-color: #0d6efd;
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
background-color: #fff;
}
.btn {
padding: 0.5rem;
font-size: 0.9rem;
}
.table-responsive {
font-size: 0.8rem;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.form-select, .form-control {
font-size: 16px; /* Empêche le zoom automatique sur iOS */
max-width: 100%;
box-sizing: border-box;
}
/* Amélioration spécifique pour les selects */
select.form-control {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
background-repeat: no-repeat;
background-position: right 0.75rem center;
background-size: 16px 12px;
padding-right: 2.5rem;
}
/* Assurer que les selects ne débordent pas */
.row.g-3 > div {
margin-bottom: 1rem;
}
/* Ajustement de l'espacement */
.mb-8 {
margin-bottom: 2rem !important;
}
}
/* Pour les très petits écrans */
@media (max-width: 576px) {
.container-fluid {
padding-left: 10px;
padding-right: 10px;
.transition-all {
transition: all var(--transition-speed) ease;
}
.card-body {
padding: 0.75rem;
}
.form-label {
font-size: 0.85rem;
}
.btn {
padding: 0.4rem 0.75rem;
font-size: 0.85rem;
}
}
/* Correction spécifique pour Bootstrap Selectpicker si utilisé */
.bootstrap-select .btn {
font-size: 16px !important;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}
.btn-primary:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3) !important;
}
.bootstrap-select .dropdown-menu {
max-width: 100vw;
width: 100%;
}
/* Améliorations Tablettes & Mobiles */
@media (max-width: 768px) {
.card-header h4 { font-size: 1.1rem; }
.form-label { font-size: 0.75rem; }
/* Empêche le zoom sur iOS */
input, select { font-size: 16px !important; }
.p-4 { padding: 1.5rem !important; }
}
/* Amélioration de la lisibilité sur mobile */
select:focus {
border-color: #80bdff;
outline: 0;
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
/* Animation de chargement */
.loading-opacity {
opacity: 0.6;
pointer-events: none;
}
</style>
<script>
// Script pour améliorer l'expérience mobile des selects
function handleSearchClick() {
const btn = document.getElementById('btn_filtre');
const text = document.getElementById('btn_text');
const spinner = document.getElementById('btn_spinner');
const resultContainer = document.getElementById('container_resultats');
// UI Feedback
btn.disabled = true;
text.classList.add('d-none');
spinner.classList.remove('d-none');
// Appel de votre fonction originale
if (typeof afficher_liste_prestataires_actifs === "function") {
afficher_liste_prestataires_actifs();
// Simulation d'affichage du container de résultat
// (À intégrer idéalement dans le success de votre appel AJAX original)
setTimeout(() => {
resultContainer.classList.remove('d-none');
btn.disabled = false;
text.classList.remove('d-none');
spinner.classList.add('d-none');
}, 800);
}
}
document.addEventListener('DOMContentLoaded', function() {
// S'assurer que les selects ne causent pas de débordement
const selects = document.querySelectorAll('select');
selects.forEach(select => {
// Ajouter un attribut pour améliorer l'expérience mobile
select.setAttribute('size', '1');
// Prévenir le zoom sur iOS quand on focus un select
select.addEventListener('focus', function() {
this.style.fontSize = '16px';
});
// Optionnel: restaurer la taille après perte du focus
select.addEventListener('blur', function() {
this.style.fontSize = '';
});
});
// Redimensionner dynamiquement si nécessaire
window.addEventListener('resize', function() {
selects.forEach(select => {
select.style.maxWidth = '100%';
// Optimisation des interactions mobiles
const selects = document.querySelectorAll('.form-select');
selects.forEach(s => {
s.addEventListener('change', function() {
this.classList.add('is-valid');
});
});
});

View File

@ -51,11 +51,11 @@
<input class="sr-only" type="text" id="codePrestataire" name="codePrestataire" value="<?= $codePrestataire; ?>">
<input class="sr-only" type="text" id="rdvPossible" name="rdvPossible" value="<?= $rdvPossible; ?>">
<div class="card shadow-lg border-0 mb-4" style="border-radius: 15px;">
<div class="card shadow-lg border-0 mb-3" style="border-radius: 15px;">
<div class="card-header bg-primary text-white py-3" style="border-radius: 15px 15px 0 0;">
<div class="row align-items-center">
<div class="col-8 text-center">
<h4 id="h4_titre" class="mb-2 text-center">
<h4 id="h4_titre" class="mb-1 text-center">
<i class="fas fa-calendar-check me-2"></i>
<?php if($idDemandeRdv == "0" && $codeEtatRdv == "0"): ?>
<?= _("Nouveau Rendez-vous") ?>
@ -78,19 +78,19 @@
</small>
</div>
<?php else: ?>
<div id="div_numero" class="alert alert-primary text-center mb-4 py-2">
<div id="div_numero" class="alert alert-primary text-center mb-3 py-2">
<strong style="font-size: 1.1rem;"><?= _("RDV No").": ".$numeroDemandeRdv ?></strong>
</div>
<?php endif; ?>
<div id="div_info_rdv" name="div_messdiv_info_rdvage_rdv" >
<marquee behavior="scroll" direction="left" scrollamount="15" style="background-color:red;color:white; font-weight:bold; font-size:14pt">
<?= _("Toute la responsabilité liée à ce rendez-vous incombe au prestataire.") ?>
<?= _("Toute la responsabilité liée à ce rendez-vous, incombe au prestataire.") ?>
</marquee>
</div>
<!-- Carte principale du formulaire -->
<div class="card shadow-sm mb-4">
<div class="card shadow-sm mb-3">
<div class="card-header bg-light py-3">
<h2 class="mb-0 text-primary">
<i class="fas fa-user-injured me-2"></i>
@ -98,7 +98,7 @@
</h2>
</div>
<div class="card-body">
<div class="row g-3">
<div class="row g-2">
<!-- Bénéficiaire -->
<div class="col-12 col-md-6">
<label class="form-label fw-bold">
@ -126,7 +126,7 @@
</div>
<!-- Carte Période du RDV -->
<div class="card shadow-sm mb-4">
<div class="card shadow-sm mb-3">
<div class="card-header bg-light py-3">
<h2 class="mb-0 text-primary">
<i class="fas fa-calendar-day me-2"></i>
@ -135,7 +135,7 @@
</div>
<div class="card-body">
<div class="row g-3">
<div class="row g-2">
<!-- Début -->
<div class="col-12 col-sm-6 col-md-6 col-lg-6">
<label class="form-label fw-bold">
@ -166,7 +166,7 @@
</div>
<!-- Carte Prestataire et Spécialité -->
<div class="card shadow-sm mb-4">
<div class="card shadow-sm mb-3">
<div class="card-header bg-light py-3">
<h2 class="mb-0 text-primary">
<i class="fas fa-hospital-user me-2"></i>
@ -174,7 +174,7 @@
</h2>
</div>
<div class="card-body">
<div class="row g-3">
<div class="row g-2">
<!-- Prestataire -->
<div class="col-12 col-md-6">
<label class="form-label fw-bold">
@ -193,16 +193,9 @@
<!-- Affichage mobile (cartes) -->
<div class="d-md-none">
<div id="div_rdvPossible"> </div>
<!--
<select class="form-select mobile-select" id="codePrestataire" name="codePrestataire"
<?= ($codeEtatRdv != "0") ? 'disabled' : 'required' ?> onChange="javascript:selectPrestataireMobile();" >
<?php liste_options($prestataires, $codePrestataire); ?>
</select>
-->
<select class="form-select mobile-select" id="codePrestataireMobile" name="codePrestataireMobile"
<?= ($codeEtatRdv != "0") ? 'disabled' : 'required' ?> onChange="javascript:selectPrestataireMobile();" >
<?= ($codeEtatRdv != "0") ? 'disabled' : 'required' ?> onChange="/*javascript:selectPrestataireMobile();*/" >
<?php liste_options($prestataires, $codePrestataire); ?>
</select>
</div>
@ -233,7 +226,7 @@
</div>
<!-- Carte Motif du RDV -->
<div class="card shadow-sm mb-4">
<div class="card shadow-sm mb-3">
<div class="card-header bg-light py-3">
<h2 class="mb-0 text-primary">
<i class="fas fa-stethoscope me-2"></i>
@ -241,7 +234,7 @@
</h2>
</div>
<div class="card-body">
<div class="row g-3">
<div class="row g-2">
<div class="col-12">
<label class="form-label fw-bold">
<?= _("Motif RDV") ?>
@ -256,7 +249,7 @@
<!-- Section Réponse (si RDV existant) -->
<?php if($idDemandeRdv > "0"): ?>
<div class="card shadow-sm mb-4">
<div class="card shadow-sm mb-3">
<div class="card-header bg-light py-3">
<h2 class="mb-0 text-primary">
<i class="fas fa-reply me-2"></i>
@ -264,7 +257,7 @@
</h2>
</div>
<div class="card-body">
<div class="row g-3">
<div class="row g-2">
<!-- État Réponse -->
<div class="col-12 col-md-6 col-lg-3">
<label class="form-label fw-bold"><?= _("Etat Réponse") ?></label>
@ -311,7 +304,7 @@
<!-- Boutons d'action -->
<div class="card shadow-sm">
<div class="card-body">
<div class="row g-3">
<div class="row g-2">
<div class="col-12">
<?php if($idDemandeRdv == "0" && $codeEtatRdv == "0"): ?>
<button class="btn btn-primary w-100 py-2 btn_autre"
@ -402,14 +395,22 @@
</style>
<script>
// Adapter l'interface pour mobile
document.addEventListener('DOMContentLoaded', function() {
// Vérification initiale au chargement (ex: si on modifie un RDV existant)
updateRdvButton();
// Écouteur pour le select Mobile
$("#codePrestataireMobile").on("change", function() {
updateRdvButton();
});
// Ton code d'adaptation mobile existant
function adaptForMobile() {
if (window.innerWidth < 768) {
// Ajustements spécifiques pour mobile
// Ajustements
}
}
adaptForMobile();
window.addEventListener('resize', adaptForMobile);
});

View File

@ -109,6 +109,33 @@
<!-- FIN APLLI MOBILE -->
</head>
<style>
/* Company logo area */
.company-logo-area {
display: flex;
align-items: center;
gap: 8px;
padding: 4px 10px;
border-radius: var(--radius-md);
border: 1px solid var(--border-light);
background: var(--bg-surface-2);
transition: all var(--transition-fast);
max-width: 300px;
}
.company-logo-area:hover {
border-color: var(--color-primary-light);
box-shadow: var(--shadow-sm);
}
.company-logo-area img { height: 50px; width: auto; object-fit: contain; }
.company-logo-area .company-name {
font-size: 0.75rem;
font-weight: 600;
color: #020849ff;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<body >
<?php
$style = "";
@ -153,12 +180,12 @@
<ul class="d-flex align-items-center">
<li class="nav-item">
<a title="<?= _("Gestionnaire d'assurance santé");?>" style="margin-left:10px; margin-right:10px;" class="nav-link nav-icon" href="javascript:infos_entite();">
<img id="lienLogo" src="<?= $_SESSION['lienLogo'] ?>" alt="Logo" style="width:200px;max-height: 60px;" class="rounded-circle">
<span id="nomSociete" class="d-none d-lg-inline"> <?=$companyDisplayName?> </span>
<a class="company-logo-area text-decoration-none"
href="javascript:infos_entite();"
title="<?= _('Gestionnaire d\'assurance santé') ?>">
<img src="<?= $_SESSION['lienLogo'] ?>"
alt="<?= htmlspecialchars($_SESSION['nomSociete'], ENT_QUOTES) ?>">
<span class="company-name"><?= $companyDisplayName ?></span>
</a>
</li>
@ -359,13 +386,13 @@
<!-- Adhérent et bénéficiaire -->
<div class="mb-2">
<button class="btn btn-info btn-sm w-100 text-truncate" onclick="javascript:afficher_adherent_id();" id="numeroAdherent_C" NAME="numeroAdherent_C" title="<?= _("Voir les membres de famille")?>">
<button class="btn btn-info btn-sm w-100 text-truncate" onclick="javascript:accueilassure();" id="numeroAdherent_C" NAME="numeroAdherent_C">
<i class="fa-solid fa-users"></i> <?= _("Famille")." : ".$this->nettoyer($_SESSION['numeroAdherent_C']) ?>
</button>
</div>
<div class="mb-2">
<button class="btn btn-outline-secondary btn-sm w-100 text-truncate" onclick="javascript:afficher_adherent_id();" title="<?= _("Voir les membres de famille")?>">
<button class="btn btn-outline-secondary btn-sm w-100 text-truncate" onclick="javascript:accueilassure();">
<?= substr($this->nettoyer($_SESSION['adherent_C']), 0, 25) ?>
</button>
</div>
@ -547,7 +574,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.css" integrity="sha512-3pIirOrwegjM6erE5gPSwkUzO+3cTjpnV9lexlNZqvupR64iZBnOOTiiLPb9M36zpMScbmUNIcHUqKD47M719g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js" integrity="sha512-VEd+nq25CkR676O+pLBnDW09R7VQX9Mdiij052gVCp5yVH3jGtH70Ho/UUv4mJDsEdTvqRCFZg0NKGiojGnUCw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="Js/fonctions.js?ver=2026.03.05.25"></script>
<script src="Js/fonctions.js?ver=2026.03.26.08"></script>
<script src="Bootstrap/js/bootstrap.min.js"></script>
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>