{{ $template["one"] }}

{{ $testkit->testkit_product_name }}

{{ $template["two"] }}

@foreach($stats['total'] AS $catK => $catV)

{{ $template["food"] }} @if(isset($template[$catK.'-title'])) {{ $template[$catK.'-title'] }} @else {{ $catK }} @endif - {{ $catV }} {{ $template["items"] }}

@php if($catK == 'Allergies') { @endphp @php } else { @endphp @php } @endphp
{{ $stats["overview"][$catK]["No Reaction"] }} {{ ((int)$stats['overview'][$catK]['High'] + (int)$stats['overview'][$catK]['Medium'] + (int)$stats['overview'][$catK]['Low']) }} {{ ((int)$stats['overview'][$catK]['Medium'] + (int)$stats['overview'][$catK]['Low']) }} {{ $stats["overview"][$catK]["High"] }}
@endforeach
{{ $template["name"] }} @if (isset($testkit->sample_name)) {{ $testkit->sample_name }} @else {{ $testkit->name }} @endif
{{ $template["test-name"] }} {{ $testkit->testkit_product_name }}
{{ $template["testkit-id"] }} {{ strtoupper($testkit->activation_code_number) }}
{{ $template["results"] }} {{ date("d/m/Y", strtotime($testedDate)) }}

{{ $template["important-title"] }}

{{ $template["important"] }}

@php $shortDescriptions = []; @endphp @foreach($allergyData AS $k => $allergy)

@if(isset($template[$k.'-title'])) {{ $template[$k.'-title'] }} @else {{ $k }} @endif

{{ $template["food"] }} {{ $k }} - {{ $stats["total"][$k] }} {{ $template["items"] }}

{{ $template[$k] }}

@foreach($allergy AS $key => $individualAllergy) @php $ind = explode('-', $key); $useKey = rtrim($ind[0]); if(!in_array($useKey,$shortDescriptions)) { $shortDescriptions[] = $useKey; } @endphp

@if(isset($template[strtolower(str_replace(' ', '-', $ind[0]).'category')])) {{ $template[strtolower(str_replace(' ', '-', $ind[0]).'category')] }} - @if(isset($template[strtolower(trim($ind[1]))])) {{ $template[strtolower(trim($ind[1]))] }} @endif @else {{ $key }} @endif

@foreach($individualAllergy AS $singleAllergen) @foreach($singleAllergen['points'] AS $theKey => $points) @foreach($scoring AS $sk => $sv) @php $class = 'noreaction' @endphp @if($sk < $theKey || $sk == count($scoring) && number_format((int)$singleAllergen['score']) == 100) @php $class = (isset($template['override_scoring_class_'.strtolower($k)]))?$template['override_scoring_class_'.strtolower($k)]:$scoring[$theKey]['class'] @endphp @endif @if($sk == 1) @endforeach @endforeach
{{ $template["results-table-row-1"] }} {{ $template["results-table-row-2"] }} {{ $template["results-table-row-3"] }}
@if(isset($template[strtolower(trim($singleAllergen['allergen_name'])).'-item'])) {{ $template[strtolower(trim($singleAllergen['allergen_name'])).'-item'] }} @else {{ $singleAllergen["allergen_name"] }} @endif {{ $singleAllergen["score"] }} @if(isset($template[strtolower(str_replace(' ','-',$scoring[$theKey]['reaction'])).'-score'])) {{ $template[strtolower(str_replace(' ','-',$scoring[$theKey]['reaction'])).'-score'] }} @else {{ $scoring[$theKey]["reaction"] }} @endif @endif @endforeach
@endforeach @endforeach
{!! $template['recommendations'] !!}
@foreach($shortDescriptions AS $description) @if(isset($template[$description]) && strlen($template[$description]) > 0)

@if(isset($template[strtolower(str_replace(' ', '-', $description)).'-category'])) {{ $template[strtolower(str_replace(' ', '-', $description)).'-category'] }} @else {{ $description }} @endif

{!! $template[$description] !!}

@endif @endforeach
{!! $template['happens-next'] !!}
{!! $template['last-page'] !!}