This commit is contained in:
No4m
2025-11-02 14:05:02 +01:00
parent 9187f41e17
commit f2b78086dd
13 changed files with 122 additions and 74 deletions

View File

@@ -1,29 +1,29 @@
<?php
global $pdo;
require '../include/db.php';
require '../include/authenticator.php';
require '../include/auth.php';
requireLogin();
$stmt = $pdo->query('SELECT * FROM articles ORDER BY date_creation DESC');
$articles = $stmt->fetchAll();
?>
<!DOCTYPE html>
<html lang="fr">
<head><meta charset="UTF-8"><title>Admin - Tableau de bord</title></head>
<body>
<h1>Tableau de bord</h1>
<a href="add.php">Ajouter un article</a> | <a href="logout.php">Se déconnecter</a>
<table border="1">
<tr><th>ID</th><th>Titre</th><th>Actions</th></tr>
<?php foreach ($articles as $a): ?>
<tr>
<td><?= $a['id'] ?></td>
<td><?= htmlspecialchars($a['titre']) ?></td>
<td>
<a href="modif.php?id=<?= $a['id'] ?>">Modifier</a> |
<a href="delete.php?id=<?= $a['id'] ?>">Supprimer</a>
</td>
</tr>
<?php endforeach; ?>
</table>
</body>
<body>
<h1>Tableau de bord</h1>
<a href="add.php">Ajouter un article</a> | <a href="logout.php">Se déconnecter</a>
<table border="1">
<tr><th>ID</th><th>Titre</th><th>Actions</th></tr>
<?php foreach ($articles as $a): ?>
<tr>
<td><?= $a['id'] ?></td>
<td><?= htmlspecialchars($a['titre']) ?></td>
<td>
<a href="modif.php?id=<?= $a['id'] ?>">Modifier</a> |
<a href="delete.php?id=<?= $a['id'] ?>">Supprimer</a>
</td>
</tr>
<?php endforeach; ?>
</table>
</body>
</html>