{{-- ── EN-TÊTE ─────────────────────────── --}}

Rapport délégué médical

{{ $user->name }}
Code : {{ $user->code }}
Secteur : {{ $user->cities->pluck('name')->implode(', ') }}
Généré le : {{ now()->format('d/m/Y à H:i') }}
{{-- ── KPI GLOBAUX ─────────────────────── --}}
KPI Globaux
{{ $totalVisits }}
Total visites
{{ $totalListingsVisited }}
Établissements visités
{{ $coverageRate }}%
Taux de couverture
{{ $averageVisitsPerCycle }}
Moy. visites/cycle
{{ $totalListings }}
Total listings secteur
{{ $neverVisited->count() }}
Jamais visités
{{ $cycles->count() }}
Cycles analysés
{{ $avgDuration }}s
Durée moy. visite
{{-- ── COUVERTURE PAR TYPE ──────────────── --}}
Couverture par type d'établissement
@foreach($byType as $row) @php $cls = $row['rate'] >= 70 ? 'green' : ($row['rate'] >= 40 ? 'yellow' : 'red'); @endphp @endforeach
Type Listings Visités Visites Restants Taux couverture
{{ $row['type'] }} {{ $row['total'] }} {{ $row['done'] }} {{ $row['visits'] }} {{ $row['todo'] }}
{{ $row['rate'] }}%
{{-- ── ANALYSE PAR CYCLE ────────────────── --}}
Analyse par cycle
@foreach($cyclesData as $row) @php $cls = $row['rate'] >= 70 ? 'green' : ($row['rate'] >= 40 ? 'yellow' : 'red'); @endphp @endforeach
Cycle Début Fin Visites Établ. visités Couverture Évolution
{{ $row['cycle']->name }} {{ \Carbon\Carbon::parse($row['cycle']->start_date)->format('d/m/Y') }} {{ \Carbon\Carbon::parse($row['cycle']->end_date)->format('d/m/Y') }} {{ $row['count'] }} {{ $row['visited'] }}
{{ $row['rate'] }}%
@if($row['evo'] === 'up') ↑ Progr. @elseif($row['evo'] === 'down') ↓ Baisse @else = Stable @endif
{{-- ── VISITES PAR ÉTABLISSEMENT ────────── --}}
Visites par établissement
@foreach($visitsByListing->take(40) as $item) @endforeach @if($visitsByListing->count() > 40) @endif
Établissement Ville Type Nb visites Dernière visite Niveau
{{ $item['name'] }} {{ $item['city'] }} {{ $item['type'] }} {{ $item['count'] }} {{ $item['last_visit'] ? \Carbon\Carbon::parse($item['last_visit'])->format('d/m/Y') : '-' }} @if($item['count'] >= 5) Sur-visite @elseif($item['count'] >= 3) Surveillance @else Normal @endif
… {{ $visitsByListing->count() - 40 }} établissement(s) supplémentaires non affichés.
{{-- ── JAMAIS VISITÉS ───────────────────── --}} @if($neverVisited->count())
Listings jamais visités ({{ $neverVisited->count() }})
@foreach($neverVisited->take(30) as $l) @endforeach @if($neverVisited->count() > 30) @endif
NomTypeSpécialitéVilleAdresse
{{ $l->name }} {{ $l->type }} {{ $l->specialty ?? '-' }} {{ $l->city->name ?? '-' }} {{ $l->address ?? '-' }}
… {{ $neverVisited->count() - 30 }} listing(s) supplémentaires.
@endif {{-- ── INTERPRÉTATION ──────────────────── --}}
Interprétation managériale
@foreach($interpretation as $item) @php $icons = ['danger'=>'✗','warning'=>'⚠','success'=>'✓','info'=>'ℹ']; @endphp
{{ $icons[$item['level']] ?? '•' }} {{ $item['text'] }}
@endforeach
{{-- ── FOOTER ──────────────────────────── --}}