@php $isMarketing = auth()->user()->unit_type === 'marketing'; @endphp @extends('layouts.app') @section('title', 'Dashboard Manager') @section('content') @if($isMarketing) {{-- ===== MARKETING / CONSUMER INSIGHT DASHBOARD ===== --}} {{-- STAT CARDS --}}
Total CC Selesai
{{ $totalProducts }}
Total CC Plan
{{ $totalTests }}
Plan Aktif
{{ $activeTests }}
Total SPG/APS
{{ $totalSpg }}
{{-- PROGRESS TABLE + FUNNEL --}}
{{ auth()->user()->unit_type === 'divisi' ? 'Progress Panel Test' : 'Progress Consumer Contact Plan' }}
@forelse($progressData as $p) @php $pct = $p['pct']; $done = $pct >= 100; @endphp @empty @endforelse
{{ auth()->user()->unit_type === 'divisi' ? 'Nama Surveyor' : 'Nama APS/SPG/TL' }} Area Promotion Target Aktual Achievement
{{ $p['name'] }} {{ $p['product'] }} {{ $p['target'] ?: '-' }} {{ $p['achieved'] }}
{{ $pct }}%
Belum ada data
Consumer Funnel
@php $funnelOrder = ['Kenal','Tertarik','Coba','Beli','Rutin','Konsumen Setia']; $firstVal = $funnelData->first() ?: 1; $lastVal = $funnelData->last() ?: 0; $dropOff = $firstVal > 0 ? round((1 - $lastVal/$firstVal)*100,1) : 0; @endphp Total: {{ $totalProducts }} Drop Off: {{ $dropOff }}%
{{-- DEMOGRAPHY --}}
Consumer Demography
Jenis Kelamin
Generasi
Profesi
Pengeluaran RT/Bulan
{{-- AWARENESS + BRAND INSIGHT --}}
Awareness Channel
Brand Aktivasi
@foreach($brandAktivasiData->sortDesc()->take(8) as $brand => $count)
{{ $brand ?: 'Tidak diisi' }}
{{ $count }}
@endforeach
Brand Kompetitor
@foreach($kompetitorData->sortDesc()->take(6) as $brand => $count) @if($brand)
{{ $brand }} {{ $count }}
@endif @endforeach
{{-- CONSUMER INSIGHT ANALYSIS --}}
Conversion Barrier
Alasan Pakai Kompetitor
@push('scripts') @endpush @else
{{ auth()->user()->unit_type === 'divisi' ? 'Total Panel Test Selesai' : 'Total CC Selesai' }}
{{ $totalProducts }}
{{ auth()->user()->unit_type === 'divisi' ? 'Total Panel Test' : 'Total CC Plan' }}
{{ $totalTests }}
{{ auth()->user()->unit_type === 'divisi' ? 'Panel Test Aktif' : 'Contact Plan Aktif' }}
{{ $activeTests }}
{{ auth()->user()->unit_type === 'divisi' ? 'Total Surveyor' : 'Total SPG' }}
{{ $totalSpg }}
{{ auth()->user()->unit_type === 'divisi' ? 'Status Panel Test' : 'Status Consumer Contact Plan' }}
{{ auth()->user()->unit_type === 'divisi' ? 'Panel Test Terbaru' : 'Consumer Contact Plan Terbaru' }}
Lihat Semua
@forelse($recentTests as $test) @empty @endforelse
{{ auth()->user()->unit_type === 'divisi' ? 'Nama Panel Test' : 'Nama Brand Aktivasi' }} {{ auth()->user()->unit_type === 'divisi' ? 'Nama Surveyor' : 'Nama APS/SPG/TL' }} Tanggal Status Peserta
{{ $test->title }} {{ $test->product->name }} {{ $test->test_date->format('d M Y') }} {{ ucfirst($test->status) }} {{ $test->testSessions->where('status','completed')->count() }} orang
{{ auth()->user()->unit_type === 'divisi' ? 'Belum ada panel test' : 'Belum ada consumer contact plan' }}
@endif @endsection @push('scripts') @endpush