</div>
<!-- /.content-wrapper -->




</div>
<!-- ./wrapper -->

<!-- jQuery -->
<script src="{{ asset('assets/admin/') }}/plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="{{ asset('assets/admin/') }}/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>

{{ $slot }}
<script>
    cek_data_pesan()

    function cek_data_pesan() {
        $.ajax({
            type: 'GET',
            url: 'cek-data-pesan',
            success: function(data) {
                $('#pesanbaru').html(data);
            }
        });
    }

    function cek_pesan() {
        $.ajax({
            type: 'GET',
            url: 'cek-pesan',
            success: function(data) {
                $('#isinotif').remove();
                $('.isinotif').append(`<span id="isinotif">` + data + ` Notifications</span>`);
                if (data != 0) {
                    $('#notif').remove();
                    $('.notif').append(`<span id="notif" class="badge badge-warning navbar-badge">` +
                        data +
                        `</span>`);

                    $('#sidnotif').html(data);
                } else {
                    $('#notif').remove();
                    $('#sidnotif').html("");
                }
            }
        });
    }
    cek_pesan();
    setInterval(function() {
        cek_data_pesan()
        cek_pesan();
    }, 5000);
</script>
<!-- AdminLTE App -->
<script src="{{ asset('assets/admin/') }}/dist/js/adminlte.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script>
    window.setTimeout(function() {
        $(".alert").fadeTo(500, 0).slideUp(500, function() {
            $(this).remove();
        });
    }, 7000);


    $('.numbers').keyup(function() {
        this.value = this.value.replace(/[^0-9]/g, '');
    });

    $('.rupiah').keyup(function() {
        this.value = formatRupiah(this.value);
    });

    function formatRupiah(angka, prefix) {
        var number_string = angka.replace(/[^,\d]/g, '').toString(),
            split = number_string.split(','),
            sisa = split[0].length % 3,
            rupiah = split[0].substr(0, sisa),
            ribuan = split[0].substr(sisa).match(/\d{3}/gi);

        if (ribuan) {
            separator = sisa ? '.' : '';
            rupiah += separator + ribuan.join('.');
        }

        rupiah = split[1] != undefined ? rupiah + '.' + split[1] : rupiah;
        return prefix == undefined ? rupiah : (rupiah ? 'Rp. ' + rupiah : '');
    }

    var Toast = Swal.mixin({
        toast: true,
        position: 'top-end',
        showConfirmButton: false,
        timer: 3000
    });
</script>
</body>

</html>
