<?php
/**
 * Enterprise HRM ERP System - Index (Redirect)
 * Redirects to login or role-based dashboard
 */

require_once __DIR__ . '/includes/init.php';

if (isLoggedIn()) {
    // Redirect based on user role
    $redirectUrl = getRoleBasedRedirect();
    header('Location: ' . $redirectUrl);
} else {
    header('Location: ' . BASE_URL . '/login.php');
}
exit;

