Refactor entry handling: update date format, enhance entry retrieval, and improve HTML structure

This commit is contained in:
marc-go committed 2026-10-07 19:22:40 +02:00
1 parent ff2afb4441
commit fd1b8d9a0b
7 files changed
+15 -7

No files matched your search

+5 -2
View File
@@ -5,7 +5,7 @@ require "../api.php";
$api = new gbAPI(false);
// Get Entrys
$command = "SELECT * FROM entrys WHERE status = :status";
$command = "SELECT * FROM entrys WHERE status = :status ORDER BY date DESC";
$result = $api->dbCommand($command, true, true, [":status" => 1]);
$entrys = [];
@@ -20,10 +20,13 @@ if (!$result) {
foreach($result as $row) {
$entry_name = $row["name"];
$entry_text = $row["text"];
$date = new DateTime($row["date"]);
$entry_date = $date->format("d.m.Y H:i:s");
$entry = [
"name" => $entry_name,
"text" => $entry_text
"text" => $entry_text,
"date" => $entry_date
];
$entrys[] = $entry;