Line 229... |
Line 229... |
229 |
private function obtenirIdImageAuHasard() {
|
229 |
private function obtenirIdImageAuHasard() {
|
230 |
$refTax = $this->parametres['referentiel'];
|
230 |
$refTax = $this->parametres['referentiel'];
|
231 |
$numNom = $this->Bdd->proteger($this->ref_tax_demande[$refTax][0]);
|
231 |
$numNom = $this->Bdd->proteger($this->ref_tax_demande[$refTax][0]);
|
Line 232... |
Line 232... |
232 |
|
232 |
|
233 |
$requete = 'SELECT ci.id_image AS id_image '.
|
233 |
$requete = 'SELECT ci.id_image AS id_image '.
|
234 |
'FROM cel_images AS ci '.
|
234 |
'FROM cel_images_export AS ci '.
|
235 |
' LEFT JOIN cel_obs AS co '.
|
235 |
' LEFT JOIN cel_export AS co '.
|
236 |
'ON (ci.ce_observation = co.id_observation) '.
|
236 |
'ON (ci.ce_observation = co.id_observation) '.
|
237 |
'WHERE co.transmission = 1 '.
|
237 |
'WHERE '.
|
238 |
" AND co.nom_ret_nn IN ($numNom)";
|
238 |
" co.nom_ret_nn IN ($numNom)";
|
Line 239... |
Line 239... |
239 |
" AND co.nom_referentiel = ".$this->Bdd->proteger($refTax) . ' -- ' . __FILE__ . ':' . __LINE__;
|
239 |
" AND co.nom_referentiel = ".$this->Bdd->proteger($refTax) . ' -- ' . __FILE__ . ':' . __LINE__;
|
Line 240... |
Line 240... |
240 |
|
240 |
|
Line 252... |
Line 252... |
252 |
|
252 |
|
253 |
private function obtenirIdPremiereImage() {
|
253 |
private function obtenirIdPremiereImage() {
|
254 |
$refTax = $this->parametres['referentiel'];
|
254 |
$refTax = $this->parametres['referentiel'];
|
255 |
$numNom = $this->Bdd->proteger($this->ref_tax_demande[$refTax][0]);
|
255 |
$numNom = $this->Bdd->proteger($this->ref_tax_demande[$refTax][0]);
|
256 |
$requete = 'SELECT ci.id_image AS id_image '.
|
256 |
$requete = 'SELECT ci.id_image AS id_image '.
|
257 |
'FROM cel_images AS ci'.
|
257 |
'FROM cel_images_export AS ci'.
|
258 |
' LEFT JOIN cel_obs 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 co.transmission = 1 '.
|
260 |
'WHERE '.
|
261 |
" AND 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 LIKE '.$this->Bdd->proteger($refTax.'%').' '.
|
264 |
' ORDER BY ci.date_prise_de_vue ASC '.
|
264 |
' ORDER BY ci.date_prise_de_vue ASC '.
|
Line 281... |
Line 281... |
281 |
' ci.id_image AS id_img, co.date_observation AS date, '.
|
281 |
' ci.id_image AS id_img, co.date_observation AS date, '.
|
282 |
' co.id_observation AS id_obs, '.
|
282 |
' co.id_observation AS id_obs, '.
|
283 |
' ci.courriel_utilisateur AS utilisateur_courriel, '.
|
283 |
' ci.courriel_utilisateur AS utilisateur_courriel, '.
|
284 |
' nom_sel, nom_sel_nn, '.
|
284 |
' nom_sel, nom_sel_nn, '.
|
285 |
' zone_geo, ce_zone_geo, lieudit, station, milieu '.
|
285 |
' zone_geo, ce_zone_geo, lieudit, station, milieu '.
|
286 |
'FROM cel_images AS ci'.
|
286 |
'FROM cel_images_export AS ci'.
|
287 |
' LEFT JOIN cel_obs AS co '.
|
287 |
' LEFT JOIN cel_export AS co '.
|
288 |
' ON (ci.ce_observation = co.id_observation) '.
|
288 |
' ON (ci.ce_observation = co.id_observation) '.
|
289 |
'WHERE ci.id_image = '.$this->ressources[0].
|
289 |
'WHERE ci.id_image = '.$this->ressources[0].
|
290 |
' AND co.id_observation IS NOT NULL' . ' -- ' . __FILE__ . ':' . __LINE__;
|
290 |
' AND co.id_observation IS NOT NULL' . ' -- ' . __FILE__ . ':' . __LINE__;
|
Line 291... |
Line 291... |
291 |
|
291 |
|
Line 303... |
Line 303... |
303 |
$requete = 'SELECT SQL_CALC_FOUND_ROWS '.
|
303 |
$requete = 'SELECT SQL_CALC_FOUND_ROWS '.
|
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 AS ci'.
|
308 |
'FROM cel_images_export AS ci'.
|
309 |
' LEFT JOIN cel_obs AS co '.
|
309 |
' LEFT 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 '.
|
312 |
'GROUP BY id_img '.
|
313 |
$this->formerRequeteTri().
|
313 |
$this->formerRequeteTri().
|
314 |
"LIMIT $depart,$limite " . ' -- ' . __FILE__ . ':' . __LINE__;
|
314 |
"LIMIT $depart,$limite " . ' -- ' . __FILE__ . ':' . __LINE__;
|