quelque amelioration

This commit is contained in:
2025-11-02 23:20:42 +01:00
parent 26c06eae90
commit 296b5c5a62
19 changed files with 461 additions and 328 deletions

View File

@@ -1,8 +1,8 @@
<?php
require '../include/db.php';
require '../include/auth.php';
require '../include/db.php';
requireLogin();
@@ -61,7 +61,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</label><br>
<button type="submit">Publier de la publication</button>
<a href="board.php">Annuler de l'anulation</a>
<a href="dashboard.php">Annuler de l'anulation</a>
</form>
</body>

View File

@@ -1,6 +1,6 @@
<?php
require '../include/db.php';
require '../include/auth.php';
require '../include/db.php';
requireLogin();
$stmt = $pdo->query('SELECT * FROM articles ORDER BY date_creation DESC');
$articles = $stmt->fetchAll();
@@ -23,7 +23,7 @@ $articles = $stmt->fetchAll();
echo htmlspecialchars($_SESSION['user_login'] ?? 'Invité');
?>
<!-- retourne a la page de deconnexion -->
| <a href="deconnexion.php">Se déconnecter</a>
| <a href="logout.php">Se déconnecter</a>
</p>
</header>
@@ -55,7 +55,7 @@ $articles = $stmt->fetchAll();
<td><?php echo htmlspecialchars($article['titre']); ?></td>
<td><?php echo $article['date_creation']; ?></td>
<td>
<a href="modification.php?id=<?php echo $article['id']; ?>">Modifier</a>
<a href="modifier.php?id=<?php echo $article['id']; ?>">Modifier</a>
|
<a href="supprimer.php?id=<?php echo $article['id']; ?>">Supprimer</a>
</td>

View File

@@ -2,33 +2,39 @@
require '../include/db.php';
require '../include/auth.php';
// Traite le formulaire de connexion : redirige si identifiants corrects, sinon affiche une erreur
$error = '';
f ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (checikLogin($pdo, $_POST['login'], $_POST['password'])) {
header('Location: board.php');
exit;
} else {
$error = 'Identifiants incorrects';
}
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$login = isset($_POST['login']) ? $_POST['login'] : '';
$password = isset($_POST['password']) ? $_POST['password'] : '';
if (checkLogin($pdo, $login, $password)) {
header('Location: board.php');
exit;
} else {
$error = 'Identifiants incorrects';
}
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8"><title>Connexion</title>
<link rel="stylesheet" href="styleco.css">
<meta charset="UTF-8">
<title>Connexion</title>
<link rel="stylesheet" href="stylelog.css">
</head>
<body>
<h1>Connexion</h1>
<form method="post">
<input type="text" name="login" placeholder="Login" required><br>
<input type="password" name="password" placeholder="Mot de passe" required><br>
<button type="submit">Se connecter</button>
</form>
<p style="color:red;"><?= $error ?></p>
<?php if ($error): ?>
<p style="color:red;"><?= htmlspecialchars($error) ?></p>
<?php endif; ?>
</body>
</html>

View File

@@ -3,8 +3,8 @@
global $pdo;
require '../include/db.php';
require '../include/auth.php';
require '../include/db.php';
requireLogin();
@@ -12,7 +12,7 @@ $id = isset($_GET['id']) ? (int)$_GET['id'] : 0;
// Id est pas valide on retourne au tableau
if ($id <= 0) {
header('Location: board.php');
header('Location: dashboard.php');
exit;
}
@@ -23,7 +23,7 @@ $article = $stmt->fetch();
// Article est pas valide on retourne au tableau
if (!$article) {
header('Location: board.php');
header('Location: dashboard.php');
exit;
}
@@ -50,7 +50,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
]);
header('Location: board.php');
header('Location: dashboard.php');
exit;
}
}
@@ -81,7 +81,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<textarea name="contenu" rows="10" required><?= htmlspecialchars($contenu) ?></textarea>
</label><br>
<button type="submit">Enregistrer</button>
<a href="board.php">Annuler</a>
<a href="dashboard.php">Annuler</a>
</form>
</body>

View File

