Line 114... |
Line 114... |
114 |
|
114 |
|
115 |
public function recupererStationsVigieFlore() {
|
115 |
public function recupererStationsVigieFlore() {
|
116 |
$this->bdd->requeter("USE ".Config::get('bdd_nom'));
|
116 |
$this->bdd->requeter("USE ".Config::get('bdd_nom'));
|
117 |
$requete =
|
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 ".
|
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($source)." ".
|
119 |
"FROM vigie_flore_tapir WHERE ".$this->construireWhereTaxonMoissonnage('vigie_flore')." ".
|
120 |
"AND lieu_station_longitude BETWEEN ".$this->limitesCarte['ouest']." AND ".$this->limitesCarte['est']." ".
|
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']." ".
|
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'];
|
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;
|
Line 125... |
Line 125... |
125 |
}
|
125 |
}
|
126 |
|
126 |
|
127 |
private function construireWhereTaxonMoissonnage($source) {
|
127 |
private function construireWhereTaxonMoissonnage($source) {
|
128 |
$nomRang = $this->obtenirNomRang();
|
128 |
$nomRang = $this->obtenirNomRang();
|
129 |
$criteres = array();
|
129 |
$criteres = array();
|
130 |
$criteres[] = ($source == "baznat" || $source == "ifn") ?
|
130 |
$criteres[] = (in_array($source, array("baznat", "ifn", "vigie_flore")) ) ?
|
131 |
"num_nom = ".$this->taxon['num_nom'] :
|
131 |
"num_nom = ".$this->taxon['num_nom'] :
|
132 |
"nom_scientifique_complet LIKE ".$this->bdd->proteger($this->taxon['nom_sci']) ;
|
132 |
"nom_scientifique_complet LIKE ".$this->bdd->proteger($this->taxon['nom_sci']) ;
|
133 |
if ($this->nomRang == 'espece' || $this->nomRang == 'sous_espece') {
|
133 |
if ($this->nomRang == 'espece' || $this->nomRang == 'sous_espece') {
|
134 |
foreach ($this->taxons as $sousTaxon) {
|
134 |
foreach ($this->taxons as $sousTaxon) {
|
135 |
$criteres[] = ($source == "baznat" || $source == "ifn") ?
|
135 |
$criteres[] = (in_array($source, array("baznat", "ifn", "vigie_flore"))) ?
|
136 |
"num_nom = ".$sousTaxon['num_nom'] :
|
136 |
"num_nom = ".$sousTaxon['num_nom'] :
|
137 |
"nom_scientifique_complet LIKE ".$this->bdd->proteger($sousTaxon['nom_sci']) ;
|
137 |
"nom_scientifique_complet LIKE ".$this->bdd->proteger($sousTaxon['nom_sci']) ;
|
138 |
}
|
138 |
}
|