Merge branch 'main' of git.ebene.ovh:ebene/radiantrh

This commit is contained in:
KANE LAZENI 2026-01-16 06:46:40 +00:00
commit 6292cd5331
53 changed files with 5994 additions and 1500 deletions

View File

@ -249,6 +249,7 @@ body.sidebar-collapsed .app-sidebar .nav-link:hover::after {
.nav-link[aria-expanded="true"] .nav-arrow {
transform: rotate(90deg);
transition: transform 0.3s;
}
.nav-submenu {
@ -862,6 +863,20 @@ body.sidebar-collapsed .nav-bar {
padding: 1rem !important;
font-size: 9pt;
}
.chart-container {
height: 60vh;
}
.card-header {
flex-direction: column;
align-items: flex-start !important;
}
.btn-export {
margin-top: 0.5rem;
align-self: flex-end;
}
}
/* Écrans larges : mêmes insets pour nav-tabs et content-area */
@ -1045,7 +1060,9 @@ li i { margin-right:10px; color:#007bff; }
#div_colleges_police,
#div_ajout_adherent,
#div_avenant,
#div_liste_adherent {
#div_liste_adherent,
#div_adherent,
#div_liste {
background-color: var(--office-light);
color: var(--office-dark);
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
@ -1059,7 +1076,9 @@ li i { margin-right:10px; color:#007bff; }
#div_colleges_police .card,
#div_ajout_adherent .card,
#div_avenant .card,
#div_liste_adherent .card{
#div_liste_adherent .card,
#div_adherent .card,
#div_liste .card{
border: 1px solid var(--office-border);
border-radius: 2px; /* Office style is more rectangular */
}
@ -1070,7 +1089,9 @@ li i { margin-right:10px; color:#007bff; }
#div_colleges_police .card-header,
#div_ajout_adherent .card-header,
#div_avenant .card-header,
#div_liste_adherent .card-header{
#div_liste_adherent .card-header
#div_adherent .card-header,
#div_adherent .card-header{
border-bottom: 1px solid var(--office-border) !important;
background-color: white;
color: var(--office-dark);
@ -1428,4 +1449,20 @@ li i { margin-right:10px; color:#007bff; }
padding: 15px;
border-radius: 8px;
background-color: white;
}
}
/* Styles communs pour tous les graphiques */
.chart-container {
position: relative;
width: 100%;
min-height: 300px;
}
.legend-text {
vertical-align: middle;
}
.btn-export {
padding: 0.25rem 0.5rem;
font-size: 0.75rem;
}

View File

@ -0,0 +1,72 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Facture.php';
class ControleurAjaxfactureconspop extends Controleur {
private $facture;
public function __construct() {
$this->facture = new Facture();
}
public function index()
{
$idFacture = $this->requete->getParametreFormulaire("idFacture");
$_SESSION['idFacture_C'] = $idFacture;
$facture = $this->facture->consulterfacturefacture($idFacture) ;
$this->genererVueAjax(array('facture' => $facture));
}
public function feuillemaladie()
{
$idFacture = $this->requete->getParametreFormulaire("idFacture");
$feuillemaladie = $this->facture->consulterfacturefeuillemaladie($idFacture) ;
$diagnostics = $this->facture->consulterfacturediagnostics($idFacture);
$this->genererVueAjax(array('feuillemaladie' => $feuillemaladie, 'diagnostics' => $diagnostics));
}
public function prestationactes()
{
$idFacture = $this->requete->getParametreFormulaire("idFacture");
$prestations = $this->facture->consulterfactureprestationactes($idFacture) ;
$this->genererVueAjax(array('prestations' => $prestations));
}
public function medicaments()
{
$idFacture = $this->requete->getParametreFormulaire("idFacture");
$medicaments = $this->facture->consulterfacturemedicaments($idFacture) ;
$this->genererVueAjax(array('medicaments' => $medicaments));
}
public function geds()
{
unset($_FILES['fichier_upload']);
$idFacture = $this->requete->getParametreFormulaire("idFacture");
$geds = $this->facture->getgedfacture($idFacture);
$this->genererVueAjax(array('geds' => $geds));
}
public function verres()
{
$idFacture = $this->requete->getParametreFormulaire("idFacture");
$verres = $this->facture->consulterfactureverres($idFacture) ;
$this->genererVueAjax(array('verres' => $verres));
}
}

View File

@ -0,0 +1,150 @@
<?php
require_once 'Framework/Controleur.php'; // OK
require_once 'Modele/Utilisateur.php';
class ControleurAjaxhabilitation extends Controleur
{
private $utilisateur;
public function __construct()
{
$this->utilisateur = new Utilisateur();
}
public function index()
{
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$menus_accessibles = $this->utilisateur->getMenusAccessiblesProfil($codeProfil);
$menus_non_accessibles = $this->utilisateur->getMenusNonAccessiblesProfil($codeProfil);
$this->genererVueAjax(array('menus_accessibles' => $menus_accessibles, 'menus_non_accessibles' => $menus_non_accessibles));
}
public function ajouterunmenuprofilrh()
{
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$codeMenu = $this->requete->getParametreFormulaire("codeMenu");
$this->utilisateur->ajouterunmenuprofilrh($codeProfil, $codeMenu);
}
public function retirerunmenuprofilrh()
{
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$codeMenu = $this->requete->getParametreFormulaire("codeMenu");
$this->utilisateur->retirerunmenuprofilrh($codeProfil, $codeMenu);
}
public function ajoutertousmenusprofilrh()
{
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$this->utilisateur->ajoutertousmenusprofilrh($codeProfil);
}
public function retirertousmenuprofilrh()
{
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$this->utilisateur->retirertousmenuprofilrh($codeProfil);
}
public function afficheraccessousmenusass()
{
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$codeModule = $this->requete->getParametreFormulaire("codeModule");
$vue = $this->requete->getParametreFormulaire("vue");
$menus_accessibles = $this->utilisateur->getSousMenusAccessiblesVue($codeProfil, $vue);
$menus_non_accessibles = $this->utilisateur->getSousMenusNonAccessiblesVue($codeProfil,$vue);
$this->genererVueAjax(array('menus_accessibles' => $menus_accessibles, 'menus_non_accessibles' => $menus_non_accessibles,
'codeModule' => $codeModule));
}
public function ajoutertoussousmenusass()
{
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$vue = $this->requete->getParametreFormulaire("vue");
$this->utilisateur->ajoutertoussousmenusass($codeProfil, $vue);
}
public function retirertoussousmenusass()
{
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$vue = $this->requete->getParametreFormulaire("vue");
$this->utilisateur->retirertoussousmenusass($codeProfil, $vue);
}
public function ajouterunsousmenusass()
{
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$vue = $this->requete->getParametreFormulaire("vue");
$codeMenu = $this->requete->getParametreFormulaire("codeMenu");
$this->utilisateur->ajouterunsousmenusass($codeProfil, $vue, $codeMenu);
}
public function retirerunsousmenusass()
{
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$vue = $this->requete->getParametreFormulaire("vue");
$codeMenu = $this->requete->getParametreFormulaire("codeMenu");
$this->utilisateur->retirerunsousmenusass($codeProfil, $vue, $codeMenu);
}
public function creerprofilass()
{
$libelle = $this->requete->getParametreFormulaire("libelle");
$libelleEng = $this->requete->getParametreFormulaire("libelleEng");
$this->utilisateur->creerprofilass($libelle, $libelleEng);
}
public function transfererdroitsprofilassureur()
{
$codeProfilSource = $this->requete->getParametreFormulaire("codeProfilSource");
$codeProfilDest = $this->requete->getParametreFormulaire("codeProfilDest");
$this->utilisateur->transfererdroitsprofilassureur($codeProfilSource, $codeProfilDest);
// $this->genererVueAjax();
}
public function batchviderprofilass()
{
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$this->utilisateur->batchviderprofilass($codeProfil);
}
public function batchattribuerdroitsreferenceass()
{
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$this->utilisateur->batchattribuerdroitsreferenceass($codeProfil);
}
public function ajaxlisteusersass()
{
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$nom = $this->requete->getParametreFormulaire("nom");
$prenoms = $this->requete->getParametreFormulaire("prenoms");
$codePointVente = $this->requete->getParametreFormulaire("codePointVente");
$users = $this->utilisateur->getusersassueurfiltre($codeProfil, $nom, $prenoms, $codePointVente);
$this->genererVueAjax(array('users' => $users));
}
}

View File

@ -0,0 +1,20 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Police.php';
class ControleurAjaxlisterpolicesclient extends Controleur {
private $police;
public function __construct()
{
$this->police = new Police();
}
public function index()
{
$vue = $this->requete->getParametreFormulaire("vue");
$polices = $this->police->getPoliceRh();
$this->genererVueAjax(array('vue' => $vue, 'polices' => $polices));
}
}

View File

@ -0,0 +1,14 @@
<?php
require_once 'Framework/Controleur.php';
class ControleurAjaxsaisirpassnewuser extends Controleur {
public function __construct() {
}
public function index() {
$codeModeGenerationPass = $this->requete->getParametreFormulaire("codeModeGenerationPass");
$this->genererVueAjax(array('codeModeGenerationPass' => $codeModeGenerationPass));
}
}

View File

@ -0,0 +1,89 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Client.php';
class ControleurAjaxuserrhclient extends Controleur {
private $client;
public function __construct() {
$this->client = new Client();
}
public function index()
{
$this->genererVueAjax();
}
public function reinitpaswd()
{
$codeUtilisateur = $this->requete->getParametreFormulaire("codeUtilisateur");
$this->client->reinitpaswd($codeUtilisateur);
}
public function desactiver()
{
$codeUtilisateur = $this->requete->getParametreFormulaire("codeUtilisateur");
$this->client->desactiver($codeUtilisateur);
}
public function activer()
{
$codeUtilisateur = $this->requete->getParametreFormulaire("codeUtilisateur");
$this->client->activer($codeUtilisateur);
}
public function enregistrermodifuser()
{
$idUtilisateur = $this->requete->getParametreFormulaire("idUtilisateur");
$nom = $this->requete->getParametreFormulaire("nom");
$prenoms = $this->requete->getParametreFormulaire("prenoms");
$actif = $this->requete->getParametreFormulaire("actif");
$actVisible = $this->requete->getParametreFormulaire("actVisible");
$codeLangue = $this->requete->getParametreFormulaire("codeLangue");
$AffectionVisible = $this->requete->getParametreFormulaire("AffectionVisible");
$telephone = $this->requete->getParametreFormulaire("telephone");
$email = $this->requete->getParametreFormulaire("email");
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
$this->client->enregistrermodifuser($idUtilisateur, $nom, $prenoms, $actif, $actVisible,
$codeLangue, $AffectionVisible, $telephone, $email, $codeProfil);
}
public function creeruser()
{
$codeUtilisateur = $this->requete->getParametreFormulaire("codeUtilisateur");
$nom = $this->requete->getParametreFormulaire("nom");
$prenoms = $this->requete->getParametreFormulaire("prenoms");
$telephone = $this->requete->getParametreFormulaire("telephone");
$email = $this->requete->getParametreFormulaire("email");
$motPass = $this->requete->getParametreFormulaire("motPass");
$codeLangue = $this->requete->getParametreFormulaire("codeLangue");
$actVisible = $this->requete->getParametreFormulaire("actVisible");
$AffectionVisible = $this->requete->getParametreFormulaire("AffectionVisible");
$codeModeGenerationPass = $this->requete->getParametreFormulaire("codeModeGenerationPass");
$codeModeEnvoiPass = $this->requete->getParametreFormulaire("codeModeEnvoiPass");
$codeProfil = $this->requete->getParametreFormulaire("codeProfil");
if($this->client->existelogin($codeUtilisateur))
{
$this->genererVueAjax(array('uniciteLogin' => "0", 'msgErreur' => "Login $codeUtilisateur déjà utilisé!"));
}
else
{
$this->client->creeruser($codeUtilisateur, $nom, $prenoms, $telephone, $email, $motPass, $codeLangue, $actVisible,
$AffectionVisible, $codeModeGenerationPass, $codeModeEnvoiPass, $codeProfil);
$this->genererVueAjax(array('uniciteLogin' => "1", 'msgErreur' => "Utlisateur $codeUtilisateur créé avec succès!"));
}
}
}

View File

@ -21,6 +21,7 @@ class ControleurFicheadherent extends Controleur {
$_SESSION['modeDevis'] = "0";
}
public function index() {
$idPolice = $_SESSION['idPolice_C'];
@ -37,9 +38,48 @@ class ControleurFicheadherent extends Controleur {
$_SESSION['controlerPlafondBeneficiaire'] = "0";
$limite_adherent = $this->garantieadherent->getLimitesAdherent($idAdherent);
$prestationsParMois = $this->adherent->getPrestationsmensuelles($idAdherent);
$prestationsParLiens = $this->adherent->getPrestationsLiensParente($idAdherent);
// Prestations par mois
$tabPrestationsParMois = [
'mois' => array_column($prestationsParMois, 'mois'),
'consos' => array_column($prestationsParMois, 'consommationAdherent')
];
// Prestations par liens de parenté
$tabPrestationsParLiens = [
'lienparente' => array_column($prestationsParLiens, 'lienparente'),
'consos_liens' => array_column($prestationsParLiens, 'consommation')
];
$nbreLienParente = count($tabPrestationsParLiens['lienparente']);
// Consommations par garanties
$tabConsoParGaranties = [
'garanties' => array_column($garantieadherents, 'codeGarantie'),
'depenses' => array_column($garantieadherents, 'consommationFamille'),
'plafonds' => array_column($garantieadherents, 'plafondFamille')
];
// Encodage JSON
$dataConsoParMois = json_encode($tabPrestationsParMois, JSON_NUMERIC_CHECK);
$dataConsoParLiens = json_encode($tabPrestationsParLiens, JSON_NUMERIC_CHECK);
$dataConsoParGaranties = json_encode($tabConsoParGaranties, JSON_NUMERIC_CHECK);
$this->genererVue(array('adherent' => $adherent, 'beneficiaires' => $beneficiaires, 'totalbeneficiaires' => $totalbeneficiaires,
'garantieadherents' => $garantieadherents, 'limite_adherent' => $limite_adherent));
$this->genererVue(array(
'adherent' => $adherent,
'beneficiaires' => $beneficiaires,
'totalbeneficiaires' => $totalbeneficiaires,
'garantieadherents' => $garantieadherents,
'limite_adherent' => $limite_adherent,
'dataConsoParMois' => $dataConsoParMois,
'dataConsoParLiens' => $dataConsoParLiens,
'dataConsoParGaranties' => $dataConsoParGaranties,
'nbreLienParente' => $nbreLienParente
));
}
public function supprimer() {

View File

@ -202,9 +202,35 @@ class ControleurFichebeneficiaire extends Controleur
$limite_beneficiaire = $this->garantieadherent->getLimitesBeneficiaire($idBeneficiaire);
$limite_adherent = $this->garantieadherent->getLimitesAdherent($idAdherent);
$prestationsParMois = $this->beneficiaire->getPrestationsmensuelles($idBeneficiaire);
// Extraction directe des colonnes avec array_column
$tabConsoParMois = [
'mois' => array_column($prestationsParMois, 'mois'),
'consos' => array_column($prestationsParMois, 'consommationBeneficiaire')
];
$tabConsoParGaranties = [
'garanties' => array_column($garantieadherents, 'codeGarantie'),
'depenses' => array_column($garantieadherents, 'consommation'),
'plafonds' => array_column($garantieadherents, 'plafond')
];
// Encodage JSON
$dataConsoParMois = json_encode($tabConsoParMois, JSON_NUMERIC_CHECK);
$dataConsoParGaranties = json_encode($tabConsoParGaranties, JSON_NUMERIC_CHECK);
$this->genererVue(array('beneficiaire' => $beneficiaire, 'message' => $message, 'nouveau_fichier' => $nouveau_fichier,
'garantieadherents' => $garantieadherents, 'limite_beneficiaire' => $limite_beneficiaire, 'limite_adherent' => $limite_adherent));
$this->genererVue(array(
'beneficiaire' => $beneficiaire,
'message' => $message,
'nouveau_fichier' => $nouveau_fichier,
'garantieadherents' => $garantieadherents,
'limite_beneficiaire' => $limite_beneficiaire,
'limite_adherent' => $limite_adherent,
'dataConsoParMois' => $dataConsoParMois,
'dataConsoParGaranties' => $dataConsoParGaranties
));
}
public function supprimer() {

View File

@ -0,0 +1,45 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Client.php';
require_once 'Modele/Menuvueutilisateur.php';
require_once 'Modele/Ouinon.php';
require_once 'Modele/Langue.php';
class ControleurFicheuserrhclient extends Controleur {
private $menuvue;
private $client;
private $langue;
private $oui_non;
public function __construct()
{
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue("Ficheuserrhclient");
$this->client = new Client();
$this->oui_non = new Ouinon();
$this->langue = new Langue();
}
public function index()
{
$idUtilisateur = $this->requete->getParametreFormulaire("id");
$user_actif = $this->oui_non->getListe();
$user_actVisible = $this->oui_non->getListe();
$langue = $this->langue->getListe();
$user_AffectionVisible = $this->oui_non->getListe();
$user_rh = $this->client->getunuserrhclient($idUtilisateur);
$user_profil = $this->client->getListeProfilRh();
$this->genererVue(array(
'user_rh' => $user_rh,
'user_actif' => $user_actif,
'user_actVisible' => $user_actVisible,
'langue' => $langue,
'user_AffectionVisible' => $user_AffectionVisible,
'user_profil' => $user_profil
));
}
}

View File

@ -0,0 +1,51 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Client.php';
require_once 'Modele/Ouinon.php';
require_once 'Modele/Langue.php';
require_once 'Modele/Societeuser.php';
require_once 'Modele/Menuvueutilisateur.php';
class ControleurNouveluserrh extends Controleur {
private $menuvue;
private $client;
private $langue;
private $oui_non;
private $societeuser;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue('Nouveluserrh');
$this->client = new Client();
$this->langue = new Langue();
$this->oui_non = new Ouinon();
$this->societeuser = new Societeuser();
}
public function index()
{
$idClient = $_SESSION['idClient_C'];
//$gc = $this->client->getGcAssureurCode($codeGcAssureur);
$langue = $this->langue->getListe();
$user_actVisible = $this->oui_non->getListe();
$user_AffectionVisible = $this->oui_non->getListe();
$user_profil = $this->client->getListeProfilRh();
$paramsgenerationpass = $this->societeuser->getparamsgenerationpass();
$modeenvoipass = $this->societeuser->getmodeenvoipass();
$modegenerationpass = $this->societeuser->getmodegenerationpass();
$this->genererVue(array(
//'gc' => $gc,
'langue' => $langue,
'user_actVisible' => $user_actVisible,
'paramsgenerationpass' => $paramsgenerationpass,
'modeenvoipass' => $modeenvoipass,
'modegenerationpass' => $modegenerationpass,
'user_AffectionVisible' => $user_AffectionVisible,
'user_profil' => $user_profil
));
}
}

View File

@ -0,0 +1,22 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Utilisateur.php';
require_once 'Modele/Menuvueutilisateur.php';
class ControleurRoles extends Controleur
{
private $utilisateur;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue('Roles');
$this->utilisateur = new Utilisateur();
}
public function index()
{
$profil = $this->utilisateur->getListeProfilCode();
$this->genererVue(array('profil' => $profil));
}
}

View File

@ -0,0 +1,26 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Client.php';
require_once 'Modele/Menuvueutilisateur.php';
class ControleurUsersrhclient extends Controleur {
private $menuvue;
private $gc;
public function __construct() {
$this->menuvue = new Menuvueutilisateur();
$this->menuvue->getMenuVue("Usersrhclient");
$this->client = new Client();
}
public function index() {
$idClient = $_SESSION['idClient_C'];
$client = $this->client->getClientId($idClient);
$users = $this->client->getusersrhclient($idClient);
$this->genererVue(array('client' => $client, 'users' => $users));
}
}

File diff suppressed because it is too large Load Diff

View File

@ -846,5 +846,34 @@ class Adherent extends Modele {
$resultat = $this->executerRequete($sql, array($idAdherent));
return $resultat->fetch(PDO::FETCH_ASSOC);
}
// Ajouté par Sorel le 12-01-2026 => Gestion des graphiques de la famille
public function getPrestationsmensuelles($idAdherent){
if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US"){
$sql = 'call prestations_mensuelles_famille_eng(?)';
}else{
$sql = 'call prestations_mensuelles_famille(?)';
}
$resultat = $this->executerRequete($sql, array($idAdherent));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getPrestationsLiensParente($idAdherent){
if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US"){
$sql = 'call prestations_lienparente_famille_eng(?)';
}else{
$sql = 'call prestations_lienparente_famille(?)';
}
$resultat = $this->executerRequete($sql, array($idAdherent));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
}

View File

@ -1644,5 +1644,18 @@ class Beneficiaire extends Modele {
return $resultat->fetch(PDO::FETCH_ASSOC);
}
public function getPrestationsmensuelles($idBeneficiaire){
if (isset($_SESSION['lang']) && $_SESSION['lang']=="en_US"){
$sql = 'call prestations_mensuelles_beneficiaire_eng(?)';
}else{
$sql = 'call prestations_mensuelles_beneficiaire(?)';
}
$resultat = $this->executerRequete($sql, array($idBeneficiaire));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
}

View File

@ -287,4 +287,106 @@ class Client extends Modele {
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getusersrhclient($idClient)
{
$sql = 'call sp_c_get_users_rh(?)';
$resultat = $this->executerRequete($sql, array($idClient));
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getunuserrhclient($idUtilisateur)
{
$sql = 'call sp_un_user_rh_client(?)';
$resultat = $this->executerRequete($sql, array($idUtilisateur));
return $resultat->fetch(PDO::FETCH_ASSOC);
}
public function getListeProfilRh()
{
if (est_anglophone()){
$sql = 'call sp_get_liste_profil_rh_eng()';
}else{
$sql = 'call sp_get_liste_profil_rh()';
}
$resultat = $this->executerRequete($sql);
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function enregistrermodifuser($idUtilisateur, $nom, $prenoms, $actif, $actVisible, $codeLangue, $AffectionVisible, $telephone, $email, $codeProfil)
{
$user = $_SESSION['login'];
$sql = 'call sp_c_modifier_user_rh(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);';
$resultat = $this->executerRequete($sql, array($idUtilisateur, $nom, $prenoms, $actif, $actVisible, $codeLangue, $AffectionVisible, $user, $telephone, $email, $codeProfil));
}
public function reinitpaswd($codeUtilisateur)
{
$sql = 'call sp_c_reinit_utilisateur_rh_client(?)';
$this->executerRequete($sql, array($codeUtilisateur));
}
public function desactiver($codeUtilisateur)
{
$sql = 'call sp_c_desactiver_utilisateur_rh_client(?)';
$this->executerRequete($sql, array($codeUtilisateur));
}
public function activer($codeUtilisateur)
{
$sql = 'call sp_c_activer_utilisateur_rh_client(?)';
$this->executerRequete($sql, array($codeUtilisateur));
}
public function existelogin($codeUtilisateur) {
$sql = 'select id FROM c_utilisateur WHERE (codeUtilisateur=?)';
$resultat = $this->executerRequete($sql, array($codeUtilisateur));
return ($resultat->rowCount() > 0);
}
public function creeruser($codeUtilisateur, $nom, $prenoms, $telephone, $email, $motPass, $codeLangue,
$actVisible, $AffectionVisible, $codeModeGenerationPass, $codeModeEnvoiPass, $codeProfil)
{
$codeSociete = $_SESSION['codeSociete'];
$user = $_SESSION['login'];
$idClient = $_SESSION['idClient_C'];
$numeroClient = $_SESSION['numeroClient_C'];
$passAutoGen = "";
switch ($codeModeGenerationPass)
{
case "0":
$hash = password_hash($motPass, PASSWORD_DEFAULT);
break;
case "1":
$passAutoGen = uniqid();
$hash = password_hash($passAutoGen, PASSWORD_DEFAULT);
$motPass = $passAutoGen;
break;
case 2:
$hash = "";
break;
default:
$hash = password_hash($motPass, PASSWORD_DEFAULT);
}
$sql = 'call sp_c_creer_user_rh_client(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);';
$this->executerRequete($sql, array($codeSociete, $idClient, $numeroClient, $codeUtilisateur, $nom, $prenoms, $telephone,
$email, $hash, $codeLangue, $actVisible, $AffectionVisible, $user, $codeModeGenerationPass,
$passAutoGen, $codeModeEnvoiPass, $motPass, $codeProfil));
}
}

View File

@ -50,4 +50,50 @@ class Societeuser extends Modele {
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getparamsgenerationpass()
{
$codeSociete = $_SESSION['codeSociete'];
$sql = 'SELECT A.codeModeGenerationPass, B.libelle AS modegenerationpass, A.codeModeEnvoiPass FROM societeuser A
LEFT JOIN modegenerationpass B ON (B.codeModeGenerationPass=A.codeModeGenerationPass) WHERE (A.codeSociete=?) LIMIT 1;';
$resultat = $this->executerRequete($sql, array($codeSociete));;
$ligne = $resultat->fetch(PDO::FETCH_ASSOC);
return $ligne;
}
public function getmodeenvoipass()
{
if (est_anglophone())
{
$sql = 'SELECT codeModeEnvoiPass AS `code`, libelleEng AS libelle FROM modeenvoipass ORDER BY ordre;';
}
else
{
$sql = 'SELECT codeModeEnvoiPass AS `code`, libelle FROM modeenvoipass ORDER BY ordre;';
}
$resultat = $this->executerRequete($sql);
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
public function getmodegenerationpass()
{
if (est_anglophone())
{
$sql = 'SELECT codeModeGenerationPass AS `code`, libelleEng AS libelle FROM modegenerationpass ORDER BY ordre;';
}
else
{
$sql = 'SELECT codeModeGenerationPass AS `code`, libelle FROM modegenerationpass ORDER BY ordre;';
}
$resultat = $this->executerRequete($sql);
return $resultat->fetchAll(PDO::FETCH_ASSOC);
}
}

View File

@ -129,4 +129,78 @@ class Utilisateur extends Modele {
setcookie('lang', $codeNewLang, time()+365*24*3600, '/');
}
public function getListeProfilCode()
{
if (est_anglophone())
{
$sql = 'SELECT codeProfil AS `code`, CONCAT(libelleEng, " ( ", codeProfil, " )") AS libelle FROM c_profil WHERE (codeSociete=?) ORDER BY libelleEng';
}
else
{
$sql = 'SELECT codeProfil AS `code`, CONCAT(libelle, " ( ", codeProfil, " )") AS libelle FROM c_profil WHERE (codeSociete=?) ORDER BY libelle';
}
$liste = $this->executerRequete($sql, array($_SESSION['codeSociete']));
return $liste->fetchAll(PDO::FETCH_ASSOC);
}
public function getMenusAccessiblesProfil($codeProfil)
{
$sql = "call sp_c_get_menus_accessibles_profil_rh(?, ?);";
$menu = $this->executerRequete($sql, array($_SESSION['codeSociete'], $codeProfil));
return $menu->fetchAll(PDO::FETCH_ASSOC);
}
public function getMenusNonAccessiblesProfil($codeProfil)
{
$sql = "call sp_c_get_menus_non_accessibles_profil_rh(?, ?);";
$menu = $this->executerRequete($sql, array($_SESSION['codeSociete'], $codeProfil));
return $menu->fetchAll(PDO::FETCH_ASSOC);
}
public function ajoutertousmenusprofilrh($codeProfil)
{
$codeSociete = $_SESSION['codeSociete'];
$user = $_SESSION['login'];
$sql = 'call sp_c_ajouter_tous_menus_accessibles_profil_rh(?, ?, ?)';
$this->executerRequete($sql, array($codeSociete, $codeProfil, $user));
}
public function ajouterunmenuprofilrh($codeProfil, $codeMenu)
{
$codeSociete = $_SESSION['codeSociete'];
$user = $_SESSION['login'];
$sql = 'call sp_c_ajouter_un_menu_accessibles_profil_rh(?, ?, ?, ?)';
$this->executerRequete($sql, array($codeSociete, $codeProfil, $codeMenu, $user));
}
public function retirertousmenuprofilrh($codeProfil)
{
$codeSociete = $_SESSION['codeSociete'];
$user = $_SESSION['login'];
$sql = 'call sp_c_retirer_tous_menus_accessibles_profil_rh(?, ?, ?)';
$this->executerRequete($sql, array($codeSociete, $codeProfil, $user));
}
public function retirerunmenuprofilrh($codeProfil, $codeMenu)
{
$codeSociete = $_SESSION['codeSociete'];
$user = $_SESSION['login'];
$sql = 'call sp_c_retirer_un_menu_accessibles_profil_rh(?, ?, ?, ?)';
$this->executerRequete($sql, array($codeSociete, $codeProfil, $codeMenu, $user));
}
}

View File

@ -32,12 +32,12 @@
<div class="sub-values">
<div class="sub-item">
<span><?= _('Statistique') ?> :</span>
<strong class="text-success"><?= format_N($kpis["primeNetteStat"]).' '.$_SESSION['devise_C'] ?></strong>
<strong class="text-success"><?= format_N($kpis["primeNetteStat"]) ?></strong>
</div>
<div class="sub-item">
<span><?= _('TTC') ?> :</span>
<strong><?= format_N($kpis["primeTtc"]).' '.$_SESSION['devise_C'] ?></strong>
<strong><?= format_N($kpis["primeTtc"]) ?></strong>
</div>
</div>
</div>
@ -48,7 +48,7 @@
<div class="sub-values">
<div class="sub-item">
<span><?= _('Montant') ?> :</span>
<strong class="text-danger"><?= format_N($kpis["montantApayer"]).' '.$_SESSION['devise_C'] ?></strong>
<strong class="text-danger"><?= format_N($kpis["montantApayer"]) ?></strong>
</div>
<div class="sub-item">
<span><?= _('Rapport S/P') ?> :</span>
@ -73,7 +73,6 @@
<h2 class="accordion-header" id="headingContrats">
<button class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#contratsCollapse"
aria-expanded="false"
aria-controls="contratsCollapse">
@ -99,7 +98,6 @@
<h2 class="accordion-header" id="headingGraphiques">
<button class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#graphiqueCollapse"
aria-expanded="false"
aria-controls="graphiqueCollapse">
@ -128,39 +126,58 @@
</div>
</div>
<!-- ======================================================= -->
<!-- CHARGEMENT DES LIBRAIRIES GRAPHIQUES ET PDF ICI -->
<!-- Pour éviter de les recharger à chaque appel Ajax -->
<!-- ======================================================= -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.1/dist/chart.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
const collapses = document.querySelectorAll('.accordion-collapse');
document.addEventListener('DOMContentLoaded', function() {
// On cible tous les boutons qui pointent vers un accordéon
const accordionButtons = document.querySelectorAll('.accordion-button');
collapses.forEach(collapse => {
// Quand une section s'ouvre
collapse.addEventListener('show.bs.collapse', function () {
const fnName = this.dataset.openFn;
if (fnName && typeof window[fnName] === 'function') {
window[fnName]();
}
// Changer licône en chevron-up
const headerBtn = document.querySelector('[data-bs-target="#' + this.id + '"] .accordion-icon');
if (headerBtn) headerBtn.classList.replace('bi-chevron-down', 'bi-chevron-up');
accordionButtons.forEach(btn => {
btn.addEventListener('click', function(e) {
e.preventDefault();
const targetSelector = this.getAttribute('data-bs-target');
const targetEl = document.querySelector(targetSelector);
if (!targetEl) return;
// On récupère l'instance existante ou on en crée une proprement
// Le "parent" permet de fermer automatiquement les autres sections
const instance = bootstrap.Collapse.getOrCreateInstance(targetEl, {
parent: '#dashboardAccordion',
toggle: false
});
// Quand une section se ferme
collapse.addEventListener('hide.bs.collapse', function () {
const fnName = this.dataset.closeFn;
if (fnName && typeof window[fnName] === 'function') {
window[fnName]();
}
// Remettre licône en chevron-down
const headerBtn = document.querySelector('[data-bs-target="#' + this.id + '"] .accordion-icon');
if (headerBtn) headerBtn.classList.replace('bi-chevron-up', 'bi-chevron-down');
});
// On déclenche l'action manuellement
instance.toggle();
});
});
// Gestion des icônes et des fonctions de chargement (open-fn / close-fn)
const collapses = document.querySelectorAll('.accordion-collapse');
collapses.forEach(collapseEl => {
// Au moment où il commence à s'ouvrir
collapseEl.addEventListener('show.bs.collapse', function () {
const btn = document.querySelector(`[data-bs-target="#${this.id}"]`);
btn.classList.remove('collapsed');
const icon = btn?.querySelector('.accordion-icon');
if (icon) icon.classList.replace('bi-chevron-down', 'bi-chevron-up');
const fnName = this.dataset.openFn;
if (fnName && typeof window[fnName] === 'function') window[fnName]();
});
// Au moment où il commence à se fermer
collapseEl.addEventListener('hide.bs.collapse', function () {
const btn = document.querySelector(`[data-bs-target="#${this.id}"]`);
btn.classList.add('collapsed');
const icon = btn?.querySelector('.accordion-icon');
if (icon) icon.classList.replace('bi-chevron-up', 'bi-chevron-down');
const fnName = this.dataset.closeFn;
if (fnName && typeof window[fnName] === 'function') window[fnName]();
});
});
});
</script>

View File

@ -1,68 +1,76 @@
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:8pt;">
<thead>
<tr>
<td colspan="4" style='text-align:center'> Total </td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['primeNetteTotal'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['commissionTotal'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['commissionAutreTotal'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['accessoireTotal'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['taxeTotal'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['fraisCarteTotal'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['primeTtcTotal'])) ?></td>
</tr>
<div class="table-responsive shadow-sm border rounded">
<table class="table table-hover align-middle mb-0" style="font-size: 8.5pt;">
<thead class="table-dark">
<tr class="border-bottom-0">
<th colspan="4" class="text-center text-uppercase small py-3" style="letter-spacing: 1px;">
<i class="fa-solid fa-sigma me-2"></i><?= _("Total Général") ?>
</th>
<th class="text-center h6 mb-0"><?= format_N($this->nettoyer($beneficiaires_total['primeNetteTotal'])) ?></th>
<th class="text-center h6 mb-0"><?= format_N($this->nettoyer($beneficiaires_total['commissionTotal'])) ?></th>
<th class="text-center h6 mb-0"><?= format_N($this->nettoyer($beneficiaires_total['commissionAutreTotal'])) ?></th>
<th class="text-center h6 mb-0"><?= format_N($this->nettoyer($beneficiaires_total['accessoireTotal'])) ?></th>
<th class="text-center h6 mb-0"><?= format_N($this->nettoyer($beneficiaires_total['taxeTotal'])) ?></th>
<th class="text-center h6 mb-0"><?= format_N($this->nettoyer($beneficiaires_total['fraisCarteTotal'])) ?></th>
<th class="text-center h5 mb-0 text-warning"><?= format_N($this->nettoyer($beneficiaires_total['primeTtcTotal'])) ?></th>
</tr>
<tr class="bg-secondary bg-opacity-25 small text-uppercase">
<th class="text-center border-0 fw-bold"><?= _("Effet") ?></th>
<th class="text-center border-0 fw-bold" colspan="3"><?= _("Bénéficiaire") ?></th>
<th class="text-center border-0 fw-bold"><?= _("P. Nette") ?></th>
<th class="text-center border-0 fw-bold"><?= _("Com. Court") ?></th>
<th class="text-center border-0 fw-bold"><?= _("Com. Comm") ?></th>
<th class="text-center border-0 fw-bold"><?= _("Access.") ?></th>
<th class="text-center border-0 fw-bold"><?= (isset($_SESSION['composanteprime']['Taxes'])) ? _($_SESSION['composanteprime']['Taxes']) : _("Taxes") ?></th>
<th class="text-center border-0 fw-bold">
<?= (isset($_SESSION['composanteprime']['Cartes'])) ? _($_SESSION['composanteprime']['Cartes']) : _("Cartes") ?>
</th>
<th class="text-center border-0 fw-bold text-info"><?= _("Prime TTC") ?></th>
</tr>
</thead>
<tr>
<th style='text-align:center'> <?= _("Effet") ?> </th>
<th style='text-align:center' colspan="3" > <?= _("Bénéficiaire") ?> </th>
<th style='text-align:center'> <?= _("P Nette") ?> </th>
<th style='text-align:center'> <?= _("Com Court") ?> </th>
<th style='text-align:center'> <?= _("Com Commerc") ?> </th>
<th style='text-align:center'> <?= _("Acess") ?> </th>
<th style='text-align:center'> <?= (isset($_SESSION['composanteprime']['Taxes'])) ? _($_SESSION['composanteprime']['Taxes']) : _("Taxes") ?> </th>
<th style='text-align:center'>
<?php
if(isset($_SESSION['composanteprime']['Cartes']))
{
echo _($_SESSION['composanteprime']['Cartes']);
}
else
{
echo _("Cartes");
}
?>
</th>
<th style='text-align:center'> <?= _("Prime TTC") ?> </th>
</tr>
</thead>
<tbody>
<?php foreach ($beneficiaires as $beneficiaire): ?>
<tr class="border-bottom">
<td class="text-center text-muted small">
<?= dateLang($this->nettoyer($beneficiaire['dateEffet'])) ?>
</td>
<td class="text-center">
<span class="badge bg-light text-dark border fw-normal"><?= $this->nettoyer($beneficiaire['codeLienParente']) ?></span>
</td>
<td class="text-center fw-bold text-secondary"><?= $this->nettoyer($beneficiaire['numeroBeneficiaire']) ?></td>
<td>
<div class="fw-bold text-dark"><?= $this->nettoyer($beneficiaire['beneficiaire']) ?></div>
</td>
<td class="text-center text-monospace"><?= format_N($this->nettoyer($beneficiaire['primeNette'])) ?></td>
<td class="text-center text-monospace"><?= format_N($this->nettoyer($beneficiaire['commission'])) ?></td>
<td class="text-center text-monospace"><?= format_N($this->nettoyer($beneficiaire['commissionAutre'])) ?></td>
<td class="text-center text-monospace"><?= format_N($this->nettoyer($beneficiaire['accessoire'])) ?></td>
<td class="text-center text-monospace"><?= format_N($this->nettoyer($beneficiaire['taxe'])) ?></td>
<td class="text-center text-monospace"><?= format_N($this->nettoyer($beneficiaire['fraisCarte'])) ?></td>
<td class="text-center text-monospace fw-bold text-primary bg-primary bg-opacity-10">
<?= format_N($this->nettoyer($beneficiaire['primeTtc'])) ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<td colspan="4" style='text-align:center'> Total </td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['primeNetteTotal'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['commissionTotal'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['commissionAutreTotal'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['accessoireTotal'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['taxeTotal'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['fraisCarteTotal'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaires_total['primeTtcTotal'])) ?></td>
</tr>
</tfoot>
<tbody>
<?php foreach ($beneficiaires as $beneficiaire):
?>
<tr valign="top">
<td align='center'><?= dateLang($this->nettoyer($beneficiaire['dateEffet'])) ?></td>
<td align='center'> <?= $this->nettoyer($beneficiaire['codeLienParente']) ?></td>
<td align='center'> <?= $this->nettoyer($beneficiaire['numeroBeneficiaire']) ?></td>
<td><?= $this->nettoyer($beneficiaire['beneficiaire']) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaire['primeNette'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaire['commission'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaire['commissionAutre'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaire['accessoire'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaire['taxe'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaire['fraisCarte'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($beneficiaire['primeTtc'])) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<tfoot class="table-light">
<tr class="fw-bold">
<td colspan="4" class="text-end text-uppercase small pe-4"><?= _("Sous-Total") ?></td>
<td class="text-center"><?= format_N($this->nettoyer($beneficiaires_total['primeNetteTotal'])) ?></td>
<td class="text-center"><?= format_N($this->nettoyer($beneficiaires_total['commissionTotal'])) ?></td>
<td class="text-center"><?= format_N($this->nettoyer($beneficiaires_total['commissionAutreTotal'])) ?></td>
<td class="text-center"><?= format_N($this->nettoyer($beneficiaires_total['accessoireTotal'])) ?></td>
<td class="text-center"><?= format_N($this->nettoyer($beneficiaires_total['taxeTotal'])) ?></td>
<td class="text-center"><?= format_N($this->nettoyer($beneficiaires_total['fraisCarteTotal'])) ?></td>
<td class="text-center text-primary"><?= format_N($this->nettoyer($beneficiaires_total['primeTtcTotal'])) ?></td>
</tr>
</tfoot>
</table>
</div>
<style>
.text-monospace { font-family: 'Courier New', Courier, monospace; letter-spacing: -0.5px; }
.table thead th { vertical-align: middle; }
.table tbody tr:hover { background-color: rgba(0,0,0,0.03) !important; transition: 0.2s; }
</style>

View File

@ -0,0 +1,136 @@
<div id="div_facture_detail" class="mt-3">
<?php
$actVisible = "0"; //$_SESSION['actVisible'];
$AffectionVisible = "0"; //$_SESSION['AffectionVisible'];
// Gestion de la langue et de la confidentialité
if (est_anglophone()) {
$libelleAffection = $this->nettoyer($feuillemaladie['libelleAffectionEng']);
$raisonconsultation = $this->nettoyer($feuillemaladie['raisonconsultationEng']);
} else {
$libelleAffection = $this->nettoyer($feuillemaladie['libelleAffection']);
$raisonconsultation = $this->nettoyer($feuillemaladie['raisonconsultation']);
}
if($AffectionVisible != "1") {
$libelleAffection = $this->nettoyer($feuillemaladie['codeAffection']);
}
?>
<div class="d-flex align-items-center bg-success text-white p-2 rounded-top">
<i class="fa-solid fa-notes-medical me-2 ms-1"></i>
<span class="fw-bold text-uppercase small"><?= _("Informations sur la consultation") ?></span>
</div>
<div class="card border-0 shadow-sm rounded-0 rounded-bottom mb-4">
<div class="card-body bg-light">
<div class="row g-3 mb-3">
<div class="col-md-3">
<label class="extra-small text-muted text-uppercase fw-bold"><?= _("No Feuille") ?></label>
<div class="fw-bold border-bottom"><?= $this->nettoyer($feuillemaladie['numeroFeuilleMaladie']) ?></div>
</div>
<div class="col-md-2">
<label class="extra-small text-muted text-uppercase fw-bold"><?= _("Date Cons.") ?></label>
<div class="fw-bold border-bottom"><?= dateLang($this->nettoyer($feuillemaladie['dateConsultation'])) ?></div>
</div>
<div class="col-md-4">
<label class="extra-small text-muted text-uppercase fw-bold"><?= _("Prestataire") ?></label>
<div class="fw-bold border-bottom text-truncate"><?= $this->nettoyer($feuillemaladie['prestataire']) ?></div>
</div>
<div class="col-md-3">
<label class="extra-small text-muted text-uppercase fw-bold"><?= _("Médecin") ?></label>
<div class="fw-bold border-bottom"><?= $this->nettoyer($feuillemaladie['medecinConsultation']) ?></div>
</div>
</div>
<div class="row g-2 p-2 bg-white rounded border mb-3">
<?php
$bons = [
'Cons.' => $feuillemaladie['numeroBonConsultation'],
'Phar.' => $feuillemaladie['numeroBonOrdonnance'],
'Hosp.' => $feuillemaladie['numeroBonHospitalisation'],
'Opt.' => $feuillemaladie['numeroBonOptique'],
'Exam.' => $feuillemaladie['numeroBonExamen'],
'Kine.' => $feuillemaladie['numeroBonKine']
];
foreach($bons as $lbl => $val): ?>
<div class="col-md-2">
<div class="p-1 border rounded bg-light text-center">
<div class="extra-small text-muted fw-bold"><?= $lbl ?></div>
<div class="small fw-bold"><?= $this->nettoyer($val) ?: '-' ?></div>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="row g-3">
<div class="col-md-4 border-end">
<label class="extra-small text-muted text-uppercase fw-bold"><?= _("Raison Consultation") ?></label>
<div class="small italic text-secondary"><?= $raisonconsultation ?></div>
</div>
<div class="col-md-8">
<label class="extra-small text-muted text-uppercase fw-bold"><?= _("Affection Principale") ?></label>
<div class="p-2 bg-white border rounded fw-bold text-success text-center">
<i class="fa-solid fa-disease me-2"></i><?= $libelleAffection ?>
</div>
</div>
</div>
</div>
</div>
<div class="table-responsive shadow-sm">
<table class="table table-hover align-middle border mb-0" style="font-size: 0.8rem;">
<thead class="table-secondary">
<tr>
<th class="ps-3"><?= _("Date Diagnostic") ?></th>
<th><?= _("Diagnostic détaillé") ?></th>
<th class="text-center"><?= _("Saisi par") ?></th>
<th class="text-center bg-light border-start" colspan="2"><?= _("Historique Suppression") ?></th>
</tr>
<tr class="extra-small text-uppercase text-muted bg-light">
<th colspan="3"></th>
<th class="text-center border-start"><?= _("Utilisateur") ?></th>
<th class="text-center"><?= _("Date/Heure") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($diagnostics as $diagnostic):
$isSupprime = ($this->nettoyer($diagnostic['supprime']) == '1');
$rowStyle = $isSupprime ? 'style="background-color: #fff5f5; opacity: 0.7;"' : '';
$codeAff = $this->nettoyer($diagnostic['codeAffection']);
$libAff = est_anglophone() ? $this->nettoyer($diagnostic['libelleAffectionEng']) : $this->nettoyer($diagnostic['libelleAffection']);
if($AffectionVisible != "1") { $libAff = $codeAff; }
else { $libAff .= " <span class='badge bg-light text-dark border'>$codeAff</span>"; }
?>
<tr <?= $rowStyle ?>>
<td class="ps-3">
<?= dateheureLang($this->nettoyer($diagnostic['dateSysteme'])) ?>
</td>
<td>
<?php if($isSupprime): ?><i class="fa-solid fa-ban text-danger me-2"></i><del><?php endif; ?>
<?= $libAff ?>
<?php if($isSupprime): ?></del><?php endif; ?>
</td>
<td class="text-center fw-bold text-muted">
<?= $this->nettoyer($diagnostic['codeUtilisateur']) ?>
</td>
<td class="text-center border-start text-danger small">
<?= $this->nettoyer($diagnostic['userSuppression']) ?>
</td>
<td class="text-center text-danger small">
<?= dateheureLang($this->nettoyer($diagnostic['heueSuppression'])) ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<style>
.extra-small { font-size: 0.65rem; }
.italic { font-style: italic; }
.bg-light { background-color: #f8f9fa !important; }
</style>

View File

@ -0,0 +1,75 @@
<div id="div_facture_detail" class="mt-3">
<div id="div_ged">
<div class="card border-0 shadow-sm">
<div class="card-header bg-dark text-white py-2 d-flex justify-content-between align-items-center">
<span class="fw-bold small text-uppercase">
<i class="fa-solid fa-folder-tree me-2"></i><?= _("Documents joints au dossier") ?>
</span>
<span class="badge bg-secondary"><?= count($geds) ?> <?= _("Fichier(s)") ?></span>
</div>
<div class="table-responsive">
<table class="table table-hover align-middle mb-0">
<thead class="table-light">
<tr>
<th width="20%" class="text-center small text-muted text-uppercase"><?= _("Date d'ajout") ?></th>
<th class="small text-muted text-uppercase"><?= _("Nom du document") ?></th>
<th width="15%" class="text-center small text-muted text-uppercase"><?= _("Action") ?></th>
</tr>
</thead>
<tbody>
<?php if (empty($geds)): ?>
<tr>
<td colspan="3" class="text-center py-4 text-muted small italic">
<i class="fa-solid fa-circle-info me-2"></i><?= _("Aucun document numérisé pour cette facture.") ?>
</td>
</tr>
<?php else: ?>
<?php foreach ($geds as $ged):
$idGed = $this->nettoyer($ged['idGed']);
$cheminFichier = $this->nettoyer($ged['cheminFichier']);
$nomFichier = $this->nettoyer($ged['nomOrigine']);
// Détection de l'icône selon l'extension
$extension = strtolower(pathinfo($nomFichier, PATHINFO_EXTENSION));
$icon = "fa-file-lines";
if(in_array($extension, ['jpg', 'jpeg', 'png'])) $icon = "fa-file-image text-info";
if($extension == 'pdf') $icon = "fa-file-pdf text-danger";
?>
<tr>
<td class="text-center">
<div class="small fw-bold text-dark"><?= dateLang($this->nettoyer($ged['dateSysteme'])) ?></div>
<div class="extra-small text-muted"><?= date('H:i', strtotime($ged['dateSysteme'])) ?></div>
</td>
<td>
<div class="d-flex align-items-center">
<i class="fa-solid <?= $icon ?> fs-4 me-3"></i>
<div class="text-truncate" style="max-width: 400px;">
<span class="fw-bold d-block small mb-0"><?= $nomFichier ?></span>
<span class="extra-small text-muted">ID: #<?= $idGed ?></span>
</div>
</div>
</td>
<td class="text-center">
<a href="<?= $cheminFichier ?>"
target="_blank"
class="btn btn-sm btn-outline-primary rounded-pill px-3 shadow-sm"
title="<?= _("Visualiser le document") ?>">
<i class="fa-solid fa-download me-1"></i> <?= _("Ouvrir") ?>
</a>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<style>
.extra-small { font-size: 0.7rem; }
.italic { font-style: italic; }
.table-hover tbody tr:hover { background-color: rgba(0,0,0,0.02); }
</style>

View File

@ -0,0 +1,162 @@
<div id="div_consulter_facture_pop" class="p-2 bg-light">
<div class="card border-0 shadow-sm mb-3">
<div class="card-header bg-white py-2">
<div class="row align-items-center">
<div class="col-md-4">
<span class="text-muted small text-uppercase fw-bold"><?= _("ID Facture") ?> :</span>
<span class="h6 mb-0 text-primary ms-2"><?= $this->nettoyer($facture['idFacture']) ?></span>
</div>
<div class="col-md-4 text-center">
<span class="badge bg-primary px-3 rounded-pill"><?= $this->nettoyer($facture['etatfacture']) ?></span>
</div>
<div class="col-md-4 text-end small">
<span class="text-muted"><?= _("Saisie par") ?> :</span>
<span class="fw-bold"><?= $this->nettoyer($facture['codeUtilisateur']) ?></span>
</div>
</div>
</div>
<div class="card-body py-3">
<div class="row g-3">
<div class="col-md-3">
<label class="small text-muted mb-1"><?= _("Bénéficiaire") ?></label>
<div class="fw-bold border-bottom pb-1"><?= $this->nettoyer($facture['numeroBeneficiaire']) ?> - <?= $this->nettoyer($facture['beneficiaire']) ?></div>
</div>
<div class="col-md-3">
<label class="small text-muted mb-1"><?= _("Adhérent / Police") ?></label>
<div class="text-truncate small fw-bold"><?= $this->nettoyer($facture['adherent']) ?></div>
<div class="extra-small text-muted">Pol: <?= $this->nettoyer($facture['numeroPolice']) ?> | Cat: <?= $this->nettoyer($facture['codeProduit']) ?></div>
</div>
<div class="col-md-3">
<label class="small text-muted mb-1"><?= _("Prestataire") ?></label>
<div class="fw-bold text-primary small"><?= $this->nettoyer($facture['prestataire']) ?></div>
</div>
<div class="col-md-3">
<label class="small text-muted mb-1"><?= _("Contact Adhérent") ?></label>
<div class="small text-truncate"><?= $this->nettoyer($facture['emailAdherent']) ?></div>
<div class="small fw-bold"><?= $this->nettoyer($facture['telAdherent']) ?></div>
</div>
</div>
</div>
</div>
<div class="row g-3 mb-3">
<div class="col-md-8">
<div class="card border-0 shadow-sm h-100">
<div class="card-body">
<h6 class="card-title small fw-bold text-uppercase border-bottom pb-2 mb-3"><i class="fa-solid fa-calculator me-2"></i><?= _("Décompte Financier") ?></h6>
<div class="row text-center g-2">
<div class="col-3">
<div class="small text-muted italic"><?= _("Frais Réels") ?></div>
<div class="fw-bold"><?= format_N($this->nettoyer($facture['fraisReel'])) ?></div>
</div>
<div class="col-3 border-start">
<div class="small text-muted"><?= _("Ticket Modérateur") ?></div>
<div class="fw-bold text-danger"><?= format_N($this->nettoyer($facture['montantTm'])) ?></div>
</div>
<div class="col-3 border-start">
<div class="small text-muted"><?= _("Dépassement") ?></div>
<div class="fw-bold text-warning"><?= format_N($this->nettoyer($facture['fraisExclu'])) ?></div>
</div>
<div class="col-3 border-start">
<div class="small text-muted"><?= _("A Rembourser") ?></div>
<div class="h6 mb-0 fw-bold text-success"><?= format_N($this->nettoyer($facture['montantArembourser'])) ?></div>
</div>
</div>
<hr class="my-3 opacity-10">
<div class="row text-center g-2">
<div class="col-3">
<div class="small text-muted"><?= _("Retenu") ?></div>
<div class="fw-bold small text-muted"><?= format_N($this->nettoyer($facture['fraisRetenu'])) ?></div>
</div>
<div class="col-3">
<div class="small text-muted"><?= _("Redressé") ?></div>
<div class="fw-bold small"><?= format_N($this->nettoyer($facture['montantRedresse'])) ?></div>
</div>
<div class="col-3 border-start bg-light rounded py-1">
<div class="small text-muted fw-bold"><?= _("Net à Payer") ?></div>
<div class="h6 mb-0 fw-bold text-primary"><?= format_N($this->nettoyer($facture['montantApayer'])) ?></div>
</div>
<div class="col-3 border-start bg-primary bg-opacity-10 rounded py-1">
<div class="small text-primary fw-bold"><?= _("Montant Payé") ?></div>
<div class="h6 mb-0 fw-bold text-primary"><?= format_N($this->nettoyer($facture['montantPaye'])) ?></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card border-0 shadow-sm h-100">
<div class="card-body">
<h6 class="card-title small fw-bold text-uppercase border-bottom pb-2 mb-3"><?= _("Indicateurs") ?></h6>
<ul class="list-group list-group-flush small">
<li class="list-group-item d-flex justify-content-between px-0 py-1 border-0">
<span><?= _("Tiers-Payant") ?></span>
<span><?= ($facture['tiersPayant']=="1") ? '<i class="fa-solid fa-square-check text-success fs-5"></i>' : '<i class="fa-solid fa-square text-muted opacity-25 fs-5"></i>' ?></span>
</li>
<li class="list-group-item d-flex justify-content-between px-0 py-1 border-0">
<span><?= _("Gestion Conf.") ?></span>
<span><?= ($facture['gc']=="1") ? '<i class="fa-solid fa-square-check text-info fs-5"></i>' : '<i class="fa-solid fa-square text-muted opacity-25 fs-5"></i>' ?></span>
</li>
<li class="list-group-item d-flex justify-content-between px-0 py-1 border-0 border-top mt-2">
<span class="text-muted small"><?= _("N° Décompte") ?></span>
<span class="fw-bold"><?= $this->nettoyer($facture['numeroDecompte']) ?></span>
</li>
<li class="list-group-item d-flex justify-content-between px-0 py-1 border-0">
<span class="text-muted small"><?= _("N° Lot") ?></span>
<span class="fw-bold"><?= $this->nettoyer($facture['numeroLotDecompte']) ?></span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="card border-0 shadow-sm mb-4">
<div class="card-body py-2">
<div class="row align-items-center text-center small">
<div class="col-md-3">
<span class="text-muted"><?= _("Saisie le") ?> :</span>
<span class="fw-bold ms-1"><?= dateheureLang($this->nettoyer($facture['dateSysteme'])) ?></span>
</div>
<div class="col-md-3 border-start">
<span class="text-muted"><?= _("Vérifié par") ?> :</span>
<span class="fw-bold ms-1"><?= $this->nettoyer($facture['userControle']) ?></span>
</div>
<div class="col-md-3 border-start">
<span class="text-muted"><?= _("Date Décompte") ?> :</span>
<span class="fw-bold ms-1"><?= dateLang($this->nettoyer($facture['dateDecompte'])) ?></span>
</div>
<div class="col-md-3 border-start">
<span class="text-muted"><?= _("Règlement") ?> :</span>
<span class="fw-bold ms-1 text-success"><?= dateheureLang($this->nettoyer($facture['heureReglement'])) ?></span>
</div>
</div>
</div>
</div>
<!--
<div class="d-flex flex-wrap justify-content-center gap-2">
<button type="button" class="btn btn-outline-info flex-grow-1 shadow-sm" onclick="consulterfacturefeuillemaladie_pop();">
<i class="fa-solid fa-file-medical me-2"></i><?= _("Feuille Maladie") ?>
</button>
<button type="button" class="btn btn-outline-info flex-grow-1 shadow-sm" onclick="consulterfactureprestationactes_pop();">
<i class="fa-solid fa-stethoscope me-2"></i><?= _("Prestations") ?>
</button>
<button type="button" class="btn btn-outline-info flex-grow-1 shadow-sm" onclick="consulterfacturemedicaments_pop();">
<i class="fa-solid fa-pills me-2"></i><?= _("Médicaments") ?>
</button>
<button type="button" class="btn btn-outline-info flex-grow-1 shadow-sm" onclick="consulterfactureverres_pop();">
<i class="fa-solid fa-glasses me-2"></i><?= _("Verres") ?>
</button>
<button type="button" class="btn btn-outline-dark flex-grow-1 shadow-sm" onclick="consulterfactureged_pop();">
<i class="fa-solid fa-folder-open me-2"></i><?= _("GED (Documents)") ?>
</button>
</div>
-->
</div>
<style>
.extra-small { font-size: 0.65rem; }
.italic { font-style: italic; }
.card-header { border-bottom: 1px solid rgba(0,0,0,0.05); }
#div_consulter_facture_pop label { font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
</style>

View File

@ -0,0 +1,85 @@
<div id="div_facture_detail" class="mt-3">
<?php $actVisible = "0"; //$_SESSION['actVisible']; ?>
<div class="d-flex align-items-center bg-primary text-white p-2 rounded-top shadow-sm">
<i class="fa-solid fa-pills me-2 ms-1"></i>
<span class="fw-bold text-uppercase small"><?= _("Médicaments Livrés") ?></span>
</div>
<div class="table-responsive shadow-sm border rounded-bottom">
<table class="table table-hover align-middle mb-0" style="font-size: 0.85rem;">
<thead class="table-light">
<tr class="text-uppercase small">
<th width="12%" class="ps-3"><?= _("Date") ?></th>
<th><?= _("Désignation Médicament") ?></th>
<th class="text-center"><?= _("PU") ?></th>
<th class="text-center"><?= _("Qté") ?></th>
<th class="text-end"><?= _("Frais Réels") ?></th>
<th class="text-end"><?= _("T.M") ?></th>
<th class="text-end pe-3"><?= _("A Rembourser") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($medicaments as $medicament):
$entente = $this->nettoyer($medicament['ententePrealable']);
$libelle = $this->nettoyer($medicament['libelleMedicament']);
$code = $this->nettoyer($medicament['codeMedicament']);
if($actVisible != "1") { $libelle = $code; }
// Logique de statut pour l'entente préalable
$statusLabel = "";
$rowClass = "";
switch($entente) {
case '1': // Accordé
$statusLabel = '<span class="badge bg-success-subtle text-success border border-success-subtle me-2" title="'._("Accordé").'"><i class="fa-solid fa-check"></i></span>';
break;
case '2': // En attente / Attention
$statusLabel = '<span class="badge bg-warning-subtle text-warning-emphasis border border-warning-subtle me-2" title="'._("En attente").'"><i class="fa-solid fa-clock"></i></span>';
break;
case '9': // Refusé
$statusLabel = '<span class="badge bg-danger text-white me-2" title="'._("Refusé").'"><i class="fa-solid fa-xmark"></i></span>';
$rowClass = "table-danger opacity-75";
break;
}
?>
<tr class="<?= $rowClass ?>">
<td class="ps-3 small text-muted">
<?= dateheureLang($this->nettoyer($medicament['dateSysteme'])) ?>
</td>
<td>
<div class="d-flex align-items-center">
<?= $statusLabel ?>
<div>
<div class="fw-bold"><?= $libelle ?></div>
<?php if($actVisible == "1"): ?>
<div class="extra-small text-muted fw-normal">Code: <?= $code ?></div>
<?php endif; ?>
</div>
</div>
</td>
<td class="text-center text-monospace small"><?= format_N($this->nettoyer($medicament['valeurActe'])) ?></td>
<td class="text-center fw-bold fw-bold"><?= $this->nettoyer($medicament['quantite']) ?></td>
<td class="text-end text-monospace"><?= format_N($this->nettoyer($medicament['fraisReel'])) ?></td>
<td class="text-end text-monospace text-danger"><?= format_N($this->nettoyer($medicament['montantTm'])) ?></td>
<td class="text-end text-monospace fw-bold text-primary pe-3">
<?= format_N($this->nettoyer($medicament['montantArembourser'])) ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="mt-2 d-flex gap-3 extra-small text-muted ms-1">
<span><i class="fa-solid fa-check text-success"></i> Accordé</span>
<span><i class="fa-solid fa-clock text-warning"></i> En attente</span>
<span><i class="fa-solid fa-xmark text-danger"></i> Refusé / Hors panier</span>
</div>
</div>
<style>
.extra-small { font-size: 0.7rem; }
.text-monospace { font-family: 'Courier New', Courier, monospace; }
</style>

View File

@ -0,0 +1,105 @@
<div id="div_facture_detail" class="mt-3">
<?php $actVisible = "0"; //$_SESSION['actVisible']; ?>
<div class="d-flex align-items-center bg-primary text-white p-2 rounded-top shadow-sm" style="background: linear-gradient(45deg, #0d6efd, #004085);">
<i class="fa-solid fa-hand-holding-medical me-2 ms-1"></i>
<span class="fw-bold text-uppercase small"><?= _("Prestations de la facture") ?></span>
</div>
<div class="table-responsive shadow-sm border rounded-bottom bg-white">
<table class="table table-hover align-middle mb-0" style="font-size: 0.85rem;">
<thead class="table-light">
<tr class="text-uppercase small text-muted">
<th width="12%" class="ps-3 text-center"><?= _("Date / Heure") ?></th>
<th width="8%" class="text-center"><?= _("Type") ?></th>
<th><?= _("Désignation de l'acte") ?></th>
<th class="text-center"><?= _("P.U / Valeur") ?></th>
<th class="text-center"><?= _("Qté") ?></th>
<th class="text-end"><?= _("Frais Réels") ?></th>
<th class="text-end"><?= _("Part Patient") ?></th>
<th class="text-end text-primary fw-bold"><?= _("A Rembourser") ?></th>
<th width="5%" class="text-center pe-3">Val.</th>
</tr>
</thead>
<tbody>
<?php foreach ($prestations as $prestation):
$codeType = $this->nettoyer($prestation['codeTypePrestation']);
$entente = $this->nettoyer($prestation['ententePrealable']);
$auto = $this->nettoyer($prestation['autorisation']);
$valide = $this->nettoyer($prestation['valide']);
$codeActe = $this->nettoyer($prestation['codeActe']);
$libelleActe = est_anglophone() ? $this->nettoyer($prestation['libelleActeEng']) : $this->nettoyer($prestation['libelleActe']);
if($actVisible != "1") { $libelleActe = $codeActe; }
// Logique de statut (Entente ou Autorisation)
$rowClass = "";
$statusIcon = "";
if($entente == '9' || $auto == '9') {
$rowClass = "table-danger opacity-75";
$statusIcon = '<i class="fa-solid fa-circle-xmark text-danger me-2" title="'._("Refusé").'"></i>';
} elseif($entente == '2' || $auto == '2') {
$rowClass = "table-warning bg-opacity-10";
$statusIcon = '<i class="fa-solid fa-circle-exclamation text-warning me-2" title="'._("En attente").'"></i>';
} elseif($entente == '1' || $auto == '1') {
$statusIcon = '<i class="fa-solid fa-circle-check text-success me-2" title="'._("Accordé").'"></i>';
}
?>
<tr class="<?= $rowClass ?>">
<td class="ps-3 text-center small text-muted">
<?= dateheureLang($this->nettoyer($prestation['dateSysteme'])) ?>
</td>
<td class="text-center">
<span class="badge bg-secondary-subtle text-dark border fw-normal small"><?= $codeType ?></span>
</td>
<td>
<div class="d-flex align-items-center">
<?= $statusIcon ?>
<div class="text-truncate" style="max-width: 300px;">
<span class="fw-bold"><?= $libelleActe ?></span>
<?php if($actVisible == "1"): ?>
<div class="extra-small text-muted italic">Code: <?= $codeActe ?></div>
<?php endif; ?>
</div>
</div>
</td>
<td class="text-center text-monospace small"><?= format_N($this->nettoyer($prestation['valeurActe'])) ?></td>
<td class="text-center fw-bold"><?= $this->nettoyer($prestation['quantite']) ?></td>
<td class="text-end text-monospace"><?= format_N($this->nettoyer($prestation['fraisReel'])) ?></td>
<td class="text-end text-monospace text-danger small"><?= format_N($this->nettoyer($prestation['montantTm'])) ?></td>
<td class="text-end text-monospace fw-bold text-primary">
<?= format_N($this->nettoyer($prestation['montantArembourser'])) ?>
</td>
<td class="text-center pe-3">
<?php if($valide == '1'): ?>
<i class="fa-solid fa-shield-check text-success fs-5"></i>
<?php else: ?>
<span class="text-muted small"><?= $valide ?></span>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="mt-2 d-flex justify-content-between align-items-center px-1">
<div class="d-flex gap-3 extra-small text-muted">
<span><i class="fa-solid fa-circle-check text-success"></i> <?= _("Accordé / Autorisé") ?></span>
<span><i class="fa-solid fa-circle-exclamation text-warning"></i> <?= _("En attente") ?></span>
<span><i class="fa-solid fa-circle-xmark text-danger"></i> <?= _("Refusé") ?></span>
</div>
<div class="extra-small italic text-muted">
<i class="fa-solid fa-info-circle me-1"></i><?= _("Les montants sont exprimés en monnaie locale.") ?>
</div>
</div>
</div>
<style>
.extra-small { font-size: 0.7rem; }
.text-monospace { font-family: 'Courier New', Courier, monospace; }
.italic { font-style: italic; }
.table-hover tbody tr:hover { background-color: rgba(13, 110, 253, 0.05) !important; }
</style>

View File

@ -0,0 +1,74 @@
<div id="div_facture_detail" class="mt-3">
<?php
$actVisible = "0"; // Force à 0 selon votre code, ou utiliser $_SESSION['actVisible']
?>
<div class="d-flex align-items-center bg-info text-white p-2 rounded-top shadow-sm" style="background: linear-gradient(45deg, #0dcaf0, #0aa2c0);">
<i class="fa-solid fa-glasses me-2 ms-1"></i>
<span class="fw-bold text-uppercase small"><?= _("Équipements Optiques / Verres") ?></span>
</div>
<div class="table-responsive shadow-sm border rounded-bottom bg-white">
<table class="table table-hover align-middle mb-0" style="font-size: 0.85rem;">
<thead class="table-light">
<tr class="text-uppercase small text-muted">
<th width="20%" class="ps-3 text-center"><?= _("Date de livraison") ?></th>
<th><?= _("Description des verres") ?></th>
<th width="15%" class="text-end pe-3"><?= _("Valeur (Tarif)") ?></th>
</tr>
</thead>
<tbody>
<?php if (empty($verres)): ?>
<tr>
<td colspan="3" class="text-center py-4 text-muted small italic">
<i class="fa-solid fa-circle-info me-2"></i><?= _("Aucun verre enregistré sur cette facture.") ?>
</td>
</tr>
<?php else: ?>
<?php foreach ($verres as $verre):
$libelleVerre = $this->nettoyer($verre['libelleVerre']);
$codeOptique = $this->nettoyer($verre['codeOptique']);
// Gestion de la confidentialité (Masquage du libellé si actVisible != 1)
if($actVisible != "1") {
$displayTitle = $codeOptique;
$subTitle = "";
} else {
$displayTitle = $libelleVerre;
$subTitle = '<div class="extra-small text-muted italic">Code: '.$codeOptique.'</div>';
}
?>
<tr>
<td class="ps-3 text-center">
<div class="small fw-bold"><?= dateLang($this->nettoyer($verre['dateSysteme'])) ?></div>
<div class="extra-small text-muted"><?= date('H:i', strtotime($verre['dateSysteme'])) ?></div>
</td>
<td>
<div class="d-flex align-items-center">
<div class="bg-info bg-opacity-10 p-2 rounded me-3">
<i class="fa-solid fa-eye text-info"></i>
</div>
<div>
<span class="fw-bold d-block"><?= $displayTitle ?></span>
<?= $subTitle ?>
</div>
</div>
</td>
<td class="text-end pe-3 text-monospace fw-bold text-primary">
<?= format_N($this->nettoyer($verre['valeurActe'])) ?>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<style>
.extra-small { font-size: 0.7rem; }
.text-monospace { font-family: 'Courier New', Courier, monospace; }
.italic { font-style: italic; }
/* Animation légère au survol */
.table-hover tbody tr:hover { background-color: rgba(13, 202, 240, 0.05) !important; transition: 0.2s; }
</style>

View File

@ -1,62 +1,70 @@
<div id="div_dossiers">
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:8pt;">
<thead>
<tr>
<th style='text-align:center'> Type </th>
<th style='text-align:center'> <?= _("No Bon") ?> </th>
<th style='text-align:center'> <?= _("Id Fact") ?> </th>
<th style='text-align:center'> Date </th>
<th> <?= _("Prestataire") ?> </th>
<th> <?= _("Bénéficiaire") ?> </th>
<th style='text-align:center'> <?= _("Frais") ?> </th>
<th style='text-align:center'> <?= _("T M") ?> </th>
<th style='text-align:center'> <?= _("A Remb") ?> </th>
<th style='text-align:center'> <?= _("Dépas") ?> </th>
<th style='text-align:center'> <?= _("Ret") ?> </th>
</tr>
</thead>
<tbody>
<?php foreach ($factures as $facture):
$idFacture=$this->nettoyer($facture['idFacture']);
$numeroFeuilleMaladie=$this->nettoyer($facture['numeroFeuilleMaladie']);
$tiersPayant = $facture['tiersPayant'];
$codeTypeFacture = $this->nettoyer($facture['codeTypeFacture']);
<div id="div_dossiers" class="card shadow-sm border-0">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0" style="font-size: 0.85rem;">
<thead class="table-dark">
<tr>
<th class="ps-3"><?= _("Type") ?></th>
<th><?= _("Référence / Bon") ?></th>
<th class="text-center"><?= _("ID Fact") ?></th>
<th><?= _("Date") ?></th>
<th><?= _("Prestataire / Bénéficiaire") ?></th>
<th class="text-end"><?= _("Frais Réel") ?></th>
<th class="text-end"><?= _("Part Patient (TM)") ?></th>
<th class="text-end text-warning"><?= _("A Rembourser") ?></th>
<th class="text-end pe-3 small text-uppercase opacity-75"><?= _("Exclu/Ret") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($factures as $facture):
$idFacture = $this->nettoyer($facture['idFacture']);
$codeType = $this->nettoyer($facture['codeTypeFacture']);
// Définition des couleurs par type
$badgeClass = "bg-secondary";
switch($codeType) {
case 'PHAR': $badgeClass = "bg-success"; break;
case 'OPT' : $badgeClass = "bg-info text-dark"; break;
case 'LAB' : $badgeClass = "bg-warning text-dark"; break;
case 'SEA' : $badgeClass = "bg-primary"; break;
}
$numeroBon = $this->nettoyer($facture['numeroBonConsultation']);
if($codeTypeFacture=="PHAR")
{
$numeroBon = $this->nettoyer($facture['numeroBonOrdonnance']);
}
elseif($codeTypeFacture=="OPT")
{
$numeroBon = $this->nettoyer($facture['numeroBonOptique']);
}
elseif($codeTypeFacture=="LAB")
{
$numeroBon = $this->nettoyer($facture['numeroBonExamen']);
}
elseif($codeTypeFacture=="SEA")
{
$numeroBon = $this->nettoyer($facture['numeroBonKine']);
}
?>
<tr valign="top">
<td align='center'> <?= $codeTypeFacture ?> </td>
<td align='center'> <?= $numeroBon ?> </td>
<td align='center'> <?= $idFacture ?> </td>
<td align='center'><?= dateheureLang($this->nettoyer($facture['dateSysteme'])) ?></td>
<td><?= $this->nettoyer($facture['prestataire']) ?></td>
<td><?= $this->nettoyer($facture['beneficiaire']) ?></td>
<td align='center'><?= format_N($this->nettoyer($facture['fraisReel'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($facture['montantTm'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($facture['montantArembourser'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($facture['fraisExclu'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($facture['fraisRetenu'])) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
// Logique du numéro de bon
$numeroBon = $this->nettoyer($facture['numeroBonConsultation']);
if($codeType=="PHAR") $numeroBon = $this->nettoyer($facture['numeroBonOrdonnance']);
elseif($codeType=="OPT") $numeroBon = $this->nettoyer($facture['numeroBonOptique']);
elseif($codeType=="LAB") $numeroBon = $this->nettoyer($facture['numeroBonExamen']);
elseif($codeType=="SEA") $numeroBon = $this->nettoyer($facture['numeroBonKine']);
?>
<tr>
<td class="ps-3">
<span class="badge <?= $badgeClass ?> w-100"><?= $codeType ?></span>
</td>
<td>
<small class="fw-bold text-muted"><?= $numeroBon ?></small>
</td>
<td class="text-center">
<button class="btn btn-sm btn-outline-primary py-0" style="font-size: 0.75rem;"
onClick="consulter_facture_pop('<?= $idFacture ?>');">
<i class="fa-solid fa-magnifying-glass me-1"></i><?= $idFacture ?>
</button>
</td>
<td>
<div class="small lh-1"><?= dateheureLang($this->nettoyer($facture['dateSysteme'])) ?></div>
</td>
<td>
<div class="fw-bold text-truncate" style="max-width: 200px;"><?= $this->nettoyer($facture['prestataire']) ?></div>
<div class="small text-muted italic">👤 <?= $this->nettoyer($facture['beneficiaire']) ?></div>
</td>
<td class="text-end text-monospace fw-bold"><?= format_N($this->nettoyer($facture['fraisReel'])) ?></td>
<td class="text-end text-monospace text-danger small"><?= format_N($this->nettoyer($facture['montantTm'])) ?></td>
<td class="text-end text-monospace fw-bold text-primary"><?= format_N($this->nettoyer($facture['montantArembourser'])) ?></td>
<td class="text-end pe-3">
<div class="small text-muted text-monospace"><?= format_N($this->nettoyer($facture['fraisExclu'])) ?></div>
<div class="small text-muted text-monospace border-top pt-1"><?= format_N($this->nettoyer($facture['fraisRetenu'])) ?></div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>

View File

@ -0,0 +1,80 @@
<div id="div_menu_profil">
<div class="row">
<div id="div_utilisateur_profil_1" class="col-6" >
<legend> <?= _("Boutons invisibles")." (".format_N(count($menus_non_accessibles)).")" ?> </legend>
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:10pt;">
<thead>
<tr>
<th style='text-align:center'> <?= _("Désignation")?> </th>
<th style='text-align:center'> => </th>
</tr>
<tr>
<th colspan="2"> <button type="button" style="font-size:10pt;" class="form-control btn btn-primary" onclick="javascript:ajouter_tous_menu_vue_module_assureur();" > <?= _("Ajouter tous") . " ==>" ?> </button> </th>
</tr>
</thead>
<tbody>
<?php foreach ($menus_non_accessibles as $menus_non_accessible):
$codeMenu = $menus_non_accessible['codeMenu'];
if (est_anglophone())
{
$libeleMenu = $menus_non_accessible['libelleEng'];
}
else
{
$libeleMenu = $menus_non_accessible['libeleMenu'];
}
?>
<tr valign="top">
<td align='center'><?= $libeleMenu ?></td>
<td align='center'> <input type="button" value="=>" onClick="javascript:ajouter_un_menu_vue_module_assureur('<?=$codeMenu?>');" ></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div id="div_utilisateur_profil_2" class="col-6" >
<legend> <?= _("Boutons visibles")." (".format_N(count($menus_accessibles)).")" ?> </legend>
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:10pt;">
<thead>
<tr>
<th style='text-align:center'> <= </th>
<th style='text-align:center'> <?= _("Désignation")?> </th>
</tr>
<tr>
<th colspan="2"> <button type="button" style="font-size:10pt;" class="form-control btn btn-primary" onclick="javascript:retirer_tous_menu_vue_module_assureur();" > <?= "<== " . _("Retirer tous") ?> </button> </th>
</tr>
</thead>
<tbody>
<?php foreach ($menus_accessibles as $menus_accessible):
$codeMenu = $menus_accessible['codeMenu'];
if (est_anglophone())
{
$libeleMenu = $menus_accessible['libelleEng'];
}
else
{
$libeleMenu = $menus_accessible['libeleMenu'];
}
?>
<tr valign="top">
<td align='center'> <input type="button" value="<=" onClick="javascript:retirer_un_menu_vue_module_assureur('<?=$codeMenu?>');" ></td>
<td align='center'><?= $libeleMenu ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>

View File

@ -0,0 +1 @@
OK ajouterunsousmenusass

111
Vue/Ajaxhabilitation/index.php Executable file
View File

@ -0,0 +1,111 @@
<div id="div_menu_profil" class="animate__animated animate__fadeIn">
<div class="row g-4">
<div id="div_utilisateur_profil_1" class="col-md-6">
<div class="card h-100 shadow-sm border-danger-subtle">
<div class="card-header bg-danger-subtle text-danger d-flex justify-content-between align-items-center py-3">
<h6 class="mb-0 fw-bold"><i class="fas fa-lock me-2"></i><?= _("Menus non accessibles") ?></h6>
<span class="badge bg-danger rounded-pill"><?= count($menus_non_accessibles) ?></span>
</div>
<div class="p-2 border-bottom bg-light">
<button type="button" class="btn btn-sm btn-outline-danger w-100 fw-bold shadow-xs"
onclick="javascript:ajouter_tous_menus_principal_profil_rh();">
<?= _("Tout ajouter") ?> <i class="fas fa-angle-double-right ms-1"></i>
</button>
</div>
<div class="table-responsive" style="max-height: 400px; overflow-y: auto;">
<table class="table table-hover align-middle mb-0">
<tbody class="small">
<?php foreach ($menus_non_accessibles as $m):
$codeMenu = $m['codeMenu'];
$libeleMenu = est_anglophone() ? $m['libelleEng'] : $m['libeleMenu'];
?>
<tr>
<td class="ps-3"><?= $libeleMenu ?></td>
<td class="text-end pe-3" width="50">
<button class="btn btn-sm btn-info text-white rounded-circle btn-transfer shadow-sm"
title="<?= _("Ajouter") ?>"
onClick="javascript:ajouter_un_menu_principal_profil_rh('<?=$codeMenu?>');">
<i class="fas fa-arrow-right"></i>
</button>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<div id="div_utilisateur_profil_2" class="col-md-6">
<div class="card h-100 shadow-sm border-success-subtle">
<div class="card-header bg-success-subtle text-success d-flex justify-content-between align-items-center py-3">
<h6 class="mb-0 fw-bold"><i class="fas fa-check-double me-2"></i><?= _("Menus accessibles") ?></h6>
<span class="badge bg-success rounded-pill"><?= count($menus_accessibles) ?></span>
</div>
<div class="p-2 border-bottom bg-light">
<button type="button" class="btn btn-sm btn-outline-success w-100 fw-bold shadow-xs"
onclick="javascript:retirer_tous_menus_principal_profil_rh();">
<i class="fas fa-angle-double-left me-1"></i> <?= _("Tout retirer") ?>
</button>
</div>
<div class="table-responsive" style="max-height: 400px; overflow-y: auto;">
<table class="table table-hover align-middle mb-0">
<tbody class="small">
<?php foreach ($menus_accessibles as $m):
$codeMenu = $m['codeMenu'];
$libeleMenu = est_anglophone() ? $m['libelleEng'] : $m['libeleMenu'];
?>
<tr>
<td class="ps-3" width="50">
<button class="btn btn-sm btn-warning text-white rounded-circle btn-transfer shadow-sm"
title="<?= _("Retirer") ?>"
onClick="javascript:retirer_un_menu_principal_profil_rh('<?=$codeMenu?>');">
<i class="fas fa-arrow-left"></i>
</button>
</td>
<td class="text-start"><?= $libeleMenu ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<style>
/* Effets de transfert */
.btn-transfer {
width: 28px;
height: 28px;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-transfer:hover {
transform: scale(1.2);
}
/* Scrollbar personnalisée */
.table-responsive::-webkit-scrollbar {
width: 6px;
}
.table-responsive::-webkit-scrollbar-thumb {
background: #dee2e6;
border-radius: 10px;
}
/* Ligne de tableau au survol */
.table-hover tbody tr:hover {
background-color: #f8f9fa !important;
}
.shadow-xs { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
</style>

View File

@ -0,0 +1,63 @@
<div id="div_police" class="p-3 bg-white rounded shadow-sm border">
<div class="row g-3 align-items-end">
<div class="col-md-7">
<label for="idPolice" class="form-label extra-small fw-bold text-muted text-uppercase mb-2">
<i class="fa-solid fa-circle-dot text-primary me-1"></i><?= _("Police d'Assurance cible") ?>
</label>
<div class="input-group border rounded-3 overflow-hidden shadow-sm transition-focus">
<span class="input-group-text bg-light border-0">
<i class="fa-solid fa-file-contract text-primary"></i>
</span>
<select class="form-select border-0 fw-bold text-dark"
id="idPolice"
name="idPolice"
required
onchange="javascript:ajax_contexter_police();"
style="font-size: 10pt; height: 45px;">
<?php liste_options($polices, "", false); ?>
</select>
</div>
</div>
<div class="col-md-5">
<button type="button"
class="btn btn-primary w-100 fw-bold shadow-sm d-flex align-items-center justify-content-center hover-lift"
onclick="javascript:ouvrir_vue('<?= $vue; ?>');"
style="height: 45px; border-radius: 8px;">
<i class="fas fa-external-link-alt me-2"></i>
<span><?= _("Accéder au module") ?></span>
</button>
</div>
</div>
</div>
<style>
.extra-small { font-size: 0.7rem; }
/* Animation de focus sur l'input group */
.transition-focus {
transition: all 0.2s ease-in-out;
border: 1px solid #dee2e6 !important;
}
.transition-focus:focus-within {
border-color: #0d6efd !important;
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15) !important;
}
/* Effet au survol du bouton */
.hover-lift {
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-lift:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3) !important;
}
/* Style du select pour éviter le contour bleu par défaut de Bootstrap */
.form-select:focus {
box-shadow: none;
}
</style>

View File

@ -1,33 +1,59 @@
<div id="div_gar_exo">
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:10pt;">
<thead>
<tr>
<th style="text-align:center"> <?= _("Exercice") ?> </th>
<th style="text-align:center"> <?= _("Garantie") ?> </th>
<th style="text-align:center"> <?= _("Limites Contrat") ?> </th>
<th style="text-align:center"> <?= _("Taux Incorporation (%)") ?> </th>
<th style="text-align:center"> <?= _("Limites en vigeur") ?> </th>
<th style="text-align:center"> <?= _("Consommations") ?> </th>
<th style="text-align:center"> <?= _("Solde") ?> </th>
</tr>
</thead>
<tbody>
<div id="div_gar_exo">
<div class="card shadow-sm border-0">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0">
<thead class="table-dark">
<tr>
<th class="ps-3 fw-normal small text-uppercase"><?= _("Garantie") ?></th>
<th class="text-center fw-normal small text-uppercase"><?= _("Contrat (Annuel)") ?></th>
<th class="text-center fw-normal small text-uppercase"><?= _("Taux Inc.") ?></th>
<th class="text-center fw-normal small text-uppercase"><?= _("Limite en vigueur") ?></th>
<th class="text-center fw-normal small text-uppercase"><?= _("Consommé") ?></th>
<th class="text-end pe-4 fw-normal small text-uppercase"><?= _("Solde Disponible") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($garantieadherents as $garantieadherent):
$solde = $this->nettoyer($garantieadherent['solde']);
$statusClass = ($solde <= 0) ? 'text-danger fw-bold' : 'text-success fw-bold';
$rowClass = ($solde <= 0) ? 'table-danger' : '';
?>
<tr class="<?= $rowClass ?>">
<td class="ps-3 fw-bold text-secondary">
<?= $this->nettoyer($garantieadherent['garantie']) ?>
<div class="text-muted extra-small" style="font-size: 0.75rem;">
Réf: <?= $this->nettoyer($garantieadherent['exercieReference']) ?>
</div>
</td>
<td class="text-center text-monospace">
<?= format_N($this->nettoyer($garantieadherent['plafondAnnuel'])) ?>
</td>
<td class="text-center">
<span class="badge rounded-pill bg-info text-dark">
<?= $this->nettoyer($garantieadherent['tauxAvenant']) ?> %
</span>
</td>
<td class="text-center fw-bold">
<?= format_N($this->nettoyer($garantieadherent['plafond'])) ?>
</td>
<td class="text-center text-primary">
<?= format_N($this->nettoyer($garantieadherent['consommation'])) ?>
</td>
<td class="text-end pe-4 <?= $statusClass ?>">
<?php if($solde <= 0): ?>
<i class="fa-solid fa-circle-exclamation me-1"></i>
<?php endif; ?>
<?= format_N($solde) ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php foreach ($garantieadherents as $garantieadherent):?>
<tr valign="top">
<td align='center'> <?= $this->nettoyer($garantieadherent['exercieReference'])?> </td>
<td align='center'> <?= $this->nettoyer($garantieadherent['garantie'])?> </td>
<td align='center'><?= format_N($this->nettoyer($garantieadherent['plafondAnnuel'])) ?></td>
<td align='center'><?= $this->nettoyer($garantieadherent['tauxAvenant']) ?></td>
<td align='center'><?= format_N($this->nettoyer($garantieadherent['plafond'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($garantieadherent['consommation'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($garantieadherent['solde'])) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div id="div_export_a">
</div>
</div>
<div class="card-footer bg-light py-3">
<div id="div_export_a" class="d-flex justify-content-end gap-2">
</div>
</div>
</div>
</div>

View File

@ -1,112 +1,99 @@
<div id="div_prime">
<table class="table table-responsive table-condensed" style='font-size:9pt; text-align:center'>
<thead>
<tr>
<th style='text-align:center'> <?= _("Décompte de primes") ?> </th>
<th style='text-align:center'> <?= _("Primes Annuelles") ?> </th>
<th style='text-align:center'> <?= _("Primes proratées") ?> </th>
</tr>
</thead>
<tfoot>
<tr>
<td align='center'> <?= _("Prime TTC") ?> </td>
<td align='center'> <?= format_N($this->nettoyer($beneficiaire_temp['primeTtc_an'])) ?></td>
<td align='center'> <?= format_N($this->nettoyer($beneficiaire_temp['primeTtc'])) ?></td>
</tr>
<tr style='color:blue;'>
<td align='center'> <?= _("Prime Nette Statisque") ?> </td>
<td align='center'> <?= format_N($this->nettoyer($beneficiaire_temp['primeNetteStat_an'])) ?></td>
<td align='center'> <?= format_N($this->nettoyer($beneficiaire_temp['primeNetteStat'])) ?></td>
</tr>
</tfoot>
<tbody>
<div id="div_prime" class="mt-1">
<div class="card shadow-sm border-0">
<div class="card-header bg-dark text-white">
<h5 class="card-title mb-0 fs-6"><i class="fa-solid fa-file-invoice-dollar me-2"></i><?= _("Détail du décompte de primes") ?></h5>
</div>
<div class="table-responsive">
<table class="table table-hover table-sm align-middle mb-0" style="font-size: 0.9rem;">
<thead class="table-light">
<tr>
<th class="ps-3 py-2 text-start"><?= _("Composantes") ?></th>
<th class="text-end py-2"><?= _("Annuel") ?></th>
<th class="text-end py-2 bg-light text-primary fw-bold"><?= _("Prorata") ?></th>
</tr>
</thead>
<tbody>
<tr>
<td class="ps-3"><?= _("Prime de Base") ?></td>
<td class="text-end text-monospace"><?= format_N($this->nettoyer($beneficiaire_temp['primeBeneficiaire_an']))?></td>
<td class="text-end fw-bold bg-light"><?= format_N($this->nettoyer($beneficiaire_temp['primeBeneficiaire']))?></td>
</tr>
<tr>
<td class="ps-3"><?= _("Cpl frais funéraires") ?></td>
<td class="text-end text-monospace"><?= format_N($this->nettoyer($beneficiaire_temp['primeCplFuneraire_an']))?></td>
<td class="text-end fw-bold bg-light"><?= format_N($this->nettoyer($beneficiaire_temp['primeCplFuneraire']))?></td>
</tr>
<tr>
<td class="ps-3"><?= _("Garanties Optionnelles") ?></td>
<td class="text-end text-monospace"><?= format_N($this->nettoyer($beneficiaire_temp['surprimeOption_an']))?></td>
<td class="text-end fw-bold bg-light"><?= format_N($this->nettoyer($beneficiaire_temp['surprimeOption']))?></td>
</tr>
<tr>
<td class="ps-3"><?= _("Rachat Ticket Modérateur") ?></td>
<td class="text-end text-monospace"><?= format_N($this->nettoyer($beneficiaire_temp['surprimeTm_an']))?></td>
<td class="text-end fw-bold bg-light"><?= format_N($this->nettoyer($beneficiaire_temp['surprimeTm']))?></td>
</tr>
<tr>
<td class="ps-3"><?= _("Surprimes Diverses") ?></td>
<td class="text-end text-monospace"><?= format_N($this->nettoyer($beneficiaire_temp['surprimeAnt_an']))?></td>
<td class="text-end fw-bold bg-light"><?= format_N($this->nettoyer($beneficiaire_temp['surprimeAnt']))?></td>
</tr>
<tr>
<td> <?= _("Prime de Base") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeBeneficiaire_an']))?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeBeneficiaire']))?> </td>
</tr>
<tr>
<td> <?= _("Cpl frais funéraires") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeCplFuneraire_an']))?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeCplFuneraire']))?> </td>
</tr>
<tr class="table-info">
<td class="ps-3 fw-bold small text-uppercase text-secondary"><?= _("Prime Nette de commission") ?></td>
<td class="text-end fw-bold"><?= format_N($this->nettoyer($beneficiaire_temp['primeNette_an'])) ?></td>
<td class="text-end fw-bold text-primary bg-light"><?= format_N($this->nettoyer($beneficiaire_temp['primeNette'])) ?></td>
</tr>
<tr>
<td> <?= _("Garanties Optionnelles") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['surprimeOption_an']))?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['surprimeOption']))?> </td>
</tr>
<tr>
<td class="ps-3 text-muted small italic text-start"> <?= _("Commission Courtage") ?></td>
<td class="text-end text-muted small"><?= format_N($this->nettoyer($beneficiaire_temp['commission_an'])) ?></td>
<td class="text-end text-muted small bg-light"><?= format_N($this->nettoyer($beneficiaire_temp['commission'])) ?></td>
</tr>
<tr>
<td class="ps-3 text-muted small italic text-start"> <?= _("Commission Commerciaux") ?></td>
<td class="text-end text-muted small"><?= format_N($this->nettoyer($beneficiaire_temp['commissionAutre_an'])) ?></td>
<td class="text-end text-muted small bg-light"><?= format_N($this->nettoyer($beneficiaire_temp['commissionAutre'])) ?></td>
</tr>
<tr>
<td> <?= _("Rachat Ticket Modérateur") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['surprimeTm_an']))?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['surprimeTm']))?> </td>
</tr>
<tr>
<td> <?= _("Surprimes Diverses") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['surprimeAnt_an']))?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['surprimeAnt']))?> </td>
</tr>
<tr class="border-top">
<td class="ps-3"><?= _("Accessoires") ?></td>
<td class="text-end"><?= format_N($this->nettoyer($beneficiaire_temp['accessoire_an'])) ?></td>
<td class="text-end bg-light"><?= format_N($this->nettoyer($beneficiaire_temp['accessoire'])) ?></td>
</tr>
<tr class="fw-bold">
<td class="ps-3"><?= _("Total Prime Nette HT") ?></td>
<td class="text-end"><?= format_N($this->nettoyer($beneficiaire_temp['primeHt_an'])) ?></td>
<td class="text-end bg-light"><?= format_N($this->nettoyer($beneficiaire_temp['primeHt'])) ?></td>
</tr>
<tr>
<td class="ps-3"><?= (isset($_SESSION['composanteprime']['Taxes'])) ? _($_SESSION['composanteprime']['Taxes']) : _("Taxes") ?></td>
<td class="text-end text-danger"><?= format_N($this->nettoyer($beneficiaire_temp['taxe_an'])) ?></td>
<td class="text-end text-danger bg-light"><?= format_N($this->nettoyer($beneficiaire_temp['taxe'])) ?></td>
</tr>
<tr>
<td class="ps-3">
<?= (isset($_SESSION['composanteprime']['Cartes'])) ? _($_SESSION['composanteprime']['Cartes']) : _("Cartes") ?>
</td>
<td class="text-end"><?= format_N($this->nettoyer($beneficiaire_temp['fraisCarte_an'])) ?></td>
<td class="text-end bg-light"><?= format_N($this->nettoyer($beneficiaire_temp['fraisCarte'])) ?></td>
</tr>
</tbody>
<tr>
<td> <?= _("Prime Nette de commission") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeNette_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeNette'])) ?> </td>
</tr>
<tr>
<td> <?= _("Commission Courtage") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['commission_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['commission'])) ?></td>
</tr>
<tr>
<td> <?= _("Commission Commerciaux") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['commissionAutre_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['commissionAutre'])) ?></td>
</tr>
<tr>
<td> <?= _("Accessoires") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['accessoire_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['accessoire'])) ?> </td>
</tr>
<tr>
<td> <?= _("Prime Nette") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeHt_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeHt'])) ?> </td>
</tr>
<tr>
<td> <?= (isset($_SESSION['composanteprime']['Taxes'])) ? _($_SESSION['composanteprime']['Taxes']) : _("Taxes") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['taxe_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['taxe'])) ?> </td>
</tr>
<tr>
<td>
<?php
if(isset($_SESSION['composanteprime']['Cartes']))
{
echo _($_SESSION['composanteprime']['Cartes']);
}
else
{
echo _("Cartes");
}
?>
</td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['fraisCarte_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['fraisCarte'])) ?></td>
</tr>
</tbody>
</table>
<tfoot class="table-dark">
<tr class="fs-5">
<td class="ps-3 fw-bold"><?= _("PRIME TTC") ?></td>
<td class="text-end fw-bold"><?= format_N($this->nettoyer($beneficiaire_temp['primeTtc_an'])) ?></td>
<td class="text-end fw-bold text-warning"><?= format_N($this->nettoyer($beneficiaire_temp['primeTtc'])) ?></td>
</tr>
<tr class="table-secondary text-primary small">
<td class="ps-3 fw-bold small text-uppercase"><?= _("Prime Nette Statistique") ?></td>
<td class="text-end small"><?= format_N($this->nettoyer($beneficiaire_temp['primeNetteStat_an'])) ?></td>
<td class="text-end fw-bold small"><?= format_N($this->nettoyer($beneficiaire_temp['primeNetteStat'])) ?></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>

View File

@ -0,0 +1,74 @@
<?php if ($codeModeGenerationPass == "0"): ?>
<div class="row g-3 animate__animated animate__fadeIn">
<div class="col-md-6 mb-1">
<label class="form-label small fw-bold required"><?= _("Mot de passe") ?></label>
<div class="input-group shadow-sm">
<span class="input-group-text bg-light"><i class="fas fa-lock text-muted"></i></span>
<input type="password"
id="nvmdp"
name="nvmdp"
class="form-control"
placeholder="<?= _("Saisir le mot de passe") ?>"
onBlur="controle_longeur_passe(this);"
required
autocomplete="new-password">
<button class="btn btn-outline-secondary" type="button" onclick="togglePasswordVisibility('nvmdp')">
<i class="fas fa-eye" id="toggle_nvmdp"></i>
</button>
</div>
<div class="form-text extra-small"><?= _("8 caractères minimum recommandés") ?></div>
</div>
<div class="col-md-6 mb-1">
<label class="form-label small fw-bold required"><?= _("Confirmer le mot de passe") ?></label>
<div class="input-group shadow-sm">
<span class="input-group-text bg-light"><i class="fas fa-check-double text-muted"></i></span>
<input type="password"
id="cfnvmdp"
name="cfnvmdp"
class="form-control"
placeholder="<?= _("Confirmer") ?>"
onBlur="controle_new_pass();"
required
autocomplete="new-password">
<button class="btn btn-outline-secondary" type="button" onclick="togglePasswordVisibility('cfnvmdp')">
<i class="fas fa-eye" id="toggle_cfnvmdp"></i>
</button>
</div>
</div>
</div>
<?php else : ?>
<input type="hidden" id="nvmdp" name="nvmdp" value="">
<input type="hidden" id="cfnvmdp" name="cfnvmdp" value="">
<div class="alert alert-info d-flex align-items-center shadow-sm border-0" role="alert">
<i class="fas fa-magic me-2"></i>
<div>
<?= _("Le mot de passe sera généré automatiquement selon le mode choisi.") ?>
</div>
</div>
<?php endif; ?>
<script>
/**
* Alterne l'affichage du mot de passe entre texte et masqué
*/
function togglePasswordVisibility(id) {
const input = document.getElementById(id);
const icon = document.getElementById('toggle_' + id);
if (input.type === "password") {
input.type = "text";
icon.classList.replace('fa-eye', 'fa-eye-slash');
} else {
input.type = "password";
icon.classList.replace('fa-eye-slash', 'fa-eye');
}
}
</script>
<style>
.extra-small { font-size: 0.75rem; color: #6c757d; }
.required:after { content: " *"; color: #dc3545; }
.input-group-text { border-right: none; }
.form-control { border-left: none; }
.form-control:focus { border-left: 1px solid #86b7fe; }
</style>

View File

@ -0,0 +1,24 @@
<div id="div_unicite_login" class="mt-1">
<input type="hidden" id="uniciteLogin" name="uniciteLogin" value="<?= $uniciteLogin ?>">
<?php if (isset($msgErreur)): ?>
<div class="animate__animated animate__shakeX">
<div class="d-flex align-items-center text-danger small fw-bold">
<i class="fas fa-exclamation-circle me-2"></i>
<span><?= $msgErreur ?></span>
</div>
</div>
<script>
// Ajoute une bordure rouge au champ login pour un feedback visuel immédiat
document.getElementById('codeUtilisateur').classList.add('is-invalid');
document.getElementById('codeUtilisateur').focus();
</script>
<?php else: ?>
<script>
// Retire l'état d'erreur si le login est disponible
document.getElementById('codeUtilisateur').classList.remove('is-invalid');
document.getElementById('codeUtilisateur').classList.add('is-valid');
</script>
<?php endif; ?>
</div>

0
Vue/Ajaxuserrhclient/index.php Executable file
View File

View File

@ -1,25 +1,71 @@
<?php
$this->titre = "INTER-SANTE - Fiche Emission";
<?php $this->titre = "INTER-SANTE - Fiche Emission"; ?>
?>
<div id="div_adherent" class="container-fluid py-1 animate__animated animate__fadeIn">
<h1 class="text-primary"><i class="fa-solid fa-file-invoice-dollar me-2"></i><?= _('Détail des primes de la famille') ?></h1>
<legend> <?= _("Détail des primes de la famille") ?> </legend>
<div class="card-header d-flex justify-content-between align-items-center py-2">
<h5 class="mb-0 fw-bold">
<?= _("POLICE") ?> : <span class="text-secondary"><?= $this->nettoyer($_SESSION['numeroPolice_C']) ?></span>
<span class="ms-3 badge bg-primary text-light small fw-normal">ID: <?= $this->nettoyer($_SESSION['idPolice_C']) ?></span>
</h5>
<div>
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item fw-bold"><?= $this->nettoyer($_SESSION['adherent_C']) ?></li>
<li class="breadcrumb-item active"><?= $this->nettoyer($_SESSION['numeroAdherent_C']) ?></li>
</ol>
</nav>
</div>
</div>
<table class="table table-responsive table-condensed" style='font-size:8pt;'>
<tbody>
<tr>
<td width="10%" > <?= _("Période du") ?> </td>
<td width="15%"> <INPUT style='text-align:center; font-size:10pt;' class="form-control datepicker" TYPE="text" id="debutPeriode" NAME="debutPeriode" value="<?= dateLang($this->nettoyer($adherent['dateEffet'])) ?>" > </td>
<div class="card border-0 shadow-sm mb-4">
<div class="card-body bg-light">
<div class="row align-items-end g-3">
<div class="col-md-3">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Période du") ?></label>
<div class="input-group shadow-sm">
<span class="input-group-text bg-white border-end-0"><i class="fa-solid fa-calendar-day text-primary"></i></span>
<input style='text-align:center; font-size:10pt;' class="form-control datepicker border-start-0" type="text" id="debutPeriode" name="debutPeriode" value="<?= dateLang($this->nettoyer($adherent['dateEffet'])) ?>">
</div>
</div>
<td align="center" > <?= _("au") ?> </td>
<td width="15%"> <INPUT style='text-align:center; font-size:10pt;' class="form-control datepicker" TYPE="text" id="finPeriode" NAME="finPeriode" value="<?= dateLang($this->nettoyer($adherent['dateFinPolice'])) ?>" > </td>
<td> <button style='font-size:10pt;' type="button" class="form-control btn btn-primary" onclick="javascript:afficher_beneficiare_prime_adherent();"> <?= _("Actualiser...") ?> </button> </td>
</tr>
</tbody>
</table>
<div class="col-md-3">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Au") ?></label>
<div class="input-group shadow-sm">
<span class="input-group-text bg-white border-end-0"><i class="fa-solid fa-calendar-check text-primary"></i></span>
<input style='text-align:center; font-size:10pt;' class="form-control datepicker border-start-0" type="text" id="finPeriode" name="finPeriode" value="<?= dateLang($this->nettoyer($adherent['dateFinPolice'])) ?>">
</div>
</div>
<div id="div_detail_requete">
<?php require "Vue/Ajaxbeneficiaireprimeadherent/index.php";?>
</div>
<div class="col-md-3">
<button type="button" class="btn btn-primary w-100 shadow-sm fw-bold py-2" onclick="javascript:afficher_beneficiare_prime_adherent();">
<i class="fa-solid fa-rotate me-2"></i><?= _("Actualiser") ?>
</button>
</div>
<div class="col-md-3">
<div class="p-2 border rounded bg-white text-center shadow-sm">
<span class="extra-small text-muted d-block text-uppercase"><?= _("Statut Police") ?></span>
<span class="badge bg-success-subtle text-success border border-success-subtle rounded-pill px-3">Actif</span>
</div>
</div>
</div>
</div>
</div>
<div id="div_detail_requete" class="rounded shadow-sm bg-white p-2">
<div class="text-center py-5 text-muted">
<div class="spinner-border spinner-border-sm me-2 text-primary" role="status"></div>
<?= _("Actualiser pour charger les données de primes...") ?>
</div>
<?php // require "Vue/Ajaxbeneficiaireprimeadherent/index.php"; ?>
</div>
</div>
<style>
.extra-small { font-size: 0.65rem; }
.form-label { margin-bottom: 0.3rem; letter-spacing: 0.5px; }
.input-group-text { color: #6c757d; font-size: 0.9rem; }
#div_detail_requete { min-height: 200px; transition: all 0.3s ease; }
</style>

View File

@ -1,258 +1,206 @@
<?php $this->titre = "INTER-SANTE - Ajout Adhérent"; ?>
<form method="post" action="Creerbeneficiaire/ajouter">
<INPUT class="sr-only" TYPE="text" id="idPolice" name="idPolice" value="<?= $_SESSION['idPolice_C'] ?>">
<INPUT class="sr-only" TYPE="text" id="numeroPolice" name="numeroPolice" value="<?= $_SESSION['numeroPolice_C'] ?>">
<INPUT class="sr-only" TYPE="text" id="idAdherent" name="idAdherent" value="<?= $_SESSION['idAdherent_C'] ?>">
<INPUT class="sr-only" TYPE="text" id="numeroAdherent" name="numeroAdherent" value="<?= $_SESSION['numeroAdherent_C'] ?>">
<INPUT class="sr-only" TYPE="text" id="genreAdherent" NAME="genreAdherent" value="<?= $this->nettoyer($adherent['sexe']) ?>">
<INPUT class="sr-only" TYPE="text" id="sexeConjoint" NAME="sexeConjoint" value="">
<fieldset>
<legend> <?= _("Informations sur le Bénéficiaire") ?> </legend>
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td width="10%"> <?= _("Avenant") ?> </td>
<td>
<SELECT style='font-size:10pt;' class="form-control" id="idAvenant" NAME="idAvenant" required autofocus onChange="changer_avenant_incorporation_beneficiaire();">
<?php liste_options($avenant,""); ?>
</SELECT>
</td>
<td width="10%" align="center"> <?= _("Entrée") ?> </td>
<td>
<div id="div_date_avenant">
<INPUT style='font-size:10pt;' class="form-control datepicker" TYPE="text" id="dateEntree" NAME="dateEntree" value="<?= dateLang($_SESSION['dateAvenant_C']) ?>" required
onChange="prorater_prime_beneficiaire();">
</div>
</td>
</tr>
<tr>
<td> <?= _("Nom Bénéf") ?> </td>
<td><INPUT style='font-size:10pt;' class="form-control" TYPE="text" id="nomBeneficiaire" NAME="nomBeneficiaire" value="<?= $adherent['nom'] ?>" required style="font-size:10pt; text-transform: uppercase;"></td>
<td align="center"> <?= _("Prénoms") ?> </td>
<td><INPUT style='font-size:10pt;' class="form-control" TYPE="text" id="prenomsBeneficiaire" NAME="prenomsBeneficiaire" required></td>
</tr>
<tr>
<td> <?= _("Lien Parenté") ?> </td>
<td>
<SELECT class="form-control" id="codeLienParente" NAME="codeLienParente" required style='font-size:10pt;' onChange="filtrergenreconjoint();" >
<?php liste_options($lienparente,""); ?>
</SELECT>
</td>
<td align="center"> Sex </td>
<td>
<SELECT class="form-control" id="sexe" NAME="sexe" required style='font-size:10pt;' >
<?php liste_options($sexe,""); ?>
</SELECT>
</td>
</tr>
<td> <?= _("Naissance") ?> </td>
<td>
<INPUT class="form-control datepicker" TYPE="text" id="dateNaissance" NAME="dateNaissance" required
onchange="controle_age($('#dateNaissance').datepicker('getDate'), $('#codeLienParente').val())" style='font-size:10pt;' >
</td>
<td align="center"> <?= _("Nat Pièce") ?> </td>
<td>
<SELECT class="form-control" id="codeNaturePiece" NAME="codeNaturePiece" required style='font-size:10pt;'
onChange="javascript:controler_piece_beneficiaire();" >
<?php liste_options($naturepiece,""); ?>
</SELECT>
</td>
</tr>
<tr>
<td> <?= _("No Pièce") ?> </td>
<td>
<INPUT class="form-control" TYPE="text" id="numeroPiece" NAME="numeroPiece" style='font-size:10pt;'
onblur="javascript:controler_piece_beneficiaire();" required autocomplete="off" >
</td>
<td align="center"> <?= _("Groupe Sang") ?> </td>
<td>
<SELECT class="form-control" id="codeGroupeSanguin" NAME="codeGroupeSanguin" required style='font-size:10pt;' >
<?php liste_options($groupesanguin,""); ?>
</SELECT>
</td>
</tr>
<tr>
<td colspan="4" style="height:8px; background-color:white;">
<div id="div_controle_piece"></div>
</td>
</tr>
<tr>
<td> <?= _("Tél Port") ?> </td>
<td><INPUT class="form-control" TYPE="tel" id="telephonePortable" NAME="telephonePortable" style='font-size:10pt;' autocomplete="off" ></td>
<td align="center"> <?= _("Prorata Prime?") ?> </td>
<td>
<SELECT class="form-control" id="prorata" NAME="prorata" required onChange="prorater_prime_beneficiaire();" style='font-size:10pt;' >
<?php liste_options($ouinonprorata,"1",true); ?>
</SELECT>
</td>
</tr>
<tr>
<td>
<?php
if(isset($_SESSION['composanteprime']['Carte']))
{
echo _($_SESSION['composanteprime']['Carte']);
}
else
{
echo _("Carte");
}
?>
</td>
<td > <INPUT style='font-size:10pt;' class="form-control" id="fraisCarte" NAME="fraisCarte" TYPE="text" value="<?=$beneficiaire_temp['fraisCarte']?>" onChange="prorater_prime_beneficiaire();"> </td>
<td><input style="font-size:10pt; text-align:center;color:red;" class="form-control" type="text" id="agepersonne" name="agepersonne" value="Age : 0" readonly ></td>
<td align='center'> <input style='font-size:10pt;' class = "form-control btn btn-info" type="button" value="<?= _("Calculer la prime") ?>" onClick="prorater_prime_beneficiaire();"> </td>
</tr>
<tr>
<td></td>
<td colspan="3" ><input style='font-size:10pt;' class = "form-control btn btn-primary" type="submit" value="<?= _("Enregistrer") ?>" /></td>
</tr>
</tbody>
</table>
</fieldset>
<div id="div_prime">
<table class="table table-responsive table-condensed" style='font-size:9pt; text-align:center'>
<thead>
<tr>
<th style='text-align:center'> <?= _("Décompte de primes") ?> </th>
<th style='text-align:center'> <?= _("Primes Annuelles") ?> </th>
<th style='text-align:center'> <?= _("Primes proratées") ?> </th>
</tr>
</thead>
<tfoot>
<tr>
<td align='center'> <?= _("Prime TTC") ?> </td>
<td align='center'> <?= format_N($this->nettoyer($beneficiaire_temp['primeTtc_an'])) ?></td>
<td align='center'> <?= format_N($this->nettoyer($beneficiaire_temp['primeTtc'])) ?></td>
</tr>
<tr style='color:blue;'>
<td align='center'> <?= _("Prime Nette Statisque") ?> </td>
<td align='center'> <?= format_N($this->nettoyer($beneficiaire_temp['primeNetteStat_an'])) ?></td>
<td align='center'> <?= format_N($this->nettoyer($beneficiaire_temp['primeNetteStat'])) ?></td>
</tr>
</tfoot>
<tbody>
<tr>
<td> <?= _("Prime de Base") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeBeneficiaire_an']))?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeBeneficiaire']))?> </td>
</tr>
<tr>
<td> <?= _("Cpl frais funéraires") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeCplFuneraire_an']))?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeCplFuneraire']))?> </td>
</tr>
<tr>
<td> <?= _("Garanties Optionnelles") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['surprimeOption_an']))?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['surprimeOption']))?> </td>
</tr>
<tr>
<td> <?= _("Rachat Ticket Modérateur") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['surprimeTm_an']))?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['surprimeTm']))?> </td>
</tr>
<tr>
<td> <?= _("Surprimes Diverses") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['surprimeAnt_an']))?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['surprimeAnt']))?> </td>
</tr>
<tr>
<td> <?= _("Prime Nette de commission") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeNette_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeNette'])) ?> </td>
</tr>
<tr>
<td> <?= _("Commission Courtage") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['commission_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['commission'])) ?></td>
</tr>
<tr>
<td> <?= _("Commission Commerciaux") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['commissionAutre_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['commissionAutre'])) ?></td>
</tr>
<tr>
<td> <?= _("Accessoires") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['accessoire_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['accessoire'])) ?> </td>
</tr>
<tr>
<td> <?= _("Prime Nette") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeHt_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['primeHt'])) ?> </td>
</tr>
<tr>
<td> <?= (isset($_SESSION['composanteprime']['Taxes'])) ? _($_SESSION['composanteprime']['Taxes']) : _("Taxes") ?> </td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['taxe_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['taxe'])) ?> </td>
</tr>
<tr>
<td>
<?php
if(isset($_SESSION['composanteprime']['Cartes']))
{
echo _($_SESSION['composanteprime']['Cartes']);
}
else
{
echo _("Cartes");
}
?>
</td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['fraisCarte_an'])) ?></td>
<td> <?= format_N($this->nettoyer($beneficiaire_temp['fraisCarte'])) ?></td>
</tr>
</tbody>
</table>
</div>
<div id="div_adherent" class="container-fluid py-1 animate__animated animate__fadeIn">
</form>
<h1 class="text-primary"><i class="fa-solid fa-user-plus me-2"></i><?= _('Nouveau dépendant') ?></h1>
<?php if (isset($msgErreur)): ?>
<div class="alert alert-danger" style="height:30px; padding:5px;" >
<H4><?= $msgErreur ?></H4>
</div>
<?php endif; ?>
<div class="card-header d-flex justify-content-between align-items-center py-1">
<h5 class="mb-0 fw-bold">
<?= _("POLICE") ?> : <span class="text-secondary"><?= $this->nettoyer($_SESSION['numeroPolice_C']) ?></span>
<span class="ms-3 badge bg-primary text-light small fw-normal">ID: <?= $this->nettoyer($_SESSION['idPolice_C']) ?></span>
</h5>
<p class="text-muted small"><?= _("Adhérent Principal") ?> :<strong><?= $_SESSION['numeroAdherent_C'] ?></strong></p>
</div>
<form method="post" action="Creerbeneficiaire/ajouter" class="shadow-sm bg-white rounded p-4 border">
<div class="d-none">
<input type="text" id="idPolice" name="idPolice" value="<?= $_SESSION['idPolice_C'] ?>">
<input type="text" id="numeroPolice" name="numeroPolice" value="<?= $_SESSION['numeroPolice_C'] ?>">
<input type="text" id="idAdherent" name="idAdherent" value="<?= $_SESSION['idAdherent_C'] ?>">
<input type="text" id="numeroAdherent" name="numeroAdherent" value="<?= $_SESSION['numeroAdherent_C'] ?>">
<input type="text" id="genreAdherent" name="genreAdherent" value="<?= $this->nettoyer($adherent['sexe']) ?>">
<input type="text" id="sexeConjoint" name="sexeConjoint" value="">
</div>
<div class="row g-3">
<div class=" card col-md-6 border-end px-4">
<h5 class="mb-3 text-secondary small text-uppercase fw-bold"><?= _("Paramètres d'inclusion") ?></h5>
<div class="mb-3">
<label class="form-label small fw-bold text-uppercase"><?= _("Avenant") ?></label>
<select class="form-select form-select-sm shadow-sm border-primary" id="idAvenant" name="idAvenant" required autofocus onChange="changer_avenant_incorporation_beneficiaire();">
<?php liste_options($avenant,""); ?>
</select>
</div>
<div class="mb-3">
<label class="form-label small fw-bold text-uppercase"><?= _("Date d'Entrée") ?></label>
<div id="div_date_avenant">
<input class="form-control form-control-sm datepicker" type="text" id="dateEntree" name="dateEntree" value="<?= dateLang($_SESSION['dateAvenant_C']) ?>" required onChange="prorater_prime_beneficiaire();">
</div>
</div>
<div class="mb-3">
<label class="form-label small fw-bold text-uppercase"><?= _("Option de Prorata") ?></label>
<select class="form-select form-select-sm" id="prorata" name="prorata" required onChange="prorater_prime_beneficiaire();">
<?php liste_options($ouinonprorata,"1",true); ?>
</select>
</div>
</div>
<div class="card col-md-6 px-4">
<h5 class="mb-3 text-secondary small text-uppercase fw-bold"><?= _("État Civil") ?></h5>
<div class="row g-2 mb-3">
<div class="col-md-5">
<label class="form-label small fw-bold text-uppercase"><?= _("Nom") ?></label>
<input class="form-control form-control-sm fw-bold shadow-sm" type="text" id="nomBeneficiaire" name="nomBeneficiaire" value="<?= $adherent['nom'] ?>" required style="text-transform: uppercase;">
</div>
<div class="col-md-7">
<label class="form-label small fw-bold text-uppercase"><?= _("Prénoms") ?></label>
<input class="form-control form-control-sm shadow-sm" type="text" id="prenomsBeneficiaire" name="prenomsBeneficiaire" required>
</div>
</div>
<div class="row g-2 mb-3">
<div class="col-md-6">
<label class="form-label small fw-bold text-uppercase"><?= _("Lien Parenté") ?></label>
<select class="form-select form-select-sm" id="codeLienParente" name="codeLienParente" required onChange="filtrergenreconjoint();">
<?php liste_options($lienparente,""); ?>
</select>
</div>
<div class="col-md-6">
<label class="form-label small fw-bold text-uppercase"><?= _("Genre") ?></label>
<select class="form-select form-select-sm" id="sexe" name="sexe" required>
<?php liste_options($sexe,""); ?>
</select>
</div>
</div>
<div class="row g-2 mb-3">
<div class="col-md-6">
<label class="form-label small fw-bold text-uppercase"><?= _("Date de Naissance") ?></label>
<input class="form-control form-control-sm datepicker" type="text" id="dateNaissance" name="dateNaissance" required onchange="controle_age($('#dateNaissance').datepicker('getDate'), $('#codeLienParente').val())">
</div>
<div class="col-md-6">
<label class="form-label small fw-bold invisible">Age</label>
<input class="form-control form-control-sm border-0 fw-bold text-danger text-center bg-light" type="text" id="agepersonne" name="agepersonne" value="Age : 0" readonly>
</div>
</div>
</div>
<hr class="my-1">
<div class="card col-md-12">
<div class="row g-3">
<div class="col-md-3">
<label class="form-label small fw-bold text-uppercase"><?= _("Nature Pièce") ?></label>
<select class="form-select form-select-sm" id="codeNaturePiece" name="codeNaturePiece" required onChange="javascript:controler_piece_beneficiaire();">
<?php liste_options($naturepiece,""); ?>
</select>
</div>
<div class="col-md-3">
<label class="form-label small fw-bold text-uppercase"><?= _("N° Pièce") ?></label>
<input class="form-control form-control-sm" type="text" id="numeroPiece" name="numeroPiece" onblur="javascript:controler_piece_beneficiaire();" required autocomplete="off">
<div id="div_controle_piece" class="mt-1 small"></div>
</div>
<div class="col-md-3">
<label class="form-label small fw-bold text-uppercase"><?= _("Groupe Sanguin") ?></label>
<select class="form-select form-select-sm" id="codeGroupeSanguin" name="codeGroupeSanguin" required>
<?php liste_options($groupesanguin,""); ?>
</select>
</div>
<div class="col-md-3">
<label class="form-label small fw-bold text-uppercase"><?= _("Téléphone") ?></label>
<input class="form-control form-control-sm" type="tel" id="telephonePortable" name="telephonePortable" autocomplete="off">
</div>
</div>
</div>
</div>
<div class="card mt-2 border-primary">
<div class="card-body bg-light">
<div class="row align-items-center">
<div class="col-md-4">
<div class="input-group">
<span class="input-group-text small fw-bold bg-white text-primary">
<?= (isset($_SESSION['composanteprime']['Carte'])) ? _($_SESSION['composanteprime']['Carte']) : _("Frais Carte") ?>
</span>
<input class="form-control fw-bold" id="fraisCarte" name="fraisCarte" type="text" value="<?=$beneficiaire_temp['fraisCarte']?>" onChange="prorater_prime_beneficiaire();">
</div>
</div>
<div class="col-md-4 text-center">
<button type="button" class="btn btn-info w-75 shadow-sm" onClick="prorater_prime_beneficiaire();">
<i class="fa-solid fa-calculator me-2"></i><?= _("Calculer la prime") ?>
</button>
</div>
<div class="col-md-4 text-end">
<button type="submit" class="btn btn-primary btn-lg w-100 shadow">
<i class="fa-solid fa-floppy-disk me-2"></i><?= _("ENREGISTRER LE BÉNÉFICIAIRE") ?>
</button>
</div>
</div>
</div>
</div>
<div id="div_prime" class="mt-2">
<div class="table-responsive rounded shadow-sm">
<table class="table table-hover table-sm align-middle mb-0">
<thead class="table-dark">
<tr>
<th class="ps-3 py-3"><?= _("Nature du Décompte") ?></th>
<th class="text-center"><?= _("Primes Annuelles") ?></th>
<th class="text-center text-warning"><?= _("Primes Proratées") ?></th>
</tr>
</thead>
<tbody class="table-group-divider">
<tr>
<td class="ps-3"><?= _("Prime de Base") ?></td>
<td class="text-center"><?= format_N($this->nettoyer($beneficiaire_temp['primeBeneficiaire_an']))?></td>
<td class="text-center fw-bold"><?= format_N($this->nettoyer($beneficiaire_temp['primeBeneficiaire']))?></td>
</tr>
<tr>
<td class="ps-3"><?= _("Complément frais funéraires") ?></td>
<td class="text-center"><?= format_N($this->nettoyer($beneficiaire_temp['primeCplFuneraire_an']))?></td>
<td class="text-center fw-bold"><?= format_N($this->nettoyer($beneficiaire_temp['primeCplFuneraire']))?></td>
</tr>
<tr>
<td class="ps-3"><?= _("Garanties Optionnelles") ?></td>
<td class="text-center"><?= format_N($this->nettoyer($beneficiaire_temp['surprimeOption_an']))?></td>
<td class="text-center fw-bold"><?= format_N($this->nettoyer($beneficiaire_temp['surprimeOption']))?></td>
</tr>
<tr class="table-info">
<td class="ps-3 fw-bold text-uppercase small"><?= _("Total Prime Nette") ?></td>
<td class="text-center fw-bold"><?= format_N($this->nettoyer($beneficiaire_temp['primeHt_an'])) ?></td>
<td class="text-center fw-bold text-primary"><?= format_N($this->nettoyer($beneficiaire_temp['primeHt'])) ?></td>
</tr>
<tr>
<td class="ps-3"><?= (isset($_SESSION['composanteprime']['Taxes'])) ? _($_SESSION['composanteprime']['Taxes']) : _("Taxes") ?></td>
<td class="text-center"><?= format_N($this->nettoyer($beneficiaire_temp['taxe_an'])) ?></td>
<td class="text-center"><?= format_N($this->nettoyer($beneficiaire_temp['taxe'])) ?></td>
</tr>
<tr>
<td class="ps-3"><?= (isset($_SESSION['composanteprime']['Cartes'])) ? _($_SESSION['composanteprime']['Cartes']) : _("Cartes") ?></td>
<td class="text-center"><?= format_N($this->nettoyer($beneficiaire_temp['fraisCarte_an'])) ?></td>
<td class="text-center"><?= format_N($this->nettoyer($beneficiaire_temp['fraisCarte'])) ?></td>
</tr>
</tbody>
<tfoot class="table-primary border-top border-dark">
<tr class="fs-5">
<td class="ps-3 fw-bold text-uppercase"><?= _("Prime TTC à payer") ?></td>
<td class="text-center fw-bold"><?= format_N($this->nettoyer($beneficiaire_temp['primeTtc_an'])) ?></td>
<td class="text-center fw-bold text-danger"><?= format_N($this->nettoyer($beneficiaire_temp['primeTtc'])) ?></td>
</tr>
</tfoot>
</table>
</div>
</div>
</form>
<?php if (isset($msgErreur)): ?>
<div class="alert alert-danger d-flex align-items-center mt-3 shadow-sm" role="alert">
<i class="fa-solid fa-triangle-exclamation me-3 fa-2x"></i>
<div><h5 class="alert-heading mb-0"><?= $msgErreur ?></h5></div>
</div>
<?php endif; ?>
</div>

View File

@ -1,119 +1,140 @@
<?php
$this->titre = "INTER-SANTE - Factrures famille";
?>
<?php $this->titre = "INTER-SANTE - Factures famille"; ?>
<legend> <?= _("Historique de factures de la famille") ?> </legend>
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td width="10%" > <?= _("Période du") ?> </td>
<td width="20%" ><INPUT style='text-align:center; font-size:10pt;' class="form-control datepicker" TYPE="text" id="d1" NAME="d1" value="<?= dateLang($_SESSION['dateEffetAdherent_C'], $_SESSION['lang']) ?>" required></td>
<div id="div_adherent" class="container-fluid py-1 animate__animated animate__fadeIn">
<h1 class="text-primary"><i class="fa-solid fa-clock-rotate-left me-2"></i><?= _('Historique Factures') ?></h1>
<td width="10%" align="center" > <?= _("au") ?> </td>
<td width="20%" ><INPUT style='text-align:center; font-size:10pt;' class="form-control datepicker" TYPE="text" id="d2" NAME="d2" value="<?= dateCouranteLang($_SESSION['lang']) ?>" required></td>
<div class="card-header d-flex justify-content-between align-items-center py-2">
<h5 class="mb-0 fw-bold">
<?= _("POLICE") ?> : <span class="text-secondary"><?= $this->nettoyer($_SESSION['numeroPolice_C']) ?></span>
<span class="ms-3 badge bg-primary text-light small fw-normal">ID: <?= $this->nettoyer($_SESSION['idPolice_C']) ?></span>
</h5>
<div>
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item fw-bold"><?= $this->nettoyer($_SESSION['adherent_C']) ?></li>
<li class="breadcrumb-item active"><?= $this->nettoyer($_SESSION['numeroAdherent_C']) ?></li>
</ol>
</nav>
</div>
</div>
<td> </td>
<td> <button style='font-size:10pt;' type="button" class="form-control btn btn-primary" onclick="javascript:listerfacturefamille();"><?= _("Actualiser...") ?></button> </td>
</tr>
</tbody>
</table>
<div class="card shadow-sm border-0 mb-4">
<div class="card-body py-3">
<div class="row align-items-center g-3">
<div class="col-md">
<div class="input-group shadow-sm">
<span class="input-group-text bg-light"><i class="fa-solid fa-calendar-days me-2"></i> <?= _("Du") ?></span>
<input type="text" id="d1" name="d1" class="form-control datepicker text-center fw-bold"
value="<?= dateLang($_SESSION['dateEffetAdherent_C'], $_SESSION['lang']) ?>" required>
<span class="input-group-text bg-light"><?= _("au") ?></span>
<input type="text" id="d2" name="d2" class="form-control datepicker text-center fw-bold"
value="<?= dateCouranteLang($_SESSION['lang']) ?>" required>
<button class="btn btn-primary px-4" type="button" onclick="listerfacturefamille();">
<i class="fa-solid fa-rotate me-2"></i><?= _("Actualiser") ?>
</button>
</div>
</div>
</div>
</div>
</div>
<button id="btn_pop_consulter_facture" NAME="btn_pop_consulter_facture" type="button" class="sr-only" data-toggle="modal" data-target="#pop_consulter_facture"> </button>
<button id="btn_pop_consulter_facture" NAME="btn_pop_consulter_facture" type="button" class="sr-only" data-bs-toggle="modal" data-bs-target="#pop_consulter_facture"> </button>
<div id="div_dossiers">
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:8pt;">
<thead>
<tr>
<th style='text-align:center'> Type </th>
<th style='text-align:center'> <?= _("No Bon") ?> </th>
<th style='text-align:center'> <?= _("Id Fact") ?> </th>
<th style='text-align:center'> Date </th>
<th> <?= _("Prestataire") ?> </th>
<th> <?= _("Bénéficiaire") ?> </th>
<th style='text-align:center'> <?= _("Frais") ?> </th>
<th style='text-align:center'> <?= _("T M") ?> </th>
<th style='text-align:center'> <?= _("A Remb") ?> </th>
<th style='text-align:center'> <?= _("Dépas") ?> </th>
<th style='text-align:center'> <?= _("Ret") ?> </th>
</tr>
</thead>
<tbody>
<?php foreach ($factures as $facture):
$idFacture=$this->nettoyer($facture['idFacture']);
$numeroFeuilleMaladie=$this->nettoyer($facture['numeroFeuilleMaladie']);
$tiersPayant = $facture['tiersPayant'];
$codeTypeFacture = $this->nettoyer($facture['codeTypeFacture']);
<div id="div_dossiers" class="card shadow-sm border-0">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0" style="font-size: 0.85rem;">
<thead class="table-dark">
<tr>
<th class="ps-3"><?= _("Type") ?></th>
<th><?= _("Référence / Bon") ?></th>
<th class="text-center"><?= _("ID Fact") ?></th>
<th><?= _("Date") ?></th>
<th><?= _("Prestataire / Bénéficiaire") ?></th>
<th class="text-end"><?= _("Frais Réel") ?></th>
<th class="text-end"><?= _("Part Patient (TM)") ?></th>
<th class="text-end text-warning"><?= _("A Rembourser") ?></th>
<th class="text-end pe-3 small text-uppercase opacity-75"><?= _("Exclu/Ret") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($factures as $facture):
$idFacture = $this->nettoyer($facture['idFacture']);
$codeType = $this->nettoyer($facture['codeTypeFacture']);
// Définition des couleurs par type
$badgeClass = "bg-secondary";
switch($codeType) {
case 'PHAR': $badgeClass = "bg-success"; break;
case 'OPT' : $badgeClass = "bg-info text-dark"; break;
case 'LAB' : $badgeClass = "bg-warning text-dark"; break;
case 'SEA' : $badgeClass = "bg-primary"; break;
}
$numeroBon = $this->nettoyer($facture['numeroBonConsultation']);
if($codeTypeFacture=="PHAR")
{
$numeroBon = $this->nettoyer($facture['numeroBonOrdonnance']);
}
elseif($codeTypeFacture=="OPT")
{
$numeroBon = $this->nettoyer($facture['numeroBonOptique']);
}
elseif($codeTypeFacture=="LAB")
{
$numeroBon = $this->nettoyer($facture['numeroBonExamen']);
}
elseif($codeTypeFacture=="SEA")
{
$numeroBon = $this->nettoyer($facture['numeroBonKine']);
}
?>
<tr valign="top">
<td align='center'> <?= $codeTypeFacture ?> </td>
<td align='center'> <?= $numeroBon ?> </td>
<td align='center'>
<input style='font-size:7pt;' type="button" value="<?= $idFacture ?>"
onClick="javascript:consulter_facture_pop('<?= $idFacture ?>');">
</td>
<td align='center'><?= dateheureLang($this->nettoyer($facture['dateSysteme'])) ?></td>
<td><?= $this->nettoyer($facture['prestataire']) ?></td>
<td><?= $this->nettoyer($facture['beneficiaire']) ?></td>
<td align='center'><?= format_N($this->nettoyer($facture['fraisReel'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($facture['montantTm'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($facture['montantArembourser'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($facture['fraisExclu'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($facture['fraisRetenu'])) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="modal fade" id="pop_consulter_facture" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button id="btn_close_pop" name="btn_close_pop" type="button" class="close" data-dismiss="modal"> <?= _("Fermer") ?> </button>
<h4 class="modal-title"> <?= _("Consultation facture...") ?> </h4>
</div>
<div class="modal-body">
<div id="div_consulter_facture_pop">
</div>
<div id="div_facture_detail">
</div>
</div>
<div class="modal-footer">
<button id="close_pop" name="close_pop" type="button" class="btn btn-default" data-dismiss="modal"> <?= _("Fermer") ?> </button>
</div>
</div>
</div>
// Logique du numéro de bon
$numeroBon = $this->nettoyer($facture['numeroBonConsultation']);
if($codeType=="PHAR") $numeroBon = $this->nettoyer($facture['numeroBonOrdonnance']);
elseif($codeType=="OPT") $numeroBon = $this->nettoyer($facture['numeroBonOptique']);
elseif($codeType=="LAB") $numeroBon = $this->nettoyer($facture['numeroBonExamen']);
elseif($codeType=="SEA") $numeroBon = $this->nettoyer($facture['numeroBonKine']);
?>
<tr>
<td class="ps-3">
<span class="badge <?= $badgeClass ?> w-100"><?= $codeType ?></span>
</td>
<td>
<small class="fw-bold text-muted"><?= $numeroBon ?></small>
</td>
<td class="text-center">
<button class="btn btn-sm btn-outline-primary py-0" style="font-size: 0.75rem;"
onClick="consulter_facture_pop('<?= $idFacture ?>');">
<i class="fa-solid fa-magnifying-glass me-1"></i><?= $idFacture ?>
</button>
</td>
<td>
<div class="small lh-1"><?= dateheureLang($this->nettoyer($facture['dateSysteme'])) ?></div>
</td>
<td>
<div class="fw-bold text-truncate" style="max-width: 200px;"><?= $this->nettoyer($facture['prestataire']) ?></div>
<div class="small text-muted italic">👤 <?= $this->nettoyer($facture['beneficiaire']) ?></div>
</td>
<td class="text-end text-monospace fw-bold"><?= format_N($this->nettoyer($facture['fraisReel'])) ?></td>
<td class="text-end text-monospace text-danger small"><?= format_N($this->nettoyer($facture['montantTm'])) ?></td>
<td class="text-end text-monospace fw-bold text-primary"><?= format_N($this->nettoyer($facture['montantArembourser'])) ?></td>
<td class="text-end pe-3">
<div class="small text-muted text-monospace"><?= format_N($this->nettoyer($facture['fraisExclu'])) ?></div>
<div class="small text-muted text-monospace border-top pt-1"><?= format_N($this->nettoyer($facture['fraisRetenu'])) ?></div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal fade" id="pop_consulter_facture" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content border-0 shadow-lg">
<div class="modal-header bg-primary text-white">
<h5 class="modal-title"><i class="fa-solid fa-file-invoice me-2"></i><?= _("Détails de la Facture") ?></h5>
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body bg-light">
<div id="div_consulter_facture_pop" class="mb-3"></div>
<div id="div_facture_detail" class="bg-white p-3 rounded shadow-sm"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary fw-bold px-4" data-bs-dismiss="modal"><?= _("Fermer") ?></button>
</div>
</div>
</div>
</div>
<style>
.text-monospace { font-family: 'Courier New', Courier, monospace; }
.table-hover tbody tr:hover { background-color: rgba(13, 110, 253, 0.04); }
.italic { font-style: italic; }
</style>

View File

@ -48,212 +48,286 @@
<INPUT class="sr-only" TYPE="text" id="remplacant" name="remplace" value="<?= $adherent['remplacant'] ?>" >
<INPUT class="sr-only" TYPE="text" id="idApporteur" name="idApporteur" value="<?= $idApporteur ?>" >
<form name="formficheadehrent" id="formficheadehrent" method="POST" class="container-fluid py-4">
<input type="hidden" id="codeEtatFacturation" name="codeEtatFacturation" value="<?= $adherent['codeEtatFacturation'] ?>">
<input type="hidden" id="numeroBeneficiaire" name="numeroBeneficiaire" value="<?= $adherent['numeroBeneficiaire'] ?>">
<input type="hidden" id="codeEtatAdherent" name="codeEtatAdherent" value="<?= $adherent['codeEtatAdherent'] ?>">
<div id="div_adherent" class="container-fluid py-1 animate__animated animate__fadeIn">
<h1 class="text-primary"><i class="fas fa-id-card me-2"></i><?= _('Fiche adhérent') ?></h1>
<?php if ($adherentRetire == "1") : ?>
<div class="alert alert-danger d-flex align-items-center mb-4 shadow-sm" role="alert">
<i class="fas fa-exclamation-triangle me-3 fa-2x"></i>
<div>
<h4 class="alert-heading mb-0"><?= _("Adhérent sorti le") . " : " . dateLang($dateSortieAdherent) ?></h4>
</div>
</div>
<?php endif; ?>
<div class="card shadow-sm mb-4">
<div class="card-header bg-primary text-white d-flex justify-content-between align-items-center">
<h5 class="mb-0"><i class="fas fa-user-circle me-2"></i><?= _("Informations sur l'adhérent") ?> : <span class="badge bg-light text-primary"><?= $this->nettoyer($adherent['numeroAdherent']) ?></span></h5>
</div>
<div class="card-body bg-light">
<div class="row g-3">
<div class="col-md-4">
<label class="form-label small text-muted text-uppercase fw-bold"><?= _("Nom & Prénoms") ?></label>
<div class="input-group">
<span class="input-group-text"><i class="fas fa-id-card"></i></span>
<input type="text" class="form-control bg-white" value="<?= $this->nettoyer($adherent['nom']) ?> <?= $this->nettoyer($adherent['prenoms']) ?>" readonly>
</div>
</div>
<div class="col-md-4">
<label class="form-label small text-muted text-uppercase fw-bold"><?= _("Collège") ?></label>
<input type="text" class="form-control bg-white" value="<?= $this->nettoyer($adherent['libelleCollege']) ?>" readonly>
</div>
<div class="col-md-4">
<label class="form-label small text-muted text-uppercase fw-bold"><?= _("Contact") ?></label>
<div class="input-group">
<span class="input-group-text"><i class="fas fa-phone"></i></span>
<input type="text" class="form-control bg-white" value="<?= $this->nettoyer($adherent['telephonePortable']) ?>" readonly>
</div>
</div>
<div class="col-md-4">
<label class="form-label small text-muted text-uppercase fw-bold"><?= _("E-mail") ?></label>
<input type="email" class="form-control bg-white" value="<?= $this->nettoyer($adherent['email']) ?>" readonly>
</div>
<div class="col-md-8">
<label class="form-label small text-muted text-uppercase fw-bold"><?= _("Localisation") ?></label>
<div class="input-group">
<span class="input-group-text"><i class="fas fa-map-marker-alt"></i></span>
<input type="text" class="form-control bg-white" value="<?= $this->nettoyer($adherent['pays']) ?> / <?= $this->nettoyer($adherent['ville']) ?> / <?= $this->nettoyer($adherent['localite']) ?>" readonly>
</div>
</div>
</div>
<?php if ($controlerPlafondAdherent): ?>
<hr class="my-4">
<div class="row g-3 text-center">
<div class="col-md-4">
<div class="p-3 border rounded bg-white shadow-sm">
<div class="small fw-bold text-primary text-uppercase"><?= _("Plafond Famille") ?></div>
<div class="h4 mb-0 text-primary fw-bold"><?= format_N($limite_adherent['plafondAdherent']) ?></div>
</div>
</div>
<div class="col-md-4">
<div class="p-3 border rounded bg-white shadow-sm border-danger">
<div class="small fw-bold text-danger text-uppercase"><?= _("Consommations") ?></div>
<div class="h4 mb-0 text-danger fw-bold"><?= format_N($limite_adherent['consommationAdherent']) ?></div>
</div>
</div>
<div class="col-md-4">
<div class="p-3 border rounded bg-success text-white shadow-sm">
<div class="small fw-bold text-uppercase"><?= _("Solde Disponible") ?></div>
<div class="h4 mb-0 fw-bold"><?= format_N($limite_adherent['soldeAdherent']) ?></div>
</div>
</div>
</div>
<?php endif; ?>
</div>
<div class="card-header d-flex justify-content-between align-items-center py-1">
<h5 class="mb-0 fw-bold">
<?= _("POLICE") ?> : <span class="text-secondary"><?= $this->nettoyer($_SESSION['numeroPolice_C']) ?></span>
<span class="ms-3 badge bg-primary text-light small fw-normal">ID: <?= $this->nettoyer($_SESSION['idPolice_C']) ?></span>
</h5>
</div>
<?php if ($codeTypeContrat == "F"): ?>
<div class="card shadow-sm mb-4 border-info">
<div class="card-header bg-info text-dark fw-bold">
<i class="fas fa-file-invoice-dollar me-2"></i><?= _("Récapitulatif des primes") ?>
<form name="formficheadehrent" id="formficheadehrent" method="POST" class="container-fluid py-1">
<input type="hidden" id="codeEtatFacturation" name="codeEtatFacturation" value="<?= $adherent['codeEtatFacturation'] ?>">
<input type="hidden" id="numeroBeneficiaire" name="numeroBeneficiaire" value="<?= $adherent['numeroBeneficiaire'] ?>">
<input type="hidden" id="codeEtatAdherent" name="codeEtatAdherent" value="<?= $adherent['codeEtatAdherent'] ?>">
<?php if ($adherentRetire == "1") : ?>
<div class="alert alert-danger d-flex align-items-center mb-4 shadow-sm" role="alert">
<i class="fas fa-exclamation-triangle me-3 fa-2x"></i>
<div>
<h4 class="alert-heading mb-0"><?= _("Adhérent sorti le") . " : " . dateLang($dateSortieAdherent) ?></h4>
</div>
</div>
<?php endif; ?>
<div class="card shadow-sm mb-4">
<div class="card-header d-flex justify-content-between align-items-center">
<h5 class="mb-0"><i class="fas fa-user-circle me-2"></i><?= _("Informations sur l'adhérent") ?> : <span class="badge bg-light text-primary"><?= $this->nettoyer($adherent['numeroAdherent']) ?></span></h5>
</div>
<div class="card-body bg-light">
<div class="row g-3">
<div class="col-md-4">
<label class="form-label small text-uppercase fw-bold"><?= _("Nom & Prénoms") ?></label>
<div class="input-group">
<span class="input-group-text"><i class="fas fa-id-card"></i></span>
<input type="text" class="form-control" value="<?= $this->nettoyer($adherent['nom']) ?> <?= $this->nettoyer($adherent['prenoms']) ?>" readonly>
</div>
</div>
<div class="col-md-4">
<label class="form-label small text-uppercase fw-bold"><?= _("Collège") ?></label>
<input type="text" class="form-control" value="<?= $this->nettoyer($adherent['libelleCollege']) ?>" readonly>
</div>
<div class="col-md-4">
<label class="form-label small text-uppercase fw-bold"><?= _("Contact") ?></label>
<div class="input-group">
<span class="input-group-text"><i class="fas fa-phone"></i></span>
<input type="text" class="form-control" value="<?= $this->nettoyer($adherent['telephonePortable']) ?>" readonly>
</div>
</div>
<div class="col-md-4">
<label class="form-label small text-uppercase fw-bold"><?= _("E-mail") ?></label>
<input type="email" class="form-control" value="<?= $this->nettoyer($adherent['email']) ?>" readonly>
</div>
<div class="col-md-8">
<label class="form-label small text-uppercase fw-bold"><?= _("Localisation") ?></label>
<div class="input-group">
<span class="input-group-text"><i class="fas fa-map-marker-alt"></i></span>
<input type="text" class="form-control" value="<?= $this->nettoyer($adherent['pays']) ?> / <?= $this->nettoyer($adherent['ville']) ?> / <?= $this->nettoyer($adherent['localite']) ?>" readonly>
</div>
</div>
</div>
<?php if ($controlerPlafondAdherent): ?>
<hr class="my-4">
<div class="row g-3 text-center">
<div class="col-md-4">
<div class="p-3 border rounded bg-white shadow-sm">
<div class="small fw-bold text-primary text-uppercase"><?= _("Plafond Famille") ?></div>
<div class="h4 mb-0 text-primary fw-bold"><?= format_N($limite_adherent['plafondAdherent']) ?></div>
</div>
</div>
<div class="col-md-4">
<div class="p-3 border rounded bg-white shadow-sm border-danger">
<div class="small fw-bold text-danger text-uppercase"><?= _("Consommations") ?></div>
<div class="h4 mb-0 text-danger fw-bold"><?= format_N($limite_adherent['consommationAdherent']) ?></div>
</div>
</div>
<div class="col-md-4">
<div class="p-3 border rounded bg-success text-white shadow-sm">
<div class="small fw-bold text-uppercase"><?= _("Solde Disponible") ?></div>
<div class="h4 mb-0 fw-bold"><?= format_N($limite_adherent['soldeAdherent']) ?></div>
</div>
</div>
</div>
<?php endif; ?>
</div>
</div>
<?php if ($codeTypeContrat == "F"): ?>
<div class="card shadow-sm mb-4 border-info">
<div class="card-header bg-info text-dark fw-bold">
<i class="fas fa-file-invoice-dollar me-2"></i><?= _("Récapitulatif des primes") ?>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-sm table-hover mb-0 align-middle">
<thead class="table-light">
<tr>
<th class="text-center"><?= _("Prime HT") ?></th>
<th class="text-center"><?= _("Taxes") ?></th>
<th class="text-center"><?= _("Prime TTC") ?></th>
<th class="text-center"><?= _("Nb Échéances") ?></th>
<th class="text-center"><?= _("Part Assureur") ?></th>
<th class="text-center"><?= _("Part Tiers") ?></th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center fw-bold"><?= format_N($adherent['primeHt']) ?></td>
<td class="text-center text-muted"><?= format_N($adherent['taxe']) ?></td>
<td class="text-center fw-bold text-primary"><?= format_N($adherent['primeTtc']) ?></td>
<td class="text-center"><?= $adherent['nbEcheance'] ?></td>
<td class="text-center"><span class="badge bg-primary"><?= format_N($adherent['partAssureur']) ?></span></td>
<td class="text-center"><span class="badge bg-danger"><?= format_N($adherent['partTiers']) ?></span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<?php endif; ?>
<div class="card shadow-sm mb-4">
<div class="card-header">
<h5 class="mb-0"><i class="fas fa-users me-2"></i><?= _('Composition de la famille') ?></h5>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-sm table-hover mb-0 align-middle">
<thead class="table-light">
<tr>
<th class="text-center"><?= _("Prime HT") ?></th>
<th class="text-center"><?= _("Taxes") ?></th>
<th class="text-center"><?= _("Prime TTC") ?></th>
<th class="text-center"><?= _("Nb Échéances") ?></th>
<th class="text-center"><?= _("Part Assureur") ?></th>
<th class="text-center"><?= _("Part Tiers") ?></th>
<div class="table-responsive" style="max-height: 400px; overflow-y: auto;">
<table class="table table-hover table-striped mb-0 align-middle shadow-sm">
<thead class="table-dark sticky-top">
<tr class="small">
<th><?= _("Photo") ?></th>
<th><?= _("N° Bénéf.") ?></th>
<th><?= _("Nom & Prénoms") ?></th>
<th class="text-center"><?= _("Sexe") ?></th>
<th><?= _("Lien") ?></th>
<th class="text-center"><?= _("Âge") ?></th>
<th class="text-end"><?= _("Prime HT") ?></th>
<th class="text-end"><?= _("Prime TTC") ?></th>
<th class="text-center"><?= _("État") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($beneficiaires as $beneficiaire):
$photoPath = ($beneficiaire['faceRegistered'] == "1") ? $_SESSION['dossierPhoto_C'].$_SESSION['dossierSociete'].'/Photos/'.$beneficiaire['lienPhoto'] : '';
$faceRegistered = $this->nettoyer($beneficiaire['faceRegistered']);
?>
<tr class="pointer-cursor" onclick="selectionner_beneficiaire(<?= $beneficiaire['idBeneficiaire'] ?>,'<?= $beneficiaire['numeroBeneficiaire'] ?>'); afficher_beneficiaire_id();">
<td class="text-center">
<?php if($faceRegistered == "1"): ?>
<img src="<?= $photoPath ?>" class="rounded-circle border" width="32" height="32" alt="Photo">
<?php else: ?>
<i class="fas fa-user-circle photo-zoom" style="color: #ccc; font-size: 32px;"></i>
<?php endif; ?>
</td>
<td><span class="badge bg-secondary text-light border"><?= $beneficiaire['numeroBeneficiaire'] ?></span></td>
<td class="fw-bold"><?= $this->nettoyer($beneficiaire['nomBeneficiaire']) ?> <?= $this->nettoyer($beneficiaire['prenomsBeneficiaire']) ?></td>
<td class="text-center"><?= $beneficiaire['sexe'] ?></td>
<td><?= (est_anglophone()) ? $beneficiaire['LienParenteEng'] : $beneficiaire['LienParente'] ?></td>
<td class="text-center"><?= $beneficiaire['age'] ?> ans</td>
<td class="text-end"><?= format_N($beneficiaire['primeHt']) ?></td>
<td class="text-end fw-bold"><?= format_N($beneficiaire['primeTtc']) ?></td>
<td class="text-center">
<span class="badge <?= ($beneficiaire['codeEtatBeneficiaire'] == 'V') ? 'bg-success' : 'bg-danger' ?>">
<?= $beneficiaire['codeEtatBeneficiaire'] ?>
</span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot class="table-light fw-bold text-end">
<tr>
<td class="text-center fw-bold"><?= format_N($adherent['primeHt']) ?></td>
<td class="text-center text-muted"><?= format_N($adherent['taxe']) ?></td>
<td class="text-center fw-bold text-primary"><?= format_N($adherent['primeTtc']) ?></td>
<td class="text-center"><?= $adherent['nbEcheance'] ?></td>
<td class="text-center"><span class="badge bg-primary"><?= format_N($adherent['partAssureur']) ?></span></td>
<td class="text-center"><span class="badge bg-danger"><?= format_N($adherent['partTiers']) ?></span></td>
<td colspan="6" class="text-center"><?= _("TOTAL FAMILLE") ?></td>
<td><?= format_N($totalbeneficiaires['primeHt']) ?></td>
<td class="text-primary"><?= format_N($totalbeneficiaires['primeTtc']) ?></td>
<td></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
<div class="card shadow-sm">
<div class="card-header">
<i class="fas fa-shield-alt me-2"></i><?= _("Limites et Garanties de la famille") ?>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-sm table-hover align-middle mb-0">
<thead class="bg-light">
<tr class="small text-uppercase">
<th class="ps-3"><?= _("Garantie") ?></th>
<th class="text-center"><?= _("Plafond") ?></th>
<th class="text-center"><?= _("Conso.") ?></th>
<th class="text-center"><?= _("Solde") ?></th>
<th class="text-center"><?= _("Par tête") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($garantieadherents as $garantieadherent): ?>
<tr>
<td class="ps-3 fw-bold"><?= $this->nettoyer($garantieadherent['garantie']) ?></td>
<td class="text-center fw-bold"><?= format_N($garantieadherent['plafond']) ?></td>
<td class="text-center text-danger"><?= ($garantieadherent['champApplication'] != '1') ? format_N($garantieadherent['consommation']) : '-' ?></td>
<td class="text-center fw-bold text-success"><?= ($garantieadherent['champApplication'] != '1') ? format_N($garantieadherent['solde']) : '-' ?></td>
<td class="text-center text-primary">
<i class="fas <?= ($garantieadherent['champApplication'] == '1') ? 'fa-check-circle' : 'fa-minus text-muted' ?>"></i>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<?php endif; ?>
</form>
<div class="card shadow-sm mb-4">
<div class="card-header bg-secondary text-white">
<h5 class="mb-0"><i class="fas fa-users me-2"></i><?= _('Composition de la famille') ?></h5>
<!-- Responsive Area Chart -->
<div class="row mt-2">
<div class="col-xl-8 col-lg-7 mb-2">
<div class="card shadow h-100">
<div class="card-header py-1 d-flex flex-column flex-md-row justify-content-between align-items-center">
<h6 class="m-0 font-weight-bold text-primary"><?= _("Dépenses mensuelles") ?></h6>
<div class="mt-2 mt-md-0">
<button id="exportTrendBtn" class="btn btn-sm btn-danger mr-2">
<i class="fas fa-download"></i> PDF
</button>
<small class="text-muted"><?= _("Évolution sur 12 mois") ?></small>
</div>
</div>
<div class="card-body">
<div class="chart-container" style="position: relative; height:300px; width:100%">
<canvas id="expenseTrendChart"></canvas>
</div>
</div>
</div>
</div>
<div class="card-body p-0">
<div class="table-responsive" style="max-height: 400px; overflow-y: auto;">
<table class="table table-hover table-striped mb-0 align-middle shadow-sm">
<thead class="table-dark sticky-top">
<tr class="small">
<th><?= _("Photo") ?></th>
<th><?= _("N° Bénéf.") ?></th>
<th><?= _("Nom & Prénoms") ?></th>
<th class="text-center"><?= _("Sexe") ?></th>
<th><?= _("Lien") ?></th>
<th class="text-center"><?= _("Âge") ?></th>
<th class="text-end"><?= _("Prime HT") ?></th>
<th class="text-end"><?= _("Prime TTC") ?></th>
<th class="text-center"><?= _("État") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($beneficiaires as $beneficiaire):
$photoPath = ($beneficiaire['faceRegistered'] == "1") ? $_SESSION['dossierPhoto_C'].$_SESSION['dossierSociete'].'/Photos/'.$beneficiaire['lienPhoto'] : '';
$faceRegistered = $this->nettoyer($beneficiaire['faceRegistered']);
?>
<tr class="pointer-cursor" onclick="selectionner_beneficiaire(<?= $beneficiaire['idBeneficiaire'] ?>,'<?= $beneficiaire['numeroBeneficiaire'] ?>')">
<td class="text-center">
<?php if($faceRegistered == "1"): ?>
<img src="<?= $photoPath ?>" class="rounded-circle border" width="32" height="32" alt="Photo">
<?php else: ?>
<i class="fas fa-user-circle photo-zoom" style="color: #ccc; font-size: 32px;"></i>
<?php endif; ?>
</td>
<td><span class="badge bg-light text-dark border"><?= $beneficiaire['numeroBeneficiaire'] ?></span></td>
<td class="fw-bold"><?= $this->nettoyer($beneficiaire['nomBeneficiaire']) ?> <?= $this->nettoyer($beneficiaire['prenomsBeneficiaire']) ?></td>
<td class="text-center"><?= $beneficiaire['sexe'] ?></td>
<td><?= (est_anglophone()) ? $beneficiaire['LienParenteEng'] : $beneficiaire['LienParente'] ?></td>
<td class="text-center"><?= $beneficiaire['age'] ?> ans</td>
<td class="text-end"><?= format_N($beneficiaire['primeHt']) ?></td>
<td class="text-end fw-bold"><?= format_N($beneficiaire['primeTtc']) ?></td>
<td class="text-center">
<span class="badge <?= ($beneficiaire['codeEtatBeneficiaire'] == 'A') ? 'bg-success' : 'bg-warning' ?>">
<?= $beneficiaire['codeEtatBeneficiaire'] ?>
</span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot class="table-light fw-bold text-end">
<tr>
<td colspan="6" class="text-center"><?= _("TOTAL FAMILLE") ?></td>
<td><?= format_N($totalbeneficiaires['primeHt']) ?></td>
<td class="text-primary"><?= format_N($totalbeneficiaires['primeTtc']) ?></td>
<td></td>
</tr>
</tfoot>
</table>
<!-- Responsive Pie Chart -->
<div class="col-xl-4 col-lg-5 mb-2">
<div class="card shadow h-100">
<div class="card-header py-1 d-flex justify-content-between align-items-center">
<h6 class="m-0 font-weight-bold text-primary"><?= _("Dépenses par lien parenté") ?></h6>
<button id="exportPieBtn" class="btn btn-sm btn-danger">
<i class="fas fa-download"></i> PDF
</button>
</div>
<div class="card-body d-flex flex-column">
<div class="chart-container" style="position: relative; height:250px; width:100%">
<canvas id="expenseDistributionChart"></canvas>
</div>
<div id="pieChartLegend" class="mt-3 text-center"></div>
<div class="mt-auto pt-3">
<small class="text-muted"><?= _("Répartition en pourcentage") ?></small>
</div>
</div>
</div>
</div>
</div>
<div class="card shadow-sm border-warning">
<div class="card-header bg-warning text-dark fw-bold">
<i class="fas fa-shield-alt me-2"></i><?= _("Limites et Garanties de la famille") ?>
</div>
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-sm table-hover align-middle mb-0">
<thead class="bg-light">
<tr class="small text-uppercase">
<th class="ps-3"><?= _("Garantie") ?></th>
<th class="text-center"><?= _("Plafond") ?></th>
<th class="text-center"><?= _("Conso.") ?></th>
<th class="text-center"><?= _("Solde") ?></th>
<th class="text-center"><?= _("Par tête") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($garantieadherents as $garantieadherent): ?>
<tr>
<td class="ps-3 fw-bold"><?= $this->nettoyer($garantieadherent['garantie']) ?></td>
<td class="text-center fw-bold"><?= format_N($garantieadherent['plafond']) ?></td>
<td class="text-center text-danger"><?= ($garantieadherent['champApplication'] != '1') ? format_N($garantieadherent['consommation']) : '-' ?></td>
<td class="text-center fw-bold text-success"><?= ($garantieadherent['champApplication'] != '1') ? format_N($garantieadherent['solde']) : '-' ?></td>
<td class="text-center text-primary">
<i class="fas <?= ($garantieadherent['champApplication'] == '1') ? 'fa-check-circle' : 'fa-minus text-muted' ?>"></i>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<!-- Bar Chart Section -->
<div class="row mt-4">
<div class="col-12 mb-2">
<div class="card shadow h-100">
<div class="card-header py-1 d-flex justify-content-between align-items-center">
<h6 class="m-0 font-weight-bold text-primary"><?= _("Dépenses par garantie") ?></h6>
<button id="exportBarBtn" class="btn btn-sm btn-danger">
<i class="fas fa-download"></i> PDF
</button>
</div>
<div class="card-body">
<div class="chart-container" style="position: relative; height:400px; width:100%">
<canvas id="depensesChart"></canvas>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<style>
.pointer-cursor { cursor: pointer; transition: background 0.2s; }
@ -262,4 +336,332 @@
.table-responsive { border-radius: 0.375rem; }
.input-group-text { background-color: #f8f9fa; color: #6c757d; }
input[readonly] { cursor: default; }
</style>
</style>
<script>
// Configuration commune
(function() {
// Format numérique simplifié (sans devise)
const formatMoney = (value) => {
return new Intl.NumberFormat('fr-FR').format(value);
};
// Format pourcentage sécurisé
const formatPercentage = (value, total) => {
if (total === 0) {
return '0%'; // ou 'N/A' si tu préfères
}
const percentage = (value * 100 / total).toFixed(1);
return percentage + '%';
};
// Détection mobile
const isMobile = window.matchMedia("(max-width: 768px)").matches;
// Génération des couleurs
const generateColors = (count) => {
const palette = [
'#4e73df', '#1cc88a', '#36b9cc', '#f6c23e',
'#e74a3b', '#858796', '#5a5c69', '#3a3b45',
'#2e59a9', '#17a673', '#2c9faf', '#dda20a'
];
return palette.slice(0, count).concat(
Array.from({length: Math.max(0, count - palette.length)}, (_, i) => {
const hue = Math.floor(360 * (i / Math.max(1, count - palette.length)));
return `hsl(${hue}, 70%, 60%)`;
})
);
};
// Fonction pour générer une légende personnalisée
function generateCustomLegend(chart, containerId) {
const legendContainer = document.getElementById(containerId);
legendContainer.innerHTML = '';
const items = chart.data.datasets[0].data.map((value, i) => {
const total = chart.data.datasets[0].data.reduce((a, b) => a + b, 0);
const percentage = formatPercentage(value, total);
return `
<div class="d-inline-block mx-2 my-1">
<span class="legend-color" style="
display: inline-block;
width: 12px;
height: 12px;
background-color: ${chart.data.datasets[0].backgroundColor[i]};
border: 1px solid #fff;
vertical-align: middle;
"></span>
<span class="legend-text small ml-1">
${chart.data.labels[i]}: ${formatMoney(value)} (${percentage})
</span>
</div>
`;
});
legendContainer.innerHTML = items.join('');
}
// Fonction pour exporter un graphique en PDF
function exportChartToPDF(chartId, fileName) {
const { jsPDF } = window.jspdf;
const canvas = document.getElementById(chartId);
html2canvas(canvas).then(canvasImage => {
const imgData = canvasImage.toDataURL('image/png');
const pdf = new jsPDF({
orientation: canvasImage.width > canvasImage.height ? 'landscape' : 'portrait'
});
const pageWidth = pdf.internal.pageSize.getWidth();
const pageHeight = pdf.internal.pageSize.getHeight();
const ratio = canvasImage.height / canvasImage.width;
let imgWidth = pageWidth - 20;
let imgHeight = imgWidth * ratio;
if (imgHeight > pageHeight - 20) {
imgHeight = pageHeight - 20;
imgWidth = imgHeight / ratio;
}
pdf.addImage(imgData, 'PNG',
(pageWidth - imgWidth) / 2,
(pageHeight - imgHeight) / 2,
imgWidth,
imgHeight
);
pdf.save(fileName + '.pdf');
});
}
// Graphique d'évolution des dépenses
const dataMois = <?= $dataConsoParMois ?>;
const trendCtx = document.getElementById('expenseTrendChart').getContext('2d');
const trendChart = new Chart(trendCtx, {
type: 'line',
data: {
labels: dataMois.mois,
datasets: [{
label: '<?= _("Montant dépensé") ?>',
data: dataMois.consos,
backgroundColor: 'rgba(78, 115, 223, 0.05)',
borderColor: 'rgba(78, 115, 223, 1)',
borderWidth: 2,
pointBackgroundColor: 'rgba(78, 115, 223, 1)',
pointRadius: isMobile ? 3 : 4,
pointHoverRadius: 6,
fill: true,
tension: 0.3
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
},
tooltip: {
mode: 'index',
intersect: false,
callbacks: {
label: function(context) {
return context.dataset.label + ': ' + formatMoney(context.parsed.y);
}
}
}
},
scales: {
x: {
grid: {
display: false
},
ticks: {
maxRotation: isMobile ? 45 : 0,
autoSkip: true,
maxTicksLimit: isMobile ? 6 : 12
}
},
y: {
beginAtZero: false,
ticks: {
callback: function(value) {
return formatMoney(value);
}
},
grid: {
color: 'rgba(0, 0, 0, 0.05)'
}
}
},
interaction: {
mode: 'nearest',
axis: 'x',
intersect: false
}
}
});
// Graphique de répartition
const dataLiens = <?= $dataConsoParLiens ?>;
const distributionCtx = document.getElementById('expenseDistributionChart').getContext('2d');
const distributionChart = new Chart(distributionCtx, {
type: 'pie',
data: {
labels: dataLiens.lienparente,
datasets: [{
data: dataLiens.consos_liens,
backgroundColor: generateColors(<?= $nbreLienParente; ?>),
borderColor: '#fff',
borderWidth: 2
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false,
},
datalabels: {
formatter: (value, ctx) => {
const sum = ctx.chart.data.datasets[0].data.reduce((a, b) => a + b, 0);
return formatPercentage(value, sum);
},
color: '#fff',
font: {
weight: 'bold',
size: isMobile ? 10 : 12
}
},
tooltip: {
callbacks: {
label: function(context) {
const label = context.label || '';
const value = context.raw || 0;
const sum = context.dataset.data.reduce((a, b) => a + b, 0);
const percentage = formatPercentage(value, sum);
return `${label}: ${formatMoney(value)} (${percentage})`;
}
}
}
},
cutout: isMobile ? '60%' : '50%'
},
plugins: [ChartDataLabels]
});
// Graphique des dépenses par garantie
const dataConso = <?= $dataConsoParGaranties ?>;
const barCtx = document.getElementById('depensesChart').getContext('2d');
const barChart = new Chart(barCtx, {
type: 'bar',
data: {
labels: dataConso.garanties,
datasets: [{
label: 'Dépenses',
data: dataConso.depenses,
backgroundColor: 'rgba(54, 162, 235, 0.7)',
borderColor: 'rgba(54, 162, 235, 1)',
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
annotation: {
annotations: dataConso.plafonds.map((plafond, index) => {
if (plafond === null) return null;
return {
type: 'line',
yMin: plafond,
yMax: plafond,
borderColor: 'rgba(255, 99, 132, 0.7)',
borderWidth: 2,
borderDash: [6, 6],
label: {
content: `Plafond: ${formatMoney(plafond)}`,
enabled: true,
position: 'right'
}
};
}).filter(annotation => annotation !== null)
},
legend: {
display: false
},
tooltip: {
callbacks: {
label: function(context) {
const plafond = dataConso.plafonds[context.dataIndex];
let tooltip = `Dépenses: ${formatMoney(context.parsed.y)}`;
if (plafond !== null) {
const pourcentage = Math.min(100, Math.round((context.parsed.y / plafond) * 100));
tooltip += ` (${pourcentage}% du plafond)`;
} else {
tooltip += ' (plafond illimité)';
}
return tooltip;
}
}
}
},
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: `Montant des dépenses`,
font: {
weight: 'bold'
}
},
ticks: {
callback: function(value) {
return formatMoney(value);
}
},
suggestedMax: Math.max(...dataConso.depenses) * 1.5
},
x: {
title: {
display: true,
text: 'Garanties',
font: {
weight: 'bold'
}
},
grid: {
display: false
}
}
}
}
});
// Générer la légende au chargement et lors du redimensionnement
generateCustomLegend(distributionChart, 'pieChartLegend');
window.addEventListener('resize', function() {
generateCustomLegend(distributionChart, 'pieChartLegend');
});
// Boutons d'export PDF
document.getElementById('exportTrendBtn').addEventListener('click', () => {
exportChartToPDF('expenseTrendChart', 'evolution_depenses_mensuelles');
});
document.getElementById('exportPieBtn').addEventListener('click', () => {
exportChartToPDF('expenseDistributionChart', 'repartition_depenses_parente');
});
document.getElementById('exportBarBtn').addEventListener('click', () => {
exportChartToPDF('depensesChart', 'depenses_par_garantie');
});
})();
</script>

View File

@ -77,307 +77,568 @@
</div>
<FORM name= "formfichebeneficiaire" id ="formfichebeneficiaire" method="POST">
<fieldset>
<legend><?= _("Bénéficiaire") . " : (" . $beneficiaire['numeroBeneficiaire'] . ") => " . _("Date Effet") . " : " . dateLang($this->nettoyer($beneficiaire['dateEffet'])) ?> </legend>
<table class="table table-responsive table-condensed" style="font-size:10pt;" >
<tbody>
<tr>
<td width="10%" > <?= _("Collège") ?> </td>
<td width="24%" > <INPUT style="font-size:10pt;" class="form-control" TYPE="text" id="produit" name="produit" value="<?= $beneficiaire['libelleCollege'] ?>" readonly ></td>
<td width="10%" align="center"> <?= _("Entrée") ?> </td>
<td width="24%" > <INPUT style="font-size:10pt;" class="form-control" TYPE="text" id="dateEntree" NAME="dateEntree" value="<?= dateLang($this->nettoyer($beneficiaire['dateEntree'])) ?>" readonly></td>
<td width="10%" align="center"> <?= _("No Bénéf") ?> </td>
<td width="22%" > <INPUT style="font-size:10pt;" class="form-control" TYPE="text" id="nomBeneficiaire" NAME="nomBeneficiaire" value="<?= $beneficiaire['nomBeneficiaire'] ?>" readonly ></td>
</tr>
<tr>
<td> <?= _("Prénoms") ?> </td>
<td> <INPUT style="font-size:10pt;" class="form-control" TYPE="text" id="prenomsBeneficiaire" NAME="prenomsBeneficiaire" value="<?= $beneficiaire['prenomsBeneficiaire'] ?>" readonly ></td>
<td align="center"> <?= _("Lien Parenté") ?> </td>
<td> <INPUT style="font-size:10pt;" class="form-control" TYPE="text" id="lienparente" name="lienparente" value="<?= $lienparente ?>" readonly ></td>
<td align="center"> <?= _("Naissance") ?> </td>
<td> <INPUT cstyle="font-size:10pt;" lass="form-control" TYPE="text" id="dateNaissance" NAME="dateNaissance" value="<?= dateLang($this->nettoyer($beneficiaire['dateNaissance'])).' => '.$beneficiaire['age'].' ans' ?>" readonly></td>
</tr>
<tr>
<td>Sex</td>
<td> <INPUT style="font-size:10pt;" class="form-control" TYPE="text" id="sexe" name="sexe" value="<?= $beneficiaire['sexe'] ?>" readonly ></td>
<td align="center"> <?= _("Groupe Sang") ?> </td>
<td> <INPUT style="font-size:10pt;" class="form-control" TYPE="text" id="codeGroupeSanguin" name="codeGroupeSanguin" value="<?= $beneficiaire['codeGroupeSanguin'] ?>" readonly ></td>
<td align="center"> <?= _("Nat Pièce") ?></td>
<td> <INPUT style="font-size:10pt;" class="form-control" TYPE="text" id="naturepiece" name="naturepiece" value="<?= $naturepiece ?>" readonly ></td>
</tr>
<tr>
<td><?= _("No Pièce") ?></td>
<td> <INPUT style="font-size:10pt;" class="form-control" TYPE="text" id="numeroPiece" NAME="numeroPiece" value="<?= $beneficiaire['numeroPiece'] ?>" readonly ></td>
<td align="center"> <?= _("Tél Port") ?> </td>
<td> <INPUT style="font-size:10pt;" class="form-control" TYPE="tel" id="telephonePortable" NAME="telephonePortable" value="<?= $beneficiaire['telephonePortable'] ?>" readonly ></td>
<td align="center"> <?= _("Etat") ?> </td>
<?php if ($dateEffetCouvert=="0") : ?>
<td align="center" style='font-size:10pt; background-color:red;color:white;'> <?= _("Non renouvelé") ?> </td>
<?php else: ?>
<?php if ($estcouvert) : ?>
<?php if ($beneficiaire['codeEtatBeneficiaire']=="V"): ?>
<td align="center" style='font-size:10pt; background-color:blue;color:white;'> <?= $etatbeneficiaire ?> </td>
<?php else: ?>
<td align="center" style='font-size:10pt; background-color:red;color:white;'> <?= $etatbeneficiaire ?> </td>
<?php endif; ?>
<?php else: ?>
<?php if ($estsorti): ?>
<td align="center" style='font-size:10pt; background-color:red;color:white;'> <?= _("Retiré") ?> </td>
<?php else: ?>
<td align="center" style='font-size:10pt; background-color:red;color:white;'> <?= _("Expiré") ?> </td>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</tr>
<tr>
<td> <?= _("Sortie") ?> </td>
<td><INPUT class="form-control" TYPE="text" id="dateSortie" NAME="dateSortie" value="<?= dateLang($this->nettoyer($beneficiaire['dateSortie'])) ?>" readonly></td>
<td align="center"> <?= _("Motif Sortie") ?> </td>
<td><INPUT class="form-control" TYPE="text" id="motifSortie" NAME="motifSortie" value="<?= $motifsortie ?>" readonly></td>
<td align="center"> <?= _("No Fam") ?> </td>
<td><INPUT class="form-control" TYPE="text" value="<?= $beneficiaire['numeroAdherent'] ?>" readonly ></td>
</tr>
<?php if($controlerPlafondAdherent): ?>
<tr>
<td> <?= _("Plafond Famille") ?> </td>
<td><INPUT style='text-align:center; background-color:blue;color:white; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($limite_adherent['plafondAdherent']) ?>" readonly ></td>
<td align="center"> <?= _("Consommations") ?> </td>
<td><INPUT style='text-align:center; background-color:rgba(255, 0, 127);color:white; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($limite_adherent['consommationAdherent']) ?>" readonly ></td>
<td align="center"> <?= _("Solde") ?> </td>
<td> <INPUT style='text-align:center; background-color:green;color:white; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($limite_adherent['soldeAdherent']) ?>" readonly ></td>
</tr>
<?php endif; ?>
<?php if($controlerPlafondBeneficiaire): ?>
<tr>
<td> <?= _("Plafond Individuel") ?> </td>
<td><INPUT style='text-align:center; background-color:blue;color:white; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($limite_beneficiaire['plafondBeneficiaire']) ?>" readonly ></td>
<td align="center"> <?= _("Consommations") ?> </td>
<td><INPUT style='text-align:center; background-color:rgba(255, 0, 127);color:white; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($limite_beneficiaire['consommationBeneficiaire']) ?>" readonly ></td>
<td align="center"> <?= _("Solde") ?> </td>
<td><INPUT style='text-align:center; background-color:green;color:white; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($limite_beneficiaire['soldeBeneficiaire']) ?>" readonly ></td>
</tr>
<?php endif; ?>
<?php if($codeTypeContrat=="F"): ?>
<tr>
<td width="10%" > <?= _("Commercial") ?> </td>
<td> <input class = "form-control btn btn-info" type="button" value="<?= $libelleApporteur ?>" onClick="javascript:agent_commercial(<?= $idApporteur ?>);" > </td>
<td width="10%" align="center"> <?= _("Echéancier") ?> </td>
<td> <INPUT class="form-control" TYPE="text" value="<?= $typeecheancier ?>" readonly > </td>
<td width="10%" align="center"> <?= _("Tx Intérêt") ?> </td>
<td> <INPUT class="form-control" TYPE="text" value="<?= $tauxInteretEcheancier ?>" readonly > </td>
</tr>
<?php endif; ?>
</tbody>
</table>
</fieldset>
<div id="div_prime">
<?php if($codeTypeContrat=="F"): ?>
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<thead>
<tr>
<th colspan="8" style='text-align:center'> <?= _("Récapitulatif primes") ?> </th>
</tr>
</thead>
<tbody>
<tr>
<td width="10%" > <?= _("Prime HT") ?> </td>
<td > <INPUT style='text-align:center; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($this->nettoyer($beneficiaire['primeHt'])) ?>" readonly > </td>
<td width="10%" align="center"> <?= _("Taxes") ?> </td>
<td> <INPUT style='text-align:center; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($beneficiaire['taxe']) ?>" readonly > </td>
<td width="10%" align="center"> <?= _("Prime TTC") ?> </td>
<td> <INPUT style='text-align:center; font-size:10pt;' class="form-control" TYPE="tel" value="<?= format_N($this->nettoyer($beneficiaire['primeTtc'])) ?>" readonly > </td>
<td width="10%" align="center"> <?= _("Nb Echéances") ?> </td>
<td> <INPUT style='text-align:center; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($beneficiaire['nbEcheance']) ?>" readonly > </td>
</tr>
<tr>
<td> <?= _("Taux Surcharge") ?> </td>
<td > <INPUT style='text-align:center; font-size:10pt;' class="form-control" TYPE="tel" value="<?= $this->nettoyer($beneficiaire['tauxInteretEcheancier']) ?>" readonly > </td>
<td align="center" > <?= _("Surcharge") ?> </td>
<td> <INPUT style='text-align:center; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($beneficiaire['interet']) ?>" readonly > </td>
<td align="center" > <?= _("Prime Totale") ?> </td>
<td> <INPUT style='text-align:center; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($beneficiaire['primeTtcTousEcheances']) ?>" readonly > </td>
<td align="center" > <?= _("Prime échance") ?> </td>
<td> <INPUT style='text-align:center; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($beneficiaire['primeTtcEcheances']) ?>" readonly > </td>
</tr>
<tr>
<td> <?= _("Commission") ?> </td>
<td> <INPUT style='text-align:center; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($beneficiaire['commissionAutre']) ?>" readonly > </td>
<td align="center" > <?= _("Part assureur") ?> </td>
<td> <INPUT style='text-align:center; background-color:blue;color:white; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($this->nettoyer($beneficiaire['partAssureur'])) ?>" readonly> </td>
<td align="center" > <?= _("Part des tiers") ?> </td>
<td> <INPUT style='text-align:center; background-color:red;color:white; font-size:10pt;' class="form-control" TYPE="text" value="<?= format_N($this->nettoyer($beneficiaire['partTiers'])) ?>" readonly> </td>
</tr>
</tbody>
</table>
<?php endif; ?>
</div>
<?php if ($estsorti): ?>
<div class="alert alert-danger" style="height:30px; padding:5px; margin-bottom:5px; text-align:center;" >
<H4><?= _("Date sortie") . " : " . dateLang($dateSortieBeneficiaire) ?></H4>
</div>
<?php endif; ?>
<fieldset>
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:9pt;">
<thead>
<tr>
<th style="text-align:center"> <?= _("Exercice") ?> </th>
<th style="text-align:center"> <?= _("Garantie") ?> </th>
<th style="text-align:center"> <?= _("Limites Contrat") ?> </th>
<th style="text-align:center"> <?= _("Taux Incorporation (%)") ?> </th>
<th style="text-align:center"> <?= _("Limites en vigeur") ?> </th>
<th style="text-align:center"> <?= _("Consommations") ?> </th>
<th style="text-align:center"> <?= _("Solde") ?> </th>
<th style="text-align:center"> <?= _("Par tête?") ?> </th>
<th style="text-align:center"> <?= _("Parent") ?> </th>
</tr>
</thead>
<tbody>
<?php foreach ($garantieadherents as $garantieadherent):
$champApplication = $this->nettoyer($garantieadherent['champApplication']);
?>
<tr valign="top">
<td align='center'> <?= $this->nettoyer($garantieadherent['exercieReference'])?> </td>
<td align='center'> <?= $this->nettoyer($garantieadherent['garantie'])?> </td>
<td align='center'><?= format_N($this->nettoyer($garantieadherent['plafondAnnuel'])) ?></td>
<td align='center'><?= $this->nettoyer($garantieadherent['tauxAvenant']) ?></td>
<td align='center'><?= format_N($this->nettoyer($garantieadherent['plafond'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($garantieadherent['consommation'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($garantieadherent['solde'])) ?></td>
<?php if($champApplication=='1'): ?>
<td align='center'> <input type="checkbox" checked value="<?php echo $champApplication ; ?>" disabled ></td>
<?php else: ?>
<td align='center'> <input type="checkbox" value="<?php echo $champApplication ; ?>" disabled ></td>
<?php endif; ?>
<td align='center'> <?= $this->nettoyer($garantieadherent['garantieparentaffichage'])?> </td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</fieldset>
</FORM>
<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 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>
<div class="row align-items-start">
<!-- Colonne pour l'image -->
<div class="col-auto">
<?php if($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 endif; ?>
</div>
<div id="div_adherent" class="container-fluid py-1 animate__animated animate__fadeIn">
<!-- Colonne pour le formulaire -->
<div class="col">
<form enctype="multipart/form-data" action="Fichebeneficiaire/<?= $_SESSION['idBeneficiaire_C'] ?>/" method="post">
<?php if ($beneficiaire['lienPhoto']<=' '): ?>
<div class="col-xs-12">
<INPUT style="text-align: center" class="form-control" TYPE="text" value="<?= _("Aucune photo") ?>" readonly>
</div>
<?php endif; ?>
<div class="col-xs-12">
<fieldset>
<?php if ($_SESSION['lienPhoto_C']>" "): ?>
<INPUT style="font-size: 15px; height: 30px" class="form-control" TYPE="text" value="<?= _("Changer la photo") ?>" readonly >
<?php else: ?>
<INPUT style="font-size: 15px; height: 30px" class="form-control" TYPE="text" value="<?= _("Attribuer une photo") ?>" readonly >
<?php endif; ?>
<label for="fichier_a_uploader" title="Recherchez une photo!"></label>
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<input style="font-size: 15px; height: 40px" class="form-control btn btn-primary" name="fichier_image_a_uploader" type="file" id="fichier_image_a_uploader" />
<br>
<input style="font-size: 15px; height: 30px" class="form-control btn btn-primary" type="submit" name="submit" value="<?= _("Mettre à jour") ?>" />
</fieldset>
<h4 style="text-align: center">
<?php if ($message>" "): ?>
<div class="col-xs-12 alert alert-danger">
<?= $message ?>
</div>
<?php endif; ?>
</h4>
</div>
<h1 class="text-primary"><i class="fas fa-id-card me-2"></i><?= _('Fiche bénéficiaire') ?></h1>
<?php if ($message=='Chargement réussi !'): ?>
<INPUT style="text-align: center" class="form-control" TYPE="text" value="<?= _("Le Nouveau Fichier Photo") ?> : <?= $nouveau_fichier ?>" readonly>
<?php else: ?>
<INPUT style="text-align: center" class="form-control" TYPE="text" value="<?= _("Fichier Photo Actuel") ?> : <?= $beneficiaire['lienPhoto'] ?>" readonly>
<?php endif; ?>
</form>
<div class="card-header d-flex justify-content-between align-items-center py-1">
<h5 class="mb-0 fw-bold">
<?= _("POLICE") ?> : <span class="text-secondary"><?= $this->nettoyer($_SESSION['numeroPolice_C']) ?></span>
<span class="ms-3 badge bg-primary text-light small fw-normal">ID: <?= $this->nettoyer($_SESSION['idPolice_C']) ?></span>
</h5>
</div>
</div>
<form name="formfichebeneficiaire" id="formfichebeneficiaire" method="POST" class="container-fluid py-3">
<div class="d-flex justify-content-between align-items-center mb-4 bg-light p-3 rounded shadow-sm border-start border-primary border-4">
<div class="card">
<h4 class="h4 mb-0 text-secondary">
<?= _("Bénéficiaire") ?> : <span class="fw-bold"><?= $beneficiaire['numeroBeneficiaire'] ?></span>
</h4>
<small class="text-muted"><?= _("Date Effet") ?> : <?= dateLang($this->nettoyer($beneficiaire['dateEffet'])) ?></small>
</div>
<div class="text-end">
<?php
$statusClass = "bg-danger"; $statusText = _("Inconnu");
if ($dateEffetCouvert == "0") { $statusText = _("Non renouvelé"); }
elseif ($estcouvert) {
if ($beneficiaire['codeEtatBeneficiaire'] == "V") { $statusClass = "bg-success"; $statusText = $etatbeneficiaire; }
else { $statusText = $etatbeneficiaire; }
} elseif ($estsorti) { $statusText = _("Retiré"); }
else { $statusText = _("Expiré"); }
?>
<span class="badge <?= $statusClass ?> fs-6 shadow-sm p-2 px-3">
<i class="fa-solid fa-circle-info me-1"></i> <?= $statusText ?>
</span>
</div>
</div>
<div class="row g-4">
<div class="col-lg-8">
<div class="card shadow-sm h-100">
<div class="card-header bg-white fw-bold"><i class="fa-solid fa-user me-2"></i><?= _("Informations Personnelles") ?></div>
<div class="card-body">
<div class="row g-3">
<div class="col-md-6">
<label class="form-label small text-uppercase fw-bold"><?= _("Nom & Prénoms") ?></label>
<input class="form-control bg-light fw-bold" type="text" value="<?= $beneficiaire['nomBeneficiaire'] . ' ' . $beneficiaire['prenomsBeneficiaire'] ?>" readonly>
</div>
<div class="col-md-3">
<label class="form-label small text-uppercase fw-bold"><?= _("Genre") ?></label>
<input class="form-control bg-light text-center" type="text" value="<?= $beneficiaire['sexe'] ?>" readonly>
</div>
<div class="col-md-3">
<label class="form-label small text-uppercase fw-bold"><?= _("Groupe Sanguin") ?></label>
<input class="form-control bg-light text-center fw-bold text-danger" type="text" value="<?= $beneficiaire['codeGroupeSanguin'] ?>" readonly>
</div>
<div class="col-md-4">
<label class="form-label small text-uppercase fw-bold"><?= _("Naissance & Âge") ?></label>
<input class="form-control bg-light" type="text" value="<?= dateLang($this->nettoyer($beneficiaire['dateNaissance'])).' ('.$beneficiaire['age'].' ans)' ?>" readonly>
</div>
<div class="col-md-4">
<label class="form-label small text-uppercase fw-bold"><?= _("Lien Parenté") ?></label>
<input class="form-control bg-light" type="text" value="<?= $lienparente ?>" readonly>
</div>
<div class="col-md-4">
<label class="form-label small text-uppercase fw-bold"><?= _("Téléphone") ?></label>
<input class="form-control bg-light" type="tel" value="<?= $beneficiaire['telephonePortable'] ?>" readonly>
</div>
<div class="col-md-6">
<label class="form-label small text-uppercase fw-bold"><?= _("Pièce d'identité") ?></label>
<div class="input-group">
<span class="input-group-text small"><?= $naturepiece ?></span>
<input class="form-control bg-light" type="text" value="<?= $beneficiaire['numeroPiece'] ?>" readonly>
</div>
</div>
<div class="col-md-6">
<label class="form-label small text-uppercase fw-bold"><?= _("Collège / Produit") ?></label>
<input class="form-control bg-light text-primary fw-bold" type="text" value="<?= $beneficiaire['libelleCollege'] ?>" readonly>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="card shadow-sm border-0 mb-3">
<div class="card-body text-center p-4">
<div class="position-relative d-inline-block mb-3">
<?php if($faceRegistered == "1"): ?>
<img src="<?=$photoAssureCrypte?>" class="img-thumbnail rounded-circle shadow" style="width: 150px; height: 150px; object-fit: cover;">
<button type="button" onClick="ebene_init_confirm_photo_face();" class="btn btn-sm btn-success position-absolute bottom-0 end-0 rounded-circle">
<i class="fa-solid fa-check"></i>
</button>
<?php else: ?>
<div class="rounded-circle bg-secondary d-flex align-items-center justify-content-center shadow" style="width: 150px; height: 150px;">
<i class="fa-solid fa-user-slash fa-4x text-white-50"></i>
</div>
<button type="button" onClick="ebene_init_photo_face();" class="btn btn-sm btn-primary position-absolute bottom-0 end-0 rounded-circle">
<i class="fa-solid fa-camera"></i>
</button>
<?php endif; ?>
</div>
<h5 class="mb-1 fw-bold"><?= $beneficiaire['numeroAdherent'] ?></h5>
<p class="text-muted small"><?= _("N° Famille") ?></p>
<div class="d-grid gap-2 mt-3">
<?php if($codeTypeContrat=="F"): ?>
<button type="button" class="btn btn-outline-info btn-sm" onClick="agent_commercial(<?= $idApporteur ?>);">
<i class="fa-solid fa-user-tie me-1"></i> <?= $libelleApporteur ?>
</button>
<?php endif; ?>
</div>
</div>
</div>
<?php if ($estsorti): ?>
<div class="alert alert-warning border-0 shadow-sm d-flex align-items-center">
<i class="fa-solid fa-door-open fa-2x me-3"></i>
<div>
<div class="fw-bold"><?= _("Sortie le") ?> : <?= dateLang($dateSortieBeneficiaire) ?></div>
<small><?= $motifsortie ?></small>
</div>
</div>
<?php endif; ?>
</div>
</div>
<div class="row mt-4 g-3">
<?php if($controlerPlafondAdherent): ?>
<div class="col-md-6">
<div class="card border-0 shadow-sm">
<div class="card-header bg-primary text-white py-2 fw-bold small text-uppercase"><?= _("Plafond Famille") ?></div>
<div class="card-body p-0">
<div class="d-flex text-center border-bottom">
<div class="flex-fill p-2 border-end">
<small class="text-muted d-block"><?= _("Limite") ?></small>
<span class="fw-bold text-primary"><?= format_N($limite_adherent['plafondAdherent']) ?></span>
</div>
<div class="flex-fill p-2 border-end">
<small class="text-muted d-block"><?= _("Conso.") ?></small>
<span class="fw-bold text-danger"><?= format_N($limite_adherent['consommationAdherent']) ?></span>
</div>
<div class="flex-fill p-2 bg-light">
<small class="text-muted d-block"><?= _("Solde") ?></small>
<span class="fw-bold text-success"><?= format_N($limite_adherent['soldeAdherent']) ?></span>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php if($controlerPlafondBeneficiaire): ?>
<div class="col-md-6">
<div class="card border-0 shadow-sm">
<div class="card-header bg-dark text-white py-2 fw-bold small text-uppercase"><?= _("Plafond Individuel") ?></div>
<div class="card-body p-0">
<div class="d-flex text-center border-bottom">
<div class="flex-fill p-2 border-end">
<small class="text-muted d-block"><?= _("Limite") ?></small>
<span class="fw-bold text-primary"><?= format_N($limite_beneficiaire['plafondBeneficiaire']) ?></span>
</div>
<div class="flex-fill p-2 border-end">
<small class="text-muted d-block"><?= _("Conso.") ?></small>
<span class="fw-bold text-danger"><?= format_N($limite_beneficiaire['consommationBeneficiaire']) ?></span>
</div>
<div class="flex-fill p-2 bg-light">
<small class="text-muted d-block"><?= _("Solde") ?></small>
<span class="fw-bold text-success"><?= format_N($limite_beneficiaire['soldeBeneficiaire']) ?></span>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
</div>
<div class="card mt-1 shadow-sm">
<div class="card-header fw-bold d-flex justify-content-between">
<span><i class="fa-solid fa-shield-halved me-2"></i><?= _("Détail des Garanties") ?></span>
</div>
<div class="table-responsive">
<table class="table table-hover align-middle mb-0" style="font-size: 0.9rem;">
<thead class="table-light">
<tr>
<th class="text-center"><?= _("Exercice") ?></th>
<th><?= _("Garantie") ?></th>
<th class="text-end"><?= _("Limite Contrat") ?></th>
<th class="text-center">%</th>
<th class="text-end"><?= _("Limite Vigueur") ?></th>
<th class="text-end"><?= _("Conso.") ?></th>
<th class="text-end fw-bold"><?= _("Solde") ?></th>
<th class="text-center"><?= _("Par tête") ?></th>
<th><?= _("Parent") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($garantieadherents as $garantieadherent): ?>
<tr>
<td class="text-center"><?= $this->nettoyer($garantieadherent['exercieReference'])?></td>
<td class="fw-bold"><?= $this->nettoyer($garantieadherent['garantie'])?></td>
<td class="text-end"><?= format_N($this->nettoyer($garantieadherent['plafondAnnuel'])) ?></td>
<td class="text-center text-muted"><?= $this->nettoyer($garantieadherent['tauxAvenant']) ?>%</td>
<td class="text-end"><?= format_N($this->nettoyer($garantieadherent['plafond'])) ?></td>
<td class="text-end text-danger"><?= format_N($this->nettoyer($garantieadherent['consommation'])) ?></td>
<td class="text-end fw-bold text-success"><?= format_N($this->nettoyer($garantieadherent['solde'])) ?></td>
<td class="text-center">
<input type="checkbox" class="form-check-input" <?= ($this->nettoyer($garantieadherent['champApplication'])=='1') ? 'checked' : '' ?> disabled>
</td>
<td class="small text-muted"><?= $this->nettoyer($garantieadherent['garantieparentaffichage'])?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</form>
<div class="container-fluid mt-1">
<div class="card border-0 shadow-sm">
<div class="card-body">
<form enctype="multipart/form-data" action="Fichebeneficiaire/<?= $_SESSION['idBeneficiaire_C'] ?>/" method="post" class="row align-items-center g-3">
<div class="col-md-5">
<label class="form-label fw-bold small text-uppercase">
<?= ($_SESSION['lienPhoto_C'] > " ") ? _("Remplacer la photo") : _("Nouvelle photo") ?>
</label>
<input type="hidden" name="MAX_FILE_SIZE" value="500000" /> <input class="form-control form-control-sm" name="fichier_image_a_uploader" type="file" id="fichier_image_a_uploader" />
</div>
<div class="col-md-3">
<button type="submit" name="submit" class="btn btn-primary btn-sm mt-4 w-100">
<i class="fa-solid fa-cloud-arrow-up me-1"></i> <?= _("Mettre à jour") ?>
</button>
</div>
<div class="col-md-4">
<?php if ($message > " "): ?>
<div class="alert <?= ($message == 'Chargement réussi !') ? 'alert-success' : 'alert-danger' ?> m-0 py-2 small">
<?= $message ?>
</div>
<?php else: ?>
<div class="text-muted small italic">
<i class="fa-solid fa-file-image me-1"></i>
<?= _("Fichier actuel") ?> : <?= $beneficiaire['lienPhoto'] ?>
</div>
<?php endif; ?>
</div>
</form>
</div>
</div>
</div>
<!-- Responsive Area Chart -->
<div class="row mt-4">
<div class="col-12 mb-4">
<div class="card shadow h-100">
<div class="card-header py-3 d-flex flex-column flex-md-row justify-content-between align-items-center">
<h6 class="m-0 font-weight-bold text-primary"><?= _("Dépenses mensuelles") ?></h6>
<div class="mt-2 mt-md-0">
<button type="button" id="exportTrendBtn" class="btn btn-sm btn-danger mr-2">
<i class="fas fa-download"></i> PDF
</button>
<small class="text-muted"><?= _("Évolution sur 12 mois") ?></small>
</div>
</div>
<div class="card-body">
<div class="chart-container" style="position: relative; height:300px; width:100%">
<canvas id="expenseTrendChart"></canvas>
</div>
</div>
</div>
</div>
</div>
<!-- Bar Chart Section -->
<div class="row mt-4">
<div class="col-12 mb-4">
<div class="card shadow h-100">
<div class="card-header py-3 d-flex justify-content-between align-items-center">
<h6 class="m-0 font-weight-bold text-primary"><?= _("Dépenses par garantie") ?></h6>
<button type="button" id="exportBarBtn" class="btn btn-sm btn-danger">
<i class="fas fa-download"></i> PDF
</button>
</div>
<div class="card-body">
<div class="chart-container" style="position: relative; height:400px; width:100%">
<canvas id="depensesChart"></canvas>
</div>
</div>
</div>
</div>
</div>
</div>
<?php include 'faceebene/ebenetraitementimage.php'; ?>
<script>
// Configuration commune
(function() {
// Format numérique simplifié (sans devise)
const formatMoney = (value) => {
return new Intl.NumberFormat('fr-FR').format(value);
};
// Format pourcentage sécurisé
const formatPercentage = (value, total) => {
if (total === 0) {
return '0%'; // ou 'N/A' si tu préfères
}
const percentage = (value * 100 / total).toFixed(1);
return percentage + '%';
};
// Détection mobile
const isMobile = window.matchMedia("(max-width: 768px)").matches;
// Génération des couleurs
const generateColors = (count) => {
const palette = [
'#4e73df', '#1cc88a', '#36b9cc', '#f6c23e',
'#e74a3b', '#858796', '#5a5c69', '#3a3b45',
'#2e59a9', '#17a673', '#2c9faf', '#dda20a'
];
return palette.slice(0, count).concat(
Array.from({length: Math.max(0, count - palette.length)}, (_, i) => {
const hue = Math.floor(360 * (i / Math.max(1, count - palette.length)));
return `hsl(${hue}, 70%, 60%)`;
})
);
};
// Fonction pour générer une légende personnalisée
function generateCustomLegend(chart, containerId) {
const legendContainer = document.getElementById(containerId);
legendContainer.innerHTML = '';
const items = chart.data.datasets[0].data.map((value, i) => {
const total = chart.data.datasets[0].data.reduce((a, b) => a + b, 0);
const percentage = formatPercentage(value, total);
return `
<div class="d-inline-block mx-2 my-1">
<span class="legend-color" style="
display: inline-block;
width: 12px;
height: 12px;
background-color: ${chart.data.datasets[0].backgroundColor[i]};
border: 1px solid #fff;
vertical-align: middle;
"></span>
<span class="legend-text small ml-1">
${chart.data.labels[i]}: ${formatMoney(value)} (${percentage})
</span>
</div>
`;
});
legendContainer.innerHTML = items.join('');
}
// Fonction pour exporter un graphique en PDF
function exportChartToPDF(chartId, fileName) {
const { jsPDF } = window.jspdf;
const canvas = document.getElementById(chartId);
html2canvas(canvas).then(canvasImage => {
const imgData = canvasImage.toDataURL('image/png');
const pdf = new jsPDF({
orientation: canvasImage.width > canvasImage.height ? 'landscape' : 'portrait'
});
const pageWidth = pdf.internal.pageSize.getWidth();
const pageHeight = pdf.internal.pageSize.getHeight();
const ratio = canvasImage.height / canvasImage.width;
let imgWidth = pageWidth - 20;
let imgHeight = imgWidth * ratio;
if (imgHeight > pageHeight - 20) {
imgHeight = pageHeight - 20;
imgWidth = imgHeight / ratio;
}
pdf.addImage(imgData, 'PNG',
(pageWidth - imgWidth) / 2,
(pageHeight - imgHeight) / 2,
imgWidth,
imgHeight
);
pdf.save(fileName + '.pdf');
});
}
// Graphique d'évolution des dépenses
const dataMois = <?= $dataConsoParMois ?>;
const trendCtx = document.getElementById('expenseTrendChart').getContext('2d');
const trendChart = new Chart(trendCtx, {
type: 'line',
data: {
labels: dataMois.mois,
datasets: [{
label: '<?= _("Montant dépensé") ?>',
data: dataMois.consos,
backgroundColor: 'rgba(78, 115, 223, 0.05)',
borderColor: 'rgba(78, 115, 223, 1)',
borderWidth: 2,
pointBackgroundColor: 'rgba(78, 115, 223, 1)',
pointRadius: isMobile ? 3 : 4,
pointHoverRadius: 6,
fill: true,
tension: 0.3
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: false
},
tooltip: {
mode: 'index',
intersect: false,
callbacks: {
label: function(context) {
return context.dataset.label + ': ' + formatMoney(context.parsed.y);
}
}
}
},
scales: {
x: {
grid: {
display: false
},
ticks: {
maxRotation: isMobile ? 45 : 0,
autoSkip: true,
maxTicksLimit: isMobile ? 6 : 12
}
},
y: {
beginAtZero: false,
ticks: {
callback: function(value) {
return formatMoney(value);
}
},
grid: {
color: 'rgba(0, 0, 0, 0.05)'
}
}
},
interaction: {
mode: 'nearest',
axis: 'x',
intersect: false
}
}
});
// Graphique des dépenses par garantie
const dataConso = <?= $dataConsoParGaranties ?>;
const barCtx = document.getElementById('depensesChart').getContext('2d');
const barChart = new Chart(barCtx, {
type: 'bar',
data: {
labels: dataConso.garanties,
datasets: [{
label: 'Dépenses',
data: dataConso.depenses,
backgroundColor: 'rgba(54, 162, 235, 0.7)',
borderColor: 'rgba(54, 162, 235, 1)',
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
annotation: {
annotations: dataConso.plafonds.map((plafond, index) => {
if (plafond === null) return null;
return {
type: 'line',
yMin: plafond,
yMax: plafond,
borderColor: 'rgba(255, 99, 132, 0.7)',
borderWidth: 2,
borderDash: [6, 6],
label: {
content: `Plafond: ${formatMoney(plafond)}`,
enabled: true,
position: 'right'
}
};
}).filter(annotation => annotation !== null)
},
legend: {
display: false
},
tooltip: {
callbacks: {
label: function(context) {
const plafond = dataConso.plafonds[context.dataIndex];
let tooltip = `Dépenses: ${formatMoney(context.parsed.y)}`;
if (plafond !== null) {
const pourcentage = Math.min(100, Math.round((context.parsed.y / plafond) * 100));
tooltip += ` (${pourcentage}% du plafond)`;
} else {
tooltip += ' (plafond illimité)';
}
return tooltip;
}
}
}
},
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: `Montant des dépenses`,
font: {
weight: 'bold'
}
},
ticks: {
callback: function(value) {
return formatMoney(value);
}
},
suggestedMax: Math.max(...dataConso.depenses) * 1.5
},
x: {
title: {
display: true,
text: 'Garanties',
font: {
weight: 'bold'
}
},
grid: {
display: false
}
}
}
}
});
// Boutons d'export PDF
document.getElementById('exportTrendBtn').addEventListener('click', () => {
exportChartToPDF('expenseTrendChart', 'evolution_depenses_mensuelles');
});
document.getElementById('exportBarBtn').addEventListener('click', () => {
exportChartToPDF('depensesChart', 'depenses_par_garantie');
});
})();
</script>

View File

@ -129,7 +129,7 @@
</h6>
<form enctype="multipart/form-data" action="Fichepolice" method="post" class="row g-3">
<!-- Zone d'information sur les extensions -->
<!-- Zone d'information sur les extensions
<div class="alert alert-info mt-2 py-2 small col-md-12">
<strong><?= _("Formats autorisés") ?>:</strong>
<div class="d-flex flex-wrap mt-2">
@ -143,7 +143,7 @@
<?php endforeach; ?>
</div>
</div>
-->
<div class="col-md-9">
<input class="form-control custom-file-input" name="fichier_upload" type="file" id="fichier_upload">
</div>

111
Vue/Ficheuserrhclient/index.php Executable file
View File

@ -0,0 +1,111 @@
<?php
$this->titre = "ISA WEB - Modifier Utilisateur";
$idClient = $this->nettoyer($user_rh['idClient']);
$idUtilisateur = $user_rh['id'];
$codeUtilisateur = $user_rh['codeUtilisateur'];
$actif = $user_rh['actif'];
$codeProfil = $user_rh['codeProfil'];
$codeLangue = $user_rh['codeLangue'];
?>
<div id="div_liste" class="container-fluid py-2 animate__animated animate__fadeIn">
<input class="visually-hidden" type="text" id="idUtilisateur" value="<?= $idUtilisateur ?>">
<input class="visually-hidden" type="text" id="idClient" value="<?= $idClient ?>">
<h1 class="text-primary"><i class="fas fa-user-edit me-2"></i> <?= _("Modifier l'utilisateur") ?></h1>
<div class="card-header d-flex justify-content-between align-items-center py-1">
<h5 class="badge bg-secondary mb-0 fw-bold">
<span class="fw-normal text-dark-50"><?= $codeUtilisateur ?></span>
</h5>
<div class="d-flex align-items-center gap-3">
<button type="button" class="btn-close btn-close-dark" onClick="retour_a_users_rh_client();"></button>
</div>
</div>
<div class="card shadow border-0">
<div class="card-body p-2">
<form id="form_modif_user">
<div class="row mb-2">
<div class="col-12 mb-2">
<h6 class="text-primary text-uppercase small fw-bold border-bottom pb-2">
<i class="fas fa-id-card me-2"></i><?= _("Informations Personnelles") ?>
</h6>
</div>
<div class="col-md-6 mb-2">
<label class="form-label small fw-bold required text-uppercase"><?= _("Nom") ?></label>
<input type="text" id="nom" name="nom" class="form-control shadow-sm"
value="<?= $this->nettoyer($user_rh['nom']) ?>" required autocomplete="off" autofocus>
</div>
<div class="col-md-6 mb-2">
<label class="form-label small fw-bold text-uppercase"><?= _("Prénoms") ?></label>
<input type="text" id="prenoms" name="prenoms" class="form-control shadow-sm"
value="<?= $this->nettoyer($user_rh['prenoms']) ?>">
</div>
<div class="col-md-6 mb-2">
<label class="form-label small fw-bold required text-uppercase"><?= _("Téléphone") ?></label>
<div class="input-group shadow-sm">
<span class="input-group-text"><i class="fas fa-phone"></i></span>
<input type="tel" id="telephone" name="telephone" class="form-control"
value="<?= $this->nettoyer($user_rh['telephone']) ?>" required>
</div>
</div>
<div class="col-md-6 mb-2">
<label class="form-label small fw-bold required text-uppercase"><?= _("E-mail") ?></label>
<div class="input-group shadow-sm">
<span class="input-group-text"><i class="fas fa-envelope"></i></span>
<input type="email" id="email" name="email" class="form-control"
value="<?= $this->nettoyer($user_rh['email']) ?>" required>
</div>
</div>
</div>
<div class="row mb-2">
<div class="col-12 mb-2">
<h6 class="text-primary text-uppercase small fw-bold border-bottom pb-2">
<i class="fas fa-cog me-2"></i><?= _("Paramètres du Compte") ?>
</h6>
</div>
<div class="col-md-4 mb-2">
<label class="form-label small fw-bold text-uppercase"><?= _("Profil / Rôle") ?></label>
<select class="form-select shadow-sm fw-bold border-info-subtle" id="codeProfil" name="codeProfil">
<?php liste_options($user_profil, $codeProfil, true); ?>
</select>
</div>
<div class="col-md-4 mb-2">
<label class="form-label small fw-bold text-uppercase"><?= _("En activité ?") ?></label>
<select class="form-select shadow-sm" id="actif" name="actif">
<?php liste_options($user_actif, $actif, true); ?>
</select>
</div>
<div class="col-md-4 mb-2">
<label class="form-label small fw-bold text-uppercase"><?= _("Langue préférée") ?></label>
<select class="form-select shadow-sm" id="codeLangueUser" name="codeLangueUser">
<?php liste_options($langue, $codeLangue, true); ?>
</select>
</div>
</div>
<div class="row mt-4">
<div class="col-12 d-flex justify-content-end gap-2">
<button type="button" class="btn btn-light border px-4 shadow-sm fw-bold" onClick="retour_a_users_rh_client();">
<i class="fas fa-arrow-left me-2"></i><?= _("Annuler") ?>
</button>
<button type="button" id="btn_enreg" class="btn btn-primary px-5 shadow-sm fw-bold" onClick="enregistrer_modif_user_rh();">
<i class="fas fa-save me-2"></i><?= _("Enregistrer les modifications") ?>
</button>
</div>
</div>
</form>
</div>
</div>
</div>
<style>
.required:after { content: " *"; color: red; }
.card { border-radius: 12px; }
.form-control, .form-select, .input-group-text { border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: #0d6efd; box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15); }
.input-group-text { background-color: #f8f9fa; color: #6c757d; }
</style>

View File

@ -59,7 +59,7 @@ foreach ($modals as $id => $cfg):
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content border-0 shadow-lg">
<div class="modal-header bg-light border-bottom-0">
<h5 class="modal-title fw-bold text-dark">
<h5 class="modal-title fw-bold text-dark">
<i class="fas <?= $cfg['icon'] ?> me-2 text-primary"></i> <?= $cfg['title'] ?>
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>

View File

@ -1,55 +1,70 @@
<?php $this->titre = "Intersanté - Mouvements sur les assurés"; ?>
<div id="div_liste_adherent" class="container-fluid py-1 animate__animated animate__fadeIn">
<div id="div_liste_adherent" class="container-fluid py-3 animate__animated animate__fadeIn">
<h1 class="text-primary"><i class="fas fa-exchange-alt me-2"></i></i> <?= _("Entrées & Sorties des Assurés") ?></h1>
<div class="d-flex justify-content-between align-items-center mb-3">
<h1 class="text-primary fw-bold mb-0">
<i class="fas fa-exchange-alt me-2"></i><?= _("Entrées & sorties des assurés de la police") ?>
</h1>
</div>
<div class="card-header d-flex justify-content-between align-items-center py-2">
<h5 class="mb-0 fw-bold">
<?= _("POLICE") ?> : <span class="text-secondary"><?= $this->nettoyer($_SESSION['numeroPolice_C']) ?></span>
<span class="ms-3 badge bg-primary text-light small fw-normal">ID: <?= $this->nettoyer($_SESSION['idPolice_C']) ?></span>
</h5>
<div>
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item fw-bold"><?= $this->nettoyer($_SESSION['adherent_C']) ?></li>
<li class="breadcrumb-item active"><?= $this->nettoyer($_SESSION['numeroAdherent_C']) ?></li>
</ol>
</nav>
</div>
</div>
<div class="card shadow-sm border-0 mb-4">
<div class="card-body bg-light">
<div class="row g-3 align-items-end">
<div class="col-md-3">
<label class="form-label small fw-bold text-uppercase"><?= _("Saisie Client") ?></label>
<select class="form-select fw-bold" id="ajoutClient" name="ajoutClient">
<?php liste_options_consultation($mvt_ajoutClient, ""); ?>
</select>
<div class="card-body bg-light p-4">
<div class="row g-3">
<div class="col-lg-3 col-md-6">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Saisie Client") ?></label>
<div class="input-group">
<span class="input-group-text bg-white"><i class="fas fa-building text-primary"></i></span>
<select class="form-select fw-bold" id="ajoutClient" name="ajoutClient">
<?php liste_options_consultation($mvt_ajoutClient, ""); ?>
</select>
</div>
</div>
<div class="col-md-5">
<label class="form-label small fw-bold text-uppercase"><?= _("Période de recherche") ?></label>
<div class="input-group">
<span class="input-group-text bg-white small"><?= _("Du") ?></span>
<div class="col-lg-5 col-md-6">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Période de recherche") ?></label>
<div class="input-group shadow-sm">
<span class="input-group-text bg-white small fw-bold"><?= _("Du") ?></span>
<input type="text" id="debut" name="debut"
class="form-control datepicker text-center fw-bold"
value="<?= $_SESSION['dUneSemaineAvantFr_C'] ?>" required>
<span class="input-group-text bg-white small"><?= _("au") ?></span>
<span class="input-group-text bg-white small fw-bold"><?= _("au") ?></span>
<input type="text" id="fin" name="fin"
class="form-control datepicker text-center fw-bold"
value="<?= dateCouranteLang($_SESSION['lang']) ?>" required>
</div>
</div>
</div>
<div class="row g-3 align-items-end">
<div class="col-md-2">
<label class="form-label small fw-bold text-uppercase"><?= _("Sens / État") ?></label>
<select class="form-select fw-bold border-info-subtle" id="codeSensMouvement" name="codeSensMouvement">
<div class="col-lg-2 col-md-6">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Mouvement") ?></label>
<select class="form-select fw-bold border-info-subtle shadow-sm" id="codeSensMouvement" name="codeSensMouvement">
<?php liste_options_consultation($sensmouvement, ""); ?>
</select>
</div>
<div class="col-md-3">
<label class="form-label small fw-bold text-uppercase"><?= _("Statut Validation") ?></label>
<select class="form-select fw-bold" id="valide" name="valide">
<?php liste_options_consultation($mvt_valide, ""); ?>
</select>
</div>
<div class="col-md-2">
<div class="d-grid d-md-flex justify-content-md-end">
<button type="button" class="btn btn-primary px-4 shadow-sm fw-bold" onclick="liste_mouvemements_assures();">
<i class="fas fa-sync-alt me-2"></i>
<div class="col-lg-2 col-md-6">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Validation") ?></label>
<div class="d-flex gap-2">
<select class="form-select fw-bold shadow-sm" id="valide" name="valide">
<?php liste_options_consultation($mvt_valide, ""); ?>
</select>
<button type="button" class="btn btn-primary px-3 shadow-sm" onclick="liste_mouvemements_assures();" title="<?= _('Actualiser') ?>">
<i class="fas fa-sync-alt"></i>
</button>
</div>
</div>
@ -57,10 +72,16 @@
</div>
</div>
<div id="div_mvt" class="min-vh-50 rounded bg-white p-2 shadow-sm border">
<div class="text-center py-5 text-muted">
<i class="fas fa-search fa-3x mb-3 opacity-25"></i>
<p class="fs-5"><?= _("Cliquez sur 'Actualiser' pour charger les mouvements") ?></p>
<div id="div_mvt" class="min-vh-50 rounded bg-white p-3 shadow-sm border position-relative">
<div class="text-center py-5">
<div class="mb-3">
<span class="fa-stack fa-3x opacity-25">
<i class="fas fa-folder-open fa-stack-1x"></i>
<i class="fas fa-search fa-stack-2x text-primary"></i>
</span>
</div>
<h4 class="text-secondary"><?= _("Prêt pour la recherche") ?></h4>
<p class="text-muted small italic"><?= _("Sélectionnez vos critères et cliquez sur le bouton d'actualisation") ?></p>
</div>
</div>
</div>
@ -68,6 +89,17 @@
<style>
.min-vh-50 { min-height: 50vh; }
.datepicker { cursor: pointer !important; background-color: #fff !important; }
.form-select, .form-control { border-radius: 6px; }
.input-group-text { border-radius: 6px; color: #6c757d; }
.form-select, .form-control { border-radius: 8px; border: 1px solid #dee2e6; }
.input-group-text { border-radius: 8px; border: 1px solid #dee2e6; color: #495057; }
.card { border-radius: 12px; }
.italic { font-style: italic; }
/* Animation pour le chargement Ajax */
.loading-overlay {
background: rgba(255,255,255,0.7);
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
display: flex; align-items: center; justify-content: center;
z-index: 10;
}
</style>

View File

@ -1,52 +1,81 @@
<?php
$this->titre = "Intersanté - Mouvements sur les assurés";
?>
<?php $this->titre = "Intersanté - Mouvements sur les assurés"; ?>
<input class="form-control" style="text-align: center; font-size:10pt;" type="text" id="nbligne" name="nbligne" value="ENTREES SORTIE DES ASSURES" readonly>
<table class="table table-responsive table-condensed" style='font-size:10pt;'>
<tbody>
<tr>
<td> <?= _("Police") ?> </td>
<td>
<SELECT style="font-size:10pt;" class="form-control selectpicker" data-live-search="true" id="idPolice" NAME="idPolice" required>
<?php liste_options($polices,"",false); ?>
</SELECT>
</td>
<div id="div_liste_adherent" class="container-fluid py-3 animate__animated animate__fadeIn">
<div class="d-flex justify-content-between align-items-center mb-3">
<h1 class="text-primary fw-bold mb-0">
<i class="fas fa-exchange-alt me-2"></i><?= _("Entrées & Sorties des Assurés") ?>
</h1>
</div>
<div class="card border-0 shadow-sm rounded-0 rounded-bottom mb-4">
<div class="card-body bg-light border-bottom">
<div class="row g-3">
<div class="col-md-4">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Police d'Assurance") ?></label>
<div class="input-group shadow-sm">
<span class="input-group-text bg-white"><i class="fa-solid fa-file-contract text-primary"></i></span>
<select class="form-select shadow-none" id="idPolice" name="idPolice" required>
<?php liste_options($polices, "", false); ?>
</select>
</div>
</div>
<td> <?= _("Période du") ?> </td>
<td> <INPUT style='text-align:center; font-size:10pt;' class="form-control datepicker" TYPE="text" id="debut" NAME="debut" value="<?= $_SESSION['dUneSemaineAvantFr_C'] ?>" required </td>
<div class="col-md-5">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Période de validité") ?></label>
<div class="input-group shadow-sm">
<span class="input-group-text bg-white small fw-bold"><?= _("Du") ?></span>
<input type="text" id="debut" name="debut" class="form-control datepicker text-center fw-bold" value="<?= $_SESSION['dUneSemaineAvantFr_C'] ?>" required>
<span class="input-group-text bg-white small fw-bold"><?= _("au") ?></span>
<input type="text" id="fin" name="fin" class="form-control datepicker text-center fw-bold" value="<?= dateCouranteLang($_SESSION['lang']) ?>" required>
</div>
</div>
<td align="center"> <?= _("au") ?> </td>
<td> <INPUT style='text-align:center; font-size:10pt;' class="form-control datepicker" TYPE="text" id="fin" NAME="fin" value="<?= dateCouranteLang($_SESSION['lang']) ?>" required> </td>
</tr>
<div class="col-md-3">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Saisie Client") ?></label>
<select class="form-select fw-bold shadow-sm" id="ajoutClient" name="ajoutClient">
<?php liste_options_consultation($mvt_ajoutClient, ""); ?>
</select>
</div>
<tr>
<td > <?= _("Saisie Client") ?> </td>
<td>
<select class="form-select fw-bold" id="ajoutClient" name="ajoutClient">
<?php liste_options_consultation($mvt_ajoutClient, ""); ?>
</select>
</td align="center">
<div class="col-md-3">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Type de Mouvement") ?></label>
<select class="form-select fw-bold shadow-sm border-info-subtle" id="codeSensMouvement" name="codeSensMouvement">
<?php liste_options_consultation($sensmouvement, ""); ?>
</select>
</div>
<td> <?= _("Etat") ?> </td>
<td>
<SELECT class="form-control" id="codeSensMouvement" NAME="codeSensMouvement" style='font-size:10pt;'>
<?php liste_options_consultation($sensmouvement, ""); ?>
</SELECT>
</td>
<div class="col-md-3">
<label class="form-label small fw-bold text-muted text-uppercase"><?= _("Statut Validation") ?></label>
<select class="form-select fw-bold shadow-sm" id="valide" name="valide">
<?php liste_options_consultation($mvt_valide, ""); ?>
</select>
</div>
<td align="center"> <?= _("Validé?") ?> </td>
<td>
<SELECT style="font-size:10pt;" class="form-control" id="valide" NAME="valide" >
<?php liste_options_consultation($mvt_valide, ""); ?>
</SELECT>
</td>
</tr>
<div class="col-md-6 d-flex align-items-end">
<button type="button" class="btn btn-primary w-100 fw-bold shadow-sm py-2" onclick="javascript:liste_mouvemements_assures_client();">
<i class="fa-solid fa-magnifying-glass me-2"></i><?= _("Actualiser la liste des mouvements") ?>
</button>
</div>
</div>
</div>
</div>
<tr>
<td colspan=6 > <button style='font-size:10pt;' type="button" class="form-control btn btn-primary" onclick="javascript:liste_mouvemements_assures_client();">Actualiser...</button> </td>
</tr>
</tbody>
</table>
<div id="div_mvt" class="min-vh-50 bg-white rounded shadow-sm border p-3">
<div class="text-center py-5 text-muted opacity-50">
<i class="fa-solid fa-layer-group fa-4x mb-3"></i>
<p class="h5"><?= _("Aucune donnée chargée") ?></p>
<p class="small"><?= _("Utilisez les filtres ci-dessus pour lancer une recherche.") ?></p>
</div>
</div>
</div>
<div id="div_mvt"> </div>
<style>
.min-vh-50 { min-height: 400px; }
.form-label { margin-bottom: 0.4rem; font-size: 0.75rem; letter-spacing: 0.5px; }
.datepicker { cursor: pointer !important; background-color: #fff !important; }
.input-group-text { font-size: 0.85rem; color: #495057; }
/* Ajustement Selectpicker */
.bootstrap-select > .dropdown-toggle { border: 1px solid #dee2e6; background: #fff; font-weight: bold; font-size: 10pt; }
</style>

117
Vue/Nouveluserrh/index.php Executable file
View File

@ -0,0 +1,117 @@
<?php
$this->titre = "ISA WEB - Nouvel Utilisateur Portail RH";
$idClient = $_SESSION['idClient_C'];
$nomClient = $_SESSION['nomClient_C'];
$codeModeGenerationPass = $paramsgenerationpass['codeModeGenerationPass'];
$codeModeEnvoiPass = $paramsgenerationpass['codeModeEnvoiPass'];
?>
<input class="sr-only" id="nomForm" name="nomForm" type="text" value= "nouveluserrh" >
<div id="div_liste" class="container-fluid py-2 animate__animated animate__fadeIn">
<h1 class="text-primary"><i class="fas fa-user-plus me-2"></i> <?= _("Nouvel Utilisateur") ?></h1>
<div class="card-header d-flex justify-content-between align-items-center py-1">
<h5 class="mb-0 fw-bold">
<span class="text-dark-50"><?= $nomClient ?></span>
</h5>
</div>
<div class="card shadow border-0">
<div class="card-body p-2">
<form id="form_new_user">
<div class="row mb-2">
<div class="col-12">
<h6 class="text-success text-uppercase small fw-bold border-bottom pb-2 mb-3">
<i class="fas fa-id-badge me-2"></i><?= _("Identité & Connexion") ?>
</h6>
</div>
<div class="col-md-6 mb-2">
<label class="form-label small fw-bold required text-uppercase"><?= _("Nom de famille") ?></label>
<input type="text" id="nom" name="nom" class="form-control shadow-sm" required autocomplete="off" autofocus>
</div>
<div class="col-md-6 mb-2">
<label class="form-label small fw-bold text-uppercase"><?= _("Prénoms") ?></label>
<input type="text" id="prenoms" name="prenoms" class="form-control shadow-sm" autocomplete="off">
</div>
<div class="col-md-6 mb-2">
<label class="form-label small fw-bold required text-uppercase"><?= _("Login (Identifiant)") ?></label>
<div class="input-group shadow-sm">
<span class="input-group-text bg-light text-muted">@</span>
<input type="text" id="codeUtilisateur" name="codeUtilisateur"
class="form-control text-lowercase"
onChange="this.value=supprimer_espace_string(this.value);" required>
</div>
<div id="div_unicite_login" class="mt-1">
<input class="visually-hidden" type="text" id="uniciteLogin" name="uniciteLogin" value="0">
</div>
</div>
<div class="col-md-6 mb-2">
<label class="form-label small fw-bold required text-uppercase"><?= _("E-mail") ?></label>
<input type="email" id="email" name="email" class="form-control shadow-sm" placeholder="exemple@domaine.com" required>
</div>
</div>
<div class="row mb-2">
<div class="col-12">
<h6 class="text-success text-uppercase small fw-bold border-bottom pb-2 mb-3">
<i class="fas fa-user-shield me-2"></i><?= _("Profil & Préférences") ?>
</h6>
</div>
<div class="col-md-4 mb-2">
<label class="form-label small fw-bold required text-uppercase"><?= _("Téléphone") ?></label>
<input type="tel" id="telephone" name="telephone" class="form-control shadow-sm" required>
</div>
<div class="col-md-4 mb-2">
<label class="form-label small fw-bold required text-uppercase"><?= _("Langue") ?></label>
<select class="form-select shadow-sm" id="codeLangueUser" name="codeLangueUser" required>
<?php liste_options($langue, ""); ?>
</select>
</div>
<div class="col-md-4 mb-2">
<label class="form-label small fw-bold required text-uppercase"><?= _("Profil / Rôle") ?></label>
<select class="form-select shadow-sm fw-bold border-success-subtle" id="codeProfil" name="codeProfil" required>
<?php liste_options($user_profil, ""); ?>
</select>
</div>
</div>
<div class="row mb-4 bg-light p-3 rounded-3 border mx-1">
<div class="col-md-6 mb-2">
<label class="form-label small fw-bold text-uppercase"><?= _("Mode d'envoi du mot de passe") ?></label>
<select class="form-select shadow-sm" id="codeModeEnvoiPass" name="codeModeEnvoiPass">
<?php liste_options($modeenvoipass, $codeModeEnvoiPass, true); ?>
</select>
</div>
<div class="col-md-6 mb-2">
<label class="form-label small fw-bold text-uppercase"><?= _("Mode de génération") ?></label>
<select class="form-select shadow-sm" id="codeModeGenerationPass" name="codeModeGenerationPass" onChange="ajax_saisir_pass_new_user();">
<?php liste_options($modegenerationpass, $codeModeGenerationPass, true); ?>
</select>
</div>
<div id="div_passwd">
<?php
require __DIR__ . '/../Ajaxsaisirpassnewuser/index.php';
?>
</div>
</div>
<div class="d-flex justify-content-end gap-2 mt-4">
<button type="button" class="btn btn-light border px-4 fw-bold" onClick="retour_a_users_rh_client();">
<i class="fas fa-times me-2"></i><?= _("Annuler") ?>
</button>
<button type="button" id="btn_enreg" class="btn btn-success px-5 fw-bold shadow-sm" onClick="creer_user_rh_client();">
<i class="fas fa-check-circle me-2"></i><?= _("Créer le compte") ?>
</button>
</div>
</form>
</div>
</div>
</div>
<style>
.required:after { content: " *"; color: #dc3545; }
.card { border-radius: 15px; }
.form-control:focus, .form-select:focus { border-color: #198754; box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.15); }
.input-group-text { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
</style>

View File

@ -0,0 +1,105 @@
<?php $this->titre = "INTER-SANTE - Limites Famille"; ?>
<div id="div_adherent" class="container-fluid py-1 animate__animated animate__fadeIn">
<h1 class="text-primary"><i class="fa-solid fa-users-rectangle me-2"></i><?= _("Limites de la famille") ?></h1>
<div class="card shadow-sm mb-4 border-0">
<div class="card-header bg-white py-3">
<div class="d-flex flex-column flex-md-row justify-content-between align-items-md-center gap-3">
<div class="flex-grow-1">
<div class="d-inline-flex align-items-center bg-light border rounded-pill px-3 py-1 mt-2">
<i class="fa-solid fa-id-card text-muted me-2 small"></i>
<span class="fw-bold small me-2"><?= $_SESSION['numeroAdherent_C'] ?></span>
<span class="text-muted border-start ps-2 small"><?= $_SESSION['nomAdherent_C'] ?></span>
</div>
</div>
<div class="flex-shrink-0">
<div class="input-group shadow-sm" style="width: fit-content;">
<span class="input-group-text bg-primary text-white border-primary">
<i class="fa-solid fa-calendar-check me-2"></i> <?= _("Exercice") ?>
</span>
<select class="form-select border-primary fw-bold text-primary w-auto"
style="min-width: 150px; width: auto;"
id="idEntetecontrat"
name="idEntetecontrat"
onChange="afficher_garantieadherent_entete_contrat();">
<?php liste_options($entecontrats, $_SESSION['idEntetecontrat']); ?>
</select>
</div>
</div>
</div>
</div>
</div>
<div id="div_gar_exo">
<div class="card shadow-sm border-0">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0">
<thead class="table-dark">
<tr>
<th class="ps-3 fw-normal small text-uppercase"><?= _("Garantie") ?></th>
<th class="text-center fw-normal small text-uppercase"><?= _("Contrat (Annuel)") ?></th>
<th class="text-center fw-normal small text-uppercase"><?= _("Taux Inc.") ?></th>
<th class="text-center fw-normal small text-uppercase"><?= _("Limite en vigueur") ?></th>
<th class="text-center fw-normal small text-uppercase"><?= _("Consommé") ?></th>
<th class="text-end pe-4 fw-normal small text-uppercase"><?= _("Solde Disponible") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($garantieadherents as $garantieadherent):
$solde = $this->nettoyer($garantieadherent['solde']);
$statusClass = ($solde <= 0) ? 'text-danger fw-bold' : 'text-success fw-bold';
$rowClass = ($solde <= 0) ? 'table-danger' : '';
?>
<tr class="<?= $rowClass ?>">
<td class="ps-3 fw-bold text-secondary">
<?= $this->nettoyer($garantieadherent['garantie']) ?>
<div class="text-muted extra-small" style="font-size: 0.75rem;">
Réf: <?= $this->nettoyer($garantieadherent['exercieReference']) ?>
</div>
</td>
<td class="text-center text-monospace">
<?= format_N($this->nettoyer($garantieadherent['plafondAnnuel'])) ?>
</td>
<td class="text-center">
<span class="badge rounded-pill bg-info text-dark">
<?= $this->nettoyer($garantieadherent['tauxAvenant']) ?> %
</span>
</td>
<td class="text-center fw-bold">
<?= format_N($this->nettoyer($garantieadherent['plafond'])) ?>
</td>
<td class="text-center text-primary">
<?= format_N($this->nettoyer($garantieadherent['consommation'])) ?>
</td>
<td class="text-end pe-4 <?= $statusClass ?>">
<?php if($solde <= 0): ?>
<i class="fa-solid fa-circle-exclamation me-1"></i>
<?php endif; ?>
<?= format_N($solde) ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="card-footer bg-light py-3">
<div id="div_export_a" class="d-flex justify-content-end gap-2">
</div>
</div>
</div>
</div>
<div id="div_test"></div>
</div>
<style>
.text-monospace { font-family: 'Courier New', Courier, monospace; }
.extra-small { font-size: 0.7rem; }
.table-hover tbody tr:hover { background-color: rgba(0, 123, 255, 0.05); }
</style>

View File

@ -9,11 +9,11 @@
<div class="row g-3">
<div class="col-md-3">
<label class="form-label small fw-bold text-uppercase"><?= _("Numéro Famille") ?></label>
<input class="form-control border-primary-subtle" type="text" id="numeroAdherent" name="numeroAdherent" autocomplete="off" placeholder="Ex: ADH-100...">
<input class="form-control border-primary-subtle" type="text" id="numeroAdherent" name="numeroAdherent" autocomplete="off">
</div>
<div class="col-md-3">
<label class="form-label small fw-bold text-uppercase"><?= _("Numéro Bénéficiaire") ?></label>
<input class="form-control border-primary-subtle" type="text" id="numeroBeneficiaire" name="numeroBeneficiaire" autofocus autocomplete="off" placeholder="Ex: B-500...">
<input class="form-control border-primary-subtle" type="text" id="numeroBeneficiaire" name="numeroBeneficiaire" autofocus autocomplete="off">
</div>
<div class="col-md-3">

77
Vue/Roles/index.php Executable file
View File

@ -0,0 +1,77 @@
<?php $this->titre = "INTER SANTE - Configuration des Accès"; ?>
<div id="div_liste" class="container-fluid py-4 animate__animated animate__fadeIn">
<div class="d-flex align-items-center mb-4">
<div class="bg-primary text-white p-3 rounded-3 shadow-sm me-3">
<i class="fas fa-shield-alt fa-2x"></i>
</div>
<div>
<h1 class="mb-0 fw-bold text-primary"><?= _("Gestion des Menus & Droits") ?></h1>
<p class="text-muted small mb-0"><?= _("Configurez les accès au menu principal selon le profil utilisateur RH") ?></p>
</div>
</div>
<div class="card shadow-sm border-0 mb-4">
<div class="card-body bg-light p-4 rounded-3 border">
<div class="row align-items-center">
<div class="col-md-4">
<label for="codeProfil" class="form-label small fw-bold text-uppercase text-primary mb-2">
<i class="fas fa-user-tag me-2"></i><?= _("Profil Utilisateur cible") ?>
</label>
<div class="input-group input-group-lg shadow-sm">
<select class="form-select fw-bold border-0"
id="codeProfil"
name="codeProfil"
required
autofocus
onChange="javascript:afficher_menu_principal_profil_rh();"
style="font-size: 11pt;">
<?php liste_options($profil, ""); ?>
</select>
</div>
</div>
<div class="col-md-8 pt-4">
<div class="alert alert-info border-0 shadow-xs mb-0 py-2 px-3 d-flex align-items-center">
<i class="fas fa-info-circle me-3 fa-lg"></i>
<span class="small">
<?= _("La sélection d'un profil chargera automatiquement la liste des menus disponibles pour modification.") ?>
</span>
</div>
</div>
</div>
</div>
</div>
<div id="div_menu_profil" class="min-vh-50 rounded-3 d-flex align-items-center justify-content-center border-dashed">
<div class="text-center text-muted opacity-50 p-5">
<i class="fas fa-th-list fa-4x mb-3"></i>
<h5><?= _("En attente de sélection") ?></h5>
<p><?= _("Veuillez choisir un profil ci-dessus pour gérer ses accès.") ?></p>
</div>
</div>
</div>
<style>
.min-vh-50 { min-height: 400px; transition: all 0.3s ease; }
/* Style pour le conteneur vide */
.border-dashed {
border: 2px dashed #dee2e6;
background-color: #fcfcfc;
}
.form-select:focus {
box-shadow: none;
border-color: #0d6efd;
}
/* Animation lors du chargement des données */
#div_menu_profil:not(:empty) {
border: none;
background-color: transparent;
display: block !important;
}
.shadow-xs { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
</style>

View File

@ -1,83 +1,154 @@
<?php
$this->titre = "INTER-SANTE - Rapport S/P Famille";
$adherentRetire = $spadherent['adherentRetire'];
$dateSortieAdherent = $spadherent['dateSortieAdherent'];
$this->titre = "INTER-SANTE - Rapport S/P Famille";
$adherentRetire = $spadherent['adherentRetire'];
$dateSortieAdherent = $spadherent['dateSortieAdherent'];
// Logique de couleur pour le S/P (exemple : < 70% vert, 70-100% orange, > 100% rouge)
$ratioValeur = (float)$this->nettoyer($spadherent['rapportsp']);
$badgeColor = "bg-success";
if ($ratioValeur > 70) $badgeColor = "bg-warning text-dark";
if ($ratioValeur > 100) $badgeColor = "bg-danger";
?>
<legend><?= _("Rapport S / P de la famille") . " : " .$this->nettoyer($spadherent['adherent'])." ( ".$this->nettoyer($spadherent['numeroAdherent'])." ) " ?> </legend>
<div id="div_adherent" class="container-fluid py-1 animate__animated animate__fadeIn">
<h1 class="text-primary"><i class="fa-solid fa-chart-pie me-2"></i><?= _('Rapport Sinistre / Prime') ?></h1>
<div class="card-header d-flex justify-content-between align-items-center py-1">
<h5 class="mb-0 fw-bold">
<?= _("POLICE") ?> : <span class="text-secondary"><?= $this->nettoyer($_SESSION['numeroPolice_C']) ?></span>
<span class="ms-3 badge bg-primary text-light small fw-normal">ID: <?= $this->nettoyer($_SESSION['idPolice_C']) ?></span>
</h5>
<table class="table table-responsive table-condensed" style='font-size:10pt; text-align:center'>
<thead>
<tr>
<th width="20%" style='text-align:center'> <?= _("Date Effet Police") ?> </th>
<th width="20%" style='text-align:center'> <?= _("Date Echéance Police") ?> </th>
<th width="20%" style='text-align:center'> <?= _("Durée Police") ?> </th>
<th width="20%" style='text-align:center'> <?= _("Ratio acquise police") ?> </th>
<th width="20%" style='text-align:center'> <?= _("Durée Contrat") ?> </th>
</tr>
</thead>
<div>
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item fw-bold"><?= $this->nettoyer($spadherent['adherent']) ?></li>
<li class="breadcrumb-item active"><?= $this->nettoyer($spadherent['numeroAdherent']) ?></li>
</ol>
</nav>
</div>
</div>
<tbody>
<div class="d-flex flex-wrap justify-content-between align-items-center mb-4 gap-3">
<?php if ($adherentRetire == "1") : ?>
<div class="alert alert-danger d-flex align-items-center mb-0 py-2 px-3 shadow-sm border-0">
<i class="fa-solid fa-user-slash me-2"></i>
<div>
<small class="d-block lh-1 text-uppercase fw-bold" style="font-size: 0.65rem;"><?= _("Membre sorti le") ?></small>
<span class="fw-bold"><?= dateLang($dateSortieAdherent) ?></span>
</div>
</div>
<?php endif; ?>
</div>
<tr>
<td> <?= dateLang($this->nettoyer($spadherent['dateEffet'])) ?> </td>
<td> <?= dateLang($this->nettoyer($spadherent['dateEcheance'])) ?> </td>
<td> <?= $this->nettoyer($spadherent['duree_acquise']) ?> </td>
<td> <?= $this->nettoyer($spadherent['ratio_acquise']) ?> </td>
<td> <?= $this->nettoyer($spadherent['dureePolice']) ?> </td>
</tr>
</tbody>
</table>
<div class="row g-3 mb-4 text-center">
<div class="col-md-3">
<div class="card border-0 shadow-sm h-100">
<div class="card-body">
<h6 class="text-muted small text-uppercase fw-bold"><?= _("Primes Totales") ?></h6>
<p class="h5 mb-0 fw-bold"><?= format_N($this->nettoyer($spadherent['primestat'])) ?></p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card border-0 shadow-sm h-100 border-start border-primary border-4">
<div class="card-body">
<h6 class="text-muted small text-uppercase fw-bold"><?= _("Primes Acquises") ?></h6>
<p class="h5 mb-0 text-primary fw-bold"><?= format_N($this->nettoyer($spadherent['prime_acquise'])) ?></p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card border-0 shadow-sm h-100 border-start border-danger border-4">
<div class="card-body">
<h6 class="text-muted small text-uppercase fw-bold"><?= _("Consommations") ?></h6>
<p class="h5 mb-0 text-danger fw-bold"><?= format_N($this->nettoyer($spadherent['consommation'])) ?></p>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card border-0 shadow-sm h-100 <?= $badgeColor ?> text-dark">
<div class="card-body">
<h6 class="small text-uppercase fw-bold opacity-75"><?= _("Rapport S/P Actuel") ?></h6>
<p class="display-6 mb-0 fw-bold"><?= $this->nettoyer($spadherent['rapportsp']) ?> %</p>
</div>
</div>
</div>
</div>
<table class="table table-responsive table-condensed" style='font-size:10pt; text-align:center'>
<thead>
<tr>
<th width="20%" style='text-align:center'> <?= _("Date Effet Famille") ?> </th>
<th width="20%" style='text-align:center'> <?= _("Date Echéance Famille") ?> </th>
<th width="20%" style='text-align:center'> <?= _("Durée acquise Famille") ?> </th>
<th width="20%" style='text-align:center'> <?= _("Ratio acquise Famille") ?> </th>
<th width="20%" style='text-align:center'> <?= _("Durée Contrat") ?> </th>
</tr>
</thead>
<div class="row g-4">
<div class="col-lg-6">
<div class="card border-0 shadow-sm">
<div class="card-header bg-white fw-bold py-3">
<i class="fa-solid fa-file-contract text-primary me-2"></i><?= _("Détails du Contrat (Police)") ?>
</div>
<div class="table-responsive">
<table class="table table-sm mb-0 align-middle">
<tbody class="small">
<tr>
<td class="ps-3 text-muted"><?= _("Effet / Échéance") ?></td>
<td class="text-end pe-3 fw-bold">
<?= dateLang($this->nettoyer($spadherent['dateEffet'])) ?>
<i class="fa-solid fa-arrow-right mx-1 text-muted"></i>
<?= dateLang($this->nettoyer($spadherent['dateEcheance'])) ?>
</td>
</tr>
<tr>
<td class="ps-3 text-muted"><?= _("Durée Écoulée (Jours)") ?></td>
<td class="text-end pe-3 fw-bold"><?= $this->nettoyer($spadherent['duree_acquise']) ?> / <?= $this->nettoyer($spadherent['dureePolice']) ?></td>
</tr>
<tr>
<td class="ps-3 text-muted"><?= _("Ratio Temporel") ?></td>
<td class="text-end pe-3">
<div class="progress" style="height: 6px; width: 100px; display: inline-flex;">
<div class="progress-bar bg-primary" style="width: <?= $this->nettoyer($spadherent['ratio_acquise']) ?>%"></div>
</div>
<span class="ms-2 fw-bold text-primary"><?= $this->nettoyer($spadherent['ratio_acquise']) ?> %</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<tbody>
<div class="col-lg-6">
<div class="card border-0 shadow-sm">
<div class="card-header bg-white fw-bold py-3">
<i class="fa-solid fa-users text-primary me-2"></i><?= _("Détails de l'Adhésion Famille") ?>
</div>
<div class="table-responsive">
<table class="table table-sm mb-0 align-middle">
<tbody class="small">
<tr>
<td class="ps-3 text-muted"><?= _("Effet Famille") ?></td>
<td class="text-end pe-3 fw-bold">
<?= dateLang($this->nettoyer($spadherent['dateEffetAdherent'])) ?>
</td>
</tr>
<tr>
<td class="ps-3 text-muted"><?= _("Durée Acquise Famille") ?></td>
<td class="text-end pe-3 fw-bold"><?= $this->nettoyer($spadherent['duree_acquise_adherent']) ?> jours</td>
</tr>
<tr>
<td class="ps-3 text-muted"><?= _("Ratio Temporel Famille") ?></td>
<td class="text-end pe-3">
<div class="progress" style="height: 6px; width: 100px; display: inline-flex;">
<div class="progress-bar bg-info" style="width: <?= $this->nettoyer($spadherent['ratio_acquise_adherent']) ?>%"></div>
</div>
<span class="ms-2 fw-bold text-info"><?= $this->nettoyer($spadherent['ratio_acquise_adherent']) ?> %</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<tr>
<td> <?= dateLang($this->nettoyer($spadherent['dateEffetAdherent'])) ?> </td>
<td> <?= dateLang($this->nettoyer($spadherent['dateEcheance'])) ?> </td>
<td> <?= $this->nettoyer($spadherent['duree_acquise_adherent']) ?> </td>
<td> <?= $this->nettoyer($spadherent['ratio_acquise_adherent']) ?> </td>
<td> <?= $this->nettoyer($spadherent['dureePolice']) ?> </td>
</tr>
</tbody>
</table>
<table class="table table-responsive table-condensed" style='font-size:10pt; text-align:center'>
<thead>
<tr>
<th width="20%" style='text-align:center'> <?= _("Primes Totales") ?> </th>
<th width="20%" style='text-align:center'> <?= _("Primes Acquises") ?> </th>
<th width="20%" style='text-align:center'> <?= _("Consommations") ?> </th>
<th width="20%" style='text-align:center'> <?= _("Rapport S/P") ?> </th>
<th width="20%" style='text-align:center'> <?= _("S/P Global") ?> </th>
</tr>
</thead>
<tbody>
<tr>
<td> <?= format_N($this->nettoyer($spadherent['primestat'])) ?> </td>
<td> <?= format_N($this->nettoyer($spadherent['prime_acquise'])) ?> </td>
<td> <?= format_N($this->nettoyer($spadherent['consommation'])) ?> </td>
<td> <?= $this->nettoyer($spadherent['rapportsp']) ?> </td>
<td> <?= $this->nettoyer($spadherent['rapportspgeneral']) ?> </td>
</tr>
</tbody>
</table>
<?php if ($adherentRetire=="1") : ?>
<div class="alert alert-danger" style="height:30px; padding:5px; margin-bottom:5px; text-align:center;" >
<H4><?= _("Date sortie") . " : " . dateLang($dateSortieAdherent) ?></H4>
</div>
<?php endif; ?>
<div class="card-body mt-4 p-3 rounded d-flex justify-content-between align-items-center shadow-sm">
<span class="text-muted small text-uppercase fw-bold"><?= _("Indicateur de Sinistralité Global (Groupe)") ?></span>
<span class="h5 mb-0 fw-bold text-secondary"><?= $this->nettoyer($spadherent['rapportspgeneral']) ?> %</span>
</div>
</div>

116
Vue/Usersrhclient/index.php Executable file
View File

@ -0,0 +1,116 @@
<?php
$this->titre = "INTER SANTE - Utilisateurs RH";
$idClient = $this->nettoyer($client['idClient']);
$nomClient = $this->nettoyer($client['nom']);
?>
<input class="visually-hidden" type="text" id="idClient" value="<?= $idClient ?>">
<div id="div_liste" class="container-fluid py-3 animate__animated animate__fadeIn">
<h1 class="text-primary"><i class="fas fa-users-cog me-2"></i> <?= _("Utilisateurs Portail RH") ?></h1>
<div class="card-header d-flex justify-content-between align-items-center py-1">
<h5 class="mb-0 fw-bold">
<span class="fw-normal text-dark-50"><?= $nomClient ?></span>
</h5>
<div class="d-flex align-items-center gap-3">
<span class="badge bg-white text-primary rounded-pill px-3 shadow-sm">
<?= count($users) ?> <?= _("comptes") ?>
</span>
</div>
</div>
<div class="card shadow-sm border-0">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0">
<thead class="table-light">
<tr class="small text-uppercase text-muted border-bottom">
<th class="ps-4" width="12%"><?= _("Identifiant") ?></th>
<th width="20%"><?= _("Nom Complet") ?></th>
<th class="text-center" width="8%"><?= _("Langue") ?></th>
<th class="text-center" width="15%"><?= _("Profil / Rôle") ?></th>
<th class="text-center" width="15%"><?= _("Statut") ?></th>
<th class="text-center pe-4" width="12%"><?= _("Actions") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($users as $user_client):
$idUtilisateur = $user_client['idUtilisateur'];
$codeUtilisateur = $user_client['codeUtilisateur'];
$actif = (int)$user_client['actif'];
$reInit = (int)$user_client['reInit'];
$codeLangue = $user_client['codeLangue'];
// Gestion multilingue du profil
$libelleProfil = est_anglophone() ? $user_client['profilEng'] : $user_client['profil'];
?>
<tr>
<td class="ps-4">
<code class="text-primary fw-bold bg-primary bg-opacity-10 px-2 py-1 rounded">
<?= $this->nettoyer($codeUtilisateur) ?>
</code>
</td>
<td>
<div class="fw-bold text-dark"><?= $this->nettoyer($user_client['utilisateur']) ?></div>
</td>
<td class="text-center">
<span class="badge border text-dark bg-white shadow-xs fw-bold">
<?= strtoupper($codeLangue) ?>
</span>
</td>
<td class="text-center">
<span class="badge bg-info-subtle text-info border border-info-subtle px-2 py-1">
<i class="fas fa-user-shield me-1 small"></i><?= $this->nettoyer($libelleProfil) ?>
</span>
</td>
<td class="text-center">
<?php if($actif === 1): ?>
<button class="btn btn-sm btn-outline-success rounded-pill px-3 fw-bold"
onClick="desactiver_user_rh_client('<?= $codeUtilisateur ?>');">
<i class="fas fa-check-circle me-1"></i> <?= _("Actif") ?>
</button>
<?php else: ?>
<button class="btn btn-sm btn-outline-danger rounded-pill px-3 fw-bold"
onClick="activer_user_rh_client('<?= $codeUtilisateur ?>');">
<i class="fas fa-ban me-1"></i> <?= _("Bloqué") ?>
</button>
<?php endif; ?>
</td>
<td class="text-center pe-4">
<div class="btn-group shadow-sm">
<button class="btn btn-outline-secondary btn-sm"
title="<?= _("Modifier") ?>"
onClick="afficher_users_client_id(<?= $idUtilisateur ?>);">
<i class="fas fa-edit"></i>
</button>
<button class="btn btn-outline-secondary btn-sm <?= ($reInit === 1) ? 'text-danger fw-bold' : '' ?>"
title="<?= _("-initialiser mot de passe") ?>"
onClick="reinitpaswd_user_rh('<?= $codeUtilisateur ?>');">
<i class="fas fa-key"></i>
</button>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<div class="card-footer bg-white text-muted small py-2">
<i class="fas fa-info-circle me-1"></i>
<?= _("Les comptes bloqués ne peuvent plus se connecter au portail.") ?>
</div>
</div>
</div>
<style>
.shadow-xs { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.table-hover tbody tr:hover { background-color: rgba(13, 110, 253, 0.02) !important; }
.btn-group .btn { padding: 0.4rem 0.6rem; }
.btn-outline-secondary:hover { background-color: #f8f9fa; color: #0d6efd; }
</style>

View File

@ -126,9 +126,14 @@ $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.05.15" rel="stylesheet">
<link href="<?= $racineWeb ?>Bootstrap_new/css/style_office.css?ver=2026.01.13.00" rel="stylesheet">
<link href="<?= $racineWeb ?>Bootstrap_new/css/ux_enhancements.css?ver=2025.12.21.02" rel="stylesheet">
<!-- Charts -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<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>
<!-- ============================================
SCRIPTS ET CONFIGURATION
============================================ -->
@ -297,65 +302,69 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
</div>
</header>
<!-- Sidebar -->
<!-- Navigation principale -->
<aside class="app-sidebar" id="sidebar">
<nav class="sidebar-nav" aria-label="Navigation principale">
<div class="nav-section">
<?php foreach ($menus as $key0 => $menuParent):
$menuChildrenLevelOne = $gabary->get_menus_by_parent_code($menuParent['vue']);
// DEBUG: Afficher l'info
echo "<!-- Menu {$key0}: {$menuParent['libeleMenu']} - Enfants: " . count($menuChildrenLevelOne) . " -->\n";
$isParentActive = $activeParentId === $key0;
$hasActiveChild = false;
foreach ($menuChildrenLevelOne as $key1 => $menuChild) {
if ((explode('/', $menuChild['lienMenu'])[0] ?? '') == $activeLink) {
$hasActiveChild = true;
break;
// 1. On nettoie l'URL active (on enlève les slashs inutiles)
$currentActive = trim($activeLink, '/');
// 2. On ne compare QUE si on a vraiment une page active
if (!empty($currentActive)) {
foreach ($menuChildrenLevelOne as $key1 => $menuChild) {
// On extrait le lien du menu et on le nettoie
$childLink = trim($menuChild['lienMenu'], '/');
// On compare de manière stricte
if ($childLink === $currentActive) {
$hasActiveChild = true;
break;
}
}
}
$shouldBeOpen = ($isParentActive || $hasActiveChild) && $activeParentId !== null;
// 3. Le menu s'ouvre SEULEMENT si un enfant est actif
$shouldBeOpen = false;
?>
<div class="nav-item">
<?php if (sizeof($menuChildrenLevelOne) > 0): ?>
<a href="#submenu<?= $key0 ?>"
class="nav-link <?= $shouldBeOpen ? 'active' : '' ?>"
data-bs-toggle="collapse"
onclick="appNavigation.toggleMenu('submenu<?= $key0 ?>', event)"
aria-expanded="<?= $shouldBeOpen ? 'true' : 'false' ?>"
aria-controls="submenu<?= $key0 ?>"
data-menu-id="submenu<?= $key0 ?>"
data-label="<?= htmlspecialchars($menuParent['libeleMenu']) ?>">
<i class="<?= $menuParent['icone'] ?>"></i>
<span class="nav-text"><?= $menuParent['libeleMenu'] ?></span>
<i class="nav-arrow bi bi-chevron-right"></i>
</a>
<div class="nav-submenu collapse <?= $shouldBeOpen ? 'show' : '' ?>"
id="submenu<?= $key0 ?>"
data-parent-id="submenu<?= $key0 ?>">
<?php foreach ($menuChildrenLevelOne as $key1 => $menuChild):
$childActive = (explode('/', $menuChild['lienMenu'])[0] ?? '') == $activeLink;
?>
<a href="<?= $menuChild['lienMenu'] ?>"
class="nav-link <?= $childActive ? 'active' : '' ?>"
aria-current="<?= $childActive ? 'page' : 'false' ?>"
data-label="<?= htmlspecialchars($menuChild['libeleMenu']) ?>">
<?= $menuChild['libeleMenu'] ?>
<?php if (count($menuChildrenLevelOne) > 0): ?>
<a href="javascript:void(0)"
class="nav-link <?= $shouldBeOpen ? 'active' : '' ?>"
data-submenu-target="submenu<?= $key0 ?>"
aria-expanded="<?= $shouldBeOpen ? 'true' : 'false' ?>"
aria-controls="submenu<?= $key0 ?>"
data-label="<?= htmlspecialchars($menuParent['libeleMenu']) ?>">
<i class="<?= $menuParent['icone'] ?>"></i>
<span class="nav-text"><?= $menuParent['libeleMenu'] ?></span>
<i class="nav-arrow bi bi-chevron-right"></i>
</a>
<?php endforeach; ?>
</div>
<div class="nav-submenu collapse <?= $shouldBeOpen ? 'show' : '' ?>"
id="submenu<?= $key0 ?>"
data-bs-parent=".nav-section">
<?php foreach ($menuChildrenLevelOne as $key1 => $menuChild):
$childActive = (explode('/', $menuChild['lienMenu'])[0] ?? '') == $activeLink;
?>
<a href="<?= $menuChild['lienMenu'] ?>"
class="nav-link <?= $childActive ? 'active' : '' ?>"
aria-current="<?= $childActive ? 'page' : 'false' ?>"
data-label="<?= htmlspecialchars($menuChild['libeleMenu']) ?>">
<?= $menuChild['libeleMenu'] ?>
</a>
<?php endforeach; ?>
</div>
<?php else: ?>
<!-- Code pour "Accueil" (sans enfants) -->
<a href="<?= $menuParent['lienMenu'] ?>"
class="nav-link <?= ((explode('/', $menuParent['lienMenu'])[0] ?? '') == $activeLink) ? 'active' : '' ?>"
data-label="<?= htmlspecialchars($menuParent['libeleMenu']) ?>">
<i class="<?= $menuParent['icone'] ?>"></i>
<span class="nav-text"><?= $menuParent['libeleMenu'] ?></span>
</a>
<a href="<?= $menuParent['lienMenu'] ?>"
class="nav-link <?= ((explode('/', $menuParent['lienMenu'])[0] ?? '') == $activeLink) ? 'active' : '' ?>"
data-label="<?= htmlspecialchars($menuParent['libeleMenu']) ?>">
<i class="<?= $menuParent['icone'] ?>"></i>
<span class="nav-text"><?= $menuParent['libeleMenu'] ?></span>
</a>
<?php endif; ?>
</div>
<?php endforeach; ?>
@ -501,9 +510,10 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
<span><?= _('Photo du bénéficiaire') ?></span>
</div>
<div class="photo-container">
<img src="data:image/jpg;base64,<?= $imgData ?>"
<img src="<?=$photoAssureCrypte?>"
class="patient-photo"
onclick="appModals.openPhotoModal()"
data-bs-toggle="modal"
data-bs-target="#pop_photo"
alt="<?= _('Photo du bénéficiaire') ?>"
loading="lazy">
</div>
@ -558,7 +568,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
</div>
<div class="modal-body text-center">
<?php if ($_SESSION['faceRegistered_C'] == "1"): ?>
<img src="data:image/jpg;base64,<?= $imgData ?>"
<img src="<?=$photoAssureCrypte?>"
class="img-fluid rounded"
style="max-height: 70vh; max-width: 100%;"
alt="<?= _('Photo agrandie du bénéficiaire') ?>">
@ -584,38 +594,52 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
</div>
</div>
<!--<button class="d-none" id="btn_police" data-bs-toggle="modal" data-bs-target="#pop_police"></button>-->
<!-- Polices Modal -->
<div class="modal fade" id="pop_police" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-bs-dismiss="modal"> <?= _("Fermer") ?> </button>
<h4 class="modal-title"> <?= _("Sélectionner une police") ?> </h4>
</div>
<div class="modal-body">
<div id="div_police">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-bs-dismiss="modal"> <?= _("Fermer") ?> </button>
</div>
</div>
</div>
</div>
<div id="div_ajaxgabarit">
</div>
<div class="modal fade" id="pop_photo" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button id="btn_close_pop" name="btn_close_pop" type="button" class="close" data-bs-dismiss="modal"> <?= _("Fermer") ?> </button>
<h4 class="modal-title"> <?= _("Photo") ?> </h4>
</div>
<div class="modal-body">
<img src="<?=$photoAssureCrypte?>" style="width: 450px;" >
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-bs-dismiss="modal"> <?= _("Fermer") ?> </button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="pop_photo" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button id="btn_close_pop" name="btn_close_pop" type="button" class="close" data-bs-dismiss="modal"> <?= _("Fermer") ?> </button>
<h4 class="modal-title"> <?= _("Photo") ?> </h4>
</div>
<div class="modal-body">
<img src="<?=$photoAssureCrypte?>" style="width: 450px;" >
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-bs-dismiss="modal"> <?= _("Fermer") ?> </button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
/*$('#timer').timer({
duration: '60s',
callback: function() {
raffraichier_gabarit();
},
repeat: true
});*/
</script>
<!-- JavaScript Libraries -->
<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>
@ -638,7 +662,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- Application Scripts -->
<script src="/Js/fonctions.js?ver=2026.01.07.02"></script>
<script src="/Js/fonctions.js?ver=2026.01.15.05"></script>
<script type="text/javascript">
raffraichier_gabarit();
@ -663,6 +687,11 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
<!-- Service Worker Registration -->
<script src="/Js/sw-register.js?ver=2025.12.31.00"></script>
<script src="Bootstrap/vendor/apexcharts/apexcharts.min.js"></script>
<script src="Bootstrap/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="Bootstrap/vendor/chart.js/chart.umd.js"></script>
<script src="Bootstrap/vendor/echarts/echarts.min.js"></script>
<script>
// CORRECTION URGENTE - FORCE LE BON MENU
document.addEventListener('DOMContentLoaded', function() {
@ -757,24 +786,21 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte'];
<script>
document.addEventListener("DOMContentLoaded", function () {
const toggleBtn = document.querySelector(".toggle-sidebar-btn");
toggleBtn.addEventListener("click", function () {
const isCollapsed = document.body.classList.toggle("sidebar-collapsed");
if (isCollapsed) {
// Fermer tous les sous-menus ouverts
document.querySelectorAll(".nav-submenu.show").forEach(submenu => {
submenu.classList.remove("show");
submenu.classList.add("collapse");
submenu.setAttribute("aria-expanded", "false");
});
// Retirer les classes "active" des liens parents
document.querySelectorAll(".nav-link.active[data-bs-toggle='collapse']").forEach(link => {
link.classList.remove("active");
});
}
// On initialise les menus SANS les forcer à s'ouvrir
document.querySelectorAll('[data-submenu-target]').forEach(link => {
link.addEventListener('click', function (e) {
e.preventDefault();
const targetId = this.getAttribute('data-submenu-target');
const targetEl = document.getElementById(targetId);
if (targetEl) {
const instance = bootstrap.Collapse.getOrCreateInstance(targetEl, {
parent: '.nav-section', // Ferme les autres quand on en ouvre un
toggle: false
});
instance.toggle();
}
});
});
});
</script>