<?php

require_once __DIR__ . '/config.php'; // BASE_URL include

if(!isset($_SESSION['user_id']))
{
    header("Location: " . BASE_URL . "admin/login");
    exit;
}

function checkRole($roles)
{
    if(!in_array($_SESSION['role_id'] ?? null,$roles))
    {
        header("Location: " . BASE_URL . "admin/dashboard");
        exit;
    }
}
