<!-- view/includes/footer.php -->
<footer class="footer">
    <p>SpareParts Management System v<?= APP_VERSION ?> - Tissue Converting Machine Solutions</p>
</footer>

<!-- Scripts -->
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script src="https://cdn.datatables.net/1.13.7/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.7/js/dataTables.bootstrap5.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="../assets/js/dinar.js"></script>
<script>
    <?php if (isset($_SESSION['flash'])): ?>
        // Tunggu sampai halaman siap (agar fungsi showToast dari dinar.js sudah ada)
        document.addEventListener('DOMContentLoaded', function() {
            // Pastikan fungsi showToast ada
            if (typeof window.showToast === 'function') {
                window.showToast("<?= $_SESSION['flash']['msg'] ?>", "<?= $_SESSION['flash']['type'] ?>");
            } else {
                // Fallback jika dinar.js belum termuat
                Swal.fire({
                    toast: true,
                    position: 'top-end',
                    icon: '<?= $_SESSION['flash']['type'] ?>',
                    title: "<?= $_SESSION['flash']['msg'] ?>",
                    showConfirmButton: false,
                    timer: 3000
                });
            }
        });
        <?php unset($_SESSION['flash']); // Hapus pesan setelah ditampilkan ?>
    <?php endif; ?>
</script>
</body>
</html>