694 |
jpm |
1 |
<?php
|
|
|
2 |
/**
|
696 |
jpm |
3 |
* Service fournissant des statistiques de l'application CEL au format texte (JSON).
|
694 |
jpm |
4 |
* Encodage en entrée : utf8
|
|
|
5 |
* Encodage en sortie : utf8
|
|
|
6 |
*
|
|
|
7 |
* Cas d'utilisation :
|
696 |
jpm |
8 |
* /CelStatistiqueTxt/TypeDeStat : retourne les statistiques demandées
|
694 |
jpm |
9 |
* Paramêtres :
|
696 |
jpm |
10 |
* utilisateur=courriel : retourne les statistiques d'un utilisateur donné.
|
694 |
jpm |
11 |
*
|
696 |
jpm |
12 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
|
|
13 |
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
|
|
|
14 |
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
|
|
|
15 |
* @version $Id$
|
|
|
16 |
* @copyright Copyright (c) 2011, Tela Botanica (accueil@tela-botanica.org)
|
694 |
jpm |
17 |
*/
|
|
|
18 |
class CelStatistiqueTxt extends Cel {
|
696 |
jpm |
19 |
|
694 |
jpm |
20 |
/**
|
|
|
21 |
* Méthode appelée avec une requête de type GET.
|
|
|
22 |
*/
|
696 |
jpm |
23 |
public function getElement($ressources) {
|
694 |
jpm |
24 |
$graph = null;
|
|
|
25 |
$serveur = '';
|
|
|
26 |
|
696 |
jpm |
27 |
if (isset($ressources[0])) {
|
|
|
28 |
$this->analyserParametresUrl();
|
|
|
29 |
$stat_demande = array_shift($ressources);
|
694 |
jpm |
30 |
$methode = 'get'.$stat_demande;
|
|
|
31 |
if (method_exists($this, $methode)) {
|
702 |
jpm |
32 |
$this->ressources = $ressources;
|
696 |
jpm |
33 |
$stats = $this->$methode($ressources);
|
694 |
jpm |
34 |
} else {
|
|
|
35 |
$this->messages[] = "Ce type de statistiques '$stat_demande' n'est pas disponible.";
|
|
|
36 |
}
|
|
|
37 |
} else {
|
696 |
jpm |
38 |
$this->messages[] = "La ressource du service CEL StatistiqueTxt doit indiquer le type de statistique. Ex. : .../CelStatistiqueTxt/Nombres";
|
694 |
jpm |
39 |
}
|
|
|
40 |
|
|
|
41 |
if (!is_null($stats)) {
|
|
|
42 |
$this->envoyerJson($stats);
|
|
|
43 |
}
|
|
|
44 |
}
|
|
|
45 |
|
696 |
jpm |
46 |
private function analyserParametresUrl() {
|
702 |
jpm |
47 |
$this->parametres['utilisateur'] = isset($_GET['utilisateur']) ? $this->bdd->quote($this->verifierSecuriteParametreUrl($_GET['utilisateur'])) : null;
|
|
|
48 |
$this->parametres['num_taxon'] = isset($_GET['num_taxon']) ? $this->bdd->quote($this->verifierSecuriteParametreUrl($_GET['num_taxon'])) : null;
|
|
|
49 |
$this->parametres['taxon'] = isset($_GET['taxon']) ? $this->bdd->quote($this->verifierSecuriteParametreUrl($_GET['taxon'].'%')) : null;
|
707 |
jpm |
50 |
$this->parametres['tag'] = isset($_GET['tag']) ? $this->verifierSecuriteParametreUrl($_GET['tag']) : null;
|
702 |
jpm |
51 |
$this->parametres['start'] = isset($_GET['start']) ? $this->verifierSecuriteParametreUrl($_GET['start']) : null;
|
|
|
52 |
$this->parametres['limit'] = isset($_GET['limit']) ? $this->verifierSecuriteParametreUrl($_GET['limit']) : null;
|
696 |
jpm |
53 |
}
|
|
|
54 |
|
702 |
jpm |
55 |
private function getListeUtilisateursNbrePhotos() {
|
707 |
jpm |
56 |
$liste = array();
|
|
|
57 |
|
702 |
jpm |
58 |
$requete = $this->construireRequeteListeUtilisateurNbrePhoto();
|
707 |
jpm |
59 |
if ($requete != null) {
|
1359 |
aurelien |
60 |
$resultats = $this->executerRequete($requete);
|
707 |
jpm |
61 |
if ($resultats != false) {
|
|
|
62 |
foreach ($resultats as $resultat) {
|
1359 |
aurelien |
63 |
$liste[$resultat['courriel_utilisateur']] = $resultat['nbre'];
|
707 |
jpm |
64 |
}
|
702 |
jpm |
65 |
}
|
|
|
66 |
}
|
|
|
67 |
return $liste;
|
|
|
68 |
}
|
|
|
69 |
|
|
|
70 |
private function construireRequeteListeUtilisateurNbrePhoto() {
|
1359 |
aurelien |
71 |
$select = 'SELECT co.courriel_utilisateur, COUNT(DISTINCT ci.id_image) AS nbre ';
|
|
|
72 |
$from = 'FROM cel_obs co '.
|
|
|
73 |
' LEFT JOIN cel_obs_images coi ON (coi.id_observation = co.id_observation) '.
|
|
|
74 |
' LEFT JOIN cel_images ci ON (coi.id_image = ci.id_image) ';
|
702 |
jpm |
75 |
$where = 'WHERE transmission = 1 ';
|
1359 |
aurelien |
76 |
$groupBy = 'GROUP BY co.courriel_utilisateur ';
|
702 |
jpm |
77 |
$orderBy = 'ORDER BY nbre DESC ';
|
|
|
78 |
$limitSql = 'LIMIT 0,150 ';
|
|
|
79 |
|
707 |
jpm |
80 |
$zero_images = false;
|
702 |
jpm |
81 |
if (count($this->parametres) != 0) {
|
|
|
82 |
extract($this->parametres);
|
|
|
83 |
|
|
|
84 |
$filtres = array();
|
|
|
85 |
|
|
|
86 |
if (isset($utilisateur)) {
|
1359 |
aurelien |
87 |
$filtres[] = "co.courriel_utilisateur = $utilisateur ";
|
702 |
jpm |
88 |
}
|
|
|
89 |
if (isset($num_taxon)) {
|
1359 |
aurelien |
90 |
$filtres[] = "nt = $num_taxon ";
|
702 |
jpm |
91 |
}
|
|
|
92 |
if (isset($taxon)) {
|
|
|
93 |
$filtres[] = "nom_ret LIKE $taxon ";
|
|
|
94 |
}
|
707 |
jpm |
95 |
if (isset($tag)) {
|
|
|
96 |
$limitation = $this->construireWhereTags();
|
|
|
97 |
if ($limitation != null) {
|
|
|
98 |
$filtres[] = $limitation;
|
|
|
99 |
} else {
|
|
|
100 |
$zero_images = true;
|
|
|
101 |
}
|
|
|
102 |
}
|
702 |
jpm |
103 |
$where .= ((count($filtres) > 0) ? 'AND '.implode(' AND ', $filtres) : '');
|
|
|
104 |
|
|
|
105 |
if (isset($start)) {
|
|
|
106 |
$limitSql = str_replace('0,', "$start,", $limitSql);
|
|
|
107 |
}
|
|
|
108 |
if (isset($limit)) {
|
|
|
109 |
$limitSql = str_replace('150', $limit, $limitSql);
|
|
|
110 |
}
|
|
|
111 |
}
|
707 |
jpm |
112 |
if ($zero_images) {
|
|
|
113 |
$requete = null;
|
|
|
114 |
} else {
|
|
|
115 |
$requete = $select.$from.$where.$groupBy.$orderBy.$limitSql;
|
|
|
116 |
//echo $requete;
|
|
|
117 |
}
|
702 |
jpm |
118 |
return $requete;
|
|
|
119 |
}
|
|
|
120 |
|
707 |
jpm |
121 |
private function construireWhereTags() {
|
|
|
122 |
$where = null;
|
|
|
123 |
if (isset($this->parametres['tag'])) {
|
|
|
124 |
$tag = $this->parametres['tag'];
|
|
|
125 |
$tag_encode = $this->bdd->quote($this->encoderMotCle(trim($tag)));
|
|
|
126 |
|
|
|
127 |
// Construction de la requête
|
|
|
128 |
$requete = 'SELECT cmc_id_mot_cle_utilisateur, cmc_id_proprietaire '.
|
|
|
129 |
'FROM cel_mots_cles_images '.
|
|
|
130 |
"WHERE cmc_id_mot_cle_general = $tag_encode ";
|
|
|
131 |
$elements = $this->executerRequete($requete);
|
|
|
132 |
|
|
|
133 |
if ($elements != false && count($elements) > 0) {
|
|
|
134 |
// Pré-construction du where de la requête
|
|
|
135 |
$tpl_where = '(ci_meta_mots_cles LIKE "%%%s%%" AND ci_ce_utilisateur = %s )';
|
|
|
136 |
$requete_where = array();
|
|
|
137 |
foreach ($elements as $occurence) {
|
|
|
138 |
$requete_where[] = sprintf($tpl_where, $occurence['cmc_id_mot_cle_utilisateur'], $this->bdd->quote($occurence['cmc_id_proprietaire']));
|
|
|
139 |
}
|
|
|
140 |
$where = ' ('.implode(" \nOR ", $requete_where).') ';
|
|
|
141 |
} else {
|
|
|
142 |
$this->debug[] = "Aucune image ne correspond à ce mot clé.";
|
|
|
143 |
}
|
|
|
144 |
}
|
|
|
145 |
return $where;
|
|
|
146 |
}
|
|
|
147 |
|
702 |
jpm |
148 |
private function getListeTaxonsNbrePhotos() {
|
|
|
149 |
$requete = $this->construireRequeteListeTaxonNbrePhoto();
|
1359 |
aurelien |
150 |
|
702 |
jpm |
151 |
$resultats = $this->executerRequete($requete);
|
|
|
152 |
$liste = array();
|
|
|
153 |
if ($resultats != false) {
|
|
|
154 |
foreach ($resultats as $resultat) {
|
|
|
155 |
$liste[$resultat['nom_ret']] = $resultat['nbre'];
|
|
|
156 |
}
|
|
|
157 |
}
|
|
|
158 |
return $liste;
|
|
|
159 |
}
|
|
|
160 |
|
|
|
161 |
private function construireRequeteListeTaxonNbrePhoto() {
|
1359 |
aurelien |
162 |
$select = 'SELECT nom_ret, COUNT(DISTINCT ci.id_image) AS nbre ';
|
|
|
163 |
$from = 'FROM cel_obs co '.
|
|
|
164 |
' LEFT JOIN cel_obs_images coi ON (coi.id_observation = co.id_observation) '.
|
|
|
165 |
' LEFT JOIN cel_images ci ON (coi.id_image = ci.id_image) ';
|
702 |
jpm |
166 |
$where = 'WHERE transmission = 1 '.
|
|
|
167 |
" AND nom_ret != '' ";
|
|
|
168 |
$groupBy = 'GROUP BY nom_ret ';
|
|
|
169 |
$orderBy = 'ORDER BY nbre DESC ';
|
|
|
170 |
$limitSql = 'LIMIT 0,150 ';
|
|
|
171 |
|
|
|
172 |
|
|
|
173 |
if (count($this->parametres) != 0) {
|
|
|
174 |
extract($this->parametres);
|
|
|
175 |
|
|
|
176 |
$filtres = array();
|
|
|
177 |
|
|
|
178 |
if (isset($utilisateur)) {
|
1359 |
aurelien |
179 |
$filtres[] = "co.courriel_utilisateur = $utilisateur ";
|
702 |
jpm |
180 |
}
|
|
|
181 |
if (isset($num_taxon)) {
|
1359 |
aurelien |
182 |
$filtres[] = "nt = $num_taxon ";
|
702 |
jpm |
183 |
}
|
|
|
184 |
if (isset($taxon)) {
|
|
|
185 |
$filtres[] = "nom_ret LIKE $taxon ";
|
|
|
186 |
}
|
|
|
187 |
$where .= ((count($filtres) > 0) ? 'AND '.implode(' AND ', $filtres) : '');
|
|
|
188 |
|
|
|
189 |
if (isset($start)) {
|
|
|
190 |
$limitSql = str_replace('0,', "$start,", $limitSql);
|
|
|
191 |
}
|
|
|
192 |
if (isset($limit)) {
|
|
|
193 |
$limitSql = str_replace('150', $limit, $limitSql);
|
|
|
194 |
}
|
|
|
195 |
}
|
|
|
196 |
|
|
|
197 |
$requete = $select.$from.$where.$groupBy.$orderBy.$limitSql;
|
1359 |
aurelien |
198 |
|
702 |
jpm |
199 |
return $requete;
|
|
|
200 |
}
|
|
|
201 |
|
|
|
202 |
private function getNombres() {
|
696 |
jpm |
203 |
|
|
|
204 |
$requete = $this->construireRequeteNbreObs();
|
|
|
205 |
$info['observations'] = (int) $this->executerRequete($requete, 'Column');
|
694 |
jpm |
206 |
|
696 |
jpm |
207 |
$requete = $this->construireRequeteNbreObsPubliques();
|
|
|
208 |
$info['observationsPubliques'] = (int) $this->executerRequete($requete, 'Column');
|
|
|
209 |
|
|
|
210 |
$requete = $this->construireRequeteNbreImg();
|
|
|
211 |
$info['images'] =(int) $this->executerRequete($requete, 'Column');
|
|
|
212 |
|
|
|
213 |
$requete = $this->construireRequeteNbreImgLiees();
|
|
|
214 |
$info['imagesLiees'] =(int) $this->executerRequete($requete, 'Column');
|
|
|
215 |
|
|
|
216 |
$requete = $this->construireRequeteNbreObsLiees();
|
|
|
217 |
$info['observationsLiees'] = (int) $this->executerRequete($requete, 'Column');
|
|
|
218 |
|
697 |
jpm |
219 |
$info['moyImagesParObs'] = ($info['observationsLiees'] > 0 ? round($info['imagesLiees']/$info['observationsLiees'], 2) : '');
|
696 |
jpm |
220 |
|
|
|
221 |
$requete = $this->construireRequeteNbreObsParCommune();
|
697 |
jpm |
222 |
$info['communes'] = ($resultats = $this->executerRequete($requete)) ? count($resultats) : '' ;
|
|
|
223 |
$info['observationsParCommunesMin'] = 1000;
|
|
|
224 |
$info['observationsParCommunesMax'] = 0;
|
|
|
225 |
$info['observationsParCommunesTotal'] = 0;
|
|
|
226 |
foreach ($resultats as $resultat) {
|
|
|
227 |
if ($resultat['nbre'] < $info['observationsParCommunesMin']) {
|
|
|
228 |
$info['observationsParCommunesMin'] = $resultat['nbre'];
|
|
|
229 |
}
|
|
|
230 |
if ($resultat['nbre'] > $info['observationsParCommunesMax']) {
|
|
|
231 |
$info['observationsParCommunesMax'] = $resultat['nbre'];
|
|
|
232 |
}
|
|
|
233 |
$info['observationsParCommunesTotal'] += $resultat['nbre'];
|
|
|
234 |
}
|
702 |
jpm |
235 |
$info['observationsParCommunesMoyenne'] = ($info['communes'] > 0 ) ? round($info['observationsParCommunesTotal'] / $info['communes'], 2) : 0;
|
696 |
jpm |
236 |
|
|
|
237 |
return $info;
|
|
|
238 |
}
|
|
|
239 |
|
|
|
240 |
private function construireRequeteNbreObs() {
|
1359 |
aurelien |
241 |
$requete = 'SELECT COUNT(id_observation) AS nbre '.
|
|
|
242 |
'FROM cel_obs ';
|
696 |
jpm |
243 |
|
|
|
244 |
if (count($this->parametres) != 0) {
|
|
|
245 |
$filtres = array();
|
|
|
246 |
extract($this->parametres);
|
|
|
247 |
|
|
|
248 |
if (isset($utilisateur)) {
|
1359 |
aurelien |
249 |
$filtres[] = "courriel_utilisateur = $utilisateur ";
|
696 |
jpm |
250 |
}
|
|
|
251 |
if (isset($num_taxon)) {
|
|
|
252 |
$filtres[] = "num_taxon = $num_taxon ";
|
|
|
253 |
}
|
702 |
jpm |
254 |
if (isset($taxon)) {
|
|
|
255 |
$filtres[] = "nom_ret LIKE $taxon ";
|
|
|
256 |
}
|
696 |
jpm |
257 |
|
|
|
258 |
$requete .= ((count($filtres) > 0) ? 'WHERE '.implode(' AND ', $filtres) : '');
|
|
|
259 |
}
|
1359 |
aurelien |
260 |
|
696 |
jpm |
261 |
return $requete;
|
|
|
262 |
}
|
|
|
263 |
|
|
|
264 |
private function construireRequeteNbreObsPubliques() {
|
1359 |
aurelien |
265 |
$requete = 'SELECT COUNT(id_observation) AS nbre '.
|
|
|
266 |
'FROM cel_obs '.
|
696 |
jpm |
267 |
"WHERE transmission = 1 ";
|
|
|
268 |
|
|
|
269 |
if (count($this->parametres) != 0) {
|
|
|
270 |
$filtres = array();
|
|
|
271 |
extract($this->parametres);
|
|
|
272 |
|
|
|
273 |
if (isset($utilisateur)) {
|
1359 |
aurelien |
274 |
$filtres[] = "courriel_utilisateur = $utilisateur ";
|
696 |
jpm |
275 |
}
|
|
|
276 |
if (isset($num_taxon)) {
|
|
|
277 |
$filtres[] = "num_taxon = $num_taxon ";
|
|
|
278 |
}
|
702 |
jpm |
279 |
if (isset($taxon)) {
|
|
|
280 |
$filtres[] = "nom_ret LIKE $taxon ";
|
|
|
281 |
}
|
696 |
jpm |
282 |
|
|
|
283 |
$requete .= ((count($filtres) > 0) ? 'AND '.implode(' AND ', $filtres) : '');
|
|
|
284 |
}
|
694 |
jpm |
285 |
|
696 |
jpm |
286 |
return $requete;
|
|
|
287 |
}
|
|
|
288 |
|
|
|
289 |
private function construireRequeteNbreObsParCommune() {
|
1359 |
aurelien |
290 |
$requete = 'SELECT COUNT(id_observation) AS nbre '.
|
|
|
291 |
'FROM cel_obs '.
|
|
|
292 |
"WHERE zone_geo IS NOT NULL ".
|
|
|
293 |
" AND ce_zone_geo IS NOT NULL ";
|
|
|
294 |
$groupBy = 'GROUP BY zone_geo, ce_zone_geo';
|
696 |
jpm |
295 |
|
|
|
296 |
if (count($this->parametres) != 0) {
|
|
|
297 |
$filtres = array();
|
|
|
298 |
extract($this->parametres);
|
|
|
299 |
|
|
|
300 |
if (isset($utilisateur)) {
|
1359 |
aurelien |
301 |
$filtres[] = "courriel_utilisateur = $utilisateur ";
|
696 |
jpm |
302 |
}
|
|
|
303 |
if (isset($num_taxon)) {
|
1359 |
aurelien |
304 |
$filtres[] = "nt = $num_taxon ";
|
696 |
jpm |
305 |
}
|
702 |
jpm |
306 |
if (isset($taxon)) {
|
|
|
307 |
$filtres[] = "nom_ret LIKE $taxon ";
|
|
|
308 |
}
|
696 |
jpm |
309 |
|
|
|
310 |
$requete .= ((count($filtres) > 0) ? 'AND '.implode(' AND ', $filtres) : '');
|
|
|
311 |
}
|
|
|
312 |
$requete .= $groupBy;
|
694 |
jpm |
313 |
|
696 |
jpm |
314 |
return $requete;
|
|
|
315 |
}
|
|
|
316 |
|
|
|
317 |
private function construireRequeteNbreImg() {
|
1359 |
aurelien |
318 |
$select = 'SELECT COUNT(DISTINCT ci.id_image) AS nbre ';
|
|
|
319 |
$from = 'FROM cel_images ci ';
|
694 |
jpm |
320 |
|
696 |
jpm |
321 |
if (count($this->parametres) != 0) {
|
|
|
322 |
$filtres = array();
|
|
|
323 |
|
|
|
324 |
extract($this->parametres);
|
|
|
325 |
|
|
|
326 |
if (isset($utilisateur)) {
|
1359 |
aurelien |
327 |
$filtres[] = "courriel_utilisateur = $utilisateur ";
|
696 |
jpm |
328 |
}
|
|
|
329 |
if (isset($num_taxon)) {
|
702 |
jpm |
330 |
|
1359 |
aurelien |
331 |
$filtres[] = "nt = $num_taxon ";
|
696 |
jpm |
332 |
}
|
702 |
jpm |
333 |
if (isset($taxon)) {
|
|
|
334 |
$filtres[] = "nom_ret LIKE $taxon ";
|
|
|
335 |
}
|
|
|
336 |
if (isset($num_taxon) || isset($taxon)) {
|
1359 |
aurelien |
337 |
$from .= 'LEFT JOIN cel_obs_images coi ON (coi.id_image = ci.id_image) '.
|
|
|
338 |
'LEFT JOIN cel_obs co ON (coi.id_observation = co.id_observation) ';
|
702 |
jpm |
339 |
}
|
696 |
jpm |
340 |
|
|
|
341 |
$where = ((count($filtres) > 0) ? 'WHERE '.implode(' AND ', $filtres) : '');
|
|
|
342 |
}
|
|
|
343 |
$requete = $select.$from.$where;
|
1359 |
aurelien |
344 |
|
696 |
jpm |
345 |
return $requete;
|
694 |
jpm |
346 |
}
|
696 |
jpm |
347 |
|
|
|
348 |
private function construireRequeteNbreImgLiees() {
|
1359 |
aurelien |
349 |
$select = 'SELECT COUNT(DISTINCT ci.id_image) AS nbre ';
|
|
|
350 |
$from = 'FROM cel_obs_images coi '.
|
|
|
351 |
' LEFT JOIN cel_images ci ON (coi.id_image = ci.id_image) ';
|
696 |
jpm |
352 |
|
|
|
353 |
if (count($this->parametres) != 0) {
|
|
|
354 |
$filtres = array();
|
|
|
355 |
|
|
|
356 |
extract($this->parametres);
|
|
|
357 |
|
|
|
358 |
if (isset($utilisateur)) {
|
1359 |
aurelien |
359 |
$filtres[] = "ci.courriel_utilisateur = $utilisateur ";
|
696 |
jpm |
360 |
}
|
|
|
361 |
if (isset($num_taxon)) {
|
1359 |
aurelien |
362 |
$filtres[] = "nt = $num_taxon ";
|
696 |
jpm |
363 |
}
|
702 |
jpm |
364 |
if (isset($taxon)) {
|
|
|
365 |
$filtres[] = "nom_ret LIKE $taxon ";
|
|
|
366 |
}
|
696 |
jpm |
367 |
|
702 |
jpm |
368 |
if (isset($num_taxon) || isset($taxon)) {
|
1359 |
aurelien |
369 |
$from .= 'LEFT JOIN cel_obs ON (coi.id_observation = co.id_observation) ';
|
702 |
jpm |
370 |
}
|
|
|
371 |
|
696 |
jpm |
372 |
$where = ((count($filtres) > 0) ? 'WHERE '.implode(' AND ', $filtres) : '');
|
|
|
373 |
}
|
|
|
374 |
|
|
|
375 |
$requete = $select.$from.$where;
|
|
|
376 |
return $requete;
|
|
|
377 |
}
|
|
|
378 |
|
|
|
379 |
private function construireRequeteNbreObsLiees() {
|
1359 |
aurelien |
380 |
$select = 'SELECT COUNT(DISTINCT coi.id_observation) AS nbre ';
|
|
|
381 |
$from = 'FROM cel_obs_images coi '.
|
|
|
382 |
' LEFT JOIN cel_obs co ON (coi.id_observation = co.id_observation) ';
|
696 |
jpm |
383 |
|
|
|
384 |
if (count($this->parametres) != 0) {
|
|
|
385 |
$filtres = array();
|
|
|
386 |
|
|
|
387 |
extract($this->parametres);
|
|
|
388 |
|
|
|
389 |
if (isset($utilisateur)) {
|
1359 |
aurelien |
390 |
$filtres[] = "courriel_utilisateur = $utilisateur ";
|
696 |
jpm |
391 |
}
|
|
|
392 |
if (isset($num_taxon)) {
|
1359 |
aurelien |
393 |
$filtres[] = "nt = $num_taxon ";
|
696 |
jpm |
394 |
}
|
702 |
jpm |
395 |
if (isset($taxon)) {
|
|
|
396 |
$filtres[] = "nom_ret LIKE $taxon ";
|
|
|
397 |
}
|
696 |
jpm |
398 |
|
|
|
399 |
$where = ((count($filtres) > 0) ? 'WHERE '.implode(' AND ', $filtres) : '');
|
|
|
400 |
}
|
|
|
401 |
|
|
|
402 |
$requete = $select.$from.$where;
|
|
|
403 |
|
|
|
404 |
return $requete;
|
|
|
405 |
}
|
694 |
jpm |
406 |
}
|
|
|
407 |
?>
|