@include('manager.detailed_report.styles') @if(empty($access_report['assignment']))
Detailed access results are not available for this company.
@if(empty($company))
Your profile does not have a configured company. Please ask an administrator to set your user company.
@endif @else @foreach($access_report['sections'] as $section) @php $rawScore = $section['score'] ?? null; if (($rawScore === null || $rawScore === '') && !empty($section['score_column'])) { $rawScore = $access_report['final']->{$section['score_column']} ?? null; } $score = ''; if ($rawScore !== null && $rawScore !== '') { $score = (string) $rawScore; if (!str_ends_with($score, '%') && is_numeric($score)) { $numeric = (float) $score; if ($numeric > 0 && $numeric <= 1) { $numeric *= 100; } $score = number_format($numeric, 0) . '%'; } } $scoreClass = $section['score_class'] ?? 'score-na'; if (($scoreClass === 'score-na' || $scoreClass === '') && $score !== '') { $scoreValue = rtrim($score, '%'); if (is_numeric($scoreValue)) { $scoreNumeric = (float) $scoreValue; if ($scoreNumeric >= 80) { $scoreClass = 'score-green'; } elseif ($scoreNumeric >= 60) { $scoreClass = 'score-orange'; } else { $scoreClass = 'score-red'; } } } @endphp @component('manager.detailed_report.accordion_section', [ 'label' => $section['label'] ?? '', 'score' => $score, 'score_class' => $scoreClass, ]) @slot('content') @foreach($access_report['calls'] as $callId => $callLabel) @endforeach @foreach($section['rows'] as $row) @php $overallColumn = $row['data_col'] ?? $row['column']; $overallValue = $access_report['final']->{$overallColumn} ?? ''; @endphp @foreach($access_report['calls'] as $callId => $callLabel) @endforeach @endforeach @if(($section['label'] ?? '') === 'ACCESS SCORE') @php $callTotals = json_decode($access_report['final']->call_total ?? '{}', true) ?: []; @endphp @foreach($access_report['calls'] as $callId => $callLabel) @endforeach @endif
Metric Overall ScoreCall {{ $loop->iteration }}
{{ $row['label'] }} {{ $overallValue !== '' ? $overallValue : '-' }}{!! $row['formatted'][$callId] ?? '' !!}
ACCESS SCORE {{ $access_report['final']->access_score ?? '-' }}{{ $callTotals[$callId] ?? '-' }}
@endslot @endcomponent @endforeach @endif