-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent.php
40 lines (35 loc) · 2 KB
/
event.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
session_start();
header('Content-Type: text/html; charset=ISO-8859-15');
include "inc-connexion.php";
//if (!isset($_GET['date'])) $_GET['date'] = "2010-10-22";
$requete = 'SELECT id_evenement, titre, type, LEFT(code_postal,2) as code_postal, ville, type FROM '.$prefix.'calendrier WHERE date = "'.$_GET['date'].'"';
$resultat = mysqli_query($link,$requete) or die (mysqli_error($link));
$nb = mysqli_num_rows($resultat);
if($nb == 0) {
echo 'Aucun �v�nement.';
}
else {
echo '<ul>';
while ($event=mysqli_fetch_array($resultat)) {
if ($event['type'] == 'club' AND $_SESSION['pseudo'] != "") {
$class = "club";
echo '<li><a class="'.$class.'" href="index.php?page=prive&lvl2=calendrier&event='.$event['id_evenement'].'">'.$event['titre'].'</a> ('.$event['code_postal'].' - '.$event['ville'].')</li>';
} else if ($event['type'] == "cyclosportive") {
$class = "cyclo";
echo '<li><a class="'.$class.'" href="index.php?page=competitions&lvl2=calendrier&event='.$event['id_evenement'].'">'.$event['titre'].'</a> ('.$event['code_postal'].' - '.$event['ville'].')</li>';
} else if ($event['type'] == 'competition') {
$class = "compet";
echo '<li><a class="'.$class.'" href="index.php?page=competitions&lvl2=calendrier&event='.$event['id_evenement'].'">'.$event['titre'].'</a> ('.$event['code_postal'].' - '.$event['ville'].')</li>';
} else if ($event['type'] == 'rando') {
$class = "rando";
echo '<li><a class="'.$class.'" href="index.php?page=competitions&lvl2=calendrier&event='.$event['id_evenement'].'">'.$event['titre'].'</a> ('.$event['code_postal'].' - '.$event['ville'].')</li>';
} else if ($event['type'] == 'cyclocross') {
$class = "cyclocross";
echo '<li><a class="'.$class.'" href="index.php?page=competitions&lvl2=calendrier&event='.$event['id_evenement'].'">'.$event['titre'].'</a> ('.$event['code_postal'].' - '.$event['ville'].')</li>';
} else { echo 'Connectez-vous pour voir l\'�v�nement club.'; }
}
echo '</ul>';
}
mysqli_close($connexion);
?>