@extends ('layouts/template')

@section('content')
    <div id="practice-bills" class="px-3 mcp-theme-1">
        <div class="card">

            <ul class="nav mt-2">
                <li class="nav-item">
                    <a class="nav-link  {{!isset($status) || !$status? 'active' : ''}} active" target="_top"  native href="{{route('practice-management.claims')}}">All</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link {{$status == 'VERIFIED'? 'active' : ''}} " target="_top" native href="{{route('practice-management.claims', ['status'=>'VERIFIED'])}}">Verified</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link {{$status == 'PROCESSING' ? 'active' : ''}} " target="_top"  native href="{{route('practice-management.claims', ['status'=>'PROCESSING'])}}">Processing</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link  {{$status == 'SUBMITTED' ? 'active' : ''}}" target="_top"  native href="{{route('practice-management.claims', ['status'=>'SUBMITTED'])}}">Submitted</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link  {{$status == 'ACCEPTED'? 'active' : ''}}" target="_top"  native href="{{route('practice-management.claims', ['status'=>'ACCEPTED'])}}">Accepted</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link  {{$status == 'REJECTED'? 'active' : ''}}" target="_top"  native href="{{route('practice-management.claims', ['status'=>'REJECTED'])}}">Rejected</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link  {{$status == 'CANCELLED'? 'active' : ''}}" target="_top"  native href="{{route('practice-management.claims', ['status'=>'CANCELLED'])}}">Cancelled</a>
                </li>
            </ul>

            <div class="card-body p-0 border-0">
                <table class="table table-sm table-condensed p-0 m-0">
                    <thead class="bg-light">
                    <tr>
                        <th></th>
                        <th class="border-0">#</th>
                        <th>Status</th>
                        <th class="border-0">Lines</th>
                        <th class="px-3 border-0">Created</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach ($claims as $claim)
                        <tr>
                            <td>
                                <input type="checkbox" name="claimUid" value="{{$claim->uid}}">
                            </td>
                            <td>{{$claim->iid}}</td>
                            <td>{{$claim->status}}</td>
                            <td>
                                <strong>Claim Lines</strong>
                                <table class="table table-sm table-condensed table-striped">
                                    <tr>
                                        <th>CPT</th>
                                        <th>ICDs</th>
                                        <th>Date of Service</th>
                                    </tr>
                                    @foreach($claim->lines as $claimLine)
                                        <tr>
                                            <td>{{$claimLine->cpt}}</td>
                                            <td>{{$claimLine->icds()}}</td>
                                            <td>{{$claimLine->date_of_service}}</td>
                                        </tr>
                                    @endforeach
                                </table>
                            </td>
                            <td>{{$claim->created_at}}</td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
                <div>
                    {{$claims->links()}}
                </div>
            </div>
        </div>
    </div>
@endsection
