Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 1175 Rev 1194
Line 95... Line 95...
95
			$criteres[] = "nom_sel_nn IN (".implode(',', array_unique($taxons))	.")";
95
			$criteres[] = "nom_sel_nn IN (".implode(',', array_unique($taxons))	.")";
96
		}
96
		}
97
		return "(".implode(' OR ',array_unique($criteres)).")";
97
		return "(".implode(' OR ',array_unique($criteres)).")";
98
	}
98
	}
Line -... Line 99...
-
 
99
	
-
 
100
	
99
	
101
	
100
	public function recupererStationsMoissonnage($source) {
102
	public function recupererStationsMoissonnage($source) {
101
		$this->bdd->requeter("USE ".Config::get('bdd_nom'));
103
		$this->bdd->requeter("USE ".Config::get('bdd_nom'));
102
		$requete =
104
		$requete =
103
		"SELECT DISTINCTROW lieu_commune_code_insee, observation_date AS date, observateur_nom_complet AS auteur ".
105
		"SELECT DISTINCTROW lieu_commune_code_insee, observation_date AS date, observateur_nom_complet AS auteur ".
Line 108... Line 110...
108
		$stations = $this->bdd->recupererTous($requete);
110
		$stations = $this->bdd->recupererTous($requete);
109
		$this->rechercherInfosCommune($stations);
111
		$this->rechercherInfosCommune($stations);
110
		return $stations;
112
		return $stations;
111
	}
113
	}
Line -... Line 114...
-
 
114
	
-
 
115
	public function recupererStationsVigieFlore() {
-
 
116
		$this->bdd->requeter("USE ".Config::get('bdd_nom'));
-
 
117
		$requete =
-
 
118
		"SELECT DISTINCTROW lieu_commune_code_insee AS commune, Floor(lieu_station_longitude*10)/10 as lng, Floor(lieu_station_latitude*10)/10 as lat, observation_date AS date, observateur_nom_complet AS auteur ".
-
 
119
		"FROM vigie_flore_tapir WHERE ".$this->construireWhereTaxonMoissonnage('vigie_flore')." ".
-
 
120
		"AND lieu_station_longitude BETWEEN ".$this->limitesCarte['ouest']." AND ".$this->limitesCarte['est']." ".
-
 
121
		"AND lieu_station_latitude BETWEEN ".$this->limitesCarte['sud']." AND ".$this->limitesCarte['nord']." ".
-
 
122
		" ORDER BY lat DESC, lng ASC, lieu_commune_code_insee, date"." -- " . __FILE__ . ":" . __LINE__." ". @$_SERVER['REQUEST_URI'];
-
 
123
		$stations = $this->bdd->recupererTous($requete);
-
 
124
		return $stations;
-
 
125
	}
112
	
126
	
113
	private function construireWhereTaxonMoissonnage($source) {
127
	private function construireWhereTaxonMoissonnage($source) {
114
		$nomRang = $this->obtenirNomRang();
128
		$nomRang = $this->obtenirNomRang();
115
		$criteres = array();
129
		$criteres = array();
116
		$criteres[] = ($source == "baznat" || $source == "ifn") ? 
130
		$criteres[] = (in_array($source, array("baznat", "ifn", "vigie_flore")) ) ? 
117
						"num_nom = ".$this->taxon['num_nom'] : 
131
						"num_nom = ".$this->taxon['num_nom'] : 
118
						"nom_scientifique_complet LIKE ".$this->bdd->proteger($this->taxon['nom_sci']) ;
132
						"nom_scientifique_complet LIKE ".$this->bdd->proteger($this->taxon['nom_sci']) ;
119
		if ($this->nomRang == 'espece' || $this->nomRang == 'sous_espece') {
133
		if ($this->nomRang == 'espece' || $this->nomRang == 'sous_espece') {
120
			foreach ($this->taxons as $sousTaxon) {
134
			foreach ($this->taxons as $sousTaxon) {
121
				$criteres[] = ($source == "baznat" || $source == "ifn") ?
135
				$criteres[] = (in_array($source, array("baznat", "ifn", "vigie_flore"))) ?
122
										"num_nom = ".$sousTaxon['num_nom'] : 
136
										"num_nom = ".$sousTaxon['num_nom'] : 
123
										"nom_scientifique_complet LIKE ".$this->bdd->proteger($sousTaxon['nom_sci']) ;
137
										"nom_scientifique_complet LIKE ".$this->bdd->proteger($sousTaxon['nom_sci']) ;
124
			}
138
			}
125
		} elseif ($this->nomRang == 'famille') {
139
		} elseif ($this->nomRang == 'famille') {