first commit

This commit is contained in:
2025-11-02 18:08:53 +01:00
commit cb045fb9e1
23 changed files with 1363 additions and 0 deletions

42
index.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
require 'include/db.php';
$stmt = $pdo->query('SELECT * FROM articles ORDER BY date_creation DESC LIMIT 10');
$articles = $stmt->fetchAll();
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Accueil - CMS</title>
<link rel="stylesheet" href="assets/style.css">
</head>
<body>
<header>
<nav>
<a href="index.php">Accueil</a> |
<a href="admin/login.php">Administratreur</a>
</nav>
</header>
<main>
<h1>Articles</h1>
<?php if (empty($articles)): ?>
<p>Aucun Article pour le moment</p>
<?php endif; ?>
<?php foreach ($articles as $a): ?>
<article>
<h2><a href="article.php?id=<?= $a['id'] ?>"><?= htmlspecialchars($a['titre']) ?></a></h2>
<small>Publié le <?= date('d/m/Y', strtotime($a['date_creation'])) ?></small>
<p><?= substr(htmlspecialchars($a['contenu']), 0, 200) ?>...</p>
<p><a href="article.php?id=<?= $a['id'] ?>">Lire la suite...</a></p>
</article>
<?php endforeach; ?>
</main>
<footer>
<p>&copy; <?= date('Y') ?> CMS. Tous droits réservés par Abd'R.</p>
</footer>
</body>
</html>