
<div class="card style_table shadow-none" style="margin-bottom:0.8rem;">
    <div class="card-header d-flex align-items-center justify-content-between">
            <h6 class="mb-0">Total Item in Cart <i class="bi bi-cart"></i> ({!! isset($data) ? count($data) : '0' !!})</h6>
            <button type="submit" class="btn btn-outline-primary" id="checkout" ><i class="bx bx-plus"></i> Add New</button>
        </div>
    <div class="card-body pb-0">
        
        <div class="table-responsive">
            <table id="example" class="table table-bordered align-middle" style="width:100%">
                <thead class="table-light">
                    <tr>
                        <th class="text-start">ITEM NAME</th>
                        <th class="thbutton">ISBN</th>
                        <th class="" style="width: 16%;">Quantity</th>
                        <th class="thbutton">Delete</th>
                    </tr>
                </thead>
                <tbody>
                    @php $i = 1;$product_price = 0; @endphp
                    @if(count($data)>0)
                    @foreach($data as $id => $list)
                            <tr class="cart-products" data-patient_id="{{$id}}">
                                <td class="text-start">{{$list['name'] ?? ''}} 
                                    @if($list['author'])
                                    ,
                                    <i class="bi bi-people text-info"></i> Author:{{$list['author']??''}}
                                    @endif
                                    
                                    @if($list['publisher'])
                                    <i class="bi bi-pencil-square text-info"></i> Publisher:{{$list['publisher']??''}}
                                    @endif
                                </td>
                                <td class="text-start">{{$list['isbn'] ?? ''}} <br></td>
                                <td><input type="text" class="form-control bg-white" name="qnt[]" value="{{$list['quantity']??''}}">
                                    <input type="hidden" class="form-control" value="{{$list['name']}}" readonly>
                                    <input type="hidden" class="form-control" name="book_id[]" value="@if(isset($id)){{$id}}@endif" readonly>
                                </td>
                                <td>
                                    <a style="line-height:24px;" data-url="{{route('issue-cart-book-remove')}}" data-id="{{$id}}" data-patient_id="{{$id}}" class="btn btn-danger deleteDataCustom" href="#" class="text-danger" data-bs-toggle="tooltip" data-bs-placement="left" title="Delete">
                                        <i class="bi bi-trash text-white"></i>
                                    </a>
                                </td>
                            </tr>
                            @php $i++; @endphp
                        @endforeach
                    @else
                        <tr>
                            <td colspan="9">No Data Found</td>
                        </tr>
                    @endif
                    
                </tbody>
            </table>
        </div>
    </div>
</div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        $('#checkout').html('Submit To Book Issue')
    });
</script>