<div class="panel panel-default"> <div class="panel-heading"> <?php echo app('translator')->getFromJson('View Banners'); ?> </div> <div class="panel-body"> <form id="delete-form" action="delete/banners" method="post" class="form-inline"> <div class="row"> <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('delete', App\Banner::class)): ?> <?php echo e(csrf_field()); ?> <div class="col-md-4"> <div class="text-muted"> <label for="checkboxArray"><?php echo app('translator')->getFromJson('Bulk Options'); ?> <i class="fa fa-cog" aria-hidden="true"></i></label> </div> <input type="hidden" name="_method" value="DELETE"> <div class="form-group"> <select id="checkboxArray" name="checkboxArray" class="form-control"> <option value=""><?php echo app('translator')->getFromJson('Delete'); ?></option> </select> </div> <div class="form-group"> <input id="delete_all" name="" class="btn fa btn-warning" value="&#xf1d8;" onclick=" if(confirm('<?php echo e(__('Are you sure you want to delete selected banners?')); ?>')) { $('#delete_all').attr('name', 'delete_all'); event.preventDefault(); $('#delete-form').submit(); } else { event.preventDefault(); } " > </div> </div> <?php endif; ?> <div class="advanced-search col-md-<?php echo e(Auth::user()->can('delete', App\Banner::class) ? '8' : '8 col-md-offset-4'); ?>"> <div class="text-muted"> <label for="checkboxArray"><?php echo app('translator')->getFromJson('Advanced Search'); ?> <i class="fa fa-search" aria-hidden="true"></i></label> </div> <div class="row"> <div class="col-md-5"> <select class="form-control" id="select-column"> <option value=<?php echo e(Auth::user()->can('delete', App\Banner::class) ? 3 : 2); ?>><?php echo app('translator')->getFromJson('Title'); ?></option> <option value=<?php echo e(Auth::user()->can('delete', App\Banner::class) ? 4 : 3); ?>><?php echo app('translator')->getFromJson('Position in Home Page'); ?></option> <option value=<?php echo e(Auth::user()->can('delete', App\Banner::class) ? 5 : 4); ?>><?php echo app('translator')->getFromJson('Category'); ?></option> <option value=<?php echo e(Auth::user()->can('delete', App\Banner::class) ? 6 : 5); ?>><?php echo app('translator')->getFromJson('Position in Category Page'); ?></option> <option value=<?php echo e(Auth::user()->can('delete', App\Banner::class) ? 7 : 6); ?>><?php echo app('translator')->getFromJson('Brand'); ?></option> <option value=<?php echo e(Auth::user()->can('delete', App\Banner::class) ? 8 : 7); ?>><?php echo app('translator')->getFromJson('Position in Brand Page'); ?></option> <option value=<?php echo e(Auth::user()->can('delete', App\Banner::class) ? 9 : 8); ?>><?php echo app('translator')->getFromJson('Status'); ?></option> <option value=<?php echo e(Auth::user()->can('delete', App\Banner::class) ? 10 : 9); ?>><?php echo app('translator')->getFromJson('Created'); ?></option> </select> </div> <div class="col-md-7"> <input class="form-control" type="text" id="search-by-column" placeholder="<?php echo app('translator')->getFromJson('Search by Column'); ?>"> </div> </div> </div> </div> <div class="table-responsive"> <div class="col-md-12 text-right"> <span class="advanced-search-toggle"><?php echo app('translator')->getFromJson('Advanced Search'); ?></span> </div> <table class="display table table-striped table-bordered table-hover" id="banners-table"> <thead> <tr> <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('delete', App\Banner::class)): ?> <th><input type="checkbox" id="options"></th> <?php endif; ?> <th><?php echo app('translator')->getFromJson('ID'); ?></th> <th><?php echo app('translator')->getFromJson('Image'); ?></th> <th><?php echo app('translator')->getFromJson('Title'); ?></th> <th><?php echo app('translator')->getFromJson('Position in Home Page'); ?></th> <th><?php echo app('translator')->getFromJson('Category'); ?></th> <th><?php echo app('translator')->getFromJson('Position in Category Page'); ?></th> <th><?php echo app('translator')->getFromJson('Brand'); ?></th> <th><?php echo app('translator')->getFromJson('Position in Brand Page'); ?></th> <th><?php echo app('translator')->getFromJson('Status'); ?></th> <th><?php echo app('translator')->getFromJson('Created'); ?></th> <?php if((Auth::user()->can('update', App\Banner::class)) || (Auth::user()->can('delete', App\Banner::class))): ?> <th><?php echo app('translator')->getFromJson('Action'); ?></th> <?php endif; ?> </tr> </thead> <tbody> <?php if($banners): ?> <?php $__currentLoopData = $banners; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $banner): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <tr> <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('delete', App\Banner::class)): ?> <td><input class="checkboxes" type="checkbox" name="checkboxArray[]" value="<?php echo e($banner->id); ?>"></td> <?php endif; ?> <td><?php echo e($banner->id); ?></td> <td> <?php if($banner->photo): ?> <?php
                                            $image_url = \App\Helpers\Helper::check_image_avatar($banner->photo->name, 50);
                                        ?> <img src="<?php echo e($image_url); ?>" height="50px" alt="<?php echo e($banner->title); ?>" /> <?php else: ?> <img src="https://via.placeholder.com/50x50?text=No+Image" height="50px" alt="<?php echo e($banner->title); ?>" /> <?php endif; ?> </td> <td><?php echo e($banner->title); ?></td> <td><?php echo e($banner->position); ?></td> <td><?php echo e($banner->category ? $banner->category->name . ' (' . __('ID:') . ' ' .$banner->category->id. ')' : '-'); ?></td> <td><?php echo e($banner->category ? $banner->position_category : '-'); ?></td> <td><?php echo e($banner->brand ? $banner->brand->name . ' (' . __('ID:') . ' ' .$banner->brand->id. ')' : '-'); ?></td> <td><?php echo e($banner->brand ? $banner->position_brand : '-'); ?></td> <td><?php echo e($banner->is_active ? __('Active') : __('Inactive')); ?></td> <td><?php echo e($banner->created_at); ?></td> <?php if((Auth::user()->can('update', App\Banner::class)) || (Auth::user()->can('delete', App\Banner::class))): ?> <td> <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('update', App\Banner::class)): ?> <a href="<?php echo e(route('manage.banners.edit', $banner->id)); ?>"> <span class="glyphicon glyphicon-edit"></span> </a> <?php endif; ?> &nbsp; <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('delete', App\Banner::class)): ?> <input type="hidden" id="delete_single" name=""> <a href="" onclick=" if(confirm('Are you sure you want to delete this?')) { $('#delete_single').attr('name', 'delete_single').val(<?php echo e($banner->id); ?>); event.preventDefault(); $('#delete-form').submit(); } else { event.preventDefault(); } " ><span class="glyphicon glyphicon-trash text-danger"></span></a> <?php endif; ?> </td> <?php endif; ?> </tr> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php endif; ?> </tbody> </table> </div> </form> </div> </div>