function gestionEvent() { require './Modele/evenements.php'; $evenement_id = $_POST['id']; if (isset($_POST['SUPPR'])) { suppressioneventBD($db, $evenement_id); } else { $evenement_titre = htmlspecialchars($_POST['titre']); $evenement_description = htmlspecialchars($_POST['description']); $evenement_theme_id = htmlspecialchars($_POST['themeId']); $evenement_date_debut = htmlspecialchars(formattageDate($_POST['dateDebut'], "bdd")); $evenement_heure_debut = htmlspecialchars($_POST['heureDebut']); $evenement_date_fin = htmlspecialchars(formattageDate($_POST['dateFin'], "bdd")); $evenement_heure_fin = htmlspecialchars($_POST['heureFin']); $evenement_max_participants = htmlspecialchars($_POST['max']); $evenement_type_public = htmlspecialchars($_POST['public']); $evenement_site_web = htmlspecialchars($_POST['web']); $evenement_tarif = htmlspecialchars($_POST['tarif']); $adresse_numero_voie = htmlspecialchars($_POST['voie']); $adresse_ville = htmlspecialchars($_POST['ville']); $adresse_code_postal = htmlspecialchars($_POST['codepostal']); $adresse_pays = htmlspecialchars($_POST['pays']); if (isset($_POST['ADD'])) { $adresse_id = insertionAdresseBD($db, $adresse_numero_voie, $adresse_ville, $adresse_code_postal, $adresse_pays); insertionEventBD($db, $evenement_titre, $evenement_description, $_SESSION["userID"], $evenement_theme_id, $evenement_date_debut, $evenement_heure_debut, $evenement_date_fin, $evenement_heure_fin, $evenement_max_participants, $evenement_type_public, $evenement_site_web, $evenement_tarif, $adresse_id); } else { if (isset($_POST['MOD'])) { modificationeventBD($db, $evenement_id, $evenement_titre, $evenement_description, $_SESSION["userID"], $evenement_theme_id, $evenement_date_debut, $evenement_heure_debut, $evenement_date_fin, $evenement_heure_fin, $evenement_max_participants, $evenement_type_public, $evenement_site_web, $evenement_tarif); $adresse_id = adresseByEventBD($db, $evenement_id); modificationadresseBD($db, $adresse_id, $adresse_numero_voie, $adresse_ville, $adresse_code_postal, $adresse_pays); } } } header('Location: index.php?controle=admin&action=afficherPageAdminGE'); }
?> <div class="cadre <?php echo $class[$id]; ?> "> <form style="float: right;"> <input type='hidden' name='controle' value='evenement'/> <input type='hidden' name='action' value='afficherPageEvent'/> <input type='hidden' name='param' value='<?php echo $event["evenement_id"]; ?> '/> <input type="submit" class="btn bold btn-orange" value="Afficher"/> </form> <p><?php echo formattageDate($event["evenement_date_debut"], "aff"); ?> </p> <div class="bold"><?php echo $event["evenement_titre"]; ?> </div> <div style="float: left; margin: 10px;"> <img src="./Vue/img/<?php echo $event["miniature"]; ?> " height="100" width="100"> </div> <textarea class="text-area description" disabled="disable"><?php
"> <span class='bold'><?php echo $event["utilisateur_prenom"] . " " . $event["utilisateur_nom"]; ?> </span> </a> </p> <p> Lieu : <span id="adresse"><?php echo $event["adresse"]; ?> </span> </p> <p> <?php echo "du " . formattageDate($event["evenement_date_debut"], "aff") . " au " . formattageDate($event["evenement_date_fin"], "aff"); ?> </p> <p> Horaires : <span><?php echo substr($event["evenement_heure_debut"], 0, 5) . " - " . substr($event["evenement_heure_fin"], 0, 5); ?> </span> </p> </div> <div id="participationEvent"> <?php if (isset($_SESSION['userID'])) { if ($participation == 0) { ?> <a id="btnParticipation" class="bold btn">Participer</a>
function recherche() { require './Modele/evenements.php'; $events = array(array()); $eventsFavoris = NULL; if (isset($_POST["dateRecherche"]) && isset($_POST["themeRecherche"])) { $date = formattageDate($_POST["dateRecherche"], "bdd"); $motCle = htmlspecialchars($_POST["motCleRecherche"]); $ville = htmlspecialchars($_POST["villeRecherche"]); $theme = $_POST["themeRecherche"]; $condition = "WHERE DATEDIFF(evenement_date_debut, \"{$date}\") >= 0"; $condition .= $motCle != "" ? " AND (UPPER(evenement_titre) LIKE UPPER('%{$motCle}%') OR UPPER(evenement_description) LIKE UPPER('%{$motCle}%'))" : ""; $condition .= $ville != "" ? " AND evenement_adresse_id IN (SELECT adresse_id FROM adresse WHERE UPPER(adresse_ville) LIKE UPPER('%{$ville}%'))" : ""; $condition .= $theme != "0" ? " AND evenement_theme_id = {$theme}" : ""; $events = rechercheEvent($condition, $db); } else { if (isset($_SESSION['userID'])) { require_once './Modele/utilisateurs.php'; $date = date("Y-m-d"); $favoris = rechercheFavori($db, $_SESSION['userID']); if ($favoris != NULL) { $condition = "WHERE DATEDIFF(evenement_date_debut, \"{$date}\") >= 0 AND evenement_theme_id IN {$favoris}"; $eventsFavoris = rechercheEvent($condition, $db); if ($eventsFavoris == NULL) { $eventsFavoris = 1; } $condition2 = "WHERE DATEDIFF(evenement_date_debut, \"{$date}\") >= 0 AND evenement_theme_id NOT IN {$favoris}"; $events = rechercheEvent($condition2, $db); } else { $condition = "WHERE DATEDIFF(evenement_date_debut, \"{$date}\") >= 0"; $events = rechercheEvent($condition, $db); } } else { $date = date("Y-m-d"); $condition = "WHERE DATEDIFF(evenement_date_debut, \"{$date}\") >= 0"; $events = rechercheEvent($condition, $db); } } $retour = array($eventsFavoris, $events); return $retour; }
<link href="./Vue/css/bootstrap-3.3.5-dist/css/bootstrap.css" rel="stylesheet" media="all" type="text/css"> <link href="./Vue/css/style.css" rel="stylesheet" media="all" type="text/css"> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <script src="./Vue/js/datepicker.js"></script> <?php $dateDefault = date("Y-m-d"); $dateRecherche = isset($_POST["dateRecherche"]) ? formattageDate($_POST["dateRecherche"], "bdd") : $dateDefault; $motCleRecherche = isset($_POST["motCleRecherche"]) ? htmlspecialchars($_POST["motCleRecherche"]) : ""; $villeRecherche = isset($_POST["villeRecherche"]) ? htmlspecialchars($_POST["villeRecherche"]) : ""; $themeRecherche = isset($_POST["themeRecherche"]) ? $_POST["themeRecherche"] : "0"; ?> <script type="text/javascript"> $(function () { <?php if (!isset($_SESSION['prenom_nom'])) { ?> var dialogInscription, dialogConnexion, dialogCreerEvent dialogInscription = $("#dialog-inscription").dialog({ autoOpen: false, height: 640, width: 500, modal: true, resizable: false, draggable: false, position: {my: "center ", at: "top", of: window},