| Line 36... |
Line 36... |
| 36 |
return $nomsRangs[$position];
|
36 |
return $nomsRangs[$position];
|
| 37 |
}
|
37 |
}
|
| Line 38... |
Line 38... |
| 38 |
|
38 |
|
| 39 |
protected function recupererSynonymesEtSousEspeces() {
|
39 |
protected function recupererSynonymesEtSousEspeces() {
|
| 40 |
$requete =
|
40 |
$requete =
|
| 41 |
"SELECT num_nom, nom_sci, num_taxonomique FROM bdtfx_v1_01 WHERE hierarchie LIKE '%-{$this->taxon['num_nom']}-%' ".
|
41 |
"SELECT num_nom, nom_sci, nom_complet, num_taxonomique FROM bdtfx_v1_01 WHERE hierarchie LIKE '%-{$this->taxon['num_nom']}-%' ".
|
| 42 |
"OR num_taxonomique = {$this->taxon['num_taxonomique']}";
|
42 |
"OR num_taxonomique = {$this->taxon['num_taxonomique']}";
|
| 43 |
return $this->bdd->recupererTous($requete);
|
43 |
return $this->bdd->recupererTous($requete);
|
| Line 44... |
Line 44... |
| 44 |
}
|
44 |
}
|
| Line 97... |
Line 97... |
| 97 |
|
97 |
|
| 98 |
public function recupererStationsMoissonnage($source) {
|
98 |
public function recupererStationsMoissonnage($source) {
|
| 99 |
$this->bdd->requeter("USE ".Config::get('bdd_nom'));
|
99 |
$this->bdd->requeter("USE ".Config::get('bdd_nom'));
|
| 100 |
$requete =
|
100 |
$requete =
|
| 101 |
"SELECT DISTINCTROW lieu_commune_code_insee, observation_date AS date, observateur_nom_complet AS auteur ".
|
101 |
"SELECT DISTINCTROW lieu_commune_code_insee, observation_date AS date, observateur_nom_complet AS auteur ".
|
| 102 |
"FROM {$source}_tapir WHERE ".$this->construireWhereTaxonMoissonnage()." ".
|
102 |
"FROM {$source}_tapir WHERE ".$this->construireWhereTaxonMoissonnage($source)." ".
|
| 103 |
"AND lieu_station_longitude BETWEEN ".$this->limitesCarte['ouest']." AND ".$this->limitesCarte['est']." ".
|
103 |
"AND lieu_station_longitude BETWEEN ".$this->limitesCarte['ouest']." AND ".$this->limitesCarte['est']." ".
|
| 104 |
"AND lieu_station_latitude BETWEEN ".$this->limitesCarte['sud']." AND ".$this->limitesCarte['nord']." ".
|
104 |
"AND lieu_station_latitude BETWEEN ".$this->limitesCarte['sud']." AND ".$this->limitesCarte['nord']." ".
|
| 105 |
"AND Length(lieu_commune_code_insee)=5 ORDER BY lieu_commune_code_insee, date"." -- " . __FILE__ . ":" . __LINE__." ". @$_SERVER['REQUEST_URI'];
|
105 |
"AND Length(lieu_commune_code_insee)=5 ORDER BY lieu_commune_code_insee, date"." -- " . __FILE__ . ":" . __LINE__." ". @$_SERVER['REQUEST_URI'];
|
| 106 |
$stations = $this->bdd->recupererTous($requete);
|
106 |
$stations = $this->bdd->recupererTous($requete);
|
| 107 |
$this->rechercherInfosCommune($stations);
|
107 |
$this->rechercherInfosCommune($stations);
|
| 108 |
return $stations;
|
108 |
return $stations;
|
| Line 109... |
Line 109... |
| 109 |
}
|
109 |
}
|
| 110 |
|
110 |
|
| 111 |
private function construireWhereTaxonMoissonnage() {
|
111 |
private function construireWhereTaxonMoissonnage($source) {
|
| - |
|
112 |
$nomRang = $this->obtenirNomRang();
|
| - |
|
113 |
$criteres = array();
|
| 112 |
$nomRang = $this->obtenirNomRang();
|
114 |
|
| 113 |
$criteres = array();
|
115 |
$nom = ($source == "baznat") ? implode('%',explode(' ',$this->taxon['nom_complet'] )) : $this->taxon['nom_sci'] ;
|
| 114 |
$criteres[] = "nom_scientifique_complet LIKE ".$this->bdd->proteger($this->taxon['nom_sci']."%");
|
116 |
$criteres[] = "nom_scientifique_complet LIKE ".$this->bdd->proteger($nom);
|
| - |
|
117 |
if ($this->nomRang == 'espece' || $this->nomRang == 'sous_espece') {
|
| 115 |
if ($this->nomRang == 'espece' || $this->nomRang == 'sous_espece') {
|
118 |
foreach ($this->taxons as $sousTaxon) {
|
| 116 |
foreach ($this->taxons as $sousTaxon) {
|
119 |
$nom = ($source == "baznat") ? implode('%',explode(' ',$sousTaxon['nom_complet'] )) : $sousTaxon['nom_sci'];
|
| 117 |
$criteres[] = "nom_scientifique_complet LIKE ".$this->bdd->proteger($sousTaxon['nom_sci']."%");
|
120 |
$criteres[] = "nom_scientifique_complet LIKE ".$this->bdd->proteger($nom);
|
| 118 |
}
|
121 |
}
|
| 119 |
} elseif ($this->nomRang == 'famille') {
|
122 |
} elseif ($this->nomRang == 'famille') {
|
| 120 |
foreach ($this->genres as $genre) {
|
123 |
foreach ($this->genres as $genre) {
|