35128-vm/index.php
Flatlogic Bot 491d61d600 sikms
2025-10-23 01:36:23 +00:00

27 lines
578 B
PHP

<?php
require_once __DIR__ . '/templates/header.php';
if (!isset($_SESSION['user'])) {
header('Location: /login.php');
exit();
}
$role = $_SESSION['user']['role'];
switch ($role) {
case 'admin':
header('Location: /pages/admin/dashboard.php');
break;
case 'guru':
header('Location: /pages/guru/dashboard.php');
break;
case 'siswa':
header('Location: /pages/siswa/dashboard.php');
break;
default:
header('Location: /login.php');
break;
}
require_once __DIR__ . '/templates/footer.php';
?>