From 95837394a90873f30ac863f660b1d47b456a6ef2 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 26 Nov 2023 10:52:43 +0100 Subject: [PATCH] sorted --- web/pages/smart/controller.php | 9 +++++++++ web/pages/smart/smart.html.php | 23 ++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/web/pages/smart/controller.php b/web/pages/smart/controller.php index eb5c1ad..98cf240 100644 --- a/web/pages/smart/controller.php +++ b/web/pages/smart/controller.php @@ -23,9 +23,18 @@ class Smart extends Page { $results = []; while($row = $res->fetchArray()) { + $row['event'] = $db->querySingle("SELECT name FROM events WHERE id = ".$row['event']); + $row['date'] = $db->querySingle("SELECT date FROM events WHERE id = ".$row['event']); + $row['unixtimestamp'] = strtotime($row['date']); + $row['run'] = $db->querySingle("SELECT name FROM runs WHERE id = ".$row['run']); $results[] = $row; } + //sort results by date + usort($results, function($a, $b) { + return $a['unixtimestamp'] <=> $b['unixtimestamp']; + }); + $this->set('results', $results); $this->set('query', $query); $this->set('template', 'search.html.php'); diff --git a/web/pages/smart/smart.html.php b/web/pages/smart/smart.html.php index c2346f3..d849f25 100644 --- a/web/pages/smart/smart.html.php +++ b/web/pages/smart/smart.html.php @@ -1,11 +1,20 @@

Dein Name wie der auf Teilnahmelisten zu finden ist

- + + +
+ +
+ + +
+