@@ -1,83 +1,89 @@
/* Styles globaux */
body {
font-family: Arial, sans-serif;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
margin: 0;
padding: 20px;
background-color: #f4f4f9;
background: linear-gradient(to right, #f4f4f9, #e2e8f0); /* léger dégradé */
color: #333;
}
/* Titres */
h1 {
color: #1e3d59;
border-bottom: 2px solid #aac4e0;
padding-bottom: 10px;
color: #1a202c;
border-bottom: 3px solid #63b3ed;
padding-bottom: 12px;
margin-top: 0;
font-weight: 600;
}
/* Formulaire */
form {
background-color: #fff;
padding: 20px;
border: 1px solid #d0dbe5;
border-radius: 6px;
padding: 25px;
border-radius: 10px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
max-width: 600px;
margin-top: 20px;
}
/* Labels et champs */
label {
display: block;
margin-bottom: 15px;
font-weight: bold;
margin-bottom: 10px;
font-weight: 600;
}
input[type="text"],
input[type="password"],
textarea {
width: 100%;
padding: 8px;
border: 1px solid #bfc9d6;
border-radius: 4px;
padding: 10px;
border: 1px solid #cbd5e0;
border-radius: 6px;
box-sizing: border-box;
}
button {
background-color: #2a73cc;
color: #fff;
padding: 10px 15px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 1rem;
}
button:hover {
background-color: #195aa7;
/* Boutons */
button {
background-color: #3182ce;
color: #fff;
padding: 12px 20px;
border: none;
border-radius: 6px;
cursor: pointer;
font-size: 1rem;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #2b6cb0;
}
/* Liens */
a {
margin-left: 10px;
color: #2a73cc;
color: #3182ce;
text-decoration: none;
font-weight: 500;
}
a:hover {
text-decoration: underline;
}
/* Messages d'erreur */
.error {
color: #721c24;
background-color: #f8d7da;
border: 1px solid #f5c6cb;
color: #c53030;
background-color: #fed7d7;
border: 1px solid #f56565;
padding: 10px;
border-radius: 5px;
border-radius: 6px;
margin-bottom: 15px;
}
/* Responsive */
@media (max-width: 640px) {
body {
padding: 10px;
@@ -85,4 +91,4 @@ a:hover {
form {
padding: 15px;
}
}
}

View File

@@ -1,97 +1,116 @@
/* Styles globaux */
body {
font-family: Arial, sans-serif;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
margin: 0;
padding: 20px;
background-color: #ececec; /* gris clair pour le fond */
background: linear-gradient(to right, #f0f2f5, #e2e8f0);
color: #333;
}
/* En-tête */
header {
background-color: #555; /* gris foncé */
background-color: #2d3748; /* gris foncé plus doux */
color: #fff;
padding: 15px;
border-radius: 6px;
margin-bottom: 20px;
padding: 20px;
border-radius: 10px;
text-align: center;
margin-bottom: 25px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
header h1 {
margin: 0;
font-size: 1.8rem;
font-size: 2rem;
font-weight: 600;
}
header p {
margin: 5px 0 0 0;
margin: 8px 0 0 0;
}
header a {
color: #cfcfcf;
color: #a0aec0;
text-decoration: none;
font-weight: 500;
}
header a:hover {
text-decoration: underline;
color: #fff;
text-decoration: underline;
}
/* Titres */
h2, h3 {
color: #333;
margin-top: 20px;
color: #1a202c;
margin-top: 25px;
font-weight: 600;
}
/* Lien Ajouter un article */
a {
color: #555;
color: #3182ce;
text-decoration: none;
font-weight: bold;
font-weight: 500;
}
a:hover {
text-decoration: underline;
}
/* Permet de cree des tableau */
/* Tableau */
table {
width: 100%;
border-collapse: collapse;
margin-top: 15px;
background-color: #fff; /* fond blanc pour contraster */
border-radius: 6px;
margin-top: 20px;
background-color: #fff;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
table th, table td {
padding: 10px;
border: 1px solid #ccc;
padding: 12px;
border: 1px solid #e2e8f0;
text-align: left;
font-size: 0.95rem;
}
table th {
background-color: #bbb; /* gris moyen pour l'entête */
background-color: #4a5568; /* gris foncé pour header */
color: #fff;
font-weight: 600;
}
/* Lignes de tableau */
/* Lignes alternées */
table tr:nth-child(even) {
background-color: #f2f2f2;
background-color: #f7fafc;
}
/* Actions */
table a {
color: #2a73cc;
color: #3182ce;
font-weight: 500;
}
table a:hover {
color: #195aa7;
color: #2b6cb0;
text-decoration: underline;
}
/* Séparateurs */
hr {
border: 0;
border-top: 1px solid #ccc;
margin: 20px 0;
}
border-top: 1px solid #cbd5e0;
margin: 25px 0;
}
/* Responsive */
@media (max-width: 640px) {
body {
padding: 10px;
}
table th, table td {
padding: 8px;
}
}

View File

@@ -1,67 +1,83 @@
/* Styles globaux */
body {
font-family: Arial, sans-serif;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
margin: 0;
padding: 20px;
background-color: #f4f4f9; /* fond clair */
background: linear-gradient(to right, #f0f2f5, #e2e8f0);
color: #333;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
/* Container centré */
form {
background-color: #fff;
padding: 30px 25px;
border-radius: 12px;
box-shadow: 0 6px 20px rgba(0,0,0,0.1);
width: 100%;
max-width: 400px;
box-sizing: border-box;
}
/* Titres */
h1 {
color: #1e3d59; /* bleu foncé */
border-bottom: 2px solid #aac4e0;
padding-bottom: 10px;
margin-top: 0;
}
/* Formulaire */
form {
background: #fff;
padding: 20px;
border-radius: 6px;
border: 1px solid #d0dbe5;
max-width: 600px;
margin-top: 20px;
color: #1a202c;
border-bottom: 3px solid #63b3ed;
padding-bottom: 12px;
margin-bottom: 20px;
font-weight: 600;
text-align: center;
}
/* Labels et inputs */
label {
display: block;
margin-bottom: 15px;
font-weight: bold;
margin-bottom: 8px;
font-weight: 600;
}
input[type="text"],
textarea {
input[type="password"] {
width: 100%;
padding: 8px;
border: 1px solid #bfc9d6;
border-radius: 4px;
padding: 10px;
border: 1px solid #cbd5e0;
border-radius: 6px;
box-sizing: border-box;
font-size: 1rem;
margin-bottom: 15px;
}
/* Bouton */
button {
background-color: #2a73cc;
width: 100%;
background-color: #3182ce;
color: #fff;
padding: 10px 15px;
padding: 12px;
border: none;
border-radius: 4px;
border-radius: 6px;
cursor: pointer;
font-size: 1rem;
font-weight: 600;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #195aa7;
background-color: #2b6cb0;
}
/* Lien annuler */
/* Lien annuler / autres liens */
a {
margin-left: 10px;
color: #2a73cc;
display: inline-block;
margin-top: 10px;
color: #3182ce;
text-decoration: none;
font-weight: 500;
text-align: center;
width: 100%;
}
a:hover {
@@ -70,20 +86,22 @@ a:hover {
/* Messages d'erreur */
.error {
color: #721c24;
background: #f8d7da;
border: 1px solid #f5c6cb;
color: #c53030;
background-color: #fed7d7;
border: 1px solid #f56565;
padding: 10px;
border-radius: 5px;
border-radius: 6px;
margin-bottom: 15px;
text-align: center;
}
/* Responsive */
@media (max-width: 640px) {
@media (max-width: 480px) {
body {
padding: 10px;
}
form {
padding: 15px;
padding: 20px;
}
}
}

View File

@@ -1,35 +1,42 @@
/* Styles globaux */
body {
font-family: Arial, sans-serif;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
margin: 0;
padding: 20px;
background-color: #ececec; /* gris clair */
background: linear-gradient(to right, #f0f2f5, #e2e8f0);
color: #333;
display: flex;
justify-content: center;
align-items: flex-start;
min-height: 100vh;
}
/* Header */
header {
background-color: #555; /* gris foncé */
background-color: #2d3748; /* gris foncé plus doux */
color: #fff;
padding: 15px;
border-radius: 6px;
padding: 20px;
border-radius: 10px;
text-align: center;
margin-bottom: 20px;
margin-bottom: 25px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
header h1 {
margin: 0;
font-size: 1.8rem;
font-size: 2rem;
font-weight: 600;
}
header p {
margin: 5px 0 0 0;
margin: 8px 0 0 0;
}
header a {
color: #cfcfcf;
color: #a0aec0;
text-decoration: none;
font-weight: 500;
}
header a:hover {
@@ -39,54 +46,68 @@ header a:hover {
/* Titres */
h1, h2, h3 {
color: #333;
margin-top: 20px;
color: #1a202c;
margin-top: 25px;
font-weight: 600;
text-align: center;
}
/* Formulaire de modification */
form {
background-color: #fff;
padding: 20px;
border: 1px solid #ccc;
border-radius: 6px;
max-width: 600px;
padding: 30px 25px;
border-radius: 12px;
box-shadow: 0 6px 20px rgba(0,0,0,0.1);
max-width: 500px;
width: 100%;
box-sizing: border-box;
margin-top: 20px;
}
/* Labels et inputs */
label {
display: block;
margin-bottom: 15px;
font-weight: bold;
margin-bottom: 8px;
font-weight: 600;
}
input[type="text"],
textarea {
width: 100%;
padding: 8px;
border: 1px solid #bfc9d6;
border-radius: 4px;
padding: 10px;
border: 1px solid #cbd5e0;
border-radius: 6px;
box-sizing: border-box;
font-size: 1rem;
margin-bottom: 15px;
}
/* Boutons */
button {
background-color: #555; /* gris foncé uniforme */
width: 100%;
background-color: #3182ce;
color: #fff;
padding: 10px 15px;
padding: 12px;
border: none;
border-radius: 4px;
border-radius: 6px;
cursor: pointer;
font-size: 1rem;
font-weight: 600;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #333;
background-color: #2b6cb0;
}
/* Liens annuler */
a {
color: #555;
display: block;
text-align: center;
margin-top: 15px;
color: #3182ce;
text-decoration: none;
margin-left: 10px;
font-weight: 500;
}
a:hover {
@@ -95,19 +116,29 @@ a:hover {
/* Messages d'erreur */
.error {
color: #721c24;
background-color: #f8d7da;
border: 1px solid #f5c6cb;
color: #c53030;
background-color: #fed7d7;
border: 1px solid #f56565;
padding: 10px;
border-radius: 5px;
border-radius: 6px;
margin-bottom: 15px;
text-align: center;
}
/* Séparateurs */
hr {
border: 0;
border-top: 1px solid #ccc;
margin: 20px 0;
border-top: 1px solid #cbd5e0;
margin: 25px 0;
}
/* Responsive */
@media (max-width: 480px) {
body {
padding: 10px;
}
form {
padding: 20px;
}
}
Propulsé par Gitea
Version: 1.

View File

@@ -1,35 +1,42 @@
/* Styles globaux */
body {
font-family: Arial, sans-serif;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
margin: 0;
padding: 20px;
background-color: #ececec; /* gris clair */
background: linear-gradient(to right, #f0f2f5, #e2e8f0);
color: #333;
display: flex;
justify-content: center;
align-items: flex-start;
min-height: 100vh;
}
/* Header */
header {
background-color: #555; /* gris foncé */
background-color: #2d3748; /* gris foncé doux */
color: #fff;
padding: 15px;
border-radius: 6px;
padding: 20px;
border-radius: 10px;
text-align: center;
margin-bottom: 20px;
margin-bottom: 25px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
header h1 {
margin: 0;
font-size: 1.8rem;
font-size: 2rem;
font-weight: 600;
}
header p {
margin: 5px 0 0 0;
margin: 8px 0 0 0;
}
header a {
color: #cfcfcf;
color: #a0aec0;
text-decoration: none;
font-weight: 500;
}
header a:hover {
@@ -39,53 +46,47 @@ header a:hover {
/* Titres */
h1, h2, h3 {
color: #333;
margin-top: 20px;
color: #1a202c;
margin-top: 25px;
font-weight: 600;
text-align: center;
}
/* Formulaire de modification */
/* Formulaire de confirmation de suppression */
form {
background-color: #fff;
padding: 20px;
border: 1px solid #ccc;
border-radius: 6px;
max-width: 600px;
margin-top: 20px;
}
label {
display: block;
margin-bottom: 15px;
font-weight: bold;
}
input[type="text"],
textarea {
padding: 30px 25px;
border-radius: 12px;
box-shadow: 0 6px 20px rgba(0,0,0,0.1);
max-width: 400px;
width: 100%;
padding: 8px;
border: 1px solid #bfc9d6;
border-radius: 4px;
box-sizing: border-box;
margin-top: 20px;
text-align: center;
}
/* Boutons */
button {
background-color: #555; /* gris foncé uniforme */
background-color: #e53e3e; /* rouge pour danger */
color: #fff;
padding: 10px 15px;
padding: 12px 20px;
border: none;
border-radius: 4px;
border-radius: 6px;
cursor: pointer;
font-size: 1rem;
font-weight: 600;
margin: 0 10px;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #333;
background-color: #c53030;
}
/* Liens annuler */
a {
color: #555;
display: inline-block;
text-decoration: none;
color: #3182ce;
font-weight: 500;
margin-left: 10px;
}
@@ -95,17 +96,34 @@ a:hover {
/* Messages d'erreur */
.error {
color: #721c24;
background-color: #f8d7da;
border: 1px solid #f5c6cb;
color: #c53030;
background-color: #fed7d7;
border: 1px solid #f56565;
padding: 10px;
border-radius: 5px;
border-radius: 6px;
margin-bottom: 15px;
text-align: center;
}
/* Séparateurs */
hr {
border: 0;
border-top: 1px solid #ccc;
margin: 20px 0;
border-top: 1px solid #cbd5e0;
margin: 25px 0;
}
/* Responsive */
@media (max-width: 480px) {
body {
padding: 10px;
}
form {
padding: 20px;
}
button {
width: 100%;
margin: 10px 0;
}
}

View File

@@ -57,7 +57,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
<form method="post">
<button type="submit" name="confirm" value="yes">Oui</button>
<a href="board.php">Annuler</a>
<a href="dashboard.php">Annuler</a>
</form>
</body>