Fix pagination nav (prev, next)

This commit is contained in:
Knah Tsaeb 2024-03-19 16:59:01 +01:00
parent 34b1e135c6
commit 347f243c58
3 changed files with 7 additions and 2 deletions

View file

@ -131,6 +131,7 @@ class Backend {
$inError = $conx->getInError(); $inError = $conx->getInError();
$inQueue = $this->getInQueue(); $inQueue = $this->getInQueue();
$start = $this->start; $start = $this->start;
$max = $this->max; $max = $this->max;
$next = $start + $max; $next = $start + $max;
$previous = $start - ($max); $previous = $start - ($max);
@ -141,7 +142,7 @@ class Backend {
} }
if ($previous < 0) { if ($previous < 0) {
$previous = 0; $previous = null;
} }
require __DIR__ . '/../../tpl/infos.php'; require __DIR__ . '/../../tpl/infos.php';

View file

@ -3,6 +3,6 @@ namespace App\Controllers;
class GenHmac { class GenHmac {
function index($params, $conf) { function index($params, $conf) {
echo hash_hmac('sha1', $params->url, $conf['key']); echo hash_hmac('sha1', $params->url, $conf->key);
} }
} }

View file

@ -54,8 +54,12 @@ use App\Utils\Domains;
<div class="w3-center w3-margin-top"> <div class="w3-center w3-margin-top">
<div class="w3-bar"> <div class="w3-bar">
<?php if($start > 0) : ?>
<a href="?page=infos&start=<?= $previous; ?>" class="w3-teal w3-button">&laquo; Previous</a> <a href="?page=infos&start=<?= $previous; ?>" class="w3-teal w3-button">&laquo; Previous</a>
<?php endif; ?>
<?php if($next != $start): ;?>
<a href="?page=infos&start=<?= $next; ?>" class="w3-teal w3-button">Next &raquo; </a> <a href="?page=infos&start=<?= $next; ?>" class="w3-teal w3-button">Next &raquo; </a>
<?php endif; ?>
</div> </div>
</div> </div>
</div> </div>