330 |
aurelien |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
function mb_ucfirst($str) {
|
|
|
4 |
$fc = mb_strtoupper(mb_substr($str, 0, 1));
|
|
|
5 |
return $fc.mb_substr($str, 1);
|
|
|
6 |
}
|
|
|
7 |
|
|
|
8 |
$config = parse_ini_file('config.ini');
|
|
|
9 |
$url_jrest = $config['url_jrest'];
|
|
|
10 |
|
|
|
11 |
$url_infos_especes = $url_jrest.'OdsEspece/ToutesEspeces';
|
|
|
12 |
$especes = json_decode(file_get_contents($url_infos_especes), true);
|
|
|
13 |
|
|
|
14 |
$url_infos_stades = $url_jrest.'OdsEvenement/TousEvenements';
|
|
|
15 |
$stades = json_decode(file_get_contents($url_infos_stades), true);
|
|
|
16 |
|
|
|
17 |
$url_annee_min_obs = $url_jrest.'OdsObservation/AnneeMinimumObservation';
|
|
|
18 |
$annee_min_obs = json_decode(file_get_contents($url_annee_min_obs), true);
|
|
|
19 |
|
|
|
20 |
$annees_observations = range($annee_min_obs, date('Y'));
|
333 |
aurelien |
21 |
|
|
|
22 |
$espece_defaut = !empty($_GET['espece']) ? $_GET['espece'] : null;
|
|
|
23 |
$annee_defaut = !empty($_GET['annee']) ? $_GET['annee'] : 0;
|
330 |
aurelien |
24 |
?>
|
|
|
25 |
|
|
|
26 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
|
27 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
28 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
|
|
|
29 |
<head>
|
|
|
30 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
|
31 |
<meta http-equiv="Content-style-type" content="text/css" />
|
|
|
32 |
<meta http-equiv="Content-script-type" content="text/javascript" />
|
|
|
33 |
<meta http-equiv="Content-language" content="fr" />
|
|
|
34 |
|
|
|
35 |
<base href="<?= dirname($_SERVER['PHP_SELF'])."/"; ?>" />
|
|
|
36 |
|
|
|
37 |
<title>Graphiques</title>
|
|
|
38 |
|
|
|
39 |
<meta name="revisit-after" content="15 days" />
|
|
|
40 |
<meta name="robots" content="index,follow" />
|
|
|
41 |
<meta name="author" content="Tela Botanica" />
|
|
|
42 |
|
|
|
43 |
<script type="text/javascript" src="<?= dirname($_SERVER['PHP_SELF'])."/"; ?>js/jquery-3.2.1.min.js"></script>
|
|
|
44 |
<script type="text/javascript" src="<?= dirname($_SERVER['PHP_SELF'])."/"; ?>js/plotly.min.js"></script>
|
|
|
45 |
<script type="text/javascript" src="<?= dirname($_SERVER['PHP_SELF'])."/"; ?>js/calendrier-evenements.js"></script>
|
333 |
aurelien |
46 |
<link href="<?= dirname($_SERVER['PHP_SELF'])."/"; ?>css/graphiques.css" type="text/css" rel="stylesheet" />
|
330 |
aurelien |
47 |
|
|
|
48 |
<script type="text/javascript">
|
|
|
49 |
var url_jrest = <?= json_encode($url_jrest, true) ?>;
|
|
|
50 |
var global_evenements = <?= json_encode($stades, true) ?>;
|
|
|
51 |
var annees_observations = <?= json_encode($annees_observations, true) ?>;
|
333 |
aurelien |
52 |
var espece_defaut = <?= json_encode($espece_defaut, true) ?>;
|
|
|
53 |
var annee_defaut = <?= json_encode($annee_defaut, true) ?>;
|
330 |
aurelien |
54 |
</script>
|
|
|
55 |
</head>
|
|
|
56 |
<body>
|
|
|
57 |
<div class="conteneur">
|
|
|
58 |
<div class="conteneur-criteres">
|
|
|
59 |
|
|
|
60 |
<div class="conteneur_selecteur_especes">
|
|
|
61 |
<select id="selecteur_liste_especes">
|
333 |
aurelien |
62 |
<option value="0" class="espece_type_0" <?= $espece_defaut == null ? 'selected="selected"' : '' ?>> Choisissez une espèce </option>
|
330 |
aurelien |
63 |
<?php foreach($especes as $id_espece => $infos_espece) : ?>
|
333 |
aurelien |
64 |
<option <?= $espece_defaut == $id_espece ? 'selected="selected"' : '' ?> value="<?= $id_espece; ?>"><?= mb_ucfirst($infos_espece['nom_vernaculaire']); ?></option>
|
330 |
aurelien |
65 |
<?php endforeach; ?>
|
|
|
66 |
</select>
|
|
|
67 |
</div>
|
|
|
68 |
|
|
|
69 |
<div class="conteneur_selecteur_annees">
|
|
|
70 |
<select id="selecteur_annees">
|
333 |
aurelien |
71 |
<option data-evenements="[]" value="0" class="stade" <?= $annee_defaut == 0 ? 'selected="selected"' : '' ?>> Toutes les années </option>
|
330 |
aurelien |
72 |
<?php foreach($annees_observations as $annee_obs) : ?>
|
333 |
aurelien |
73 |
<option <?= $annee_defaut != 0 ? 'selected="selected"' : '' ?> value="<?= $annee_obs; ?>"><?= $annee_obs; ?></option>
|
330 |
aurelien |
74 |
<?php endforeach; ?>
|
|
|
75 |
</select>
|
|
|
76 |
</div>
|
|
|
77 |
|
|
|
78 |
|
|
|
79 |
</div>
|
|
|
80 |
<div id="conteneur-graphique" class="conteneur-graphique calendrier-evenements"></div>
|
|
|
81 |
</div>
|
|
|
82 |
</body>
|
|
|
83 |
</html>
|