<?php $__env->startSection('title', __('adminforms.categorygroups.plural')); ?>
<?php $__env->startSection('header', __('adminforms.categorygroups.plural')); ?>
<?php $__env->startSection('header_desc', ''); ?>
<?php $__env->startSection('breadcumbs', ''); ?>

<?php $__env->startSection('content'); ?>
    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header">
                        <h3 class="box-title"><?php echo e(__('adminforms.categorygroups.plural')); ?></h3>
                    </div>
                    <?php if(session('result')): ?>
                        <div class="alert alert-success alert-dismissible">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <i class="icon fa fa-check"></i> <strong>Info: </strong> &nbsp;  &nbsp;
                            <?php echo e(session('result')); ?>

                        </div>
                    <?php endif; ?>
                    <?php if(session('error')): ?>
                        <div class="alert alert-danger alert-dismissible">
                            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                            <i class="icon fa fa-exclamation-triangle"></i> <strong>Info: </strong> &nbsp;  &nbsp;
                            <?php echo e(session('error')); ?>

                        </div>
                    <?php endif; ?>
                <!-- /.box-header -->
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('create', $group)): ?>
                        <div class="text-right">
                            <a class="btn btn-outline-success" href="<?php echo e(route('admin.categorygroup.create')); ?>"><i class="ionicons ion-ios-plus-outline"> <?php echo e(__('adminforms.categorygroups.btn_add')); ?></i></a>
                            <hr>
                        </div>
                    <?php endif; ?>
                    <div class="box-body">
                        <table id="data-table" class="table table-hover">
                            <thead>
                            <tr>
                                <th><?php echo e(__('adminforms.categorygroups.cg_id')); ?></th>
                                <th><?php echo e(__('adminforms.categorygroups.cg_name')); ?></th>
                                <th><?php echo e(__('adminforms.categorygroups.cg_feat')); ?></th>
                                <th style="text-align: right;">&nbsp;</th>
                                <th style="text-align: right;">&nbsp;</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php $__currentLoopData = $groups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $group): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><?php echo e($group->cg_id); ?></td>
                                    <td> <?php echo e($group->ctranslation->cg_name); ?></td>
                                    <td> <?php echo e($group->cg_feat ? 'Da' : 'Ne'); ?> </td>
                                    <td style="text-align: right;">
                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('update', $group)): ?>
                                            <a class="btn btn-outline-success btn-xsm" href="<?php echo e(route('admin.categorygroup.edit', ['categorygroup' => $group->cg_id])); ?>">
                                                <i class="fa fa-pencil-square-o"></i> <?php echo e(__('adminforms.common.edit_btn')); ?>

                                            </a>
                                        <?php else: ?>
                                            &nbsp;
                                        <?php endif; ?>
                                    </td>
                                    <td style="text-align: right;">
                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('delete', $group)): ?>
                                            <?php echo e(Form::open(array('route' => array('admin.categorygroup.destroy', $group->cg_id), 'method' => 'DELETE', 'class'=>'form-inline', 'onsubmit' => 'return submitDeleteForm(this);'))); ?>

                                            <?php echo e(Form::hidden('categorygroup', $group->cg_id)); ?>

                                            <button type="submit" class="btn btn-outline-danger btn-xsm delete"><i class="fa fa-times-circle-o"></i> <?php echo e(__('adminforms.common.del_btn')); ?></button>
                                            <?php echo e(Form::close()); ?>

                                        <?php else: ?>
                                            &nbsp;
                                        <?php endif; ?>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->

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


<?php $__env->startPush('css'); ?>
<link rel="stylesheet" href="<?php echo e(asset('assets/components/datatables.net-bs/css/dataTables.bootstrap.min.css')); ?>">
<?php $__env->stopPush(); ?>

<?php $__env->startPush('primscripts'); ?>
<script src="<?php echo e(asset('assets/components/datatables.net/js/jquery.dataTables.min.js')); ?>"></script>
<script src="<?php echo e(asset('assets/components/datatables.net-bs/js/dataTables.bootstrap.js')); ?>"></script>
<?php $__env->stopPush(); ?>
<?php $__env->startPush('scripts'); ?>
<script>
    $(function () {
        $('#data-table').DataTable({
            'paging'      : true,
            'lengthChange': false,
            'searching'   : true,
            'ordering'    : true,
            'info'        : true,
            'autoWidth'   : false,
            "bStateSave"  : true,
            "language": {
                "sProcessing":   "<?php echo e(__('adminforms.data_tables.sProcessing')); ?>",
                "sLengthMenu":   "<?php echo e(__('adminforms.data_tables.sLengthMenu')); ?>",
                "sZeroRecords":  "<?php echo e(__('adminforms.data_tables.sZeroRecords')); ?>",
                "sInfo":         "<?php echo e(__('adminforms.data_tables.sInfo')); ?>",
                "sInfoEmpty":    "<?php echo e(__('adminforms.data_tables.sInfoEmpty')); ?>",
                "sInfoFiltered": "<?php echo e(__('adminforms.data_tables.sInfoFiltered')); ?>",
                "sInfoPostFix":  "<?php echo e(__('adminforms.data_tables.sInfoPostFix')); ?>",
                "sSearch":       "<?php echo e(__('adminforms.data_tables.sSearch')); ?>",
                "sUrl":          "<?php echo e(__('adminforms.data_tables.sUrl')); ?>",
                "oPaginate": {
                    "sFirst":    "<?php echo e(__('adminforms.data_tables.sFirst')); ?>",
                    "sPrevious": "<?php echo e(__('adminforms.data_tables.sPrevious')); ?>",
                    "sNext":     "<?php echo e(__('adminforms.data_tables.sNext')); ?>",
                    "sLast":     "<?php echo e(__('adminforms.data_tables.sLast')); ?>",
                }
            }
        })
    })
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layouts.admin', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>