This commit is contained in:
KONE SOREL 2025-12-31 13:32:20 +00:00
parent 27ca100482
commit 278233dab5
7 changed files with 170 additions and 187 deletions

View File

@ -955,6 +955,7 @@ li i { margin-right:10px; color:#007bff; }
}
/* Global Container */
#div_accueil,
#div_police,
#div_texte_cp,
#div_emission,
@ -965,6 +966,7 @@ li i { margin-right:10px; color:#007bff; }
}
/* Card Styling */
#div_accueil .card,
#div_police .card,
#div_texte_cp .card,
#div_emission .card,

View File

@ -17,70 +17,11 @@ class ControleurAccueil extends Controleur {
// KPIs
$kpis = $this->synthese->getKpis();
// Activité récente
$activities = [
["icon" => "fas fa-user-plus", "label" => "Nouveaux salariés ajoutés", "time" => "Il y a 1 heure"],
["icon" => "fas fa-sign-out-alt", "label" => "5 départs validés", "time" => "Il y a 2 heures"],
["icon" => "fas fa-pause-circle", "label" => "3 contrats suspendus", "time" => "Il y a 3 jours"],
["icon" => "fas fa-file-invoice", "label" => "Facture de février réglée", "time" => "Il y a 3 jours"]
];
// Alertes
$alerts = [
"Plafond de remboursement atteint",
"Paiement en retard de 4 520 €",
"Documents manquants pour 2 dossiers"
];
// Répartition sinistres
$claims = $this->synthese->getClaims();
$tabclaims = [
'claimsLabels' => array_column($claims, 'claimsLabels'),
'claimsValues' => array_column($claims, 'claimsValues')
];
$dataTabClaims = json_encode($tabclaims, JSON_NUMERIC_CHECK);
// Evolution des sinistres par mois
$claimsMonth = $this->synthese->getClaimsMonth();
$claimsSingleMonth = $this->synthese->getClaimsSingleMonth();
$tabclaimsMonth = [
'months' => array_column($claimsMonth, 'months'),
'monthlyClaims' => array_column($claimsMonth, 'monthlyClaims'),
'singleClaims' => array_column($claimsSingleMonth, 'singleClaims')
];
$dataTabClaimsMonth = json_encode($tabclaimsMonth, JSON_NUMERIC_CHECK);
// SINISTRALITÉ
$claimsLossRatio = $this->synthese->getClaimsLossRatio();
$tabLossRatio = [
'lossRatioLabels' => array_column($claimsLossRatio, 'months'),
'lossRatioValues' => array_column($claimsLossRatio, 'ratio')
];
$dataLossRatio = json_encode($tabLossRatio, JSON_NUMERIC_CHECK);
//$lossRatioLabels = ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin"];
//$lossRatioValues = [62, 68, 71, 65, 73, 69]; // %
// Polices
$polices = $this->synthese->getPolices();
$this->genererVue(
array
(
'kpis' => $kpis,
'polices' => $polices,
'activities' => $activities,
'alerts' => $alerts,
'dataTabClaims' => $dataTabClaims,
'dataTabClaimsMonth' => $dataTabClaimsMonth,
'dataLossRatio' => $dataLossRatio
)
);
}

View File

@ -0,0 +1,20 @@
<?php
require_once 'Framework/Controleur.php';
require_once 'Modele/Synthese.php';
class ControleurAjaxlistepolicesclient extends Controleur {
private $synthese;
public function __construct()
{
$this->synthese = new Synthese();
}
public function index()
{
// Polices
$polices = $this->synthese->getPolices();
$this->genererVueAjax(array('polices' => $polices));
}
}

View File

@ -1062,3 +1062,24 @@ function addChartToPdf(pdf, canvasId, title, startY) {
pdf.addImage(imgData, "PNG", 10, startY + 5, 180, 60);
}
}
function charger_contrats(){
showLoader("#div_liste_contrats", { size: 3 });
$.ajax({
url: $("#racineWeb").val()+"Ajaxlistepolicesclient/",
type : 'post',
// data: donnees,
error: function(errorData) {
},
success: function(data) {
$("#div_liste_contrats").html(data);
}
});
}
function reset_contrats()
{
$("#div_liste_contrats").empty();
}

