22 lines
497 B
PHP
Executable File
22 lines
497 B
PHP
Executable File
<?php
|
|
use App\Database;
|
|
use App\Repository\KeaHostRepository;
|
|
|
|
global $appConfig;
|
|
|
|
$pdo = Database::createPdo($appConfig);
|
|
$hosts = [];
|
|
$error = null;
|
|
|
|
if ($pdo) {
|
|
try {
|
|
$repo = new KeaHostRepository($pdo);
|
|
$hosts = $repo->findAll(50);
|
|
} catch (\Exception $e) {
|
|
$error = "Datenbankfehler: " . $e->getMessage();
|
|
}
|
|
} else {
|
|
$error = "Datenbankverbindung ist nicht konfiguriert oder deaktiviert.";
|
|
}
|
|
|
|
tpl('kea_dashboard', 'landing', compact('hosts', 'error')); |