Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 211 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 211 Rev 212
Line 97... Line 97...
97
	}
97
	}
Line 98... Line 98...
98
 
98
 
99
	public function rechercherFloue() {
99
	public function rechercherFloue() {
100
		$table = $this->getTable();
100
		$table = $this->getTable();
-
 
101
		$masque = $this->parametres->getMasquePourBdd();
101
		$masque = $this->parametres->getMasquePourBdd();
102
		$where = $this->getWhere();
102
		$navigation = $this->getNavigation();
103
		$navigation = $this->getNavigation();
103
		$requete = 'SELECT SQL_CALC_FOUND_ROWS ns.*,  '.
104
		$requete = 'SELECT SQL_CALC_FOUND_ROWS ns.*,  '.
104
			'	nr.nom_sci AS nr_nom_sci, nb.nom_sci AS nb_nom_sci '.
105
			'	nr.nom_sci AS nr_nom_sci, nb.nom_sci AS nb_nom_sci '.
105
			"FROM $table AS ns ".
106
			"FROM $table AS ns ".
106
			"	LEFT JOIN $table AS nr ON (ns.num_nom_retenu = nr.num_nom) ".
107
			"	LEFT JOIN $table AS nr ON (ns.num_nom_retenu = nr.num_nom) ".
107
			"	LEFT JOIN $table AS nb ON (ns.basionyme = nb.num_nom) ".
108
			"	LEFT JOIN $table AS nb ON (ns.basionyme = nb.num_nom) ".
108
			$this->getWhere().
109
			$where .
109
			($masque ?
110
			($masque ? ($where ? ' AND ' : ' WHERE ').
110
					"	(SOUNDEX(ns.nom_sci) = SOUNDEX($masque)) ".
111
				"	(SOUNDEX(ns.nom_sci) = SOUNDEX($masque)) ".
111
					"	OR (SOUNDEX(REVERSE(ns.nom_sci)) = SOUNDEX(REVERSE($masque))) " : '').
112
				"	OR (SOUNDEX(REVERSE(ns.nom_sci)) = SOUNDEX(REVERSE($masque))) " : '').
112
			'ORDER BY ns.nom_sci ASC '.
113
			'ORDER BY ns.nom_sci ASC '.
113
			"LIMIT $navigation ";
114
			"LIMIT $navigation ";
114
		$resultats = $this->bdd->recupererTous($requete);
115
		$resultats = $this->bdd->recupererTous($requete);
115
		return $resultats;
116
		return $resultats;