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 50 51 52 53
|
<?php include ('config.php');?>
<?php
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$page_offset = ($page - 1) * 5;
$total ='';
$pagination ='';
$total_element = $bdd->query("SELECT * from engins");
$total = $total_element->rowCount(); /* or die (print_r($total_element->errorInfo())) */
$pagination = $total/5;
$req=$bdd->query("select * from engins ORDER BY idE DESC LIMIT $page_offset, 5 ") or die(print_r($bdd->errorInfo()));
while($donnees = $req->fetch())
{
echo'<table border="1px"; width:800px; height:500px; color="#999";>
<tr>
<td>
<a href="operation.php?id='.$donnees['idE'].'"> <img src="../'.$donnees['photo1'].'"style=" width:220px; height:150px; color="#0000"; alt="Image engin" /></a>
<!-- <img src="img/ria.jpg" class="img-responsive img-rounded" alt="image 1"/> -->
</td>
<td class="description">
<a href="operation.php?id='.$donnees['idE'].'">
Numero: '.$donnees['idE'].'</br>Marque: '.$donnees['marque'].'</br>Model: '.$donnees['model'].'</br>Caractéristiques: '.$donnees['caracteristiques'].'</br>Prix: ' .$donnees['prix'].'</br>Année: '.$donnees['annee'].'</br>Lettre: '.$donnees['lettre'].'
</a>
</td>
<!-- Cetait <img src="images/photos donnees[photo1]"style=" width:220px; height:150px; color="#0000"; /> -->
</tr>
</table>';
echo '<a href="operation.php?id='.$donnees['idE'].'"> Reserver </a> ';
echo '<a href="details.php?id='.$donnees['idE'].'"> Détails </a>';
}
$req->closeCursor();
echo'</br>';
echo '<center><p align="center">Page : </center>'; //Pour l'affichage, on centre la liste des pages
for($i=1; $i<=$pagination; $i++) //On fait notre boucle
{
if($i==$page) //Si il s'agit de la page actuelle...
{
echo ' [ '.$i.' ] ';
}
else //Sinon...
{
echo ' <a href="index.php?page='.$i.'">'.$i.'</a> ';
}
}
echo '</p>';
?> |
Partager