@extends('layout.app') @section('title', 'Analyse Délégué — ' . $user->name) @push('styles') @endpush @section('content')
{{-- ── PAGE HEADER ────────────────────────────── --}} @php $tl = $dashboard['timeline']; $kpi = $dashboard['kpi']; @endphp {{-- ── TIMELINE DU CYCLE ──────────────────────── --}} @if($dashboard['cycle'])
{{ \Carbon\Carbon::parse($dashboard['cycle']->start_date)->format('d M Y') }} {{ $tl['progress_pct'] }}% {{ \Carbon\Carbon::parse($dashboard['cycle']->end_date)->format('d M Y') }}
{{ $tl['days_elapsed'] }}
Jours écoulés
{{ $tl['days_remaining'] }}
Jours restants
{{ $tl['working_days'] }}
Jours ouvrés
@endif {{-- ── KPI PRINCIPAUX ──────────────────────────── --}}
Indicateurs clés
Taux de couverture
{{ $kpi['coverage_rate'] }}%
{{ $kpi['done'] }} / {{ $kpi['total_listings'] }} établissements visités
Total visites
{{ $kpi['total_visits'] }}
Projection fin cycle : {{ $kpi['projected_total'] }}
Rythme journalier
{{ $kpi['avg_per_day'] }}
Objectif {{ $kpi['target_per_day'] }}/j @if($kpi['daily_status'] === 'ok') ✓ Respecté @elseif($kpi['daily_status'] === 'warning') ⚠ Attention @else ✗ Insuffisant @endif
Jours d'activité
{{ $kpi['active_days'] }}
{{ $kpi['inactive_days'] }} jour(s) sans visite
{{-- ── COUVERTURE PAR TYPE ──────────────────────── --}}
Couverture par type d'établissement
@forelse($dashboard['by_type'] as $row) @php $cls = $row['rate'] >= 70 ? '' : ($row['rate'] >= 40 ? 'warn' : 'crit'); @endphp
{{ $row['type'] }} — {{ $row['visits'] }} visite(s) · {{ $row['done'] }}/{{ $row['total'] }} établissements
{{ $row['rate'] }}%
{{ $row['todo'] }} restant(s)
@empty
Aucune donnée de type disponible.
@endforelse
{{-- ── COUVERTURE PAR SPÉCIALITÉ ────────────────── --}} @if($dashboard['by_specialty']->count())
Couverture par spécialité
@foreach($dashboard['by_specialty'] as $row) @php $cls = $row['rate'] >= 70 ? '' : ($row['rate'] >= 40 ? 'warn' : 'crit'); @endphp
{{ $row['specialty'] }} — {{ $row['visits'] }} visite(s) · {{ $row['done'] }}/{{ $row['total'] }}
{{ $row['rate'] }}%
@endforeach
@endif {{-- ── ACTIVITÉ JOURNALIÈRE + HEATMAP ──────────── --}}
Activité journalière
Visites par jour de semaine
@foreach($dashboard['by_weekday'] as $wd)
{{ $wd['label'] }}
{{ $wd['count'] }}
@endforeach
Comportement de visite
@php $rep = $dashboard['repeat']; @endphp
Moy. visites/établissement {{ $rep['avg_per_listing'] }}
Points revisités (>1 visite) {{ $rep['repeat_listings'] }}
Total visites répétées {{ $rep['total_repeat_visits'] }}
Maximum sur un point {{ $rep['max_repeat'] }}
{{-- ── HISTORIQUE JOURNALIER ────────────────────── --}} @if($dashboard['by_day']->count())
Historique jour par jour
@foreach($dashboard['by_day'] as $day => $count) @endforeach
Date Visites Rythme Statut
{{ \Carbon\Carbon::parse($day)->locale('fr')->isoFormat('ddd D MMM YYYY') }} {{ $count }}
@for($i=0;$i
@endfor @if($count > 10)+{{ $count-10 }}@endif
@if($count >= $kpi['target_per_day']) ✓ Objectif @elseif($count >= $kpi['target_per_day'] * 0.7) ⚠ Partiel @else ✗ Faible @endif
@endif
@endsection