Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1635 → Rev 1636

/trunk/jrest/services/CoelStructure.php
64,7 → 64,7
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_projet', 'id_structure', 'nom'), $param);
$p = $this->traiterParametresUrl(array('id_projet', 'id_structure', 'recherche'), $param);
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' cs.*, csc.*, csv.*, '.
76,7 → 76,7
((count($p) != 0) ? 'WHERE ' : '').
((isset($p['id_projet'])) ? "AND cs_ce_projet = {$p['id_projet']} " : '').
((isset($p['id_structure'])) ? "AND cs_id_structure = {$p['id_structure']} " : '').
((isset($p['nom'])) ? "AND cs_nom LIKE {$p['nom']} " : '').
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cs.cs_nom ASC').' ';
$requete = str_replace('WHERE AND', 'WHERE', $requete);
102,6 → 102,15
return $info;
}
private function construireWhereRecherche($recherche) {
$recherche = "AND ".
"(".
"cs_nom LIKE {$recherche} OR ".
"cs_ville LIKE {$recherche} ".
")";
return $recherche;
}
/* Méthode pour récupérer le nombre de structure par zone géographique.
* Appelée avec les paramêtres d'url suivant :
* /CoelStructure/ParZoneGeo/_