@extends('admin.pros.view')
@section('content-inner')

    <div class="pb-3">

        <h5 class='my-3 d-flex stag-heading stag-heading-sub'>
            <div>Pro Access</div>
            <div class="ml-auto">
                <a class="btn btn-primary btn-sm ml-2" up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href="{{route('pros_SINGLE-ACTION_add_new_pro_pro_access', ['uid' => $record->uid])}}?optimised=1"><i class='fa fa-plus-circle' aria-hidden='true'></i> Add New</a>
            </div>
        </h5>

        <div class="table-responsive p-0 bg-white border stag-table stag-table-sub">
            <table class="table table-hover text-nowrap">
                <thead>
                <tr>
                    <th>&nbsp;</th>
<th>Owner Pro</th>
<th>Accessible Pro</th>
<th>Memo</th>
<th>Can Assign As Rme</th>
<th>Can Assign As Rmm</th>
<th>Can Assign As Mcp</th>
<th>Created At</th>
<th>Created By Session Id</th>
<th>Type</th>
<th>Is Active</th>
<th>Deactivated At</th>
<th>Deactivated By Session Id</th>
<th>Deactivation Memo</th>
<th>Reactivated At</th>
<th>Reactivated By Session Id</th>
<th>Reactivation Memo</th>
<th>Can Book Appointments</th>
                </tr>
                </thead>
                <tbody>
                @foreach($subRecords as $subRecord)
                    <tr>
                        <td><a href="/pro_access/view/{{ $subRecord->uid }}"><i class="fas fa-share-square"></i></a></td>
<td><?= value_from_rs($result_pros, 'name_display', [['id', '=', $subRecord->owner_pro_id], ], 'all'); ?></td>
<td><?= value_from_rs($result_pros, 'name_display', [['id', '=', $subRecord->accessible_pro_id], ], 'all'); ?></td>
<td><?= $subRecord->memo ?></td>
<td><?= $subRecord->can_assign_as_rme ?></td>
<td><?= $subRecord->can_assign_as_rmm ?></td>
<td><?= $subRecord->can_assign_as_mcp ?></td>
<td><?= friendly_date_time($subRecord->created_at) ?></td>
<td><?= $subRecord->created_by_session_id ?></td>
<td><?= $subRecord->type ?></td>
<td><?= $subRecord->is_active ?></td>
<td><?= friendly_date_time($subRecord->deactivated_at) ?></td>
<td><?= $subRecord->deactivated_by_session_id ?></td>
<td><?= $subRecord->deactivation_memo ?></td>
<td><?= friendly_date_time($subRecord->reactivated_at) ?></td>
<td><?= $subRecord->reactivated_by_session_id ?></td>
<td><?= $subRecord->reactivation_memo ?></td>
<td><?= $subRecord->can_book_appointments ?></td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>

    </div>

@endsection
