-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
executable file
·204 lines (187 loc) · 9.14 KB
/
index.php
File metadata and controls
executable file
·204 lines (187 loc) · 9.14 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<?php
require('inc/config.inc.php');
//on include tous les modeles
foreach (glob( ADMIN_FOLDER."/modeles/*.php" ) as $filename){
include $filename;
}
$parametres = getParametres();
pageLoaded();
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo $parametres[0]['valeur'] ?></title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link href="css/bootstrap.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<link href="css/index.css" rel="stylesheet">
</head>
<body id="0">
<?php if ($nav = getNav()): ?>
<!-- Nav -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<?php foreach ($nav as $key => $lien): ?>
<?php if ($lien['lien'] == "#0"): ?>
<li class="nav-link active">
<?php else : ?>
<li class="nav-link">
<?php endif; ?>
<a href="<?php echo $lien['lien']; ?>"><?php echo $lien['titre']; ?></a></li>
<?php endforeach; ?>
</ul>
</div>
</div>
</nav>
<?php endif; ?>
<?php if ($carousel = getCarousel()): ?>
<!-- Carousel -->
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<?php if (count($carousel) != 1): ?>
<ol class="carousel-indicators">
<?php foreach ($carousel as $key => $image): ?>
<?php if ($key == 0): ?>
<li data-target="#carousel-example-generic" data-slide-to="<?php echo $key; ?>" class="active"></li>
<?php else: ?>
<li data-target="#carousel-example-generic" data-slide-to="<?php echo $key; ?>"></li>
<?php endif; ?>
<?php endforeach; ?>
</ol>
<?php endif; ?>
<div class="carousel-inner" role="listbox">
<?php foreach (getCarousel() as $key => $image): ?>
<?php if ($key == 0): ?>
<div class="item active">
<?php else: ?>
<div class="item">
<?php endif; ?>
<img src="images/carousel/<?php echo $image['id_carousel'] ?>.<?php echo $image['extension'] ?>" alt="<?php echo $image['alt']; ?>">
<div class="carousel-caption">
<h3><?php echo $image['titre']; ?></h3>
<p><?php echo $image['description']; ?></p>
</div>
</div>
<?php endforeach; ?>
</div>
<?php if (count($carousel) != 1): ?>
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($categories = getCategories()): ?>
<!-- Categories -->
<?php foreach ($categories as $key => $categorie): ?>
<div id="<?php echo $categorie['id_categorie']; ?>" class="categorie" style="background-color:<?php echo $categorie['color']; ?>">
<?php echo $categorie['code']; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php if (1): ?>
<!-- Contact Form -->
<div id="contact">
<div class="col-sm-6 col-sm-offset-3">
<h3>Contactez-moi !</h3>
<br/>
<div id="msgValideSubmit" class="hidden alert alert-success" role="alert">Le message a bien été envoyé</div>
<div id="msgErrorSubmit" class="hidden alert alert-danger" role="alert">Il y a eu une erreur lors de l'envoi du message</div>
<br/>
<form role="form" id="contactForm">
<div class="row">
<div class="form-group col-sm-6">
<label for="name" class="h4">Nom</label>
<input type="text" class="form-control" id="name" name="nom" placeholder="Entrez votre Nom" required>
</div>
<div class="form-group col-sm-6">
<label for="email" class="h4">Email</label>
<input type="email" class="form-control" id="email" name="mail" placeholder="Entrez votre Email" required>
</div>
</div>
<div class="form-group">
<label for="message" class="h4 ">Message</label>
<textarea id="message" class="form-control" rows="5" name="commentaire" placeholder="Entrez votre message" required></textarea>
</div>
<button type="submit" value="submit" id="form-submit" class="btn btn-primary btn-lg pull-right ">Envoyer</button>
</form>
</div>
</div>
<?php endif; ?>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script>
//config du temps du carousel
$('.carousel').carousel({
intervale : <?php echo $parametres[1]['valeur'] ?>,
pause : false
});
//permet le scroll swing
$(document).ready(function () {
$(document).on("scroll", onScroll);
$('a[href^="#"]').on('click', function (e) {
e.preventDefault();
$(document).off("scroll");
$('a').parent().each(function () {
$(this).removeClass('active');
});
$(this).parent().addClass('active');
var target = this.hash;
$target = $(target);
$('html, body').stop().animate({
'scrollTop': $target.offset().top - $('.navbar').height()
}, 500, 'swing', function () {
$(document).on("scroll", onScroll);
});
});
});
//permet d'ajouter activer sur certain lien
function onScroll(event){
var scrollPos = $(document).scrollTop();
$('.nav-link a').each(function () {
var currLink = $(this);
var refElement = $(currLink.attr("href"));
if (refElement.position().top <= scrollPos + $('.navbar').height() + 5 && refElement.position().top + refElement.height() > scrollPos + $('.navbar').height() + 5) {
$('.nav-link').removeClass("active");
currLink.parent().addClass("active");
}
else{
currLink.parent().removeClass("active");
}
});
}
//quand on valide le formulaire de contact
$('#contactForm').on('submit', function (event) {
event.preventDefault();
$.ajax({
type: "POST",
url: "inc/form-contact.php",
data: $(this).serialize(),
success : function(text){
console.log(text);
if (text == "success"){
$("#contactForm").toggle(400);
$( "#msgErrorSubmit" ).addClass( "hidden" );
$( "#msgValideSubmit" ).removeClass( "hidden" );
}else{
$( "#msgErrorSubmit" ).removeClass( "hidden" );
}
}
});
});
</script>
</body>
</html>