<div class="table-responsive">
    <table id="example" class="table table-bordered align-middle" style="width:100%">
        <thead class="table-light">
            <tr>
                <th class="thbutton">Sl No</th>
                <th>Account Name</th>
                <th>Incentive Slab </th>
                <th>Date upto</th>
                <th style="width: 10px;">Recieved By</th>
                <th class="thbutton" >Status</th>
                @if(in_array('incentive-setting-edit', $authRolePermissions))
                <th class="thbutton">Edit</th>
                @endif
                @if(in_array('incentive-setting-delete', $authRolePermissions))
                <th class="thbutton">Delete</th>
                @endif
            </tr>
        </thead>
        <tbody>
            @php $i=1;@endphp
            @if(count($data)>0)
                @foreach($data as $key=> $list)
                <tr>
                        <td>{{$data->firstItem() + $key}}</td>
                        <td><strong>{{$list->getAccount->name ?? ''}}</strong><br>{{$list->getAccount->code ?? ''}}</td>

                        <td>{{$list->getIncentiveSlab->slab_name ?? ''}}</td>
                        <td>
                             @php $auth_format = \Session::get('company_data')['date_format'] ?? ''; @endphp
                            {{ date($auth_format, strtotime($list->date_upto)) ?? '' }}
                        </td>
                        {{-- <td>{{$list->received_by}}</td> --}}
                        <td>
                            <div class="form-check form-check-inline{{ $i }} customCheck">
                                <input class="form-check-input{{ $i }} btn-lg changeRecievedByCustom" type="checkbox" id="inlineCheckbox{{ $i }}" data-url="{{ route('incentive-settings.changereceivedby') }}" data-id="{{ $list->id }}" data-status="{{ $list->received_by == '0' ? '1' : '0' }}" {{ $list->received_by == '1' ? 'checked' : '' }}>
                            </div>
                        </td>
                        <td>
                            <div class="form-check form-check-inline{{ $i }}">
                                <input class="form-check-input{{ $i }} btn-lg changeStatusCustom" type="checkbox" id="inlineCheckbox{{ $i }}" data-url="{{ route('incentive-settings.changestatus') }}" data-id="{{ $list->id }}" data-status="{{ $list->status == '0' ? '1' : '0' }}" {{ $list->status == '1' ? 'checked' : '' }}>
                            </div>
                        </td>
                        @if(in_array('incentive-setting-edit', $authRolePermissions))
                        <td>
                            <button data-id="{{ $list->id }}" class="btn btn-warning edit" data-bs-toggle="modal" data-bs-target="#commonModal" title="Edit">
                                <i class="bi bi-pencil-square text-white"></i>
                            </button>
                        </td>
                        @endif
                        @if(in_array('incentive-setting-delete', $authRolePermissions))
                        <td>
                            <a data-url="{{route('incentive-settings.destroy')}}" data-id="{{$list->id}}" class="btn btn-danger deleteDataCustom" href="#" class="text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Delete">
                                <i class="bi bi-trash text-white"></i>
                            </a>
                        </td>
                        @endif
                    </tr>
                    @php $i++; @endphp
                @endforeach
            @else
                <tr>
                    <td colspan="7">No Data Found</td>
                </tr>
            @endif
        </tbody>
    </table>
</div>
<div class="col-md-8">
    <ul class="pagination" style="    margin-left: 14px; margin-top: 16px;">
        {!! $data->onEachSide(0)->render('incentive-settings.pagination') !!}
    </ul>

</div>
<nav class="float-end mt-2">
    <div class="col-md-1" style="text-align: right; margin-right: 59px; width: 155px; margin-top: -15px;">
        <div class="btn-group mb-0">
            <a class="btn btn-outline-primary" href="{!! route('incentive-settings-export-create') !!}"><i class="bi bi-cloud-download"></i> Import/Export</a>
        </div>
    </div>
</nav>
</div>

