HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-26-0-120 6.17.0-1009-aws #9~24.04.2-Ubuntu SMP Fri Mar 6 23:50:29 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/html/spion/storage/framework/views/77c171e5214a2d0994aca10e430b89fc.php
<?php echo $__env->make('admin.includes.datatable-axios-files', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<?php $__env->startSection('title', 'Dashboard'); ?>

<?php $__env->startSection('content_header'); ?>
<h1>Roles</h1>
<small>Manage roles</small>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="card card-dark">
    <div class="card-header">
        <h3 class="card-title"></h3>
        <div class="card-tools">
            <a href="<?php echo e(route('roles.create')); ?>" class="btn btn-dark"><i class="fas fa-plus"></i> Add Role</a>
        </div>
    </div>

    <div class="card-body">
        <form method="POST" id="search-form" role="form">

            <div class="form-group">
                <label for="search">Search</label>
                <?php if (isset($component)) { $__componentOriginale5d826ae10df3aa87f8449f474c11664 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginale5d826ae10df3aa87f8449f474c11664 = $attributes; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Form\Input::resolve(['id' => 'search_keyword','name' => 'search_keyword'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('adminlte-input'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(JeroenNoten\LaravelAdminLte\View\Components\Form\Input::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'form-control','placeholder' => 'Enter Name']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginale5d826ae10df3aa87f8449f474c11664)): ?>
<?php $attributes = $__attributesOriginale5d826ae10df3aa87f8449f474c11664; ?>
<?php unset($__attributesOriginale5d826ae10df3aa87f8449f474c11664); ?>
<?php endif; ?>
<?php if (isset($__componentOriginale5d826ae10df3aa87f8449f474c11664)): ?>
<?php $component = $__componentOriginale5d826ae10df3aa87f8449f474c11664; ?>
<?php unset($__componentOriginale5d826ae10df3aa87f8449f474c11664); ?>
<?php endif; ?>

            </div>
            <div class="form-group">
                <label for="status">Status</label>
                <?php
                $options = ['all' => 'All', STATUS_DISABLED => 'Disabled', STATUS_ENABLED => 'Active'];
                ?>
                <?php if (isset($component)) { $__componentOriginal377f5828c1076ae12e071b1688061877 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal377f5828c1076ae12e071b1688061877 = $attributes; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Form\Select::resolve(['name' => 'status_filter','id' => 'status_filter'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('adminlte-select'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(JeroenNoten\LaravelAdminLte\View\Components\Form\Select::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
                    <?php if (isset($component)) { $__componentOriginal1e9af52466c1670f554542c6e6d1a065 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal1e9af52466c1670f554542c6e6d1a065 = $attributes; } ?>
<?php $component = JeroenNoten\LaravelAdminLte\View\Components\Form\Options::resolve(['options' => $options,'emptyOption' => 'Select an option...'] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('adminlte-options'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(JeroenNoten\LaravelAdminLte\View\Components\Form\Options::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal1e9af52466c1670f554542c6e6d1a065)): ?>
<?php $attributes = $__attributesOriginal1e9af52466c1670f554542c6e6d1a065; ?>
<?php unset($__attributesOriginal1e9af52466c1670f554542c6e6d1a065); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1e9af52466c1670f554542c6e6d1a065)): ?>
<?php $component = $__componentOriginal1e9af52466c1670f554542c6e6d1a065; ?>
<?php unset($__componentOriginal1e9af52466c1670f554542c6e6d1a065); ?>
<?php endif; ?>
                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal377f5828c1076ae12e071b1688061877)): ?>
<?php $attributes = $__attributesOriginal377f5828c1076ae12e071b1688061877; ?>
<?php unset($__attributesOriginal377f5828c1076ae12e071b1688061877); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal377f5828c1076ae12e071b1688061877)): ?>
<?php $component = $__componentOriginal377f5828c1076ae12e071b1688061877; ?>
<?php unset($__componentOriginal377f5828c1076ae12e071b1688061877); ?>
<?php endif; ?>

            </div>



            <!--<button type="submit" class="btn btn-primary">Filter</button>-->

            <!--<div class="card-footer">
                    <button type="submit" class="btn btn-primary">Submit</button>
                </div>-->
        </form>
        <table class="table table-bordered yajra-datatable">
            <thead>
                <tr>
                    
                    
                    <th>Name</th>
                    <th>description</th>
                    <th>Status</th>
                    <!-- <th>Created Date</th> -->
                    <th>Actions</th>
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
<script type="text/javascript">
    $(function() {

        var dataTable = $('.yajra-datatable').DataTable({
            processing: true,
            serverSide: true,
            pageLength: 10,
            searching: false,
            'ajax': {
                'url': "<?php echo e(route('roles.index')); ?>",
                'data': function(data) {
                    // Read values
                    var search_keyword = $('#search_keyword').val();
                    var shop_filter = $('#shop_filter option:selected').val();
                    var status_filter = $('#status_filter option:selected').val();


                    // Append to data
                    data.search_keyword = search_keyword;
                    data.shop_filter = shop_filter;
                    data.status_filter = status_filter;

                }
            },
            columns: [
                /*{data: 'checkbox', name: 'checkbox', orderable: false, searchable: false},*/
                /*  {data: 'id', name: 'ID'},  */
                {
                    data: 'name',
                    name: 'name'
                },
                {
                    data: 'description',
                    name: 'description'
                },
                {
                    data: 'status',
                    name: 'status'
                },
                // {
                //     data: 'created_at',
                //     name: 'Created Date'
                // },
                {
                    data: 'action',
                    name: 'action',
                    /*orderable: true,
                    searchable: true*/
                },
            ]
        });

        $('#search_keyword').keyup(function() {
            dataTable.draw();
        });
        $('#shop_filter').on('change', function() {
            dataTable.draw();
        });
        $('#status_filter').on('change', function() {
            dataTable.draw();
        });

        /*
            // select all rows
            $('#selectAll').on('change', function(){
                let groupCheck = Array.from(document.getElementsByClassName('select_row'));
                //console.log(groupCheck)
                if (this.checked) {
                    groupCheck.forEach(element => {
                        // checking the checkbox
                        element.checked = true;
                        //$('#bulk-action-apply').prop('disabled', false);
                        $('.bulk-action-wrap').show();
                    })
                } else {
                    groupCheck.forEach(element => {
                        // Unchecking the checkbox
                        element.checked = false;
                        $('.bulk-action-wrap').hide();
                    })
                }
            });*/

        $(document).on('click', '.update_status', function(e) {
            e.preventDefault();
            $('.overlay-with-loader').show();
            var update_status_id = $(this).attr('id');
            var current_status = $(this).data('current-status');
            var new_status = (current_status == 0) ? 1 : 0;
            var new_status_label = (new_status == 1) ? 'Active' : 'Inactive';
            var url = $(this).data('update-url');
            axios.put(url, {
                    new_status: new_status
                })
                .then(response => {
                    // Handle success response
                    $('.overlay-with-loader').hide();
                    if (response.data.status === 'success') {
                        var success_messages = '';
                        console.log('#update_status_currnt', '#update_status_' + current_status);
                        console.log('#update_status_new', '#update_status_' + new_status);
                        $('#update_status_' + current_status).hide();
                        $('#update_status_' + new_status).show();
                        if (Array.isArray(response.data.message)) {
                            $.each(response.data.message, function(Index, Value) {
                                if (success_messages === '') {
                                    success_messages += Value;
                                } else {
                                    success_messages += '<br/>' + Value;
                                }
                            });
                        } else {
                            success_messages = response.data.message;
                        }
                        $('#success-container').html(success_messages).show('slow');
                    } else {
                        var messages = '';
                        if (Array.isArray(response.data.message)) {
                            $.each(response.data.message, function(Index, Value) {
                                if (messages === '') {
                                    messages += Value;
                                } else {
                                    messages += '<br/>' + Value;
                                }
                            });
                        } else {
                            messages = response.data.message;
                        }
                        $('#error-container').html(messages).show('slow');
                    }
                    setTimeout(function() {
                        $('#success-container').hide('slow');
                        $('#error-container').hide('slow');
                    }, 5000);
                })
                .catch(error => {
                    console.error(error);
                });
        });

    });
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('adminlte::page', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/spion/resources/views/admin/role/index.blade.php ENDPATH**/ ?>