add files

This commit is contained in:
luthfihadinugroho79
2026-06-10 19:42:59 +07:00
parent 7bf3c98e59
commit e950468760
3541 changed files with 0 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
<?php
// index.php — Entry point, redirect berdasarkan role
require_once 'includes/config.php';
startSession();
if (empty($_SESSION['user_id'])) {
header('Location: login.php');
exit;
}
$role = $_SESSION['role'] ?? '';
$redirectMap = [
'admin' => 'dashboard/pengurus.php',
'pengurus_ibadah' => 'dashboard/pengurus.php',
'masyarakat' => 'dashboard/masyarakat.php',
'pemerintah' => 'dashboard/pemerintah.php',
];
header('Location: ' . ($redirectMap[$role] ?? 'login.php'));
exit;
?>