@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
Conducteurs ({{ count($data['drivers']) }})
@if (!empty($data['drivers']))
| Conducteur |
Permis |
Type formation |
Date |
Score avant |
Score après |
Évolution |
Statut |
@foreach ($data['drivers'] as $d)
| {{ $d['name'] }} |
{{ $d['license_number'] ?? '—' }} |
{{ $d['training_type'] ?? '—' }} |
{{ $d['training_date'] ?? '—' }} |
{{ $d['before_score'] ?? '—' }} |
{{ $d['after_score'] ?? '—' }} |
{{ $d['evolution'] ?? '—' }} |
{{ $d['status'] }} |
@endforeach
@else
Aucun conducteur dans le périmètre.
@endif
@endsection