quest-rando

This commit is contained in:
Michel Tuboeuf 2024-11-24 11:31:15 +01:00
parent 7be734b080
commit 8f950eb850
3 changed files with 200 additions and 0 deletions

57
style-form.css Normal file
View File

@ -0,0 +1,57 @@
body {
font-family: Georgia, 'Times New Roman', Times, serif;
font-size: 11pt;
background-color: #f4f4f4;
color: #333;
background-image: url(../quest-rando/images/ciel-overlay2.jpg); */
background-attachment: fixed;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
h1 {
color: #090090;
}
h2 {
color: #090090;
}
h3 {
color: #090090;
}
form {
background: #fff;
padding: 2% 3%;
margin-bottom: 20px;
box-shadow: 0 2px 4px grey;
border-radius: 5px;
max-width: 800px;
width: 100%;
}
input[type="text"],
textarea {
font-size: 11pt;
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
background: #3498db;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background: #2980b9;
}

115
style.css Normal file
View File

@ -0,0 +1,115 @@
/* Conteneur principal pour éviter les styles flex globaux */
.main-container {
width: 100%;
max-width: 900px;
margin: 0 auto;
padding: 20px;
}
/* Bouton retour aligné à droite */
.btn-retour {
float: right; margin: 10px; /* Aligne le contenu à droite */
margin-bottom: 20px;
}
.btn-retour a img {
display: inline-block; /* Assure que l'image reste au format bouton */
}
body {
font-family: Georgia, 'Times New Roman', Times, serif;
font-size: 11pt;
background-color: #f4f4f4;
color: #333;
background-image: url(../quest-rando/images/ciel-overlay2.jpg);
background-attachment: fixed;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
h1 {
color: #090090;
}
h2 {
color: #090090;
}
h3 {
color: #090090;
}
form {
background: #fff;
padding: 15px;
margin-bottom: 20px;
box-shadow: 0 2px 4px grey;
border-radius: 5px;
max-width: 900px;
width: 100%;
}
input[type="text"],
textarea {
font-size: 11pt;
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
background: #3498db;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background: #2980b9;
}
.annonce {
background: #fff;
padding: 10px;
margin-bottom: 10px;
box-shadow: 0 2px 4px grey;
border-radius: 5px;
max-width: 900px;
width: 100%;
}
.annonce small {
color: #888;
}
/* Bouton haut page */
/* Effet fluide */
/* Style du bouton */
#scrollToTop {
position: fixed;
bottom: 20px;
right: 170px; /*Position*/
padding: 10px 15px;
font-size: 16px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
opacity: 0;
visibility: hidden;
transition:
opacity 0.3s,
visibility 0.3s;
}
/* Afficher le bouton lorsqu'on est en bas de page */
#scrollToTop.show {
opacity: 1;
visibility: visible;
}

28
traitement.php Normal file
View File

@ -0,0 +1,28 @@
<?php
include 'annonces.php';
session_start();
// Vérifiez si le CAPTCHA est correct
if (!isset($_POST['captcha']) || $_POST['captcha'] != ($_SESSION['captcha_num1'] + $_SESSION['captcha_num2'])) {
// Redirigez vers le formulaire avec une erreur
header('Location: formulaire.php?captcha_error=1');
exit();
}
if ($_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST['title'])) {
// $nombre = isset($_POST['not_present']) ? 0 : ($_POST['nombre'] ?? 0);
$nombre = isset($_POST['nombre']) ? intval($_POST['nombre']) : null;
$description = $_POST['description'] ?? '';
$transportOption = $nombre > 0 ? ($_POST['transport_option'] ?? '') : '';
if ($nombre > 0 && empty($transportOption)) {
echo "<p style='color:red;'>Veuillez sélectionner une option de transport.</p>";
} else {
addAnnonce($_POST['title'], $nombre, $description, $transportOption);
// Rediriger vers la page de la liste des participants
header("Location: liste.php");
exit;
}
}