@extends('reports.pdf.layout') @section('title', $data['meta']['title']) @php $meta = $data['meta']; $kpis = $data['kpis']; $monthly = $data['monthly_histogram']; $rows = $data['expiring_table']; $fmtNum = 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 — pin pixel width/height (wkhtmltopdf 0.12 quirk). $chartW = 480; $chartH = 160; $padX = 30; $padY = 24; $barCount = max(count($monthly), 1); $maxVal = max(1, max(array_map(fn ($r) => (int) $r['count'], $monthly))); $barSpace = ($chartW - 2 * $padX) / $barCount; $barWidth = max(8, $barSpace * 0.6); $bars = []; foreach ($monthly as $i => $r) { $h = ($r['count'] / $maxVal) * ($chartH - 2 * $padY); $x = $padX + $i * $barSpace + ($barSpace - $barWidth) / 2; $y = $chartH - $padY - $h; $bars[] = [ 'x' => $x, 'y' => $y, 'w' => $barWidth, 'h' => $h, 'label' => $r['label'], 'value' => $r['count'], 'cx' => $x + $barWidth / 2, ]; } @endphp @section('content')
Aucun contrat à analyser.
@endif| Immatriculation | Marque / Modèle | Type | Fin | Jours restants | Action recommandée |
|---|---|---|---|---|---|
| {{ $r['plate'] }} | {{ $r['mark_model'] }} | {{ $r['type'] }} | {{ $r['end_date'] }} | {{ $r['days_remaining'] }} | {{ $r['action'] }} |
Aucun contrat dans l'horizon.
@endif @endsection