View File

@ -1,13 +1,17 @@
<div class="container text-primary">
<h1><i class="fas fa-tachometer-alt"></i> <?= _('Tableau de bord') ?></h1>
<div id="div_accueil" class="container-fluid py-4">
<h1 class="text-primary"><i class="fas fa-tachometer-alt"></i> <?= _('Tableau de bord') ?></h1>
<!-- KPIs -->
<div class="kpis">
<!-- Nombre des contrats santé -->
<div class="card">
<h3><?= _('Total Contrats')?></h3>
<div class="value"><?= number_format($kpis["nbPolice"]) ?></div>
</div>
<!-- Adhérents et Ayants droits -->
<div class="card">
<h3><?= _('Total Assurés')?></h3>
<div class="sub-values">
@ -22,6 +26,7 @@
</div>
</div>
<!-- Primes -->
<div class="card">
<h3><?= _('Primes')?></h3>
<div class="sub-values">
@ -37,6 +42,7 @@
</div>
</div>
<!-- Sinistres -->
<div class="card">
<h3><?= _('Sinistres')?></h3>
<div class="sub-values">
@ -58,105 +64,48 @@
</div>
</div>
<!-- Accordéons -->
<div class="grid-1">
<div class="card">
<section class="accordion-section">
<h2 class="accordion-header">
<i class="fas fa-file-contract text-primary"></i>
<span class="accordion-title"><?= _("Liste des contrats")?></span>
<i class="accordion-icon bi bi-chevron-down"></i>
</h2>
<div class="accordion-content">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed tabliste compact w-100" style="font-size:10pt; white-space:nowrap;">
<thead>
<tr>
<th style="text-align:center"> <?= _("No Police") ?> </th>
<th style="text-align:center"> <?= _("ID Police") ?> </th>
<th style="text-align:center">Type</th>
<th style="text-align:center"> <?= _("Effet") ?> </th>
<th style="text-align:center"> <?= _("Échéance") ?> </th>
<th style="text-align:center"> <?= _("Type Avenant") ?> </th>
<th style="text-align:center"> <?= _("État") ?> </th>
<th style="text-align:center"> <?= _("Prime") ?> </th>
<th style="text-align:center"> <?= _("Sinistres") ?> </th>
<th style="text-align:center"> <?= _("R S/P") ?> </th>
<!-- Colonnes cachées pour recherche -->
<th data-hidden="true">NoPoliceHidden</th>
<th data-hidden="true">IdPoliceHidden</th>
</tr>
</thead>
<tbody>
<?php foreach ($polices as $police):
$id = $this->nettoyer($police['idPolice']);
$nopol = $this->nettoyer($police['numeroPolice']);
?>
<tr>
<!-- Boutons visibles -->
<td align="center">
<input type="button" class="form-control btn btn-primary" value="<?= $nopol ?>"
onClick="selectionner_police(<?= $id ?>,'<?= $nopol ?>');">
</td>
<td align="center">
<input type="button" class="form-control btn btn-info" value="<?= $id ?>"
onClick="selectionner_police(<?= $id ?>,'<?= $nopol ?>');">
</td>
<!-- Autres colonnes -->
<td align='center'><?= $this->nettoyer($police['typeContrat']) ?></td>
<td align='center'><?= dateLang($this->nettoyer($police['dateEffet']), $_SESSION['lang'])?></td>
<td align='center'><?= dateLang($this->nettoyer($police['dateEcheance']), $_SESSION['lang']) ?></td>
<td align='center'><?= $this->nettoyer($police['typeAvenant']) ?></td>
<td align='center'><?= $this->nettoyer($police['etatPolice']) ?></td>
<td align='center'><?= format_N($this->nettoyer($police['primeNetteStat'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($police['montantApayer'])) ?></td>
<?php if($police["rapportSp"] > 65 && $police["rapportSp"] <= 80):?>
<td align='center' class="text-warning"><?= $police["rapportSp"].'%' ?></td>
<?php elseif($police["rapportSp"] > 80):?>
<td align='center' class="text-danger"><?= $police["rapportSp"].'%' ?></td>
<?php else:?>
<td align='center' class="text-primary"><?= $police["rapportSp"].'%' ?></td>
<?php endif;?>
<!-- Colonnes cachées -->
<td><?= $nopol ?></td>
<td><?= $id ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="accordion" id="dashboardAccordion">
<!-- Section Contrats -->
<section class="accordion-section">
<h2 class="accordion-header" data-bs-toggle="collapse" data-bs-target="#contratsCollapse">
<i class="fas fa-file-contract text-primary"></i>
<span class="accordion-title"><?= _("Contrats santé")?></span>
</h2>
<div id="contratsCollapse"
class="accordion-collapse collapse"
data-bs-parent="#dashboardAccordion"
data-open-fn="charger_contrats"
data-close-fn="reset_contrats">
<div class="accordion-content">
<div id="div_liste_contrats"></div>
</div>
</div>
</div>
</section>
</section>
<section class="accordion-section">
<h2 class="accordion-header">
<!-- Section Graphiques -->
<section class="accordion-section">
<h2 class="accordion-header" data-bs-toggle="collapse" data-bs-target="#graphiqueCollapse">
<i class="fas fa-chart-line text-primary"></i>
<span class="accordion-title"><?= _("Graphiques sinistres")?></span>
<i class="accordion-icon bi bi-chevron-down"></i>
</h2>
<div class="accordion-content">
<div class="d-flex justify-content-start gap-2 mb-3">
<!-- Bouton Actualiser -->
<button id="graphiqueBtn" class="btn btn-primary" onclick="graphique_sinistre();">
<i class="fas fa-sync-alt me-2"></i> <?= _('Afficher') ?>
</button>
<!-- Bouton Fermer / Réinitialiser -->
<button id="resetGraphiqueBtn" class="btn btn-secondary" onclick="reset_graphique();">
<i class="fas fa-times me-2"></i> <?= _('Masquer') ?>
</button>
</h2>
<div id="graphiqueCollapse"
class="accordion-collapse collapse"
data-bs-parent="#dashboardAccordion"
data-open-fn="graphique_sinistre"
data-close-fn="reset_graphique">
<div class="accordion-content">
<div id="div_graphique">
<canvas id="claimsChart"></canvas>
<canvas id="claimsMonthChart"></canvas>
<canvas id="lossRatioChart"></canvas>
</div>
</div>
</div>
<div id="div_graphique">
<canvas id="claimsChart"></canvas>
<canvas id="claimsMonthChart"></canvas>
<canvas id="lossRatioChart"></canvas>
</div>
</div>
</section>
</section>
</div>
</div>
</div>
</div>
@ -170,36 +119,24 @@
<script>
document.addEventListener('DOMContentLoaded', function() {
// Laisser Bootstrap gérer les accordéons - suppression du script conflictuel
// Bootstrap s'occupe déjà du fonctionnement des accordéons
const collapses = document.querySelectorAll('.accordion-collapse');
// Si vous voulez garder votre système personnalisé pour les grandes sections,
// assurez-vous qu'il ne cible pas les mêmes éléments que Bootstrap
const sectionHeaders = document.querySelectorAll('.accordion-section .accordion-header');
sectionHeaders.forEach(header => {
header.addEventListener('click', function() {
// Vérifier si cet accordéon est géré par Bootstrap
if (!this.querySelector('[data-bs-toggle="collapse"]')) {
const content = this.nextElementSibling;
const isCurrentlyActive = this.classList.contains('active');
// Fermer toutes les sections d'abord
document.querySelectorAll('.accordion-section .accordion-content').forEach(content => {
content.style.display = 'none';
});
document.querySelectorAll('.accordion-section .accordion-header').forEach(header => {
header.classList.remove('active');
});
// Si la section n'était pas active, l'ouvrir
if (!isCurrentlyActive) {
this.classList.add('active');
content.style.display = 'block';
}
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]();
}
});
});
});
});
// Quand une section se ferme
collapse.addEventListener('hide.bs.collapse', function () {
const fnName = this.dataset.closeFn;
if (fnName && typeof window[fnName] === 'function') {
window[fnName]();
}
});
});
});
</script>

