📊 Statistiques — Recherche par Mot-clé

{{-- CSS d'impression --}}
{{-- ─── Onglets de navigation ───────────────────────────────────── --}} @php $profile = auth()->user()?->profileAgent; $isAdminOrRH = $profile && ($profile->est_admin || $profile->est_rh); $isChef = $profile && $profile->est_chef_de_service; $currentRoute = request()->route()->getName(); @endphp
{{-- ─── Formulaire de filtre ───────────────────────────────────── --}}
Réinitialiser
{{-- ─── Tableau de Résultats ───────────────────────────────────── --}} @if(isset($startDateRaw) && isset($endDateRaw))
{{-- Pré-calcul des totaux par colonne et par agent --}} @php $colTotals = []; $agentTotals = []; $grandTotal = 0; foreach($monthsCols as $k => $m) { $colTotals[$k] = 0; } foreach($tableData as $idx => $row) { $agentTotals[$idx] = array_sum($row['months']); $grandTotal += $agentTotals[$idx]; foreach($monthsCols as $k => $m) { $colTotals[$k] += ($row['months'][$k] ?? 0); } } // Colonnes non-vides uniquement $visibleCols = []; foreach($monthsCols as $k => $m) { if(abs($colTotals[$k]) >= 0.01) { $visibleCols[$k] = $m; } } @endphp @foreach($visibleCols as $m) @endforeach @forelse($tableData as $idx => $row) @php $agentTotal = $agentTotals[$idx]; @endphp @foreach($visibleCols as $k => $m) @php $val = $row['months'][$k] ?? 0; $isZero = abs($val) < 0.01; $class = $isZero ? 'zero' : 'positive'; @endphp @endforeach @empty @endforelse @if(count($tableData) > 0) @foreach($visibleCols as $k => $m) @endforeach @endif
Agent Total{{ $m['label'] }}
{{ $row['agent'] }} {{ abs($agentTotal) < 0.01 ? '-' : \App\Helpers\TimeHelper::decimalToHours($agentTotal) }} {{ $isZero ? '-' : \App\Helpers\TimeHelper::decimalToHours($val) }}
Aucune donnée à afficher pour cette période et ce(s) service(s).
Total Général {{ abs($grandTotal) < 0.01 ? '-' : \App\Helpers\TimeHelper::decimalToHours($grandTotal) }} {{ abs($colTotals[$k]) < 0.01 ? '-' : \App\Helpers\TimeHelper::decimalToHours($colTotals[$k]) }}
@endif