Line 340... |
Line 340... |
340 |
|
340 |
|
341 |
// Construction de la requête
|
341 |
// Construction de la requête
|
342 |
$requete = (isset($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' co.*, '.
|
342 |
$requete = (isset($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' co.*, '.
|
343 |
' ci.id_image, co.ce_utilisateur, nom_original, ci.date_creation, ci.mots_cles_texte AS mots_cles_texte_images, '.
|
343 |
' ci.id_image, co.ce_utilisateur, nom_original, ci.date_creation, ci.mots_cles_texte AS mots_cles_texte_images, '.
|
344 |
' co.mots_cles_texte AS mots_cles_texte_images_obs, "" as commentaire, "" as note_qualite, nom_referentiel '.
|
344 |
' co.mots_cles_texte AS mots_cles_texte_images_obs, "" as commentaire, "" as note_qualite, nom_referentiel '.
|
345 |
'FROM cel_export_total AS co LEFT JOIN cel_images_export AS ci ON (co.id_observation = ci.ce_observation) '.
|
345 |
'FROM cel_export_total AS co JOIN cel_images_export AS ci ON (co.id_observation = ci.ce_observation) '.
|
346 |
'WHERE co.transmission = 1 '.
|
346 |
'WHERE co.transmission = 1 '.
|
347 |
' AND co.ce_utilisateur = ci.ce_utilisateur '.
|
347 |
' AND co.ce_utilisateur = ci.ce_utilisateur '.
|
348 |
'ORDER BY '.(isset($this->orderby) && (!is_null($this->orderby)) ? $this->orderby : 'ci.date_creation DESC').' '.
|
348 |
'ORDER BY '.(isset($this->orderby) && (!is_null($this->orderby)) ? $this->orderby : 'ci.date_creation DESC').' '.
|
Line 381... |
Line 381... |
381 |
$requete = (isset($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' co.*, '.
|
381 |
$requete = (isset($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' co.*, '.
|
382 |
' ci.id_image, co.ce_utilisateur, nom_original, ci.date_creation, ci.mots_cles_texte AS mots_cles_texte_images, '.
|
382 |
' ci.id_image, co.ce_utilisateur, nom_original, ci.date_creation, ci.mots_cles_texte AS mots_cles_texte_images, '.
|
383 |
' co.mots_cles_texte AS mots_cles_texte_obs, ci.commentaire AS commentaire_img, note_qualite, nom_referentiel, '.
|
383 |
' co.mots_cles_texte AS mots_cles_texte_obs, ci.commentaire AS commentaire_img, note_qualite, nom_referentiel, '.
|
384 |
' co.commentaire AS commentaire_obs '.
|
384 |
' co.commentaire AS commentaire_obs '.
|
385 |
'FROM cel_images_export AS ci '.
|
385 |
'FROM cel_images_export AS ci '.
|
386 |
' LEFT JOIN cel_export_total AS co '.
|
386 |
' JOIN cel_export AS co '.
|
387 |
' ON (ci.ce_observation = co.id_observation) '.
|
387 |
' ON (ci.ce_observation = co.id_observation) '.
|
388 |
(($this->etreFluxAdmin()) ? '' : 'WHERE co.transmission = 1 ').
|
388 |
(($this->etreFluxAdmin()) ? '' : 'WHERE co.transmission = 1 ').
|
389 |
'ORDER BY '.(isset($this->orderby) && (!is_null($this->orderby)) ? $this->orderby : 'ci.date_creation DESC').' '.
|
389 |
'ORDER BY '.(isset($this->orderby) && (!is_null($this->orderby)) ? $this->orderby : 'ci.date_creation DESC').' '.
|
390 |
"LIMIT $this->start, $this->limit ";
|
390 |
"LIMIT $this->start, $this->limit ";
|
391 |
//echo $requete;
|
391 |
//echo $requete;
|
Line 436... |
Line 436... |
436 |
private function creerRequeteSansParametres() {
|
436 |
private function creerRequeteSansParametres() {
|
437 |
// Construction de la requête
|
437 |
// Construction de la requête
|
438 |
$requete = 'SELECT *, b.mots_cles_texte AS mots_cles_texte_obs, c.mots_cles_texte AS mots_cles_texte_images, '.
|
438 |
$requete = 'SELECT *, b.mots_cles_texte AS mots_cles_texte_obs, c.mots_cles_texte AS mots_cles_texte_images, '.
|
439 |
' b.commentaire AS commentaire_obs, "" AS commentaire_img, nom_referentiel '.
|
439 |
' b.commentaire AS commentaire_obs, "" AS commentaire_img, nom_referentiel '.
|
440 |
'FROM cel_images_export c '.
|
440 |
'FROM cel_images_export c '.
|
441 |
' left JOIN cel_export AS b '.
|
441 |
' JOIN cel_export AS b '.
|
442 |
' ON (c.ce_observation = b.id_observation) ';
|
442 |
' ON (c.ce_observation = b.id_observation) ';
|
443 |
$requete .= ' ORDER BY '.(isset($this->orderby) && (!is_null($this->orderby)) ? $this->orderby : 'c.date_creation DESC').' '.
|
443 |
$requete .= ' ORDER BY '.(isset($this->orderby) && (!is_null($this->orderby)) ? $this->orderby : 'c.date_creation DESC').' '.
|
444 |
"LIMIT $this->start,$this->limit ";
|
444 |
"LIMIT $this->start,$this->limit ";
|
445 |
//echo $requete;
|
445 |
//echo $requete;
|
446 |
return $requete;
|
446 |
return $requete;
|
Line 449... |
Line 449... |
449 |
private function creerRequeteAvecParametres() {
|
449 |
private function creerRequeteAvecParametres() {
|
450 |
// Construction de la requête
|
450 |
// Construction de la requête
|
451 |
$requete = 'SELECT *, b.mots_cles_texte as mots_cles_texte_obs, c.mots_cles_texte as mots_cles_texte_images, '.
|
451 |
$requete = 'SELECT *, b.mots_cles_texte as mots_cles_texte_obs, c.mots_cles_texte as mots_cles_texte_images, '.
|
452 |
' b.commentaire as commentaire_obs, "" as commentaire_img, nom_referentiel '.
|
452 |
' b.commentaire as commentaire_obs, "" as commentaire_img, nom_referentiel '.
|
453 |
'FROM cel_images_export AS c '.
|
453 |
'FROM cel_images_export AS c '.
|
454 |
' INNER JOIN cel_export_total AS b '.
|
454 |
' JOIN cel_export_total AS b '.
|
455 |
' ON (c.ce_observation = b.id_observation) '.
|
455 |
' ON (c.ce_observation = b.id_observation) '.
|
456 |
'WHERE donnees_standard = 1'.
|
456 |
'WHERE '.
|
457 |
(($this->etreFluxAdmin()) ? '' : ' AND b.transmission = 1 ').
|
457 |
(($this->etreFluxAdmin()) ? '' : ' AND b.transmission = 1 ').
|
458 |
' AND ';
|
458 |
' AND ';
|
Line 459... |
Line 459... |
459 |
|
459 |
|
460 |
if ($this->estUneRechercheGenerale()) {
|
460 |
if ($this->estUneRechercheGenerale()) {
|
461 |
$chaine_requete = $_GET['recherche'];
|
461 |
$chaine_requete = $_GET['recherche'];
|
462 |
$requete .= $this->creerSousRequeteRechercheGenerale($chaine_requete);
|
462 |
$requete .= "donnees_standard = 1 AND ".$this->creerSousRequeteRechercheGenerale($chaine_requete);
|
463 |
} else {
|
463 |
} else {
|
464 |
$criteres = $this->traiterCriteresMultiples($_GET) ;
|
464 |
$criteres = $this->traiterCriteresMultiples($_GET) ;
|
465 |
if (!empty($criteres)) {
|
465 |
if (!empty($criteres)) {
|
466 |
$requete .= $this->creerSousRequeteRechercheParCriteres($criteres);
|
466 |
$requete .= $this->creerSousRequeteRechercheParCriteres($criteres);
|