%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/silvzytp/dsr_code/storage/framework/views/
Upload File :
Create Path :
Current File : //home/silvzytp/dsr_code/storage/framework/views/c3b4744177eb28a6799988417611d2b3a83683d6.php

<?php $__env->startSection('title', $siteTitle); ?>
<?php $__env->startSection('action'); ?>
<?php if (\Illuminate\Support\Facades\Blade::check('permission', 'app.agents.create')): ?>
<div class="d-flex align-items center">
    <a href="<?php echo e(route(routeName().'.agents.create')); ?>" class="btn btn-sm btn-primary"><i class="ti-plus fs-ism fw-800"></i> Add Agent</a>
</div>
<?php endif; ?>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('styles'); ?>
<style>
    .onoffswitch {
        position: relative;
        width: 95px;
        -webkit-user-select:none;
        -moz-user-select:none;
        -ms-user-select: none;
        margin: auto;
    }
    .onoffswitch-checkbox {
        display: none;
    }
    .onoffswitch-label {
        display: block;
        overflow: hidden;
        cursor: pointer;
        border-radius: 20px;
        margin-bottom: 0;
    }
    .onoffswitch-inner {
        display: block;
        width: 200%;
        margin-left: -100%;
        transition: margin 0.3s ease-in 0s;
    }
    .onoffswitch-inner:before, .onoffswitch-inner:after {
        display: block;
        float: left;
        width: 50%;
        height: 25px;
        padding: 0;
        line-height: 25px;
        font-size: 14px;
        color: white;
        font-family: Trebuchet, Arial, sans-serif;
        font-weight: 400;
        box-sizing: border-box;
    }
    .onoffswitch-inner:before {
        content: "Enabled";
        padding-right: 15px;
        background-color: green;
        color: #FFFFFF;
    }
    .onoffswitch-inner:after {
        content: "Disabled";
        padding-right: 10px;
        background-color: red;
        color: #FFFFFF;
        text-align: right;
    }
    .onoffswitch-switch {
        display: block;
        width: 25px;
        margin: 2px;
        background: #FFFFFF;
        position: absolute;
        top: 0;
        bottom: 0;
        right: 67px;
        border-radius: 20px;
        transition: all 0.3s ease-in 0s;
    }
    .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner {
        margin-left: 0;
    }
    .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch {
        right: 0px;
    }
    ol.agent-list{
        margin: 0 0 0 18px;
        padding: 0;
    }
    .ui-checkbox.disabled input:checked~.input-span.disabled:after {
        display: none !important;
    }
</style>
<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>

    <div class="row">
        <div class="col-12">
            <div id="bulk-iboxs">
                <form method="POST" id="bulk-form">
                    <?php echo csrf_field(); ?>
                    <div class="d-flex align-items-center mb-3">
                        <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.form.selectbox','data' => ['name' => 'operation','divClass' => 'mb-0']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('form.selectbox'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['name' => 'operation','divClass' => 'mb-0']); ?>
                            <option value="">-- Select --</option>
                            <!--<?php if (\Illuminate\Support\Facades\Blade::check('permission', 'app.agents.bulk-destroy')): ?>-->
                            <!--<option value="delete">Deleted</option>-->
                            <!--<?php endif; ?>-->
                            <?php if (\Illuminate\Support\Facades\Blade::check('permission', 'app.agents.assign')): ?>
                            <option value="assign">Assign</option>
                            <?php endif; ?>
                         <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>

                        <?php if (\Illuminate\Support\Facades\Blade::check('permission', 'app.agents.assign')): ?>
                        <?php if($managers->isNotEmpty()): ?>
                            <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.form.selectbox','data' => ['name' => 'managers','divClass' => 'mb-0 ml-2 manager-list d-none']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('form.selectbox'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['name' => 'managers','divClass' => 'mb-0 ml-2 manager-list d-none']); ?>
                                <option value="">-- Select Manager--</option>
                                <?php $__currentLoopData = $managers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <option value="<?php echo e($value->id); ?>"><?php echo e($value->name); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                        <?php endif; ?>
                        <?php endif; ?>


                        <div class="bulk-apply">
                            <button class="btn btn-md btn-primary rounded-0 ml-2 px-3">Apply</button>
                        </div>
                    </div>
                </form>
            </div>

            <div class="ibox">
                <div class="ibox-body px-0">
                    <table class="table table-sm table-borderless table-style" id="admin-datatables">
                        <thead>
                            <th>
                                <label class="ui-checkbox">
                                    <input type="checkbox" id="all_checked">
                                    <span class="input-span"></span>
                                </label>
                            </th>
                            <th>Name</th>
                            <th>Email</th>
                            <th>Target</th>
                            <th>Role</th>
                            <th class="text-right">Action</th>
                        </thead>
                        <tbody>

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

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

