<?php
/**
 * Main Entry Point - Redirects based on role
 */
require_once __DIR__ . '/includes/init.php';

if (!SessionManager::isLoggedIn()) {
    redirect(APP_URL . '/login.php');
}

$role = SessionManager::getUserRole();
switch ($role) {
    case ROLE_ADMIN:
        redirect(APP_URL . '/admin/dashboard.php');
        break;
    case ROLE_COUNTER:
        redirect(APP_URL . '/counter/dashboard.php');
        break;
    case ROLE_CHECKER:
        redirect(APP_URL . '/checker/dashboard.php');
        break;
    case ROLE_CONTROLLER:
        redirect(APP_URL . '/controller/dashboard.php');
        break;
    default:
        redirect(APP_URL . '/login.php');
}
