<div class="table-responsive">
  <table class="table table-bordered align-middle" style="width:100%">
      <thead class="table-light">
          <tr>
              <th class="thbutton">Sl No</th>
              <th>Name</th>
              <th>Book limit</th>
              <th>Library Card Serial</th>
              <th>Card No Length</th>
              <th>Serial Start From</th>
              <th>Prefix code</th>
              <th>Suffix code</th>
              <th class="thbutton">Status</th>
              <th class="thbutton">Edit</th>
              <th class="thbutton">Delete</th>
          </tr>
      </thead>
      <tbody>
        @php $i=1;@endphp
        @if(count($CardTypeData)>0)
        @foreach($CardTypeData as $key=> $row)
        <tr>
            <td>{{$CardTypeData->firstItem() + $key}}</td>
            <td>{{$row->name}}</td>
            <td>{{$row->book_limit}}</td>
            <td>{{$row->library_card_serial}}</td>
            <td>{{$row->card_no_length}}</td>
            <td>{{$row->serial_start_from}}</td>
            <td>{{$row->prefix_code}}</td>
            <td>{{$row->suffix_code}}</td>

            <td align="center">
                <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('library.card-type.changestatus')}}" data-id="{{$row->id}}" data-status="{{$row->status=='0' ? '1' : '0'}}" {{ $row->status=='1' ? 'checked' : ''}}>
                </div>
            </td>
            <td align="center">
                @if(in_array('card-type-edit', $authRolePermissions))
                <a href="{{route('card-type.edit',$row->id)}}" class="btn btn-outline-secondary edit" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Edit">
                    <i class="bi bi-pencil-square"></i>
                </a>
            @endif
            </td>
            <td align="center">
                @if(in_array('card-type-delete', $authRolePermissions))
                <a data-url="{{route('library.card-type.destroy')}}" data-id="{{$row->id}}" class="btn btn-danger deleteDataCustom" class="text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Delete">
                    <i class="bi bi-trash text-white"></i>
                </a>
            @endif
            </td>
            
        </tr>
        @php $i++; @endphp
        @endforeach
        @else
        <tr>
            <td colspan="10">No Data Found</td>
        </tr>
        @endif
    </tbody>
</table>
</div>
<div class="table-responsive">
    <nav class="float-start mt-2">
        <ul class="pagination">
            {!! $CardTypeData->onEachSide(-1)->render('library-setting.card-type.pagination') !!}
        </ul>
    </nav>
</div>
</div>

