@extends('layouts.app') @section('title', 'Analisis Panel Test') @section('content') @php $sampleColors = ['#3b82f6','#22c55e','#f59e0b','#ef4444','#8b5cf6']; $colorsBg = ['#dbeafe','#dcfce7','#fef3c7','#fee2e2','#ede9fe']; @endphp

{{ $panelTest->title }}

{{ $panelTest->product->name }} • {{ $panelTest->test_date->format('d M Y') }} @if($panelTest->location)• {{ $panelTest->location }}@endif

Grafik Export Excel
{{-- Header Ringkasan --}}
Jumlah Responden = {{ $totalRespondents }} orang
@php $pria = collect($respondents)->where('gender','Laki-laki')->count(); $wanita = collect($respondents)->where('gender','Perempuan')->count(); $pctP = $totalRespondents > 0 ? round($pria/$totalRespondents*100,2) : 0; $pctW = $totalRespondents > 0 ? round($wanita/$totalRespondents*100,2) : 0; @endphp
👨
{{ $pria }}
Laki-laki ({{ $pctP }}%)
👩
{{ $wanita }}
Perempuan ({{ $pctW }}%)
{{-- Chart gender --}}
{{-- Perbandingan antar Sampel per Pertanyaan --}} @foreach($questionGroups as $groupIdx => $group)
{{ $groupIdx + 1 }}. {{ $group['question_text'] }}
@foreach($panelTest->samples as $si => $sample) @endforeach @if($panelTest->samples->count() > 1) @endif @foreach($group['choices'] as $choiceIdx => $choice) @php $maxPct = 0; $maxSampleName = ''; @endphp @foreach($panelTest->samples as $si => $sample) @php $data = $choice['data'][$sample->id] ?? ['count'=>0,'pct'=>0]; $count = $data['count']; $pct = $data['pct']; $bgColor = $sampleColors[$si % 5]; if ($pct > $maxPct) { $maxPct = $pct; $maxSampleName = $sample->name; } @endphp @endforeach @if($panelTest->samples->count() > 1) @endif @endforeach {{-- Baris total --}} @foreach($panelTest->samples as $si => $sample) @endforeach @if($panelTest->samples->count() > 1) @endif
Pilihan Jawaban {{ $sample->name }} @if($sample->code)
{{ $sample->code }} @endif
🏆 Terbaik
{{ $choice['label'] }}
{{ $count }}org
({{ $pct }}%)
@if($maxPct > 0 && $maxSampleName) {{ $maxSampleName }}
{{ $maxPct }}%
@endif
Total {{ $group['totals'][$sample->id] ?? 0 }} orang
{{-- Chart perbandingan --}}
@endforeach {{-- Pertanyaan Umum --}} @if(count($generalQuestionStats) > 0)
Pertanyaan Umum
@foreach($generalQuestionStats as $gi => $stat)
{{ $gi + 1 }}. {{ $stat['question'] }}
@if($stat['type'] === 'rating')
{{ $stat['avg'] }}
@for($s=1;$s<=5;$s++)@endfor
{{ $stat['count'] }} jawaban
@else @foreach($stat['counts'] as $choice => $count) @php $pct = $stat['total'] > 0 ? round($count/$stat['total']*100,2) : 0; @endphp @endforeach
PilihanJumlahPersentase
{{ $choice }} {{ $count }} org ({{ $pct }}%)
@endif
@endforeach @endif @push('scripts') @endpush @endsection