@extends ('layouts.patient')

@section('inner-content')
<div id="client-settings-container">
    <div class="row">
        <div class="col-md-12">
            <h1>MCP Requests</h1>
            <hr>
            <table class="table table-condensed table-striped">
                <thead>
                    <tr>
                        <th>Created At</th>
                        <th>Created By</th>
                        <th>Was Claimed?</th>
                        <th>Claimed At</th>
                        <th>Claimed By</th>
                        <th>Waiting Time</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach($patient->mcpRequests as $mcp)
                    <tr>
                        <td>{{friendly_date_time($mcp->created_at)}}</td>
                        <td>[{{$mcp->createdBy->session_type}}] {{$mcp->createdByName()}}</td>
                        <td>{{$mcp->was_claimed?'Yes':'No'}}</td>
                       
                        @if($mcp->was_claimed)
                        <td>{{friendly_date_time($mcp->proClientWork->created_at)}}</td>
                        <td>{{$mcp->proClientWork->pro->name_first}} {{$mcp->proClientWork->pro->name_last}}</td>
                        @else 
                        <td>-</td>
                        <td>-</td>
                        @endif
                        <td>{{$mcp->getWaitTime()}}</td>
                    </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>
</div>
@endsection
