Line 258... |
Line 258... |
258 |
' LEFT JOIN cel_export AS co '.
|
258 |
' LEFT JOIN cel_export AS co '.
|
259 |
' ON (ci.ce_observation = co.id_observation) '.
|
259 |
' ON (ci.ce_observation = co.id_observation) '.
|
260 |
'WHERE '.
|
260 |
'WHERE '.
|
261 |
" co.nom_ret_nn IN ($numNom) ".
|
261 |
" co.nom_ret_nn IN ($numNom) ".
|
262 |
' AND ci.date_prise_de_vue != "0000-00-00" '.
|
262 |
' AND ci.date_prise_de_vue != "0000-00-00" '.
|
263 |
' AND co.nom_referentiel LIKE '.$this->Bdd->proteger($refTax.'%').' '.
|
263 |
' AND co.nom_referentiel = '.$this->Bdd->proteger($refTax).' '.
|
264 |
' ORDER BY ci.date_prise_de_vue ASC '.
|
264 |
' ORDER BY ci.date_prise_de_vue ASC '.
|
265 |
'LIMIT 1' . ' -- ' . __FILE__ . ':' . __LINE__;
|
265 |
'LIMIT 1' . ' -- ' . __FILE__ . ':' . __LINE__;
|
Line 266... |
Line 266... |
266 |
|
266 |
|
Line 304... |
Line 304... |
304 |
' co.id_observation AS id_obs, co.courriel_utilisateur AS utilisateur_courriel, co.zone_geo, co.ce_zone_geo, '.
|
304 |
' co.id_observation AS id_obs, co.courriel_utilisateur AS utilisateur_courriel, co.zone_geo, co.ce_zone_geo, '.
|
305 |
' co.nom_sel, co.nom_sel_nn, '.
|
305 |
' co.nom_sel, co.nom_sel_nn, '.
|
306 |
' ci.id_image AS id_img, co.date_observation AS date '.
|
306 |
' ci.id_image AS id_img, co.date_observation AS date '.
|
307 |
(isset($this->parametres['retour.champs']) ? ', '.$this->parametres['retour.champs'] : '').
|
307 |
(isset($this->parametres['retour.champs']) ? ', '.$this->parametres['retour.champs'] : '').
|
308 |
'FROM cel_images_export AS ci'.
|
308 |
'FROM cel_images_export AS ci'.
|
309 |
' LEFT JOIN cel_export AS co '.
|
309 |
' JOIN cel_export AS co '.
|
310 |
' ON (ci.ce_observation = co.id_observation) '.
|
310 |
' ON (ci.ce_observation = co.id_observation) '.
|
311 |
$this->formerRequeteConditions($numNomListe).' '.
|
311 |
$this->formerRequeteConditions($numNomListe).' '.
|
312 |
'GROUP BY id_img '.
|
- |
|
313 |
$this->formerRequeteTri().
|
312 |
$this->formerRequeteTri().
|
314 |
"LIMIT $depart,$limite " . ' -- ' . __FILE__ . ':' . __LINE__;
|
313 |
"LIMIT $depart,$limite " . ' -- ' . __FILE__ . ':' . __LINE__;
|
Line 315... |
Line 314... |
315 |
|
314 |
|
316 |
$this->infosImages = $this->Bdd->recupererTous($requete);
|
315 |
$this->infosImages = $this->Bdd->recupererTous($requete);
|
Line 317... |
Line 316... |
317 |
}
|
316 |
}
|
318 |
|
317 |
|
319 |
private function formerRequeteConditions($numNomListe) {
|
318 |
private function formerRequeteConditions($numNomListe) {
|
320 |
$refTax = $this->parametres['referentiel'];
|
- |
|
321 |
$where[] = " co.nom_ret_nn IN ($numNomListe) ";
|
- |
|
322 |
// exclusion des noms à déterminer, douteux ou plantnet-mobile
|
319 |
$refTax = $this->parametres['referentiel'];
|
Line 323... |
Line 320... |
323 |
$where[] = " ((co.mots_cles_texte not like '%aDeterminer%' AND co.mots_cles_texte not like '%plantnet-mobile%') OR co.mots_cles_texte IS null) ";
|
320 |
$where[] = " co.nom_ret_nn IN ($numNomListe) ";
|
324 |
$where[] = " co.nom_referentiel LIKE ".$this->Bdd->proteger($refTax."%").' ';
|
321 |
$where[] = " co.nom_referentiel = ".$this->Bdd->proteger($refTax).' ';
|
Line 325... |
Line 322... |
325 |
|
322 |
|
Line 533... |
Line 530... |
533 |
private function formaterCommune($infos) {
|
530 |
private function formaterCommune($infos) {
|
534 |
$commune = array();
|
531 |
$commune = array();
|
535 |
if ($this->avoirContenu($infos['zone_geo'])) {
|
532 |
if ($this->avoirContenu($infos['zone_geo'])) {
|
536 |
$commune[] = $infos['zone_geo'];
|
533 |
$commune[] = $infos['zone_geo'];
|
537 |
}
|
534 |
}
|
538 |
if (isset($infos['ce_zone_geo']) && $this->avoirContenu($infos['ce_zone_geo']) && $infos['ce_zone_geo'] != 'INSEE-C:') {
|
535 |
if (isset($infos['ce_zone_geo']) && $this->avoirContenu($infos['ce_zone_geo']) && $infos['ce_zone_geo'] != '') {
|
539 |
$commune[] = '('.substr(str_replace('INSEE-C:','',$infos['ce_zone_geo']), 0, 2).')';
|
536 |
$commune[] = '('.substr(str_replace('INSEE-C:','',$infos['ce_zone_geo']), 0, 2).')';
|
540 |
}
|
537 |
}
|
541 |
return implode(' ', $commune);
|
538 |
return implode(' ', $commune);
|
542 |
}
|
539 |
}
|
Line 550... |
Line 547... |
550 |
$nn = substr($this->parametres['masque.nn'], strpos($this->parametres['masque.nn'], ':') + 1);
|
547 |
$nn = substr($this->parametres['masque.nn'], strpos($this->parametres['masque.nn'], ':') + 1);
|
551 |
$referentiel = isset($this->parametres['masque.referentiel']) ? $this->parametres['masque.referentiel'] : '';
|
548 |
$referentiel = isset($this->parametres['masque.referentiel']) ? $this->parametres['masque.referentiel'] : '';
|
552 |
$and = $referentiel ? ' AND referentiel = ' . $this->Bdd->proteger($referentiel) : '';
|
549 |
$and = $referentiel ? ' AND referentiel = ' . $this->Bdd->proteger($referentiel) : '';
|
Line 553... |
Line 550... |
553 |
|
550 |
|
554 |
$requete = 'SELECT referentiel, ce_image as id_img, organe '.
|
551 |
$requete = 'SELECT referentiel, ce_image as id_img, organe '.
|
555 |
'FROM tb_del_test.del_image_top '.
|
552 |
'FROM tb_del.del_image_top '.
|
Line 556... |
Line 553... |
556 |
'WHERE nn = '. $this->Bdd->proteger($nn) . $and . ' -- ' . __FILE__ . ':' . __LINE__;
|
553 |
'WHERE nn = '. $this->Bdd->proteger($nn) . $and . ' -- ' . __FILE__ . ':' . __LINE__;
|
Line 557... |
Line 554... |
557 |
|
554 |
|