@extends ('layouts/template')

@section('content')

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

            <div class="card-header px-2 py-1 d-flex align-items-center">
                <strong class="text-nowrap">
                    <i class="fas fa-user"></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-striped 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>
                                {{ isset($rate->pro) ? $rate->pro->name_display : 'No Pro' }}
                            </td>
                            <td>
                                {{ $rate->responsibility }}
                            </td>
                            <td>
                                {{ $rate->code }}
                            </td>
                            <td>
                                ${{ $rate->amount }}
                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>

@endsection
