
<?php $__env->startSection('content'); ?>
    <!-- begin::main content -->
    <main class="main-content">
        <div class="container">
            <!-- begin::page header -->
            <div class="page-header">
                <h3><?php echo e(__('message.notification')); ?></h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="<?php echo e(asset('dashboard')); ?>"><?php echo e(__('message.dashboard')); ?></a></li>
                        <li class="breadcrumb-item active" aria-current="page"><?php echo e(__('message.list')); ?></li>
                    </ol>
                </nav>
            </div>
            <!-- end::page header -->
            <?php if (isset($component)) { $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\FlashMessage::class, []); ?>
<?php $component->withName('flashMessage'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74)): ?>
<?php $component = $__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74; ?>
<?php unset($__componentOriginal8a5ba9c90b64d384232e9948b1023e746ba08e74); ?>
<?php endif; ?>
            <div class="card">
                <div class="card-header">
                    <form method="POST" action="<?php echo e(asset('notification-filter')); ?>">
                        <?php echo csrf_field(); ?>
                        <div class="row">
                            <div class="col-md-2">
                                <select class="form-control select2" id="entry" name="entry">
                                    <option value="" disabled selected>25</option>
                                    <option value="50" >50</option>
                                    <option value="100">100</option>
                                    <option value="1000">1000</option>
                                    <option value="5000" >5000</option>
                                </select>
                            </div>
                            <div class="col-md-4">
                                <input type="text" id="search" name="search" class="form-control"
                                    placeholder="Search by Title, Subtitle">
                            </div>
                            <div class="col-md-6">
                                
                                <button type="submit" class="btn btn-success">
                                    <i class="fa fa-search"></i>&nbsp;<?php echo e(__('message.search')); ?></button>
                               
                                <a href="<?php echo e(asset('notification')); ?>" class="btn btn-primary text-white"><i
                                        class="fa fa-recycle fa-lg"></i>&nbsp;<?php echo e(__('message.reset')); ?></a>
                               
                                <a href="<?php echo e(asset('add-notification')); ?>" class="btn btn-info text-white"> 
                                    <i
                                        class="fa fa-plus fa-lg"></i>&nbsp<?php echo e(__('message.add')); ?>

                                    <?php echo e(__('message.notification')); ?>

                                </a>
                                
                                <a id="delete-multiple" href="javascript:;" class="btn btn-danger text-white pull-right"> <i
                                        class="fa fa-trash-o fa-lg"></i></a>
                                
                            </div>
                        </div>
                    </form>
                </div>
                <div class="card-body">
                    <?php if(isset($notification)): ?>
                        <div class="table-responsive">
                            <table id="students" class="table table-striped table-bordered font-size-11">
                                <thead>
                                    <tr>
                                        <th>
                                            <input type="checkbox" id="checkAll">
                                        </th>
                                        <th><?php echo e(__('message.si')); ?></th>
                                        <th>Image</th>
                                        <th>Title</th>
                                        <th>Subtitle</th>
                                        <th>Text</th>
                                        <th><?php echo e(__('message.action')); ?></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php if(!empty($notification)): ?>
                                        <?php $__currentLoopData = $notification; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $notice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <td>
                                                    <input class="nt_id" type="checkbox" value="<?php echo e($notice->id); ?>"
                                                        name="enquireids[]">
                                                </td>
                                                <td>
                                                    <span class="font-size-13"><?php echo e($key + 1); ?></span>
                                                </td>
                                                <td>
                                                    <img src="<?php echo e(asset('public'.$notice->image)); ?>" alt="image" width="50">
                                                </td>
                                                <td>
                                                    <span class="font-size-13"><?php echo e($notice->title); ?></span>
                                                </td>
                                                <td>
                                                    <span class="font-size-13"><?php echo e($notice->subtitle); ?></span>
                                                </td>
                                                <td>
                                                    <span class="font-size-13">
                                                        <?php echo e($notice->description); ?>

                                                    </span>
                                                </td>
                                                <td>
                                                    
                                                    <div class="dropdown">
                                                        <button class="btn btn-sm btn-dark dropdown-toggle" type="button"
                                                            data-toggle="dropdown">
                                                            <?php echo e(__('message.action')); ?>

                                                        </button>
                                                        <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                                                            
                                                            <a class="dropdown-item"
                                                                href="<?php echo e(asset('edit-notification/'.$notice->id)); ?>"><?php echo e(__('message.edit')); ?></a>
                                                            
                                                            <a class="dropdown-item delete-confirm"
                                                                href="<?php echo e(asset('delete-notification/'.$notice->id)); ?>"><?php echo e(__('message.delete')); ?></a>
                                                           
                                                        </div>
                                                    </div>
                                                </td>
                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php else: ?>
                                        <h1>No Record Found!!</h1>
                                    <?php endif; ?>
                                </tbody>
                            </table>
                        </div>
                        
                        <div class="pagination-block">
                            <?php echo e($notification->appends(request()->query())->links('includes.paginationlinks')); ?>

                            <label>Showing total <?php echo $notification->total(); ?> results</label>
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </main>
    <!-- end::main content -->
