Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 1278 → Rev 1279

/trunk/jrest/lib/RechercheImage.php
196,6 → 196,22
$sous_requete .= ') AND ' ;
break;
case "auteur":
$sous_requete .= '(ci.ce_utilisateur LIKE '.$this->proteger($valeur.'%').' OR '.
'ci.courriel_utilisateur LIKE '.$this->proteger($valeur.'%').' OR '.
'ci.nom_utilisateur LIKE '.$this->proteger($valeur.'%').' OR '.
'ci.prenom_utilisateur LIKE '.$this->proteger($valeur.'%').
') AND ';
break;
case "ce_zone_geo":
$sous_requete .= '(co.ce_zone_geo LIKE '.(is_numeric($valeur) ? $this->proteger('INSEE-C:'.$valeur.'%') : $this->proteger($valeur)).') ';
break;
case "zone_geo":
$sous_requete .= '(co.zone_geo = '.$this->proteger($valeur).') ';
break;
default:
$sous_requete .= 'ci.'.$nom.' = '.$this->proteger($valeur) ;
$sous_requete .= ' AND ' ;
240,10 → 256,12
$requete .= ' OR ' ;
}
$requete .= 'ci.ce_utilisateur LIKE '.$this->proteger($chaine_recherche.'%') ;
$requete .= 'ci.ce_utilisateur LIKE '.$this->proteger($chaine_recherche.'%').' OR '.
'ci.courriel_utilisateur LIKE '.$this->proteger($chaine_recherche.'%').' OR '.
'ci.nom_utilisateur LIKE '.$this->proteger($chaine_recherche.'%').' OR '.
'ci.prenom_utilisateur LIKE '.$this->proteger($chaine_recherche.'%').' '.
') ';
$requete .= ') ';
return $requete;
}
/trunk/jrest/services/InventoryImageListPublic.php
43,15 → 43,16
$this->limit = isset($_GET['limit']) ? $_GET['limit'] : self::limit_defaut;
$criteres['mots_cles'] = isset($_GET['tag']) ? $_GET['tag'] : null;
$criteres['ce_utilisateur'] = isset($_GET['auteur']) ? $_GET['auteur'] : null;
$criteres['auteur'] = isset($_GET['auteur']) ? $_GET['auteur'] : null;
$criteres['zone_geo'] = isset($_GET['commune']) ? $_GET['commune'] : null;
$criteres['taxon'] = isset($_GET['taxon']) ? $_GET['taxon'] : null;
$criteres['ce_zone_geo'] = isset($_GET['dept']) ? $_GET['dept'] : null;
$criteres['recherche'] = isset($_GET['recherche']) ? $_GET['recherche'] : null;
$chercheur_images = new RechercheImage($this->config);
$total = $chercheur_images->compterImages($criteres['ce_utilisateur'], $criteres);
$images = $chercheur_images->rechercherImages($criteres['ce_utilisateur'], $criteres, $this->start, $this->limit);
$total = $chercheur_images->compterImages(null, $criteres);
$images = $chercheur_images->rechercherImages(null, $criteres, $this->start, $this->limit);
 
$resultat = array('total' => $total,'images' => $images);