Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Ignore whitespace Rev 1211 → Rev 1212

/branches/v5.12-baouque/services/modules/0.1/moissonnage/cartes/SourceDonnees.php
107,7 → 107,7
"AND lieu_station_longitude BETWEEN ".$this->limitesCarte['ouest']." AND ".$this->limitesCarte['est']." ".
"AND lieu_station_latitude BETWEEN ".$this->limitesCarte['sud']." AND ".$this->limitesCarte['nord']." ".
"AND Length(lieu_commune_code_insee)=5 ORDER BY lieu_commune_code_insee, date"." -- " . __FILE__ . ":" . __LINE__." ". @$_SERVER['REQUEST_URI'];
$stations = $this->bdd->recupererTous($requete);
$stations = $this->bdd->recupererTous($requete);
$this->rechercherInfosCommune($stations);
return $stations;
}
124,21 → 124,33
return $stations;
}
public function recupererStationsPhotoflora() {
$this->bdd->requeter("USE ".Config::get('bdd_nom'));
$requete =
"SELECT DISTINCTROW lieu_commune_code_insee, observation_date AS date, observateur_nom_complet AS auteur ".
"FROM photoflora_tapir WHERE ".$this->construireWhereTaxonMoissonnage('photoflora')." ".
"AND Length(lieu_commune_code_insee)=5 ORDER BY lieu_commune_code_insee, date"." -- " . __FILE__ . ":" . __LINE__." ". @$_SERVER['REQUEST_URI'];
$stations = $this->bdd->recupererTous($requete);
$this->rechercherInfosCommune($stations);
return $stations;
}
private function construireWhereTaxonMoissonnage($source) {
$nomRang = $this->obtenirNomRang();
$criteres = array();
$criteres[] = (in_array($source, array("baznat", "ifn", "vigie_flore")) ) ?
$criteres[] = (in_array($source, array("baznat", "ifn", "vigie_flore", "photoflora")) ) ?
"num_nom = ".$this->taxon['num_nom'] :
"nom_scientifique_complet LIKE ".$this->bdd->proteger($this->taxon['nom_sci']) ;
if ($this->nomRang == 'espece' || $this->nomRang == 'sous_espece') {
foreach ($this->taxons as $sousTaxon) {
if ($source == "sophy") {
if ($sousTaxon['num_nom'] = $sousTaxon['num_nom_retenu']) {
if (isset($sousTaxon['num_nom_retenu']) && $sousTaxon['num_nom'] == $sousTaxon['num_nom_retenu']) {
$criteres[] =
"nom_scientifique_complet LIKE ".$this->bdd->proteger($sousTaxon['nom_sci']) ;
}
} else {
$criteres[] = (in_array($source, array("baznat", "ifn", "vigie_flore"))) ?
$criteres[] = (in_array($source, array("baznat", "ifn", "vigie_flore", "photoflora"))) ?
"num_nom = ".$sousTaxon['num_nom'] :
"nom_scientifique_complet LIKE ".$this->bdd->proteger($sousTaxon['nom_sci']) ;
}
149,6 → 161,7
}
}
return "(".implode(' OR ',array_unique($criteres)).")";
}
private function rechercherInfosCommune(& $stations) {