<?php $__env->startSection('styles'); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('header'); ?>
    <?php echo $__env->make('includes.header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <div class="row mt-4">
        <div class="col-md-12">
        <?php echo $__env->make('includes.errors', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
            <div class="card">
                <div class="card-body">
                    <h3 class="card-title">Produits en panier : <span class="badge bg-dark text-white p-2"><?php echo e(Cart::content()->count()); ?></span></h3>
                    <table class="table table-dark mx-auto">
                        <thead class="thead-default">
                            <tr>
                            <th></th>
                                <th>Libellé</th>
                                <th>Prix</th>
                                <th>Qté</th>
                                <th>Total</th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = Cart::content(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td><img src="<?php echo e(URL::to('images/'.$product->model->file)); ?>" height="50" width="50" alt=""></td>
                                <td scope="row"><?php echo e($product->name); ?></td>
                                <td><?php echo e($product->price); ?> dh</td>
                                <td>
                                    <a href="<?php echo e(route('cart.decrease',['id'=>$product->rowId,'qte'=>$product->qty])); ?>" class="btn bg-light" id="moins">-</a>
                                    <input type="text" style="width:8%;text-align:center;padding:5px;" class="qte" id="qte" name="qte" value="<?php echo e($product->qty); ?>">
                                    <a href="<?php echo e(route('cart.increase',['id'=>$product->rowId,'qte'=>$product->qty])); ?>" class="btn bg-light" id="plus">+</a>
                                </td>
                                <td><?php echo e($product->total); ?> dh</td>
                                <td><a href="<?php echo e(route('cart.delete',['id'=>$product->rowId])); ?>" class="btn btn-danger btn-xs"><i class="fa fa-trash"></i></a></td>
                            </tr> 
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                    <p class="lead">Total: <span class="badge bg-success text-white"><?php echo e(Cart::total()); ?> dh</span></p>
                    <a href="<?php echo e(route('cart.checkout')); ?>" class="btn btn-success">Valider</a>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('footer'); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('includes.main-layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>