nice
All checks were successful
Build and push / Pulling repo on server (push) Successful in 2s
All checks were successful
Build and push / Pulling repo on server (push) Successful in 2s
This commit is contained in:
@ -23,16 +23,17 @@ 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['event'] = $db->querySingle("SELECT name FROM events WHERE id = ".$row['event']);
|
||||
$row['unixtimestamp'] = strtotime($row['date']);
|
||||
$row['run'] = $db->querySingle("SELECT name FROM runs WHERE id = ".$row['run']);
|
||||
$row['ago'] = printRelativeTime(time(),$row['unixtimestamp']);
|
||||
$results[] = $row;
|
||||
}
|
||||
|
||||
//sort results by date
|
||||
usort($results, function($a, $b) {
|
||||
return $a['unixtimestamp'] <=> $b['unixtimestamp'];
|
||||
return $b['unixtimestamp'] <=> $a['unixtimestamp'];
|
||||
});
|
||||
|
||||
$this->set('results', $results);
|
||||
|
@ -4,6 +4,7 @@
|
||||
<tr>
|
||||
|
||||
<th>event</th>
|
||||
<th>Wann wars</th>
|
||||
<th>run</th>
|
||||
<th>rang</th>
|
||||
<th>stnr</th>
|
||||
@ -22,6 +23,7 @@
|
||||
<?php foreach($results as $res): ?>
|
||||
<tr>
|
||||
<td><?= $res['event'] ?></td>
|
||||
<td><?= $res['ago'] ?></td>
|
||||
<td><?= $res['run'] ?></td>
|
||||
<td><?= $res['rang'] ?></td>
|
||||
<td><?= $res['stnr'] ?></td>
|
||||
|
Reference in New Issue
Block a user