@extends ('layouts/template')

@section('content')

    <div id="practice-supply-orders" class="p-3 mcp-theme-1">
        <div class="card">

            <div class="card-header px-3 py-3 d-flex align-items-center bg-white">
                <strong class="font-size-14">
                    Supply Orders - Cancelled but Unacknowledged
                </strong>
            </div>
            <div class="card-body p-0">
                <table class="table table-sm table-condensed p-0 m-0" style="table-layout: fixed">
                    <thead class="bg-light">
                    <tr>
                        <th class="border-0">Patient</th>
                        <th class="border-0">Address</th>
                        <th class="border-0">Item(s)</th>
                        <th class="border-0">Shipment</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach ($supplyOrders as $supplyOrder)
                        <tr data-client-uid="{{$supplyOrder->client->uid}}">
                            <td class="align-top border-top">
                                <a href="{{route('patients.view.supply-orders',['patient'=>$supplyOrder->client, 'supplyOrder'=>$supplyOrder, 'filter' => 'all'])}}"> {{$supplyOrder->client->displayName()}}</a>
                            </td>
                            <td class="align-top border-top">
                                {!! $supplyOrder->mailing_address_full ? implode(" ", [$supplyOrder->mailing_address_line1 . ' ' . $supplyOrder->mailing_address_line2, $supplyOrder->mailing_address_city . ' ' . $supplyOrder->mailing_address_state . ' ' . $supplyOrder->mailing_address_zip]) : '-'  !!}
                            </td>
                            <td class="align-top border-top">
                                {{$supplyOrder->product->title}}
                            </td>
                            <td class="align-top border-top">
                                <b>CANCELLED</b>
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
                <div>
                    {{$supplyOrders->links()}}
                </div>
            </div>
        </div>
    </div>

@endsection
