Téléverser les fichiers vers "index.php"
This commit is contained in:
commit
24f7d4f2f4
39
index.php/Index.php
Normal file
39
index.php/Index.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
include 'db.php';
|
||||
|
||||
$query = $pdo->query('SELECT * FROM livres');
|
||||
$livres = $query->fetchAll(PDO::FETCH_ASSOC);
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<title>Liste des livres</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Liste des livres</h1>
|
||||
<table border="1">
|
||||
<tr>
|
||||
<th>Titre</th>
|
||||
<th>Auteur</th>
|
||||
<th>ISBN</th>
|
||||
<th>Année</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
<?php foreach ($livres as $livre): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($livre['titre']) ?></td>
|
||||
<td><?= htmlspecialchars($livre['auteur']) ?></td>
|
||||
<td><?= htmlspecialchars($livre['isbn']) ?></td>
|
||||
<td><?= htmlspecialchars($livre['annee_publication']) ?></td>
|
||||
<td>
|
||||
<a href="details.php?id=<?= $livre['id'] ?>">Voir Détails</a> |
|
||||
<a href="modifier.php?id=<?= $livre['id'] ?>">Modifier</a> |
|
||||
<a href="supprimer.php?id=<?= $livre['id'] ?>" onclick="return confirm('Confirmer la suppression ?')">Supprimer</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<a href="ajouter.php">Ajouter un livre</a>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user