<?php
// Di awal file config.php
define('BASE_URL', '/digipus'); // Sesuaikan dengan path aplikasi Anda

session_start();

$host = 'localhost';
$username = 'smah6429_usedbsmansab';
$password = 'userdbsmansab#1';
$database = 'smah6429_smansab';

$conn = new mysqli($host, $username, $password, $database);

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
// Set timezone
date_default_timezone_set('Asia/Jakarta');

// Fungsi untuk menampilkan pesan SweetAlert
function showAlert($icon, $title, $text, $redirect = null) {
    echo "<script>
        Swal.fire({
            icon: '$icon',
            title: '$title',
            text: '$text'
        }).then(() => {
            " . ($redirect ? "window.location.href = '$redirect';" : "") . "
        });
    </script>";
}
?>