<?php
require_once __DIR__ . '/../kkn-system/includes/auth.php';
require_once __DIR__ . '/../kkn-system/includes/data.php';

requireLogin();

$role = getRole();
$user = getUser();
$page = $_GET['page'] ?? 'home';

// Route ke halaman yang sesuai
switch ($role) {
    case 'admin':      require __DIR__ . '/../kkn-system/dashboard/admin.php'; break;
    case 'dpl':        require __DIR__ . '/../kkn-system/dashboard/dpl.php';   break;
    case 'mahasiswa':  require __DIR__ . '/../kkn-system/dashboard/mhs.php';   break;
    default:
        logout();
}
