<?php
date_default_timezone_set('Africa/Nairobi');


$host = "localhost"; // MySQL server hostname
$username = "lolanico_muniafu"; // MySQL username
$password = "lolanico_muniafu"; // MySQL password
$database = "lolanico_muniafu"; // MySQL database name

// Create a MySQL connection
$conn = new mysqli($host, $username, $password, $database);

// Check the connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

function checkAuth() {
    if (!isset($_SESSION['user_id']) || !isset($_SESSION['role_id'])) {
        header("Location: logout.php");
        exit();
    }
}
// Close the connection


?>