premier commit

This commit is contained in:
2025-11-01 19:50:25 +01:00
commit 296e6c2859
14 changed files with 91 additions and 0 deletions

BIN
.DS_Store vendored Executable file

Binary file not shown.

0
ajouter.php Executable file
View File

0
article.php Executable file
View File

0
css/style.css Executable file
View File

0
dashboard.php Executable file
View File

25
docker-compose.yaml Executable file
View File

@@ -0,0 +1,25 @@
version: '3.8'
services:
web:
image: php:8.2-apache
container_name: cms-web
ports:
- "8080:80"
volumes:
- ./public:/var/www/html
- ./includes:/var/www/html/includes
depends_on:
- db
db:
image: mysql:latest
container_name: cms-db
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: cms_simplifie
ports:
- "3306:3306"
volumes:
- db_data:/var/lib/mysql

16
includes/db.php Executable file
View File

@@ -0,0 +1,16 @@
<?php
$host = 'db';
$dbname = 'cms_simplifie';
$user = 'root';
$pass = 'root';
try {
$pdo = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8", $user, $pass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
die("Erreur de connexion : " . $e->getMessage());
}
?>

0
includes/footer.php Executable file
View File

0
includes/header.php Executable file
View File

40
index.php Executable file
View File

@@ -0,0 +1,40 @@
<?php
require_once 'includes/db.php';
echo "Connexion réussie à la base de données !";
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CMS - Accueil</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<h1>Bienvenue sur mon CMS</h1>
<nav>
<a href="index.html">Accueil</a>
<a href="add.html">Ajouter un article</a>
<a href="login.html">Connexion</a>
</nav>
</header>
<main>
<section class="articles">
<article>
<h2>Article 1</h2>
<p>Ceci est un exemple d'article pour tester le CMS.</p>
</article>
<article>
<h2>Article 2</h2>
<p>Encore un autre article de test avec du contenu fictif.</p>
</article>
</section>
</main>
<footer>
<p>&copy; 2025 Mini CMS. Tous droits réservés.</p>
</footer>
</body>
</html>

0
login.php Executable file
View File

0
modifier.php Executable file
View File

0
supprimer.php Executable file
View File

10
test.php Normal file
View File

@@ -0,0 +1,10 @@
<?php
require_once 'config.php';
$stmt = $pdo->query("SELECT * FROM utilisateur");
$users = $stmt->fetchAll(PDO::FETCH_ASSOC);
echo '<pre>';
print_r($users);
echo '</pre>';
?>