 <?php $__env->startPush('head-script'); ?>
    <link rel="stylesheet" href="//cdn.datatables.net/fixedheader/3.1.5/css/fixedHeader.bootstrap.min.css">
    <link rel="stylesheet" href="//cdn.datatables.net/responsive/2.2.3/css/responsive.bootstrap.min.css">
    <style>
        .mb-20 {
            margin-bottom: 20px
        }
    </style>
<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-md-4 col-sm-6 col-12">
            <div class="info-box">
                <span class="info-box-icon bg-primary"><i class="icon-badge"></i></span>

                <div class="info-box-content">
                    <span class="info-box-text"><?php echo app('translator')->get('modules.dashboard.totalJobsAlert'); ?></span>
                    <span class="info-box-number"><?php echo e(number_format($totalJobAlert)); ?></span>
                </div>
                <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
        </div>

        <div class="col-md-4 col-sm-6 col-12">
            <div class="info-box">
                <span class="info-box-icon bg-success"><i class="icon-badge"></i></span>

                <div class="info-box-content">
                    <span class="info-box-text"><?php echo app('translator')->get('modules.dashboard.activeJobsAlert'); ?></span>
                    <span class="info-box-number"><?php echo e(number_format($activeJobsAlert)); ?></span>
                </div>
                <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
        </div>

        <div class="col-md-4 col-sm-6 col-12">
            <div class="info-box">
                <span class="info-box-icon bg-danger"><i class="icon-badge"></i></span>

                <div class="info-box-content">
                    <span class="info-box-text"><?php echo app('translator')->get('modules.dashboard.inactiveJobsAlert'); ?></span>
                    <span class="info-box-number"><?php echo e(number_format($inactiveJobsAlert)); ?></span>
                </div>
                <!-- /.info-box-content -->
            </div>
            <!-- /.info-box -->
        </div>
    </div>
    <div class="row">
        <div class="col-md-4">
            <div class="form-group">
                <select name="" id="filter-status" class="form-control">
                    <option value=""><?php echo app('translator')->get('app.filter'); ?> <?php echo app('translator')->get('app.status'); ?>: <?php echo app('translator')->get('app.viewAll'); ?></option>
                    <option value="active"><?php echo app('translator')->get('app.active'); ?></option>
                    <option value="inactive"><?php echo app('translator')->get('app.inactive'); ?></option>
                </select>
            </div>
        </div>
        <div class="col-md-4">
            <div class="form-group">
                <select name="" id="filter-location" class="form-control">
                    <option value=""><?php echo app('translator')->get('app.filter'); ?> <?php echo app('translator')->get('menu.locations'); ?>: <?php echo app('translator')->get('app.viewAll'); ?></option>
                    <?php $__currentLoopData = $locations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $location): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($location->id); ?>"><?php echo e(ucwords($location->location)); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-body">
                    <div class="table-responsive m-t-40">
                        <table id="myTable" class="table table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th><?php echo app('translator')->get('app.email'); ?></th>
                                    <th><?php echo app('translator')->get('menu.locations'); ?></th>
                                    <th><?php echo app('translator')->get('modules.jobs.workExperience'); ?></th>
                                    <th><?php echo app('translator')->get('modules.jobs.jobType'); ?></th>
                                    <th><?php echo app('translator')->get('app.status'); ?></th>
                                    <th><?php echo app('translator')->get('app.action'); ?></th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>


<?php $__env->startPush('footer-script'); ?>
    <script src="//cdn.datatables.net/fixedheader/3.1.5/js/dataTables.fixedHeader.min.js"></script>
    <script src="//cdn.datatables.net/responsive/2.2.3/js/dataTables.responsive.min.js"></script>
    <script src="//cdn.datatables.net/responsive/2.2.3/js/responsive.bootstrap.min.js"></script>

    <script>
        var table = $('#myTable').dataTable({
            responsive: true,
            // processing: true,
            serverSide: true,
            ajax: {
                'url': '<?php echo route('admin.job_alert.data'); ?>',
                "data": function(d) {
                    return $.extend({}, d, {
                        "filter_status": $('#filter-status').val(),
                        "filter_location": $('#filter-location').val(),
                    });
                }
            },
            language: languageOptions(),
            "fnDrawCallback": function(oSettings) {
                $("body").tooltip({
                    selector: '[data-toggle="tooltip"]'
                });
            },
            columns: [{
                    data: 'DT_Row_Index',
                    name: 'DT_Row_Index',
                    orderable: false,
                    searchable: false
                },
                {
                    data: 'email',
                    name: 'email'
                },
                {
                    data: 'location_id',
                    name: 'location_id'
                },
                {
                    data: 'work_experience_id',
                    name: 'work_experience_id'
                },
                {
                    data: 'job_type_id',
                    name: 'job_type_id'
                },
                {
                    data: 'status',
                    name: 'status'
                },
                {
                    data: 'action',
                    name: 'action',
                    width: '20%'
                }
            ]
        });

        new $.fn.dataTable.FixedHeader(table);

        $('#filter-status, #filter-location').change(function() {
            table._fnDraw();
        })

        $('body').on('click', '.sa-params', function(){
            var id = $(this).data('row-id');
            swal({
                title: "<?php echo app('translator')->get('errors.areYouSure'); ?>",
                text: "<?php echo app('translator')->get('errors.deleteWarning'); ?>",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "<?php echo app('translator')->get('app.delete'); ?>",
                cancelButtonText: "<?php echo app('translator')->get('app.cancel'); ?>",
                closeOnConfirm: true,
                closeOnCancel: true
            }, function(isConfirm){
                if (isConfirm) {

                    let url = "<?php echo e(route('admin.job_alert.destroy', ':id')); ?>";
                    url = url.replace(':id', id);

                    var token = "<?php echo e(csrf_token()); ?>";

                    $.easyAjax({
                        type: 'POST',
                        url: url,
                        data: {'_token': token, '_method': 'DELETE'},
                        success: function (response) {
                            if (response.status == "success") {
                                $.unblockUI();
                                table._fnDraw();
                            }
                        }
                    });
                }
            });
        });
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/hoseadevimcon/hr.hosea.dev-imcon.com/resources/views/admin/job_alert/index.blade.php ENDPATH**/ ?>