Line 226... |
Line 226... |
226 |
//+---------------------------------------- REQUETES ---------------------------------------------------------------+
|
226 |
//+---------------------------------------- REQUETES ---------------------------------------------------------------+
|
227 |
private function obtenirIdImageAuHasard() {
|
227 |
private function obtenirIdImageAuHasard() {
|
228 |
$refTax = $this->parametres['referentiel'];
|
228 |
$refTax = $this->parametres['referentiel'];
|
229 |
$numNom = $this->Bdd->proteger($this->ref_tax_demande[$refTax][0]);
|
229 |
$numNom = $this->Bdd->proteger($this->ref_tax_demande[$refTax][0]);
|
Line 230... |
Line 230... |
230 |
|
230 |
|
231 |
$requete = 'SELECT coi.id_image AS id_image '.
|
231 |
$requete = 'SELECT ci.id_image AS id_image '.
|
232 |
'FROM cel_obs_images AS coi '.
|
232 |
'FROM cel_images AS ci '.
|
233 |
' LEFT JOIN cel_obs AS co '.
|
233 |
' LEFT JOIN cel_obs AS co '.
|
234 |
'ON (coi.id_observation = co.id_observation) '.
|
234 |
'ON (ci.ce_observation = co.id_observation) '.
|
235 |
'WHERE co.transmission = 1 '.
|
235 |
'WHERE co.transmission = 1 '.
|
236 |
" AND co.nom_ret_nn IN ($numNom)";
|
236 |
" AND co.nom_ret_nn IN ($numNom)";
|
Line 237... |
Line 237... |
237 |
" AND co.nom_referentiel = ".$this->Bdd->proteger($refTax) . ' -- ' . __FILE__ . ':' . __LINE__;
|
237 |
" AND co.nom_referentiel = ".$this->Bdd->proteger($refTax) . ' -- ' . __FILE__ . ':' . __LINE__;
|
Line 251... |
Line 251... |
251 |
private function obtenirIdPremiereImage() {
|
251 |
private function obtenirIdPremiereImage() {
|
252 |
$refTax = $this->parametres['referentiel'];
|
252 |
$refTax = $this->parametres['referentiel'];
|
253 |
$numNom = $this->Bdd->proteger($this->ref_tax_demande[$refTax][0]);
|
253 |
$numNom = $this->Bdd->proteger($this->ref_tax_demande[$refTax][0]);
|
254 |
$requete = 'SELECT ci.id_image AS id_image '.
|
254 |
$requete = 'SELECT ci.id_image AS id_image '.
|
255 |
'FROM cel_images AS ci'.
|
255 |
'FROM cel_images AS ci'.
|
256 |
' LEFT JOIN cel_obs_images AS coi '.
|
- |
|
257 |
' ON (coi.id_image = ci.id_image) '.
|
- |
|
258 |
' LEFT JOIN cel_obs AS co '.
|
256 |
' LEFT JOIN cel_obs AS co '.
|
259 |
' ON (coi.id_observation = co.id_observation) '.
|
257 |
' ON (ci.ce_observation = co.id_observation) '.
|
260 |
'WHERE co.transmission = 1 '.
|
258 |
'WHERE co.transmission = 1 '.
|
261 |
" AND co.nom_ret_nn IN ($numNom) ".
|
259 |
" AND co.nom_ret_nn IN ($numNom) ".
|
262 |
' AND ci.date_prise_de_vue != "0000-00-00" ORDER BY ci.date_prise_de_vue ASC '.
|
260 |
' AND ci.date_prise_de_vue != "0000-00-00" '.
|
263 |
' AND co.nom_referentiel LIKE '.$this->proteger($refTax.'%').' '.
|
261 |
' AND co.nom_referentiel LIKE '.$this->Bdd->proteger($refTax.'%').' '.
|
- |
|
262 |
' ORDER BY ci.date_prise_de_vue ASC '.
|
264 |
'LIMIT 1' . ' -- ' . __FILE__ . ':' . __LINE__;
|
263 |
'LIMIT 1' . ' -- ' . __FILE__ . ':' . __LINE__;
|
Line 265... |
Line 264... |
265 |
|
264 |
|
Line 266... |
Line 265... |
266 |
$resultat = $this->Bdd->recupererTous($requete);
|
265 |
$resultat = $this->Bdd->recupererTous($requete);
|
Line 281... |
Line 280... |
281 |
' co.id_observation AS id_obs, '.
|
280 |
' co.id_observation AS id_obs, '.
|
282 |
' ci.courriel_utilisateur AS utilisateur_courriel, '.
|
281 |
' ci.courriel_utilisateur AS utilisateur_courriel, '.
|
283 |
' nom_sel, nom_sel_nn, '.
|
282 |
' nom_sel, nom_sel_nn, '.
|
284 |
' zone_geo, ce_zone_geo, lieudit, station, milieu '.
|
283 |
' zone_geo, ce_zone_geo, lieudit, station, milieu '.
|
285 |
'FROM cel_images AS ci'.
|
284 |
'FROM cel_images AS ci'.
|
286 |
' LEFT JOIN cel_obs_images AS coi '.
|
- |
|
287 |
' ON (coi.id_image = ci.id_image) '.
|
- |
|
288 |
' LEFT JOIN cel_obs AS co '.
|
285 |
' LEFT JOIN cel_obs AS co '.
|
289 |
' ON (coi.id_observation = co.id_observation) '.
|
286 |
' ON (ci.ce_observation = co.id_observation) '.
|
290 |
'WHERE ci.id_image = '.$this->ressources[0].
|
287 |
'WHERE ci.id_image = '.$this->ressources[0].
|
291 |
' AND co.id_observation IS NOT NULL' . ' -- ' . __FILE__ . ':' . __LINE__;
|
288 |
' AND co.id_observation IS NOT NULL' . ' -- ' . __FILE__ . ':' . __LINE__;
|
Line 292... |
Line 289... |
292 |
|
289 |
|
293 |
$this->infosImages = $this->Bdd->recupererTous($requete);
|
290 |
$this->infosImages = $this->Bdd->recupererTous($requete);
|
Line 305... |
Line 302... |
305 |
' co.id_observation AS id_obs, co.courriel_utilisateur AS utilisateur_courriel, co.zone_geo, co.ce_zone_geo, '.
|
302 |
' co.id_observation AS id_obs, co.courriel_utilisateur AS utilisateur_courriel, co.zone_geo, co.ce_zone_geo, '.
|
306 |
' co.nom_sel, co.nom_sel_nn, '.
|
303 |
' co.nom_sel, co.nom_sel_nn, '.
|
307 |
' ci.id_image AS id_img, co.date_observation AS date '.
|
304 |
' ci.id_image AS id_img, co.date_observation AS date '.
|
308 |
(isset($this->parametres['retour.champs']) ? ', '.$this->parametres['retour.champs'] : '').
|
305 |
(isset($this->parametres['retour.champs']) ? ', '.$this->parametres['retour.champs'] : '').
|
309 |
'FROM cel_images AS ci'.
|
306 |
'FROM cel_images AS ci'.
|
310 |
' LEFT JOIN cel_obs_images AS coi '.
|
- |
|
311 |
' ON (coi.id_image = ci.id_image) '.
|
- |
|
312 |
' LEFT JOIN cel_obs AS co '.
|
307 |
' LEFT JOIN cel_obs AS co '.
|
313 |
' ON (coi.id_observation = co.id_observation) '.
|
308 |
' ON (ci.ce_observation = co.id_observation) '.
|
314 |
$this->formerRequeteConditions($numNomListe).' '.
|
309 |
$this->formerRequeteConditions($numNomListe).' '.
|
315 |
'GROUP BY id_img '.
|
310 |
'GROUP BY id_img '.
|
316 |
$this->formerRequeteTri().
|
311 |
$this->formerRequeteTri().
|
317 |
"LIMIT $depart,$limite " . ' -- ' . __FILE__ . ':' . __LINE__;
|
312 |
"LIMIT $depart,$limite " . ' -- ' . __FILE__ . ':' . __LINE__;
|