26,13 → 26,13 |
$info = array(); |
|
// Pré traitement des paramêtres |
$p = $this->traiterParametresUrl(array('id_projet', 'cpr_nom'), $param); |
$p = $this->traiterParametresUrl(array('id_projet', 'recherche'), $param); |
|
// Nous avons un identifiant de projet, nous récupérons seulement les informations du projet donné |
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' * '. |
'FROM coel_projet '. |
((count($p) != 0) ? 'WHERE ' : ''). |
((isset($p['cpr_nom'])) ? "AND cpr_nom LIKE {$p['cpr_nom']} " : ''). |
((isset($p['recherche'])) ? $this->construireWhereRecherche($p['recherche']) : ''). |
((isset($p['id_projet'])) ? "AND cpr_id_projet = {$p['id_projet']} " : ''). |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cpr_id_projet ASC').' '; |
|
62,6 → 62,18 |
|
} |
|
private function construireWhereRecherche($recherche) { |
$recherche = "AND ". |
"(". |
"cpr_nom LIKE {$recherche} OR ". |
"cpr_abreviation LIKE {$recherche} OR ". |
"cpr_resume LIKE {$recherche} OR ". |
"cpr_url LIKE {$recherche} OR ". |
"cpr_mot_cles LIKE {$recherche} ". |
")"; |
return $recherche; |
} |
|
/** |
* Méthode appelée pour ajouter un élément. |
*/ |