DSP Project first push, date: 29/01/2026

This commit is contained in:
Sok Ponlork
2026-01-29 14:31:48 +07:00
parent 951262afb3
commit 644b624d2d
1857 changed files with 163516 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
<?php
// dsp26072025/index.php
// This is the main front controller for the application.
// Define the base path for consistent includes
// This will correctly point to the root directory of your project
define('BASE_PATH', __DIR__ . '/');
// Start the session once at the very beginning
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
// Global Dependencies - All pages will have access to these.
// NOTE: Make sure these files exist in the specified paths.
require_once BASE_PATH . 'config.php';
require_once BASE_PATH . 'includes/auth.php';
require_once BASE_PATH . 'includes/functions.php';
require_once BASE_PATH . 'classes/DataSource.php';
require_once BASE_PATH . 'classes/Classifications.php';
require_once BASE_PATH . 'classes/User.php';
require_once BASE_PATH . 'classes/Permission.php';
require_once BASE_PATH . 'classes/Request.php';
require_once BASE_PATH . 'classes/Log.php';
// Get the requested page from the URL. Default to 'dashboard' if not set.
$page = $_GET['page'] ?? 'dashboard';
// A simple routing system to include the correct file
switch ($page) {
case 'dashboard':
include BASE_PATH . 'data_user/dashboard.php';
break;
case 'browse_datasources':
include BASE_PATH . 'data_user/browse_datasources.php';
break;
case 'my_permissions':
include BASE_PATH . 'data_user/my_permissions.php';
break;
case 'my_downloads':
include BASE_PATH . 'data_user/my_downloads.php';
break;
case 'login':
include BASE_PATH . 'data_user/login.php';
break;
case 'register':
include BASE_PATH . 'data_user/register.php';
break;
case 'process_request_permission':
include BASE_PATH . 'data_user/process_request_permission.php';
break;
default:
// Handle pages not found
header("HTTP/1.0 404 Not Found");
include BASE_PATH . 'data_user/404.php';
break;
}
?>