Correction d'un bug

This commit is contained in:
stiti 2024-05-20 20:26:00 +02:00
parent dc14c38fb1
commit cf3d63d747
2 changed files with 12 additions and 11 deletions

View File

@ -1,4 +1,3 @@
<!-- application/views/albums_list.php -->
<!DOCTYPE html>
<html lang="fr">
<head>
@ -26,16 +25,17 @@
<div class="pagination">
<?php if ($current_page > 1): ?>
<a href="<?php echo base_url('index.php/albums/index/'.($current_page-1)); ?>">Précédent</a>
<a class="fleche" href="<?php echo base_url('index.php/albums/index/'.($current_page-1)); ?>"><</a>
<?php endif; ?>
<?php for ($i = 1; $i <= $total_pages; $i++): ?>
<?php for ($i = max(1, $current_page - 2); $i <= min($total_pages, $current_page + 2); $i++): ?>
<a href="<?php echo base_url('index.php/albums/index/'.$i); ?>" <?php echo ($i == $current_page) ? 'class="active"' : ''; ?>><?php echo $i; ?></a>
<?php endfor; ?>
<?php if ($current_page < $total_pages): ?>
<a href="<?php echo base_url('index.php/albums/index/'.($current_page+1)); ?>">Suivant</a>
<a class="fleche" href="<?php echo base_url('index.php/albums/index/'.($current_page+1)); ?>">></a>
<?php endif; ?>
</div>
</div>
</body>
</html>

View File

@ -109,3 +109,4 @@ header.short-text a {
.pagination .active {
background-color: #29043e;
}