function getStation($id) { global $db; $q = mysqli_query($db, "SELECT * FROM `es_stations` WHERE `id` Like \"{$id}\" "); $o = mysqli_fetch_assoc($q); $o["address"] = getAdress($id); $o["prices"] = getPrices($id); return $o; }
} else { alert("error", "Vous n'avez pas le droit de modifier cet évènement!"); header("Location: " . getLink(["accueil"])); exit; } } //Traitement Dates $contents["values"]["date_debut"] = date('Y-m-d', strtotime($contents['values']['debut'])); $contents["values"]["beginning"] = date('H:i', strtotime($contents['values']['debut'])); $contents["values"]["date_fin"] = date('Y-m-d', strtotime($contents['values']['fin'])); $contents["values"]["end"] = date('H:i', strtotime($contents['values']['fin'])); if ($contents['values']['end'] == "OO:OO") { unset($contents['values']['end']); } //Get addresse $contents["values"]["adresse"] = getAdress($_GET['id'])[0]; // ===== VERIFICATION POST ===== //Formulaire soumis if (!empty($_POST)) { //Sécuriser POST foreach ($_POST as $cle => $valeur) { $_POST[$cle] = htmlspecialchars($valeur); } //Vérifier que l'on a les champs requis $requiredFields = ['titre', 'type', 'date_debut', 'date_fin', 'beginning', 'adresse', 'visibility', 'invitation']; foreach ($requiredFields as $field) { if (empty($_POST[$field]) && $_POST[$field] != "0") { $errors[$field] = 'Ce champ est requis'; } } $push = $_POST;
} } $participants = getParticipants($_GET['id']); $contents['participants'] = $participants; $i = 0; foreach ($contents['participants'] as $participant) { $participant_photo = getMembersPicture($participant['id']); if ($participant_photo) { $contents['participants'][$i]['picture'] = PHOTO_PROFIL . $participant_photo[0]; $i++; } else { $contents['participants'][$i]['picture'] = IMAGES . "photo_profil_defaut.jpg"; $i++; } } $adresse = getAdress($_GET['id']); $contents['adresse'] = $adresse; $contents['tarif'] = $event['tarif']; if ($event['max_participants']) { $contents['max_participants'] = $event['max_participants']; } else { $contents['max_participants'] = "Non renseigné"; } $contents['age_min'] = $event['age_min']; $contents['age_max'] = $event['age_max']; $contents['description'] = $event['description']; if ($event['site']) { $contents['site'] = $event['site']; } else { $contents['site'] = "Non renseigné"; }
<?php include '../../settings.php'; include '../../inc/login_functions.php'; include '../../inc/helper.php'; include 'functions.php'; $logedIn = access($mysqli); $userData = getUserData($mysqli, $_SESSION['userId']); $adress = getAdress($mysqli, $_SESSION['userId']); $updateEmail = updateEmail($mysqli, $_SESSION['userId']); $updateData = updateUserData($mysqli, $_SESSION['userId'], $userData['email']); $updatePassword = updatePassword($mysqli, $_SESSION['userId']); if ($updateData == 1 || $updatePassword == 1 || $updateEmail == 1) { header("Location: ../Account/account.php"); exit; } if ($updateData == 2 || $updatePassword == 2 || $updateEmail == 2) { header("Location: ../../404.php"); exit; } include "../../inc/head.php"; ?> <section id="Content" role="main"> <div class="container"> <!-- SECTION EMPHASIS 1 --> <!-- FULL WIDTH --> </div><!-- !container --> <div class="full-width section-emphasis-1 page-header"> <div class="container">