This commit is contained in:
KONE SOREL 2026-01-06 13:20:19 +00:00
parent 5fc60604dd
commit 411586bc64

View File

@ -1,63 +1,76 @@
<div id="div_detail_sp">
<table class="table table-striped table-bordered table-hover table-condensed table-responsive" style="font-size:7pt;">
<thead>
<tr>
<th rowspan="2" colspan="2" style='text-align:center'> <?= _("Adhérent") ?> </th>
<div id="div_detail_sp" class="animate__animated animate__fadeIn">
<?php
// Initialisation des compteurs de totaux
$totStat = $totTtc = $totAll = 0;
$natures = ['OUT', 'INP', 'OPT', 'MON', 'DEN', 'FUN'];
$totPlafonds = array_fill_keys($natures, 0);
$totConsos = array_fill_keys($natures, 0);
<th colspan="2" style='text-align:center'> <?= _("Primes") ?> </th>
// Calcul des sommes
foreach ($conommations as $conso) {
$totStat += (float)$conso['primeStat'];
$totTtc += (float)$conso['primeTtc'];
$totAll += (float)$conso['consommation_ALL'];
foreach ($natures as $n) {
$totPlafonds[$n] += (float)$conso['plafond_' . $n];
$totConsos[$n] += (float)$conso['consommation_' . $n];
}
}
?>
<th colspan="6" style='text-align:center'> <?= _("Plafonds") ?> </th>
<div class="table-responsive shadow-sm border rounded">
<table class="table table-sm table-hover align-middle mb-0" style="font-size: 0.75rem;">
<thead class="text-white sticky-top">
<tr class="bg-dark border-bottom border-secondary text-center">
<th colspan="2" class="py-2 border-end border-secondary"><?= _("Bénéficiaire") ?></th>
<th colspan="2" class="py-2 border-end border-secondary bg-primary bg-opacity-75"><?= _("Primes") ?></th>
<th colspan="6" class="py-2 border-end border-secondary bg-info bg-opacity-50 text-dark"><?= _("Plafonds") ?></th>
<th colspan="7" class="py-2 bg-danger bg-opacity-75"><?= _("Consommations") ?></th>
</tr>
<tr class="bg-light text-dark small text-center border-bottom">
<th class="border-end"><?= _("Nom / N° Adh") ?></th>
<th class="border-end">ID</th>
<th class="bg-primary bg-opacity-10">Stat</th>
<th class="border-end bg-primary bg-opacity-10">TTC</th>
<?php foreach ($natures as $n): ?><th class="bg-info bg-opacity-10 small"><?= $n ?></th><?php endforeach; ?>
<?php foreach ($natures as $n): ?><th class="bg-danger bg-opacity-10 small border-start border-white"><?= $n ?></th><?php endforeach; ?>
<th class="bg-dark text-white fw-bold border-start border-white">TOTAL</th>
</tr>
</thead>
<th colspan="7" style='text-align:center'> <?= _("Consommations") ?> </th>
</tr>
<tbody>
<?php foreach ($conommations as $conso): ?>
<tr class="text-center">
<td class="text-start ps-2 border-end fw-bold text-uppercase"><?= $this->nettoyer($conso['nomAdherent']) ?></td>
<td class="border-end x-small text-muted"><?= $this->nettoyer($conso['numeroAdherent']) ?></td>
<td class="bg-primary bg-opacity-10"><?= format_N($conso['primeStat']) ?></td>
<td class="border-end bg-primary bg-opacity-10 fw-semibold"><?= format_N($conso['primeTtc']) ?></td>
<?php foreach ($natures as $n): ?><td><?= format_N($conso['plafond_'.$n]) ?></td><?php endforeach; ?>
<?php foreach ($natures as $n): ?><td class="bg-danger bg-opacity-10 text-danger fw-medium border-start border-white"><?= format_N($conso['consommation_'.$n]) ?></td><?php endforeach; ?>
<td class="bg-dark text-white fw-bold"><?= format_N($conso['consommation_ALL']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
<tr>
<th style='text-align:center'> Stat </th>
<th style='text-align:center'> <?= _("TTC") ?> </th>
<th style='text-align:center'> OUT </th>
<th style='text-align:center'> INP </th>
<th style='text-align:center'> OPT </th>
<th style='text-align:center'> MON </th>
<th style='text-align:center'> DEN </th>
<th style='text-align:center'> FUN </th>
<th style='text-align:center'> OUT </th>
<th style='text-align:center'> INP </th>
<th style='text-align:center'> OPT </th>
<th style='text-align:center'> MON </th>
<th style='text-align:center'> DEN </th>
<th style='text-align:center'> FUN </th>
<th style='text-align:center'> ALL </th>
</tr>
</thead>
<tbody>
<?php foreach ($conommations as $conommation): ?>
<tr valign="top">
<td><?= $this->nettoyer($conommation['nomAdherent']) ?></td>
<td align='center'><?= $this->nettoyer($conommation['numeroAdherent']) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['primeStat'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['primeTtc'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['plafond_OUT'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['plafond_INP'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['plafond_OPT'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['plafond_MON'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['plafond_DEN'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['plafond_FUN'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_OUT'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_INP'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_OPT'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_MON'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_DEN'])) ?></td>
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_FUN'])) ?></td>
<tfoot class="sticky-bottom bg-warning bg-opacity-10 fw-bold border-top border-dark text-center shadow-lg">
<tr style="font-size: 0.8rem;">
<td colspan="2" class="text-end pe-3 bg-dark text-white fw-bold"><?= _("TOTAL GÉNÉRAL") ?> :</td>
<td class="bg-primary bg-opacity-25"><?= format_N($totStat) ?></td>
<td class="bg-primary bg-opacity-25 border-end border-dark"><?= format_N($totTtc) ?></td>
<?php foreach ($natures as $n): ?><td class="bg-info bg-opacity-25 text-dark"><?= format_N($totPlafonds[$n]) ?></td><?php endforeach; ?>
<?php foreach ($natures as $n): ?><td class="bg-danger bg-opacity-25 text-danger border-start border-white"><?= format_N($totConsos[$n]) ?></td><?php endforeach; ?>
<td class="bg-dark text-warning fw-bolder fs-6 border-start border-white"><?= format_N($totAll) ?></td>
</tr>
</tfoot>
</table>
</div>
</div>
<td align='center'><?= format_N($this->nettoyer($conommation['consommation_ALL'])) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<style>
.x-small { font-size: 0.65rem; }
.table-responsive { position: relative; max-height: 70vh; overflow: auto; }
/* Fixation du footer et du header pour le scroll */
.sticky-top { position: sticky; top: 0; z-index: 1020; }
.sticky-bottom { position: sticky; bottom: 0; z-index: 1020; }
tfoot td { border-top: 2px solid #333 !important; }
</style>