
<script src="js/app.js" type="text/javascript"></script>
<script src="js/perfect-scrollbar.min.js"></script>
<script src="js/config.js" type="text/javascript"></script>
<script src="js/scripts.bundle.js" type="text/javascript"></script>
<script src="js/custom.js" type="text/javascript"></script>
<script src="<?php echo e(asset('js/datatables.bundle.js')); ?>" type="text/javascript"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/toastify-js"></script>

<script>
    var _token = "<?php echo e(csrf_token()); ?>";
    var $window = $(window);

    // :: Preloader Active Code
    $window.on('load', function () {
        $('#preloader').fadeOut('slow', function () {
            $(this).remove();
        });
    });
    $(document).ready(function(){
        material_stock_alert();
        function material_stock_alert()
        {
            $.get("<?php echo e(url('product-stock-notification')); ?>", function(data){
                if(data.count > 0)
                {
                    $('.total-alert-qty-badge').removeClass('d-none');
                    $('.total-alert-qty-badge').text(data.count);
                    $('#total-alert-qty').text(data.count);

                    let alert_html = data.output;
                    $('#material-stock-alert').empty().html(alert_html);
                }else{
                    $('.total-alert-qty-badge').addClass('d-none');
                    $('.total-alert-qty-badge').text('');
                    $('#total-alert-qty').text('');
                    $('#material-stock-alert').empty().html(`<div class="p-8 text-center font-weight-bolder">All caught up!<br>No new notifications.</div>`);
                }
            });
        }
        <?php
        if (session('status')){
        ?>
        notification("<?php echo e(session('status')); ?>","<?php echo e(session('message')); ?>");
        <?php
        }
        ?>
        <?php
        if (session('success')){
        ?>
        notification("success","<?php echo e(session('success')); ?>");
        <?php
        }
        ?>
        <?php
        if (session('error')){
        ?>
        notification("error","<?php echo e(session('error')); ?>");
        <?php
        }
        ?>
    });
</script>
<?php echo $__env->yieldPushContent('scripts'); ?> <!-- Load Scripts Dynamically -->
<?php /**PATH /home/iconshoppercom/iconshopper/resources/views/layouts/includes/scripts.blade.php ENDPATH**/ ?>