<?php
declare(strict_types=1);

// Compatibility bridge for the old "laporan_bulanan" route.
// The active monthly report implementation lives in modules/laporan/.
require_once __DIR__ . '/../config/database.php';
require_once __DIR__ . '/../config/app.php';

checkAuth();

$level = strtolower((string)($_GET['level'] ?? 'unit'));
$pageMap = [
    'kepala_unit' => 'unit_form',
    'unit' => 'unit_form',
    'kasubdiv' => 'kasubdiv_form',
    'kadiv' => 'kadiv_form',
];

$_GET['page'] = $pageMap[$level] ?? ($_GET['page'] ?? 'unit_form');

require __DIR__ . '/laporan/index.php';
