Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 1200 Rev 1204
Line 122... Line 122...
122
		" ORDER BY lat DESC, lng ASC, lieu_commune_code_insee, date"." -- " . __FILE__ . ":" . __LINE__." ". @$_SERVER['REQUEST_URI'];
122
		" ORDER BY lat DESC, lng ASC, lieu_commune_code_insee, date"." -- " . __FILE__ . ":" . __LINE__." ". @$_SERVER['REQUEST_URI'];
123
		$stations = $this->bdd->recupererTous($requete);
123
		$stations = $this->bdd->recupererTous($requete);
124
		return $stations;
124
		return $stations;
125
	}
125
	}
Line -... Line 126...
-
 
126
	
-
 
127
	public function recupererStationsPhotoflora() {
-
 
128
		$this->bdd->requeter("USE ".Config::get('bdd_nom'));
-
 
129
		$requete =
-
 
130
		"SELECT DISTINCTROW lieu_commune_code_insee, observation_date AS date, observateur_nom_complet AS auteur ".
-
 
131
		"FROM photoflora_tapir WHERE ".$this->construireWhereTaxonMoissonnage('photoflora')." ".
-
 
132
		"AND Length(lieu_commune_code_insee)=5 ORDER BY lieu_commune_code_insee, date"." -- " . __FILE__ . ":" . __LINE__." ". @$_SERVER['REQUEST_URI'];
-
 
133
		$stations = $this->bdd->recupererTous($requete);
-
 
134
		$this->rechercherInfosCommune($stations);
-
 
135
		return $stations;
-
 
136
	}
-
 
137
	
126
	
138
	
127
	private function construireWhereTaxonMoissonnage($source) {
139
	private function construireWhereTaxonMoissonnage($source) {
128
		$nomRang = $this->obtenirNomRang();
140
		$nomRang = $this->obtenirNomRang();
129
		$criteres = array();
141
		$criteres = array();
130
		$criteres[] = (in_array($source, array("baznat", "ifn", "vigie_flore")) ) ? 
142
		$criteres[] = (in_array($source, array("baznat", "ifn", "vigie_flore", "photoflora")) ) ? 
131
						"num_nom = ".$this->taxon['num_nom'] : 
143
						"num_nom = ".$this->taxon['num_nom'] : 
132
						"nom_scientifique_complet LIKE ".$this->bdd->proteger($this->taxon['nom_sci']) ;
144
						"nom_scientifique_complet LIKE ".$this->bdd->proteger($this->taxon['nom_sci']) ;
133
		if ($this->nomRang == 'espece' || $this->nomRang == 'sous_espece') {
145
		if ($this->nomRang == 'espece' || $this->nomRang == 'sous_espece') {
134
			foreach ($this->taxons as $sousTaxon) {
146
			foreach ($this->taxons as $sousTaxon) {
135
				if ($source == "sophy") {
147
				if ($source == "sophy") {
136
					if ($sousTaxon['num_nom'] = $sousTaxon['num_nom_retenu']) {
148
					if ($sousTaxon['num_nom'] = $sousTaxon['num_nom_retenu']) {
137
						$criteres[] =
149
						$criteres[] =
138
						"nom_scientifique_complet LIKE ".$this->bdd->proteger($sousTaxon['nom_sci']) ;
150
						"nom_scientifique_complet LIKE ".$this->bdd->proteger($sousTaxon['nom_sci']) ;
139
					}
151
					}
140
				} else {
152
				} else {
141
					$criteres[] = (in_array($source, array("baznat", "ifn", "vigie_flore"))) ?
153
					$criteres[] = (in_array($source, array("baznat", "ifn", "vigie_flore", "photoflora"))) ?
142
										"num_nom = ".$sousTaxon['num_nom'] : 
154
										"num_nom = ".$sousTaxon['num_nom'] : 
143
										"nom_scientifique_complet LIKE ".$this->bdd->proteger($sousTaxon['nom_sci']) ;
155
										"nom_scientifique_complet LIKE ".$this->bdd->proteger($sousTaxon['nom_sci']) ;
144
				}
156
				}
145
			}
157
			}