<?php $__env->startSection('content'); ?>
<div class="modal-dialog">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h5 class="modal-title"><?php echo e(trans('application.select_product')); ?></h5>
        </div>
        <div class="modal-body">
            <a href="<?php echo e(route('products.create')); ?>" class="btn btn-primary btn-xs" data-toggle="ajax-modal"> <i class="fa fa-plus"></i> <?php echo e(trans('application.new_product')); ?></a>
            <table class="table table-bordered table-striped table-hover datatable">
                        <thead class="item-table-header">
                        <tr>
                            <th></th>
                            <th>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>
                        </tr>
                        </thead>
                        <tbody>
                        <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); ?>
                        <tr>
                            <td> <?php echo Form::checkbox('products_lookup_ids[]',$product->uuid); ?></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->name); ?> </td>
                            <td><?php echo e(format_amount($product->price)); ?> </td>
                        </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); ?>
                        </tbody>
                    </table>
    </div>
        <div class="modal-footer">
            <?php echo Form::button('Add Product',['class'=>'btn btn-xs btn-success pull-left', 'id'=>'select-products-confirm'] ); ?>
            <?php echo Form::button('Cancel',['class'=>'btn btn-xs btn-danger','data-dismiss'=>'modal'] ); ?>
        </div>
    </div>
</div>
<style>
    td, th{word-break: break-all;}
</style>
<?php $__env->stopSection(); ?>


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