-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.view.php
49 lines (46 loc) · 1.59 KB
/
index.view.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html lang="ees">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="main.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300&family=Oswald&display=swap" rel="stylesheet">
<title>Paginacion</title>
</head>
<body>
<div class="contenedor">
<h1>Articulos</h1>
<section class="articulos">
<ul>
<?php foreach ($articulos as $articulo): ?>
<li><?php echo $articulo['id']. '.-' . $articulo['articulo'] ?></li>
<?php endforeach?>
</ul>
</section>
<section class="paginacion">
<ul>
<?php if ($pagina == 1): ?>
<li class="disabled">«</li>
<?php else:?>
<li><a href="?pagina=<? echo $pagina - 1 ?>">«</a></li>
<?php endif;?>
<?php
for ($i=1; $i <= $numeroPagina; $i++){
if($pagina == $i){
echo "<li class='active'><a href='?pagina=$i'>$i</a></li>";
}else{
echo "<li><a href='?pagina=$i'>$i</a></li>";
}
}
?>
<?php if ($pagina == $numeroPagina): ?>
<li class="disabled">»</li>
<?php else:?>
<li><a href="?pagina=<? echo $pagina + 1 ?>">»</a></li>
<?php endif;?>
</ul>
</section>
</div>
</body>
</html>