@extends('reports.pdf.layout') @section('title', $data['meta']['title']) @php $meta = $data['meta']; $kpis = $data['kpis']; $fmt = function ($v, $unit = '') { if ($v === null) return '—'; $s = is_numeric($v) ? number_format((float) $v, 0, ',', ' ') : (string) $v; return trim($s . ' ' . $unit); }; // Bar chart geometry — formations par mois (placeholder). $monthly = $data['monthly_trainings']; $barW = 480; $barH = 140; $padX = 30; $padY = 18; $barCount = max(1, count($monthly)); $barWidth = ($barW - 2 * $padX) / $barCount; $maxVal = 1; foreach ($monthly as $r) { if (($r['count'] ?? null) !== null && $r['count'] > $maxVal) $maxVal = $r['count']; } @endphp @section('content')
DADYCAR FLEET MANAGER

{{ $meta['title'] }}

Conducteurs {{ $meta['code'] }} Période : {{ $meta['period']['label'] }} · {{ $meta['site_label'] }} · {{ $meta['total_drivers'] }} conducteurs · Généré le {{ $meta['generated_at']->locale('fr')->isoFormat('D MMMM YYYY') }}
Module formation à venir. {{ $data['placeholder_note'] }}

Indicateurs de formation

Formations réalisées
{{ $fmt($kpis['completed']['value']) }}
{{ $kpis['completed']['delta_label'] }}
Taux de couverture
{{ $fmt($kpis['coverage_rate']['value']) }}{{ $kpis['coverage_rate']['unit'] }}
{{ $kpis['coverage_rate']['delta_label'] }}
Score moyen post-formation
{{ $fmt($kpis['avg_score_post']['value']) }}{{ $kpis['avg_score_post']['unit'] }}
{{ $kpis['avg_score_post']['delta_label'] }}
Formations recommandées
{{ $fmt($kpis['recommended']['value']) }}
{{ $kpis['recommended']['delta_label'] }}

Formations par mois

@foreach ($monthly as $i => $row) @php $cx = $padX + $i * $barWidth + $barWidth / 2; $val = $row['count'] ?? 0; $bh = $val > 0 ? (($val / $maxVal) * ($barH - 2 * $padY)) : 0; $by = $barH - $padY - $bh; $bw = max(8, $barWidth * 0.55); $bx = $cx - $bw / 2; @endphp @if ($bh > 0) @else @endif {{ $row['label'] }} @endforeach Données indisponibles — module à venir

Conducteurs ({{ count($data['drivers']) }})

@if (!empty($data['drivers'])) @foreach ($data['drivers'] as $d) @endforeach
Conducteur Permis Type formation Date Score avant Score après Évolution Statut
{{ $d['name'] }} {{ $d['license_number'] ?? '—' }} {{ $d['training_type'] ?? '—' }} {{ $d['training_date'] ?? '—' }} {{ $d['before_score'] ?? '—' }} {{ $d['after_score'] ?? '—' }} {{ $d['evolution'] ?? '—' }} {{ $d['status'] }}
@else

Aucun conducteur dans le périmètre.

@endif @endsection