
<?php
session_start();

if (!isset($_SESSION['user_id'])) {
    header('Location: index.php'); 
    exit;
}

switch ($_SESSION['role'] ?? 'user') {
    case 'dean_admin':
        header('Location: pages/admins/dean_admin/dean_admin_dashboard.php');
        break;
    case 'assistant_first_admin':
        header('Location: pages/admins/assistant_first_admin/assistant_first_admin_dashboard.php');
        break;
    case 'finance_second_admin':
        header('Location: pages/admins/finance_second_admin/finance_second_admin_dashboard.php');
        break;
    default:
        header('Location: pages/users/user_dashboard.php');
        break;
}
exit;
?>
