correction ex2
This commit is contained in:
parent
cf7a51459c
commit
09e55a2b28
@@ -1,32 +1,64 @@
|
||||
<!--
|
||||
Variables de la vue
|
||||
$films : les films de la page
|
||||
<!--
|
||||
Variables de la vue
|
||||
$films : les films de la page
|
||||
-->
|
||||
|
||||
<h2>Films</h2>
|
||||
<?php if (!empty($errorMessage)) { ?>
|
||||
<article><?php echo htmlspecialchars($errorMessage, ENT_QUOTES, 'UTF-8'); ?></article>
|
||||
<?php } ?>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Titre</th>
|
||||
<th>Année</th>
|
||||
<th>Genre</th>
|
||||
<th>Réalisateur</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Titre</th>
|
||||
<th>Année</th>
|
||||
<th>Genre</th>
|
||||
<th>Réalisateur</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach($films as $film){
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
<td><a href='#'>{$film['titre']}</a></td>
|
||||
<td>{$film['annee']}</td>
|
||||
<td>{$film['genre']}</td>
|
||||
<td>{$film['prenom']} {$film['nom']}</td>
|
||||
</tr>";
|
||||
foreach ($films as $film) {
|
||||
$titre = htmlspecialchars($film['titre'], ENT_QUOTES, 'UTF-8');
|
||||
$annee = htmlspecialchars((string) $film['annee'], ENT_QUOTES, 'UTF-8');
|
||||
$genre = htmlspecialchars($film['genre'], ENT_QUOTES, 'UTF-8');
|
||||
$realisateur = htmlspecialchars($film['prenom'] . ' ' . $film['nom'], ENT_QUOTES, 'UTF-8');
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
<td><a href='#'>{$titre}</a></td>
|
||||
<td>{$annee}</td>
|
||||
<td>{$genre}</td>
|
||||
<td>{$realisateur}</td>
|
||||
</tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php if ($totalPages > 1) { ?>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<?php if ($currentPage > 1) { ?>
|
||||
<a href="?page=<?php echo $currentPage - 1; ?>">Précédent</a>
|
||||
<?php } else { ?>
|
||||
<span>Précédent</span>
|
||||
<?php } ?>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>Page <?php echo $currentPage; ?> / <?php echo $totalPages; ?></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>
|
||||
<?php if ($currentPage < $totalPages) { ?>
|
||||
<a href="?page=<?php echo $currentPage + 1; ?>">Suivant</a>
|
||||
<?php } else { ?>
|
||||
<span>Suivant</span>
|
||||
<?php } ?>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user