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

@section('details')
    <div class="row">

        <div class="col-md-4">
            <div class="card">
                <div class="card-header">
                    <h5 class="mb-0 fw-bold">Order Details </h5>
                </div>
                <div class="card-body">
                    <table class="table table-sm table-bordered dashboard-stats-table mb-0">
                        <tbody>
                            <tr>
                                <th class="px-2" colspan="2">
                                    <span class="text-secondary">Created:</span>
                                    {{ friendly_date_time($order->created_at) }}
                                </th>
                            </tr>
                            <tr>
                                <th class="px-2" colspan="2">
                                    <span class="text-secondary">Client:</span>
                                    <a
                                        href="{{ route('admin.users.view.dashboard', $order->user) }}">{{ $order->user->full_name }}</a>
                                </th>
                            </tr>

                            @if($order->lab())
                            <tr>
                                <th class="px-2" colspan="2">
                                    <span class="text-secondary">Lab:</span>
                                    <?= $order->lab()->name ?>
                                </th>
                            </tr>
                            <tr>
                                <th class="px-2" colspan="2">
                                    <span class="text-secondary">Lab Address:</span>
                                    <?= $order->lab()->address() ?>
                                </th>
                            </tr>
                            @endif
                            <tr>
                                <th class="px-2" colspan="2">
                                    <span class="text-secondary">Total:</span>
                                    {{ displayAmount('$', $order->total()) }}
                                </th>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="card">
                <div class="card-header">
                    <div class="d-flex align-items-center justify-content-between">
                        <h5 class="mb-0 fw-bold">Tests</h5>
                    </div>
                </div>
                <div class="card-body">
                    <div>
                        <?php
                        $tests = $order->tests();
                        parseRender($tests);
                        ?>
                    </div>
                </div>
            </div>
        </div>

    </div>
@endsection
