[add] count total per page

This commit is contained in:
Knah Tsaeb 2015-07-21 16:02:24 +02:00
parent 5563208160
commit 7fbdffa7d7
3 changed files with 13 additions and 9 deletions

View File

@ -12,6 +12,7 @@ function getAllBan($db, $sortBy = 'ban_date, ban_time', $order = 'DESC') {
return $allBan;
}
?>
<h2>All time banned</h2>
<div class='table'>
<div class='row'>
<a href="?page=allBans&amp;sortBy=service&amp;order=<?php echo $newOrder?>" class='cell-header'>Service</a>

View File

@ -12,8 +12,13 @@ function getCurrentBan($db, $sortBy = 'ban_date, ban_time', $order = 'DESC') {
}
//echo '<h3>Currently ',abs($currentlybanned),' ',$grammer,' banned.</h3>';
if (empty($sortBy)) {
$sortBy = 'ban_date';
}
$currentBan = getCurrentBan($db, $sortBy, $order);
$nbCurrentBan = count($currentBan);
?>
<h2>Currently Banned</h2>
<h2>Currently Banned (<?php echo $nbCurrentBan; ?>)</h2>
<div class='table'>
<div class='row'>
<div class='cell-header'>
@ -33,10 +38,6 @@ function getCurrentBan($db, $sortBy = 'ban_date, ban_time', $order = 'DESC') {
</div>
</div>
<?php
if (empty($sortBy)) {
$sortBy = 'ban_date';
}
$currentBan = getCurrentBan($db, $sortBy, $order);
foreach ($currentBan as $value) {
echo '<div class="row">
<div class="cell">', $value['service'], '</div>

View File

@ -9,7 +9,13 @@ function getLast24hBan($db, $sortBy = 'ban_date, ban_time', $order = 'DESC') {
}
return $lastBan;
}
if (empty($sortBy)) {
$sortBy = 'ban_date';
}
$getLast24hBan = getLast24hBan($db, $sortBy, $order);
$nbLast24hBan = count($getLast24hBan);
?>
<h2>Last 24h ban (<?php echo $nbLast24hBan; ?>)</h2>
<div class='table'>
<div class='cell-header'>
<a href="?page=lastBan&amp;sortBy=service&amp;order=<?php echo $newOrder?>">Service</a>
@ -27,10 +33,6 @@ function getLast24hBan($db, $sortBy = 'ban_date, ban_time', $order = 'DESC') {
<a href="?page=lastBan&amp;sortBy=country&amp;order=<?php echo $newOrder?>">Country</a>
</div>
<?php
if (empty($sortBy)) {
$sortBy = 'ban_date';
}
$getLast24hBan = getLast24hBan($db, $sortBy, $order);
foreach ($getLast24hBan as $value) {
echo '
<div class="row">