View File

@ -0,0 +1,62 @@
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed tabliste compact w-100" style="font-size:10pt; white-space:nowrap;">
<thead>
<tr>
<th style="text-align:center"> <?= _("No Police") ?> </th>
<th style="text-align:center"> <?= _("ID Police") ?> </th>
<th style="text-align:center">Type</th>
<th style="text-align:center"> <?= _("Effet") ?> </th>
<th style="text-align:center"> <?= _("Échéance") ?> </th>
<th style="text-align:center"> <?= _("Type Avenant") ?> </th>
<th style="text-align:center"> <?= _("État") ?> </th>
<th style="text-align:center"> <?= _("Prime") ?> </th>
<th style="text-align:center"> <?= _("Sinistres") ?> </th>
<th style="text-align:center"> <?= _("R S/P") ?> </th>
<!-- Colonnes cachées pour recherche -->
<th data-hidden="true">NoPoliceHidden</th>
<th data-hidden="true">IdPoliceHidden</th>
</tr>
</thead>
<tbody>
<?php foreach ($polices as $police):
$id = $this->nettoyer($police['idPolice']);
$nopol = $this->nettoyer($police['numeroPolice']);
?>
<tr>
<!-- Boutons visibles -->
<td align="center">
<input type="button" class="form-control btn btn-primary" value="<?= $nopol ?>"
onClick="selectionner_police(<?= $id ?>,'<?= $nopol ?>');">
</td>
<td align="center">
<input type="button" class="form-control btn btn-info" value="<?= $id ?>"
onClick="selectionner_police(<?= $id ?>,'<?= $nopol ?>');">
</td>
<!-- Autres colonnes -->
<td align='center'><?= $this->nettoyer($police['typeContrat']) ?></td>
<td align='center'><?= dateLang($this->nettoyer($police['dateEffet']), $_SESSION['lang'])?></td>
<td align='center'><?= dateLang($this->nettoyer($police['dateEcheance']), $_SESSION['lang']) ?></td>
<td align='center'><?= $this->nettoyer($police['typeAvenant']) ?></td>
<td align='center'><?= $this->nettoyer($police['etatPolice']) ?></td>
<td align='center'><?= format_N($this->nettoyer($police['primeNetteStat'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($police['montantApayer'])) ?></td>
<?php if($police["rapportSp"] > 65 && $police["rapportSp"] <= 80):?>
<td align='center' class="text-warning"><?= $police["rapportSp"].'%' ?></td>
<?php elseif($police["rapportSp"] > 80):?>
<td align='center' class="text-danger"><?= $police["rapportSp"].'%' ?></td>
<?php else:?>
<td align='center' class="text-primary"><?= $police["rapportSp"].'%' ?></td>
<?php endif;?>
<!-- Colonnes cachées -->
<td><?= $nopol ?></td>
<td><?= $id ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>

View File

@ -119,7 +119,7 @@ $activeChildId = $menuData['child'];
<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=2025.12.30.00" rel="stylesheet">
<link href="<?= $racineWeb ?>Bootstrap_new/css/style_office.css?ver=2025.12.31.00" rel="stylesheet">
<link href="<?= $racineWeb ?>Bootstrap_new/css/ux_enhancements.css?ver=2025.12.21.02" rel="stylesheet">
<!-- ============================================
@ -595,7 +595,7 @@ $activeChildId = $menuData['child'];
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- Application Scripts -->
<script src="/Js/fonctions.js?ver=2025.12.31.08"></script>
<script src="/Js/fonctions.js?ver=2025.12.31.09"></script>
<script type="text/javascript">
setInterval(function() {