@extends('app.my-account.admin.orders.single')

@section('details')

<div class="my-4">
    <div class="d-flex align-items-center">
        <h4 class="mb-0"><b>Test Results</b></h4>
        <div>
            @include('app.my-account.admin.orders.forms.create-test-result')
        </div>
    </div>
    <div class="">
        <table class="table table-sm table-hover table-striped table-bordered mb-0">
            <thead>
                <tr>
                    <th>Date</th>
                    <th>Test Name</th>
                    <th>Result Category</th>
                    <th>Result Color</th>
                    <th>Numeric Value And Units</th>
                    <th>Numeric Value Label</th>
                    <th>Numeric Value Memo</th>
                    <th>commentary</th>
                    <th>Actions</th>
                </tr>
            </thead>
            <tbody>
                @foreach($testResults as $tr)
                <?php
                    $test_quest_name_for_pdf = $tr->getDetailJsonValue('test_quest_name_for_pdf');
                    $test_quest_code_for_pdf = $tr->getDetailJsonValue('test_quest_code_for_pdf');
                ?>
                <tr>
                    <td>{{friendly_date($tr->created_at)}}</td>
                    <td>
                        <div>{{ $tr->test_name }}</div>
                        @if(@$test_quest_name_for_pdf)
                        <div class="text-muted">{{ @$test_quest_code_for_pdf }} - {{ @$test_quest_name_for_pdf }}</div>
                        @endif
                    </td>
                    <td>{{ $tr->result_category }}</td>
                    <td>{{ $tr->result_color }}</td>
                    <td>{{ $tr->numeric_value_and_units }}</td>
                    <td>{{ $tr->numeric_value_label }}</td>
                    <td>{{ $tr->numeric_value_memo }}</td>
                    <td>{{ $tr->commentary }}</td>
                    <td>
                        @include('app.my-account.admin.orders.forms.delete-test-result')
                        @include('app.my-account.admin.orders.forms.update-test-result')
                    </td>
                </tr>
                @endforeach
            </tbody>
        </table>
    </div>
</div>

@endsection