43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
|
require '../include/db.php';
|
|
require '../include/authenticator.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>
|
|
<link rel="stylesheet" href="../assets/board.css">
|
|
<body>
|
|
<header>
|
|
<h1>Tableau de bord</h1>
|
|
<div class="header-buttons">
|
|
<a href="add.php" class="btn">Ajouter un article</a>
|
|
<a href="logout.php" class="btn">Se déconnecter</a>
|
|
</div>
|
|
</header>
|
|
|
|
<main>
|
|
<table>
|
|
<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'] ?>" class="btn">Modifier</a>
|
|
<a href="delete.php?id=<?= $a['id'] ?>" class="btn">Supprimer</a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</table>
|
|
</main>
|
|
|
|
<footer>
|
|
<p>© <?= date('Y') ?> CMS. Tous droits réservés par Abd'R.</p>
|
|
</footer>
|
|
</body>
|
|
</html>
|
|
|