@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->product->name }} • {{ $panelTest->test_date->format('d M Y') }} @if($panelTest->location)• {{ $panelTest->location }}@endif
| Pilihan Jawaban | @foreach($panelTest->samples as $si => $sample)
{{ $sample->name }}
@if($sample->code)
{{ $sample->code }} @endif |
@endforeach
@if($panelTest->samples->count() > 1)
🏆 Terbaik | @endif
|---|---|---|
| {{ $choice['label'] }} | @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
{{ $count }}org
({{ $pct }}%)
|
@endforeach
@if($panelTest->samples->count() > 1)
@if($maxPct > 0 && $maxSampleName)
{{ $maxSampleName }}
{{ $maxPct }}%
@endif
|
@endif
| Total | @foreach($panelTest->samples as $si => $sample){{ $group['totals'][$sample->id] ?? 0 }} orang | @endforeach @if($panelTest->samples->count() > 1)@endif |
| Pilihan | Jumlah | Persentase |
|---|---|---|
| {{ $choice }} | {{ $count }} org | ({{ $pct }}%) |