-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccueil.php
121 lines (109 loc) · 4.95 KB
/
accueil.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<div id="centre-gauche">
<div id="intro">
<?php
$rq = 'SELECT id, titre, texte FROM '.$prefix.'content WHERE page = "accueil" ORDER BY ordre';
$rs = mysqli_query($link,$rq) OR die('Erreur : '.mysqli_error($link));
while($content = mysqli_fetch_array($rs)) {
if($content['titre'] != "") { echo "<h2>".htmlspecialchars_decode($content['titre'])."</h2>"; }
if($content['texte'] != "") { echo "<p>". htmlspecialchars_decode($content['texte'])."</p>"; }
if($_SESSION['permission'] == "admin") {
echo '<div class="outils admin">';
echo '<a href="index.php?page=accueil&outils=modifier&id='.$content['id'].'" class="btn btn-default"><i class="fa fa-edit"></i> Modifier</a>';
echo '</div>';
}
}
?>
<div class="galerie">
<?php // PHOTOS
$req2 = 'SELECT id, titre, nom FROM '.$prefix.'photos WHERE id IN(24,29,22,16) ORDER BY id ASC';
$res2 = mysqli_query($link,$req2) OR die(mysqli_error($link));
$nb2 = mysqli_num_rows($res2);
if ($nb2 == 0) { echo '<p>Aucune photo.</p>'; }
else {?>
<ul class="liste_photos">
<?php
while ($p = mysqli_fetch_array($res2)) :
?>
<li><a class="colorbox" title="<?php echo $p['titre']; ?>" href="photos/<?php echo $p['nom']; ?>"><img src="photos/mini/<?php echo $p['nom']; ?>" alt="<?php echo $p['titre']; ?>" /></a></li>
<?php
endwhile;
?>
</ul>
<?php } ?>
</div>
<div class="lien"><a href="index.php?page=photos">Voir toutes les photos</a> <i class="fa fa-arrow-circle-right"></i></div>
</div>
<div id="zoomsur">
<h2>Zoom sur</h2>
<div id="slideshow">
<div id="slidesContainer">
<?php
$rq = 'SELECT id, titre, texte, accroche, photo, categorie FROM '.$prefix.'activites ORDER BY RAND() LIMIT 0,10';
$rs = mysqli_query($link,$rq) OR die('Erreur : '.mysqli_error($link));
while($content = mysqli_fetch_array($rs)) {
echo '<div class="slide">';
echo '<div class="slide_int">';
if($content['titre'] != "") { echo "<h3>".tronque($content['titre'],20)."</h3>"; }
if($content['categorie'] != "") {
$rq2 = 'SELECT libelle FROM '.$prefix.'categorie WHERE id IN ('.$content['categorie'].') ORDER BY libelle';
$rs2 = mysqli_query($link,$rq2) OR die('Erreur : '.mysqli_error($link));
$categories = array();
while ($cat = mysqli_fetch_array($rs2)) {
$categories[] = $cat['libelle'];
}
$nb_cat = count($categories);
$cate = "";
for($i=0;$i<$nb_cat;$i++) {
if($i==($nb_cat-1)) {
$cate .= $categories[$i];
} else {
$cate .= $categories[$i].', '; }
}
echo "<p class='categorie'>".$cate."</p>";
}
if ($content['photo'] != "") { echo "<p class='img'><a href='images/activites/".$content['photo']."' class='colorbox' title='".$content['titre']."'><img src='images/activites/accueil/".$content['photo']."' alt='".$content['titre']."' /></a></p>"; }
if($content['accroche'] != "") { echo "<p>".tronque($content['accroche'],280)."</p>"; }
echo '<p class="suite"><a href="index.php?page=activites&detail='.$content['id'].'">Lire la suite</a></p>';
echo '</div>';
echo '</div>';
}
?>
</div>
</div>
</div>
</div>
<div id="centre-droit">
<div id="wrap_news">
<div id="news">
<h2><img src="images/titreactu.png" alt="News du mois" /></h2>
<?php
$rq = 'SELECT id, accroche, titre, DATE_FORMAT(date, "%d/%m/%Y") as date2 FROM '.$prefix.'news ORDER BY date DESC LIMIT 0,2';
$rs = mysqli_query($link,$rq) OR die('Erreur : '.mysqli_error($link));
while($content = mysqli_fetch_array($rs)) {
echo '<div class="actu id-'.$content['id'].'">';
echo '<span class="date">'.$content['date2'].'</span>';
echo '<div class="accroche"><h3 class="titre"><a href="index.php?page=news&id='.$content['id'].'">'.htmlspecialchars_decode($content['titre']).'</a></h3> '.htmlspecialchars_decode($content['accroche']).'</div>';
if ($_SESSION['identifiant'] != "") { echo '<span class="outils"><a href="index.php?outils=modifier&type=news&id='.$content['id'].'"><i class="fa fa-edit" title="Modifier"></i></a> <a href="index.php?outils=supprimer&type=news&id='.$content['id'].'"><i class="fa fa-trash-o" title="Supprimer"></i></a></span>'; }
echo '</div>';
}
if($_SESSION['permission'] == "admin") {
echo '<div class="outils admin">';
echo '<a href="index.php?outils=ajouter&type=news" class="btn btn-default"><i class="fa fa-plus"></i> Ajouter</a>';
echo '</div>';
}
?>
<div class="lien"><a href="index.php?page=news">Toutes les news</a></div>
</div>
</div>
<div id="wrap_calend">
<div id="calendrier">
<h2><img src="images/titredispo.png" alt="Disponibilités" /></h2>
<?php $afficher = 1; require "calendrier2.php"; ?>
<div class="legende">
<h3>Légende</h3>
<p><span class="rose"></span> réservation en cours de confirmation</p>
<p><span class="rouge"></span> réservation confirmée</p>
</div>
</div>
</div>
</div>