
<?php $__env->startSection('title', ' All Users'); ?>
<?php $__env->startSection('content'); ?>
<div class="app-page-title">
    <div class="page-title-wrapper">
        <div class="page-title-heading">
            <div class="page-title-icon">
                <i class="pe-7s-users icon-gradient bg-mean-fruit"> </i>
            </div>
            <div>All Users</div>
            <div class="d-inline-block ml-2">
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('user-create')): ?>
                <button class="btn btn-success" onclick="create()"><i class="glyphicon glyphicon-plus"></i>
                    New User
                </button>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-md-12 col-sm-12">
        <div class="main-card mb-3 card">
            <div class="card-body">
                <div class="table-responsive">
                    <table id="manage_all" class="align-middle mb-0 table table-borderless table-striped table-hover">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>Photo</th>
                                <th>User Name</th>
                                <th>Email</th>
                                <th>Roles</th>
                                <th>Status</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<style>
    @media  screen and (min-width: 768px) {
        #myModal .modal-dialog {
            width: 85%;
            border-radius: 5px;
        }
    }
</style>
<script>
    $(function() {

        table = $('#manage_all').DataTable({
            processing: true,
            serverSide: true,
            ajax: {
                "url": '<?php echo route('
                admin.allUser.users '); ?>',
                "type": "GET",
                headers: {
                    "X-CSRF-TOKEN": CSRF_TOKEN,
                },
                "dataType": 'json'
            },
            columns: [{
                    data: 'DT_RowIndex',
                    name: 'DT_RowIndex'
                },
                {
                    data: 'file_path',
                    name: 'file_path'
                },
                {
                    data: 'name',
                    name: 'name'
                },
                {
                    data: 'email',
                    name: 'email'
                },
                {
                    data: 'role',
                    name: 'role'
                },
                {
                    data: 'status',
                    name: 'status'
                },
                {
                    data: 'action',
                    name: 'action'
                }
            ],
            "autoWidth": false,
        });
        $('.dataTables_filter input[type="search"]').attr('placeholder', 'Type here to search...').css({
            'width': '220px',
            'height': '30px'
        });

    });
</script>
<script type="text/javascript">
    function create() {
        ajax_submit_create('users');
    }

    $(document).ready(function() {
        // View Form
        $("#manage_all").on("click", ".view", function() {
            var id = $(this).attr('id');
            ajax_submit_view('users', id)
        });

        // Edit Form
        $("#manage_all").on("click", ".edit", function() {
            var id = $(this).attr('id');
            ajax_submit_edit('users', id)
        });


        // Delete
        $("#manage_all").on("click", ".delete", function() {
            var id = $(this).attr('id');
            ajax_submit_delete('users', id)
        });

    });
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('backend.layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH F:\lunar\xamp7.3\htdocs\lancer\chatbox\resources\views/backend/admin/user/index.blade.php ENDPATH**/ ?>