44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
echo "HELLO FROM GEMINI";
|
|
|
|
// --- Simple Router ---
|
|
$page = $_GET['page'] ?? 'dashboard';
|
|
|
|
// Whitelist of allowed pages to prevent arbitrary file inclusion
|
|
$allowed_pages = ['dashboard', 'customs', 'insurance', 'transport'];
|
|
|
|
if (!in_array($page, $allowed_pages)) {
|
|
$page = 'dashboard'; // Default to dashboard if page is not allowed
|
|
}
|
|
|
|
$page_file = $page . '.php';
|
|
|
|
// --- Page Rendering ---
|
|
|
|
// The title for the header can be set in the included page files
|
|
// e.g. <?php $title = 'My Page'; ?>
|
|
include 'partials/header.php';
|
|
|
|
?>
|
|
|
|
<!-- Sidebar -->
|
|
<?php include 'partials/sidebar.php'; ?>
|
|
|
|
<!-- Page Content -->
|
|
<div id="page-content-wrapper" class="d-flex flex-column">
|
|
<?php include 'partials/topbar.php'; ?>
|
|
<main class="flex-grow-1 p-4">
|
|
<?php
|
|
if (file_exists($page_file)) {
|
|
include $page_file;
|
|
} else {
|
|
// Fallback for 404
|
|
echo '<div class="container-fluid"><h1 class="mt-4">Page Not Found</h1><p>The requested page could not be found.</p></div>';
|
|
}
|
|
?>
|
|
</main>
|
|
</div>
|
|
|
|
<?php
|
|
include 'partials/footer.php';
|
|
?>
|