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

- + + +
+ +
+ + +
+