This commit is contained in:
KONE SOREL 2025-12-24 20:53:00 +00:00
parent 1be523e39d
commit f54727ac63
2 changed files with 63 additions and 46 deletions

View File

@ -15,22 +15,8 @@ class ControleurAccueil extends Controleur {
public function index() {
// KPIs
$kpis = $this->synthese->getKpis();
/*
$kpis = [
"assures" => 1248,
"nombre_salarie" => 405,
"nombre_ayant" => 843,
"sinistres_count" => 92,
"sinistres_amount" => 48750000,
"cotisations" => 162300000,
"solde" => 12500000
];
*/
// Activité récente
$activities = [
["icon" => "fas fa-user-plus", "label" => "Nouveaux salariés ajoutés", "time" => "Il y a 1 heure"],
@ -56,20 +42,11 @@ class ControleurAccueil extends Controleur {
$dataTabClaims = json_encode($tabclaims, JSON_NUMERIC_CHECK);
// Évolution cotisations
$months = ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin"];
$monthlyCotisations = [
24500000,
25800000,
26200000,
27500000,
28900000,
30000000
];
// SINISTRALITÉ (manquante jusquici)
$lossRatioLabels = ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin"];
$lossRatioValues = [62, 68, 71, 65, 73, 69]; // %
//
$this->genererVue(
array
@ -77,8 +54,6 @@ class ControleurAccueil extends Controleur {
'kpis' => $kpis,
'activities' => $activities,
'alerts' => $alerts,
'months' => $months,
'monthlyCotisations' => $monthlyCotisations,
'lossRatioLabels' => $lossRatioLabels,
'lossRatioValues' => $lossRatioValues,
'dataTabClaims' => $dataTabClaims

View File

@ -24,8 +24,15 @@
</div>
<div class="card">
<h3><?= _('Cotisations / Primes')?></h3>
<div class="value text-success"><?= format_N($kpis["primeTtc"]).' '.$_SESSION['devise_C'] ?></div>
<h3><?= _('Primes')?></h3>
<div class="sub-item">
<span><?= _('Nette Stat') ?> :</span>
<strong><?= format_N($kpis["primeNetteStat"]).' '.$_SESSION['devise_C'] ?></strong>
</div>
<div class="sub-item">
<span><?= _('TTC') ?> :</span>
<strong><?= format_N($kpis["primeTtc"]).' '.$_SESSION['devise_C'] ?></strong>
</div>
</div>
<div class="card">
@ -37,10 +44,10 @@
</div>
<div class="sub-item">
<span><?= _('Montant') ?> :</span>
<strong><?= format_N($kpis["fraisReel"]).' '.$_SESSION['devise_C'] ?></strong>
<strong><?= format_N($kpis["montantApayer"]).' '.$_SESSION['devise_C'] ?></strong>
</div>
<div class="sub-item">
<span><?= _('Sinistralité') ?> :</span>
<span><?= _('Rapport S/P') ?> :</span>
<?php if($kpis["rapportSp"] > 65):?>
<strong class="text-warning"><?= $kpis["rapportSp"].'%' ?></strong>
<?php elseif($kpis["rapportSp"] > 80 && $kpis["rapportSp"] <= 100):?>
@ -53,6 +60,21 @@
</div>
</div>
<div class="grid-1">
<div class="card">
<section class="accordion-section">
<h2 class="accordion-header">
<i class="fas fa-file-medical 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>
</section>
</div>
</div>
<!-- Activité & Alertes -->
<div class="grid-2">
<div class="card">
@ -81,21 +103,6 @@
</div>
</div>
<div class="grid-1">
<div class="card">
<section class="accordion-section">
<h2 class="accordion-header">
<i class="fas fa-file-medical 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>
</section>
</div>
</div>
<!-- Graphiques (placeholders) -->
<div class="grid-2">
<div class="card">
@ -176,4 +183,39 @@
});
</script>
<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
// 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';
}
}
});
});
});
</script>