Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 1153 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1153 Rev 1227
Line 204... Line 204...
204
			foreach ($niveaux as $niveau) {
204
			foreach ($niveaux as $niveau) {
205
				$niveau_str[] = $this->bdd->proteger($niveau);
205
				$niveau_str[] = $this->bdd->proteger($niveau);
206
			}
206
			}
207
		}
207
		}
Line 208... Line -...
208
		
-
 
209
		$pays_str = '';
208
 
-
 
209
		if($pays != null) {
210
		if($pays != null) {
210
			// Si le pays correspond, on fait remonter le résultat
211
			$pays_str = '(code_iso_3166_1 = '.$this->bdd->proteger($pays).' OR  '.
211
			$champs_tri .= ', IF(code_iso_3166_1 = ' . $this->bdd->proteger($pays)
-
 
212
				. ' OR  ' . 'code_iso_3166_2 LIKE ' . $this->bdd->proteger($pays."%") . ', 1, 0) as pays_correspond ';
212
			'code_iso_3166_2 LIKE '.$this->bdd->proteger($pays."%").')';
213
			$ordre = 'pays_correspond DESC, ' . $ordre;
Line 213... Line 214...
213
		}
214
		}
214
		
215
		
215
		$requete = "SELECT $champs, $champs_tri FROM osm_zones_admin ".
216
		$requete = "SELECT $champs, $champs_tri FROM osm_zones_admin ".
216
					"WHERE ".
-
 
217
						(!empty($niveau_str) ? ("niveau IN (".implode(',', $niveau_str).") AND ") : "").
217
					"WHERE ".
218
						(!empty($pays_str) ? $pays_str.' AND ' : ""). 
218
						(!empty($niveau_str) ? ("niveau IN (".implode(',', $niveau_str).") AND ") : "").
219
						"(nom LIKE ".$this->bdd->proteger($masque_fmt).' OR '.
219
						"(nom LIKE ".$this->bdd->proteger($masque_fmt).' OR '.
220
						"intitule LIKE ".$this->bdd->proteger($masque_fmt).' OR '.
220
						"intitule LIKE ".$this->bdd->proteger($masque_fmt).' OR '.
221
						"nom_fr LIKE ".$this->bdd->proteger($masque_fmt).' OR '.
221
						"nom_fr LIKE ".$this->bdd->proteger($masque_fmt).' OR '.