From f223f6b1e6896785774b726e2b42629c3a554f4c Mon Sep 17 00:00:00 2001 From: rubisalpha Date: Thu, 30 Oct 2025 11:45:09 +0000 Subject: [PATCH] Ajouter public/index.php --- public/index.php | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 public/index.php diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..8e9f9cc --- /dev/null +++ b/public/index.php @@ -0,0 +1,55 @@ +query('SELECT COUNT(*) FROM articles'); +$total = (int)$totalStmt->fetchColumn(); +$pages = max(1, ceil($total / $perPage)); +$stmt = $pdo->prepare('SELECT id, titre, contenu, date_creation FROM articles ORDER BY date_creation DESC LIMIT :lim OFFSET :off'); +$stmt->bindValue(':lim', $perPage, PDO::PARAM_INT); +$stmt->bindValue(':off', $offset, PDO::PARAM_INT); +$stmt->execute(); +$articles = $stmt->fetchAll(); +?> + + + + + CMS Simplifié - Accueil + + + +
+

CMS Simplifié

+ +
+
+

Articles

+ +

Aucun article publié.

+ + +
+

+

...

+ Publié le +
+
+ + + +
+ + +