<?php $__env->startPush('scripts'); ?>
    <script>
        table = $('#admin-datatables').DataTable({
            processing: true,
            serverSide: true,
            order: [], //Initial no order
            bInfo: true, //TO show the total number of data
            bFilter: false, //For datatable default search box show/hide
            responsive: true,
            ordering: false,
            lengthMenu: [
                [5, 10, 15, 25, 50, 100, 1000, 10000, -1],
                [5, 10, 15, 25, 50, 100, 1000, 10000, "All"]
            ],
            pageLength: 25, //number of data show per page
            ajax: {
                url: "<?php echo e(route(routeName().'.agents.get-data')); ?>",
                type: "POST",
                dataType: "JSON",
                data: function(d) {
                    d._token = _token;
                    d.search_text = $('input.custom-search').val();
                },
            },
            columns: [
                {data: 'bulk_check',orderable: false, searchable: false},
                {data: 'name'},
                {data: 'email'},
                {data: 'target'},
                {data: 'role'},
                {data: 'action', orderable: false, searchable: false},
            ],
            language: {
                processing: '<img src="<?php echo e(asset("uploads/images/table-loading.svg")); ?>">',
                emptyTable: '<strong class="text-danger">No Data Found</strong>',
                infoEmpty: '',
                zeroRecords: '<strong class="text-danger">No Data Found</strong>',
                oPaginate: {
                    sPrevious: "Previous", // This is the link to the previous page
                    sNext: "Next", // This is the link to the next page
                },
                lengthMenu: "<div class='d-flex align-items-center'>_MENU_ <div class='search-box ml-2 d-flex align-items-center'><input type='text' class='custom-search border' placeholder='name or email search here..'><i class='fa fa-search bg-primary text-light'></i></div></div>"
            },
            dom: "<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6' <'float-right pr-15'B>>>" +
            "<'row'<'col-sm-12'tr>>" +
            "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'<'float-right pr-15'p>>>",
            buttons: {
                buttons: [
                    {
                        extend: 'pdf',
                        filename: 'users_<?php echo e(date("d_m_d")); ?>',
                        title: 'User List',
                        orientation: "portrait",
                        pageSize: "A4",
                        className: 'pdfButton btn btn-sm btn-primary',
                        exportOptions: {
                            columns: '1,2,3,4'
                        },
                    },
                    {
                        extend: 'excel',
                        filename: 'users_<?php echo e(date("d_m_d")); ?>',
                        title: 'User List',
                        className: 'excelButton btn btn-sm btn-primary',
                        exportOptions: {
                            columns: '1,2,3,4'
                        },
                    },
                    {
                        extend: 'csv',
                        filename: 'users_<?php echo e(date("d_m_d")); ?>',
                        title: 'User List',
                        className: 'csvButton btn btn-sm btn-primary',
                        exportOptions: {
                            columns: '1,2,3,4'
                        },
                    },
                    {
                        extend: 'print',
                        title: 'User List',
                        orientation: "portrait",
                        pageSize: "A4",
                        className: 'printButton btn btn-sm btn-primary',
                        exportOptions: {
                            columns: '1,2,3,4'
                        },
                        customize: function ( win ) {
                            $(win.document.body)
                                .addClass('bg-white')
                                .css('font-size','10pt');

                            $(win.document.body).find('table')
                                .addClass('compact bg-white')
                                .css('font-size','inherit' );
                        }
                    }
                ]
            }
        });

        // deletable btn
        $(document).on('click', 'button.confirm-deletable-action', function(){
            // modal data
            let data_id = $('#deletable-modal input.datatable').val();
            const url = "<?php echo e(route(routeName().'.agents.destroy')); ?>";

            deletable_action(data_id,url); // define function
        });

        // user status enabled/disabled
        $(document).on('click', 'input.user-status', function(){
            let data_id = $(this).data('id');
            const url = "<?php echo e(route(routeName().'.agents.status')); ?>";
            if (this.checked) {
               var status = 1;
            }else{
               var status = 2;
            }

            datatable_status(data_id,status,url);
        });



        $(document).on('submit', '#bulk-iboxs form', function(e){
            e.preventDefault();
            $('#deletable-modal button.confirm-deletable-action').addClass('bulk-deletable-action');
            $('#deletable-modal button.bulk-deletable-action').removeClass('confirm-deletable-action');

            var operation_select = $('select[name="operation"]').val(); // select option value
            var manager = $('select[name="managers"]').val() || ''; // select option value
            if (operation_select != '') {
                // manager select
                var manager_select = operation_select == 'assign' ? manager : '';

                var operation_title = operation_select == 'delete' ? 'Do you really want to delete selected record(s)?' : 'Do you really want to operation selected record(s)?'; // modal operation content

                // modal data
                $('#deletable-modal .modal-body p').text(operation_title);
                $('#deletable-modal .modal-body input.operation-type').val(operation_select);
                $('#deletable-modal .modal-body input.manager-select').val(manager_select);

                if ($('input[name="checked"]:checked').length > 0) {
                    let bulk_data_id = [];
                    $('input[name="checked"]:checked').each(function(){
                        bulk_data_id.push($(this).val())
                    });

                    const title = 'Bulk deleted successfully.';
                    $('#deletable-modal input.datatable').val(bulk_data_id);
                }

                // modal show
                $('#deletable-modal').modal({
                    backdrop: 'static',
                    keyboard: false
                });
            }else{
                flashMessage('error','Please select a operation');
            }
        });


        function bulk_operation_action(data_id,operation_type,manager,url){
            if (data_id != '') {
                $.ajax({
                    url: url,
                    type: "POST",
                    data: {_token:_token,bulk_id:data_id,operation_type:operation_type,manager:manager},
                    cache: false,
                    success: function(response){
                        if (response.status == 'success') {
                            table.draw(); // table reload
                            $('form#bulk-form')[0].reset();
                            $('.manager-list').addClass('d-none');
                            $('#deletable-modal').modal('hide'); // modal hide
                            $('input#all_checked').prop('checked', false);
                            flashMessage(response.status,response.message);
                        }
                        else{
                            $('form#bulk-form')[0].reset();
                            $('.manager-list').addClass('d-none');
                            $('#deletable-modal').modal('hide'); // modal hide
                            $('input#all_checked').prop('checked', false);
                            flashMessage(response.status,response.message);
                        }
                    },
                    error: function(error){
                        console.log(error);
                    }
                });
            }
        }

        // user bulk deletable
        $(document).on('click', 'button.bulk-deletable-action', function(){
            var data_id = $('#deletable-modal input.datatable').val();
            var operation_type = $('#deletable-modal .modal-body input.operation-type').val();
            var manager = $('#deletable-modal .modal-body input.manager-select').val();
            const url = "<?php echo e(route(routeName().'.agents.bulk-destroy')); ?>";
            bulk_operation_action(data_id,operation_type,manager,url);
        });


        // operation assign manager
        $(document).on('change','select[name="operation"]', function(){
            let selected_value = $(this).val();
            if (selected_value == 'assign') {
                $('.manager-list').removeClass('d-none');
            }else{
                $('.manager-list').addClass('d-none');
            }
        });
        
        $(document).on('keyup keypress', 'input.custom-search', function(){
            table.ajax.reload();
        });

    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.backend', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/silvzytp/dsr_code/resources/views/backend/pages/agents/index.blade.php ENDPATH**/ ?>

Zerion Mini Shell 1.0