@if(sizeof($cartItems = Cart::content()) > 0)
    <table class="table table-striped table-bordered table-hover" id="dataTables">
        <thead>
        <tr>
            <th>S/No</th>
            <th>Image</th>
            <th>Name</th>
            <th>Quantity</th>
            <th>Price</th>
            <th>Amount</th>
            <th>Action</th>
        </tr>
        </thead>
        <tbody>


        <?php $i = 0; $total = 0; ?>
        @foreach($cartItems as $item)
            <tr>
                <td><?= ++$i; ?></td>
                <td>
                    <div style="max-width:100px;">
                        <img src="{{asset('assets/img/productThumbImage/'.$item->options->image)}}"
                             class="img-responsive"/>
                    </div>
                <td>{!!$item->name!!}</td>
                <td>
                    <label for="quant" class="label"></label>
                    <input type="number" min="1" name="quant<?php if (isset($i) && $i !== '') {
                        echo $i;
                    } ?>" id="quant<?php if (isset($i) && $i !== '') {
                        echo $i;
                    } ?>"
                           oninput="updateAmount($(this).val(), $(this).attr('data-price'), $(this).attr('data-amount'), $(this).attr('data-id') );"
                           value="{!!$item->qty!!}"
                           data-price="{!!$item->price!!}"
                           data-id="{{$item->rowId}}"
                           data-amount="amount<?php if (isset($i) && $i !== '') {
                               echo $i;
                           } ?>"
                           class="form-control"/>
                </td>

                <td>{!!$item->price!!}</td>
                <td>
                                    <span id="amount<?php if (isset($i) && $i !== '') {
                                        echo $i;
                                    } ?>">
                                        {!!$amount = $item->price * $item->qty!!}
                                    </span></td>
                <td>
                    <div class="btn-group btn-group-raised">
                        <div id="delete" data-delete="{{$item->id}}" class="btn  btn-danger"
                             style="padding:5px;">
                            <i class="zmdi zmdi-delete"></i>
                        </div>
                        <div id="deduct" data-deduct="{{$item->id}}" class="btn  btn-primary"
                             style="padding:5px;">
                            <i class="zmdi zmdi-minus"></i>
                        </div>
                        <div id="increase" data-increase="{{$item->id}}" class="btn m btn-primary"
                             style="padding:5px;">
                            <i class="zmdi zmdi-plus"></i>
                        </div>
                    </div>
                </td>
            </tr>
        @endforeach
        <tr>
            <td colspan="4">SUB TOTAL</td>
            <td colspan="">
                <strong>
                    ${{ Cart::instance('default')->subtotal() }}
                </strong>
            </td>
        </tr>
        <tr>
            <td colspan="4">Vat</td>
            <td colspan="">
                <strong>
                    $0.00
                </strong>
            </td>
        </tr>
        <tr>
            <td colspan="4">TOTAL</td>
            <td colspan="">
                <strong>
                    ${{ Cart::subtotal() }}
                </strong>
            </td>
        </tr>

        @else

            <h3 class="text-center text-capitalize">
                NO ITEMS IN BASKET
            </h3>
        @endif


        </tbody>

    </table>