<?php

    if ($_SESSION['message'] == 1) {

        ?>

        <script>
            document.addEventListener("DOMContentLoaded", () => {
                Swal.fire({
                    icon: '<?php echo $_SESSION['message_icon']; ?>',
                    title: '<?php echo $_SESSION['message_text']; ?>',
                    showConfirmButton: true,
                    timer: 8000
                });
            });  
        </script>

        <?php

        unset($_SESSION['message']);
        unset($_SESSION['message_text']);
        unset($_SESSION['message_icon']);
    }
                
?>
