/home/mip/mip/storage/framework/views/c18f3ae0171a1a23755809fd0eb381df.php
<?php $__env->startSection('page-body'); ?>
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            <i class="fa fa-<?php echo e($pageIcon ? $pageIcon : 'angle-double-right'); ?>" aria-hidden="true"></i> <?php echo e($pageTitle); ?>

            <br>
            <small><?php echo e($pageDescription); ?></small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-<?php echo e($pageIcon ? $pageIcon : 'angle-double-right'); ?>"></i> <?php echo e($pageTitle); ?></a></li>            
            <li class="active">User</li>  
        </ol>
    </section>
    <!-- Main content -->
    <section class="content">
        <?php echo $__env->make('Client::message', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        
        <div class="box box-primary">
            <div class="box-header with-border">
                <h1 class="box-title">List of Users</h1>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('create', $permissions)): ?>
                <span class="pull-right">
                    <a href="<?php echo e(url(config('modules.client').'/settings/users/create')); ?>" data-toggle="tooltip" data-placement="top" title="" data-original-title="Add User" class="btn btn-primary btn-flat"><i class="fa fa-plus-circle"></i> Add User</a>
                </span>
                <?php endif; ?>
            </div>
            <div class="box-body">
               <table class="table table-condensed table-bordered table-striped table-hover" id="users-table" width="100%">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Name</th>
                            <th>Email</th>
                            <th>Role</th>
                            <th>Status</th>
                            <th>Action</th>
                        </tr>
                    </thead>
               </table>
            </div>
        </div>
        <?php echo $__env->make('Client::logs', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    </section>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-js'); ?>
<script type="text/javascript">
$(function() {
    var userTable = $('#users-table').DataTable({
        processing: true,
        serverSide: true,
        "pagingType": "input",
        ajax: '<?php echo url(config('modules.client').'/settings/users/get-users-data'); ?>',
        columns: [
            {
                width:'10px', searchable: false, orderable: false,
                render: function (data, type, row, meta) {
                    return meta.row + meta.settings._iDisplayStart + 1;
                }
            },
            { data: 'name', name: 'name' },
            { data: 'email', name: 'email', searchable: false},
            { data: 'role.name', name: 'role.name', searchable: false, orderable: false},
            { data: 'status', name: 'status', searchable: false, orderable: false},
            { data: 'action', name: 'action', orderable: false, searchable: false, width:'50px', className:'text-center'},
        ],
        fnDrawCallback: function ( oSettings ) {
            $('[data-toggle="tooltip"]').tooltip();
            $("#users-table td").on("click", 'a#btn-delete', function() {
                var action = $(this).data('action');
                swal({
                    title: 'Are you sure you want to delete?',
                    text: "This will be permanently deleted",
                    type: 'warning',
                    showCancelButton: true,
                    confirmButtonColor: '#3085d6',
                    cancelButtonColor: '#d33',
                    confirmButtonText: 'Yes'
                    }).then(function () {                    
                    $.ajax({
                        type: "DELETE",
                        url: action,
                        dataType: 'json',
                        success: function(data) {
                            if(data.type == "success") {
                                userTable.draw();
                                swal(data.message, '', 'success')
                           }else{
                                swal(data.message, '', 'error')
                           }
                        },
                        error :function( jqXhr ) {
                            swal('Unable to delete.', 'Please try again.', 'error')
                        }
                    });
                })
            });
        },
        "order": [[1, "asc"]],
    });
});
</script>
<?php echo $__env->make('Client::notify', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('Client::layouts', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/mip/mip/app/Modules/Client/Views/settings/users/index.blade.php ENDPATH**/ ?>