@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="text-nowrap">
                    <i class="fas fa-user-injured"></i>
                    Payment Rates
                </strong>
                <span class="mx-2">for</span>
                <select provider-search data-pro-uid="{{ @$selectedProUid }}"
                        name="proUid" class="form-control form-control-sm mr-auto width-200px"
                        onchange="fastLoad('/practice-management/rates/' + this.value)">
                    <option value="all" {{$selectedProUid === 'all' ? 'selected' : ''}}>All Pros</option>
                    @foreach($pros as $apro)
                        <option value="{{$apro->uid}}" {{$selectedProUid === $apro->uid ? 'selected' : ''}}>{{$apro->name_first}} {{$apro->name_last}}</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 class="w-25 px-3 border-0">Pro</th>
                        <th class="w-25 border-0">Responsibility</th>
                        <th class="w-25 border-0">Code</th>
                        <th class="w-25 border-0">Amount</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach ($rates as $rate)
                        <tr>
                            <td class="px-3">
                                {{ $rate->pro->displayName() }}
                            </td>
                            <td class="px-3">
                                {{ $rate->responsibility }}
                            </td>
                            <td class="font-weight-bold">
                                {{ $rate->code }}
                            </td>
                            <td class="font-weight-bold">
                                ${{ $rate->amount }}
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>

@endsection
