Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1635 → Rev 1636

/trunk/jrest/services/CoelPersonne.php
29,7 → 29,7
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_personne', 'ce_projet', 'nom'), $param);
$p = $this->traiterParametresUrl(array('id_personne', 'ce_projet', 'recherche'), $param);
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' cp.*, '.
39,7 → 39,7
((count($p) != 0) ? 'WHERE ' : '').
(isset($p['id_personne']) ? "AND cp_id_personne = {$p['id_personne']} " : '').
(isset($p['ce_projet']) ? "AND cp_ce_projet = {$p['ce_projet']} " : '').
(isset($p['nom']) ? "AND cp_nom LIKE {$p['nom']} " : '').
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cp_fmt_nom_complet ASC').' ';
$requete = str_replace('WHERE AND', 'WHERE', $requete);
66,6 → 66,17
$this->envoyer($info);
}
private function construireWhereRecherche($recherche) {
$recherche = "AND ".
"(".
"cp_fmt_nom_complet LIKE {$recherche} OR ".
"cp_code_postal LIKE {$recherche} OR ".
"cp_ville LIKE {$recherche} OR ".
"cp_truk_courriel LIKE {$recherche} ".
")";
return $recherche;
}
/**
* Méthode appelée pour ajouter un élément.
*/