<?php $__env->startSection('content'); ?>
<div class="col-md-12 content-header" >
    <h1><i class="fa fa-puzzle-piece"></i> <?php echo e(trans('application.products')); ?></h1>
</div>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box  box-primary">
                <?php if(hasPermission('add_product')): ?>
                    <div class="box-header with-border">
                        <h3 class="box-title pull-right">
                            <div class="box-tools ">
                                <a href="<?php echo e(route('products.create')); ?>" class="btn btn-primary btn-xs pull-right" data-toggle="ajax-modal"> <i class="fa fa-plus"></i> <?php echo e(trans('application.new_product')); ?></a>
                            </div>
                        </h3>
                    </div>
                <?php endif; ?>
                <div class="box-body">
                    <table class="table table-bordered table-striped table-hover datatable">
                        <thead>
                        <tr>
                            <th></th>
                            <th width="10%">Image</th>
                            <th><?php echo e(trans('application.name')); ?></th>
                            <th><?php echo e(trans('application.code')); ?></th>
                            <th><?php echo e(trans('application.category')); ?></th>
                            <th><?php echo e(trans('application.price')); ?></th>
                            <th><?php echo e(trans('application.action')); ?> </th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach($products as $product): ?>
                        <tr>
                            <td></td>
                            <td>
                                <?php if($product->image != ''): ?>
                                    <a href="#" data-toggle="popover" data-trigger="hover" title="<?php echo e($product->name); ?>" data-html="true" data-content="<?php echo e(HTML::image(asset('assets/img/uploads/product_images/'.$product->image), 'image')); ?>"><?php echo HTML::image(asset('assets/img/uploads/product_images/'.$product->image), 'image', array('style'=>'width:50px')); ?></a>
                                <?php else: ?>
                                    <?php echo HTML::image(asset('assets/img/uploads/product_images/no-product-image.png'), 'image', array('style'=>'width:50px')); ?>
                                <?php endif; ?>

                            </td>
                            <td><?php echo e($product->name); ?> </td>
                            <td><?php echo e($product->code); ?> </td>
                            <td><?php echo e($product->category); ?> </td>
                            <td><?php echo e(format_amount($product->price)); ?> </td>
                            <td>
                                <?php if(hasPermission('edit_product')): ?>
                                    <?php echo edit_btn('products.edit', $product->uuid); ?>
                                <?php endif; ?>
                                <?php if(hasPermission('delete_product')): ?>
                                    <?php echo delete_btn('products.destroy', $product->uuid); ?>
                                <?php endif; ?>
                            </td>
                        </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</section>
<?php $__env->stopSection(); ?>


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