<?php $__env->stopSection(); ?>
<?php $__env->startPush('footer-script'); ?>
    <script src="<?php echo e(asset('public/admin/vendors/dataTable/jquery.dataTables.min.js')); ?>"></script>
    <script src="<?php echo e(asset('public/admin/vendors/dataTable/dataTables.bootstrap4.min.js')); ?>"></script>
    <script src="<?php echo e(asset('public/admin/vendors/dataTable/dataTables.responsive.min.js')); ?>"></script>
    <script>
        $(document).on("click", ".change-password", function() {
            $(".modal-body #user_unique_id").val($(this).data('user_unique_id'));
            $('#changepasswordModal').modal('show');
        });
        // Model Submit
        $(document).on('submit', '#change_password_form', function(e) {
            e.preventDefault();
            var formData = new FormData(jQuery('#change_password_form')[0]);
            $.ajax({
                type: 'POST',
                url: "<?php echo e(asset('student/change-password')); ?>",
                data: formData,
                contentType: false,
                processData: false,
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                },
                success: function(data) {
                    $('.error').empty();
                    $('#changepasswordModal').modal('hide');
                    swal({
                            title: "Reset Password",
                            text: data.message,
                            icon: "success"
                        })
                        .then((value) => {
                            $('#changepasswordModal').modal('hide');
                            location.reload();
                        });
                },
                error: function(reject) {
                    $('.error').empty();
                    if (reject.status === 422) {
                        var errors = $.parseJSON(reject.responseText);
                        $.each(errors, function(key, val) {
                            $('<div class="text-danger error">' + val + '</div>')
                                .insertAfter("#" + key);
                        });
                    }
                }
            });
        });
        $("#checkAll").click(function() {
            $('.nt_id').not(this).prop('checked', this.checked);
        });
        // Delete Multiple
        $("#delete-multiple").click(function() {
            var URL = "<?php echo e(asset('delete-multiple-notification')); ?>";
            var ids = [];
            $('.nt_id:checkbox:checked').each(function() {
                ids.push($(this).val());
            });
            
            swal({
                title: 'Are you sure?',
                text: 'Once deleted, you will not be recover!',
                icon: 'warning',
                dangerMode: true,
                buttons: ["Cancel", "Yes!"],
            }).then(function(value) {
                if (value) {
                    $.ajaxSetup({
                        headers: {
                            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                        }
                    });
                    $.ajax({
                        type: "post",
                        data: {
                            "ids": ids
                        },
                        url: URL,
                        dataType: "html",
                        success: function(result) {}
                    });
                    swal("success!", "Successfully deleted!", "success");
                    window.location.reload();
                }
            });
        });
    </script>
    <?php if(!empty(Request::get('type'))): ?>
        <script>
            $("#type").val("<?php echo e(Request::get('type')); ?>").trigger('change');
        </script>
    <?php endif; ?>
    <!-- end::dataTable -->
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH F:\xampp\htdocs\visitor_management\resources\views/notification/list.blade.php ENDPATH**/ ?>