- Added list, edit, and save functionalities for floors, locations, and racks. - Enhanced UI with search and filter options for better usability. - Implemented SVG upload for floor plans in the floors module. - Added validation for required fields in the save processes. - Improved navigation in the header to reflect new modules. - Styled forms and tables for a consistent look and feel across modules.
68 lines
1.7 KiB
PHP
68 lines
1.7 KiB
PHP
<?php
|
|
// Einstiegspunkt der Anwendung, Routing zur jeweiligen Modul-Seite
|
|
|
|
|
|
/**
|
|
* index.php
|
|
*
|
|
* Einstiegspunkt der Anwendung
|
|
* - Single-User
|
|
* - Modulbasiertes Routing
|
|
* - Basierend auf _sql.php
|
|
* - HTML-Layout via templates/layout.php
|
|
*/
|
|
|
|
/* =========================
|
|
* Bootstrap
|
|
* ========================= */
|
|
require_once __DIR__ . '/bootstrap.php'; // lädt config, DB, helper
|
|
// TODO: Session starten / Single-User-Auth prüfen
|
|
|
|
/* =========================
|
|
* Routing
|
|
* ========================= */
|
|
|
|
// Standard-Modul / Aktion
|
|
$module = $_GET['module'] ?? 'dashboard';
|
|
$action = $_GET['action'] ?? 'list';
|
|
|
|
// Whitelist der Module
|
|
$validModules = ['dashboard', 'locations', 'buildings', 'device_types', 'devices', 'racks', 'floors', 'connections'];
|
|
|
|
// Whitelist der Aktionen
|
|
$validActions = ['list', 'edit', 'save', 'ports'];
|
|
|
|
// Prüfen auf gültige Werte
|
|
if (!in_array($module, $validModules)) {
|
|
// TODO: Fehlerseite anzeigen
|
|
die('Ungültiges Modul');
|
|
}
|
|
|
|
if (!in_array($action, $validActions)) {
|
|
// TODO: Fehlerseite anzeigen
|
|
die('Ungültige Aktion');
|
|
}
|
|
|
|
/* =========================
|
|
* Template-Header laden
|
|
* ========================= */
|
|
require_once __DIR__ . '/templates/header.php';
|
|
// TODO: ggf. Navigation einbinden
|
|
|
|
/* =========================
|
|
* Modul laden
|
|
* ========================= */
|
|
$modulePath = __DIR__ . "/modules/$module/$action.php";
|
|
|
|
if (file_exists($modulePath)) {
|
|
require_once $modulePath;
|
|
} else {
|
|
// TODO: Fehlerseite oder 404
|
|
echo "<p>Die Seite existiert noch nicht.</p>".$modulePath;
|
|
}
|
|
|
|
/* =========================
|
|
* Template-Footer laden
|
|
* ========================= */
|
|
require_once __DIR__ . '/templates/footer.php';
|