aurweb/web/template/tu_last_votes_list.php
Lukas Fleischer 4b8b2e3eb1 Stop using each()
The each() function has been deprecated as of PHP 7.2.0. Use foreach
loops instead.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2018-05-12 13:35:11 +02:00

36 lines
781 B
PHP

<div class="box">
<h2><?= __("Last Votes by TU") ?></h2>
<table class="results">
<thead>
<tr>
<th><?= __("User") ?></th>
<th><?= __("Last vote") ?></th>
</tr>
</thead>
<tbody>
<?php if (empty($result)): ?>
<tr><td align="center" colspan="0"><?= __("No results found.") ?></td></tr>
<?php else: foreach ($result as $indx => $row):
if ($indx % 2):
$c = "even";
else:
$c = "odd";
endif;
$username = username_from_id($row["UserID"]);
?>
<tr class="<?= $c ?>">
<td>
<?= html_format_username($username) ?>
</td>
<td>
<a href="<?= get_uri('/tu/'); ?>?id=<?= $row['LastVote'] ?>"><?= intval($row["LastVote"]) ?></a>
</td>
</tr>
<?php
endforeach;
endif;
?>
</tbody>
</table>
</div>