{{-- ═══════════════════════════════════════════════════════════════ ONGLET ACQUISITION — Premium Edition Chart.js donut + bar + funnel animé + counters ═══════════════════════════════════════════════════════════════ --}}
{{-- ── KPIs ──────────────────────────────────────────────────────── --}}
👥
Total Clients
0
Personnes hébergées (hors annulations)
🛏
Durée Moyenne
0j
Durée moyenne d'un séjour
🔁
Taux de Répétition
0%
Clients ayant réservé ≥ 2 fois
Taux de Conversion
0%
Demandes contact → confirmées
{{-- ── ROW 1 : Donut sources + Top pays ─────────────────────────── --}}
{{-- Donut --}}
Clients par source
Répartition des canaux d'acquisition
@if(count($data['by_source']) > 0)
{{ number_format(array_sum(array_column($data['by_source'], 'count')), 0, '.', ' ') }}
Clients
@else
Aucune donnée de source disponible
@endif
{{-- Top pays --}}
Top pays
Provenance géographique des clients — top {{ min(count($data['by_country']), 12) }}
{{ count($data['by_country']) }} pays
@if(count($data['by_country']) > 0) @php $maxC = max(array_column($data['by_country'], 'total')); @endphp
@foreach(array_slice($data['by_country'], 0, 12) as $i => $row)
{{ $i + 1 }}
{{ $row['country'] }}
{{ number_format($row['total'], 0, '.', ' ') }}
@endforeach
@else
Aucune donnée de nationalité disponible
@endif
{{-- ── ROW 2 : Revenue par source (bar) ──────────────────────────── --}}
Revenue par source
Chiffre d'affaires généré par canal (TND)
@if(count($data['rev_by_source']) > 0)
@else
Aucune donnée de revenue disponible
@endif
{{-- ── ROW 3 : Sources bars + Funnel ─────────────────────────────── --}}
{{-- Source bars --}}
Volume par source
Nombre de clients par canal
@if(count($data['by_source']) > 0) @php $maxSrc = max(array_column($data['by_source'], 'count')); @endphp
@foreach($data['by_source'] as $i => $row)
{{ ucfirst($row['source']) }} {{ number_format($row['count'], 0, '.', ' ') }} · {{ $row['percent'] }}%
@endforeach
@else
Aucune donnée disponible
@endif
{{-- Funnel --}}
Funnel d'acquisition
Parcours des demandes contact → réservation
@if($data['funnel']['total'] > 0)
{{ $data['funnel']['total'] }} demandes au total
@foreach($data['funnel']['stages'] as $i => $stage) @if($stage['count'] > 0) @php $w = max(42, 100 - $i * 12); @endphp
{{ $stage['label'] }}
{{ $stage['count'] }}
{{ $stage['percent'] }}%
@if(!$loop->last && $stage['status'] !== 'cancelled')
@endif @endif @endforeach
@else
Aucune demande contact pour ce hostel.
Le funnel s'activera dès la première demande reçue.
@endif
{{-- /acq-wrap --}}