@extends ('layouts/template')

@section('content')

    <div class="p-3 mcp-theme-1">

        <div class="card">

            <div class="card-header px-3 py-2 d-flex align-items-center">
                <strong class="mr-4">
                    <i class="fas fa-user-injured"></i>
                    Processing Bills
                </strong>
                <select class="ml-auto max-width-300px form-control form-control-sm"
                        onchange="fastLoad('/practice-management/processing-bill-matrix/' + this.value, true, false, false)">
                    <option value="" {{ $proUid === '' ? 'selected' : '' }}>All Pros</option>
                    @foreach($allPros as $_pro)
                        <option value="{{$_pro->uid}}" {{ $proUid === $_pro->uid ? 'selected' : '' }}>{{$_pro->displayName()}}</option>
                    @endforeach
                </select>
            </div>
            <div class="card-body p-0">
                <table class="table table-sm table-condensed p-0 m-0">
                    <thead class="bg-light">
                    <tr>
                        <th>Note Link</th>
                        <td>Effective Date</td>
                        <td>Pro</td>
                        <td>Client</td>
                        <td>Code</td>
                        <td>Units</td>
                        <td>HCP Expected Amount</td>
                        <td>HCP Signed?</td>
{{--                        <td>HCP Signed At</td>--}}
                    </tr>
                    </thead>
                    <tbody>
                    @foreach ($bills as $row)
                        <tr class="">
                            <td>
                                <a href="/patients/view/{{ $row->client->uid }}/notes/view/{{ $row->note->uid }}">
                                    Note Link
                                </a>
                            </td>
                            <td>{{$row->effective_date}}</td>
                            <td>{{$row->hcp->name_last}}, {{$row->hcp->name_first}}</td>
                            <td>{{$row->client->name_last}}, {{$row->client->name_first}}</td>
                            <td>{{$row->code}}</td>
                            <td>{{$row->number_of_units}}</td>
                            <td>{{$row->hcp_expected_payment_amount}}</td>
                            <td>{{$row->is_signed_by_hcp}}</td>
{{--                            <td>{{$row->signed_by_hcp_at}}</td>--}}
                        </tr>
                    @endforeach
                    </tbody>
                </table>
                <div>
                    {{$bills->links()}}
                </div>
            </div>
        </div>
    </div>

@endsection
