 <div class="card-body" id="tables">
    <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>Request No</th>
                  <th>Member Name</th>
                  <th>Quantity</th>
                  <th>Request date</th>
                  <th class="thbutton">Status</th>
                  <th class="thbutton">View</th>
                  <!-- <th class="thbutton">Delete</th> -->
              </tr>
          </thead>
          <tbody>
            @php $i=1;@endphp
            @if(count($BookRequest)>0)
            @foreach($BookRequest as $key=> $row)
            @php $detailsbooks=json_decode($row->bookcount) @endphp
            <tr>
                <td>{{$BookRequest->firstItem() + $key}}</td>
                <td>@if(isset($row->order_no)){{$row->order_no}}@endif</td>
                <td>
                    @if(isset($row->getStudents->name)){{$row->getStudents->name}} @endif
                </td>
                <td>@if(isset($detailsbooks[0]->qnt)){{$detailsbooks[0]->qnt}}@endif</td>
                <td>@if(isset($row->order_date)){{date('d-m-Y',strtotime($row->order_date))}}@endif</td>
                <td align="center"> 
                    <span class="badge p-2 h1 rounded-pill font-size-bolt text-white @if($row->status=='Pendding'){{'bg-info'}}@elseif($row->status=='Accept'){{'bg-success'}}@elseif($row->status=='Cancelled'){{'bg-danger'}}@endif" style="padding:3px">@if($row->status=='Pendding'){{'Pendding'}}@elseif($row->status=='Accept'){{'Accepted'}}@elseif($row->status=='Cancelled'){{'Cancelled'}}@endif</span>
                </td>
                <td align="center"> 
                    <a href="{{route('book-request.show',$row->id)}}" class="btn btn-warning text-white" data-bs-toggle="tooltip" data-bs-placement="bottom" title="View Books">
                        <i class="bi bi-eye text-white"></i> 
                    </a>
                </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">
            {!! $BookRequest->onEachSide(1)->render('library.book-request.pagination') !!}
        </ul>
    </nav>
</div>
</div>

