Refactor entry handling: update date format, enhance entry retrieval, and improve HTML structure
This commit is contained in:
1 parent
ff2afb4441
commit
fd1b8d9a0b
7 files changed
+15
-7
No files matched your search
+5
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user