(feat): filter and direction dropdown

This commit is contained in:
boris
2024-12-03 20:05:15 +00:00
parent 214bfe20ac
commit f9d625e905
5 changed files with 183 additions and 44 deletions

View File

@@ -1,7 +1,7 @@
<div>
<div class="row mb-2">
<!-- Form for Pagination -->
<div id="paginationButtons" class="col-auto m-auto btn-group">
<form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']);?>" method="POST" id="paginatorButton" class="col-auto m-auto btn-group">
<!-- Start Button -->
<a class="btn btn-outline-primary" href="?page=0" <?= $view->pageNumber <= 0 ? 'disabled' : '' ?>><i class="bi bi-chevron-double-left"></i> Start</a>
<!-- Back Button -->
@@ -9,20 +9,19 @@
<!-- Dynamic Page Buttons -->
<?php
$totalPages = $view->paginator->getTotalPages();
var_dump($totalPages);
for ($i = $view->pageNumber - 2; $i <= $view->pageNumber + 2; $i++) {
if ($i >= 0 && $i < $totalPages): ?>
<a href="?page=<?= $i ?>"
<input name="paginatorButton" type="submit" value='<?= $i ?>'
class="btn <?= $i === $view->pageNumber ? 'btn-dark' : 'btn-outline-primary' ?>"
<?= $i === $view->pageNumber ? 'disabled' : '' ?>>
<?= $i + 1 ?>
</a>
</input>
<?php endif;
} ?>
<!-- Forward Button -->
<a class="btn btn-outline-primary" href="?page=<?=min($view->pageNumber + 1, $totalPages)?> " <?= $view->pageNumber >= $totalPages - 1 ? 'disabled' : '' ?>>Forward <i class="bi bi-chevron-right"></i></a>
<!-- End Button -->
<a class="btn btn-outline-primary" href="?page=<?= $totalPages - 1 ?>"<?= $view->pageNumber >= $totalPages - 1 ? 'disabled' : '' ?>>End <i class="bi bi-chevron-double-right"></i></a>
</div>
</form>
</div>
</div>