pagination

This commit is contained in:
Jenkings
2024-07-22 10:56:03 +00:00
parent ac3ce7bca4
commit 52c3de418b
2 changed files with 45 additions and 6 deletions

View File

@@ -13,6 +13,8 @@ $menu = new Menu($db);
$article->id = 0;
$numPages = $article->getPagesCount();
$result = $article->getArticles();
include('template/header.php');
@@ -46,4 +48,20 @@ include('template/header.php');
<?php } ?>
</div>
</div>
<div class="pagination">
<ul>
<?php
$curpage = (isset($_GET['page']) ? $_GET['page'] : 1);
/* pagination */
for($p = 1; $p <= $numPages;$p++){
echo " <li><a href='.?page=".$p."' class='" . ($p == $curpage ? "selectedPage" : "") . "'>" . $p . "</a></li>";
}
?>
</ul>
</div>
<?php include('template/footer.php');?>