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, nom_complet, num_taxonomique FROM ".Config::get('bdd_table_referentiel').
|
41 |
"SELECT num_nom, nom_sci, nom_complet, num_taxonomique FROM bdtfx_v1_01 WHERE hierarchie LIKE '%-{$this->taxon['num_nom']}-%' ".
|
42 |
" WHERE hierarchie LIKE '%-{$this->taxon['num_nom']}-%' ".
|
42 |
"OR num_taxonomique = {$this->taxon['num_taxonomique']}";
|
43 |
"OR num_nom_retenu = {$this->taxon['num_nom_retenu']}";
|
43 |
return $this->bdd->recupererTous($requete);
|
44 |
return $this->bdd->recupererTous($requete);
|
Line 44... |
Line 45... |
44 |
}
|
45 |
}
|
45 |
|
46 |
|
46 |
protected function recupererGenres() {
|
47 |
protected function recupererGenres() {
|
47 |
$this->bdd->requeter("USE ".Config::get('bdd_nom'));
|
48 |
$this->bdd->requeter("USE ".Config::get('bdd_nom'));
|
- |
|
49 |
$requete =
|
48 |
$requete =
|
50 |
"SELECT num_nom, nom_sci, num_taxonomique FROM ".Config::get('bdd_table_referentiel').
|
49 |
"SELECT num_nom, nom_sci, num_taxonomique FROM bdtfx_v1_01 WHERE rang=220 AND num_tax_sup={$this->taxon['num_nom']}";
|
51 |
" WHERE rang=220 AND num_tax_sup={$this->taxon['num_nom']}";
|
Line 50... |
Line 52... |
50 |
return $this->bdd->recupererTous($requete);
|
52 |
return $this->bdd->recupererTous($requete);
|
51 |
}
|
53 |
}
|
52 |
|
54 |
|
53 |
public function recupererStationsFloradata() {
|
55 |
public function recupererStationsFloradata() {
|
54 |
$this->bdd->requeter("USE ".Config::get('bdd_nom_floradata'));
|
56 |
$this->bdd->requeter("USE ".Config::get('bdd_nom_floradata'));
|
55 |
$requete =
|
57 |
$requete =
|
56 |
"SELECT DISTINCTROW zone_geo AS commune, Date(date_observation) AS date, Floor(wgs84_latitude*10)/10 AS lat, ".
|
58 |
"SELECT DISTINCTROW zone_geo AS commune, Date(date_observation) AS date, Floor(wgs84_latitude*10)/10 AS lat, ".
|
57 |
"Floor(wgs84_longitude*10)/10 AS lng, courriel_utilisateur AS auteur ".
|
59 |
"Floor(wgs84_longitude*10)/10 AS lng, courriel_utilisateur AS auteur ".
|
58 |
"FROM cel_obs LEFT JOIN cel_zones_geo cz ON ce_zone_geo=id_zone_geo ".
|
60 |
"FROM cel_obs LEFT JOIN cel_zones_geo cz ON ce_zone_geo=id_zone_geo ".
|
59 |
"WHERE ".$this->construireWhereTaxonFloradata()." AND transmission=1 AND ".
|
61 |
"WHERE ".$this->construireWhereTaxonFloradata()." AND transmission=1 AND nom_referentiel = '".Config::get('referentielsDispo')."' AND ".
|
60 |
"wgs84_longitude BETWEEN ".$this->limitesCarte['ouest']." AND ".$this->limitesCarte['est']." ".
|
62 |
"wgs84_longitude BETWEEN ".$this->limitesCarte['ouest']." AND ".$this->limitesCarte['est']." ".
|
Line 84... |
Line 86... |
84 |
if ($this->nomRang == 'famille') {
|
86 |
if ($this->nomRang == 'famille') {
|
85 |
$criteres[] = "famille=".$this->bdd->proteger($this->taxon['nom_sci']);
|
87 |
$criteres[] = "famille=".$this->bdd->proteger($this->taxon['nom_sci']);
|
86 |
} elseif ($this->nomRang == 'genre') {
|
88 |
} elseif ($this->nomRang == 'genre') {
|
87 |
$criteres[] = "nom_sel LIKE ".$this->bdd->proteger($this->taxon['nom_sci'].'%');
|
89 |
$criteres[] = "nom_sel LIKE ".$this->bdd->proteger($this->taxon['nom_sci'].'%');
|
88 |
} else {
|
90 |
} else {
|
89 |
$taxons = array($this->taxon['num_taxonomique']);
|
91 |
$taxons = array($this->taxon['num_nom']);
|
90 |
foreach ($this->taxons as $sousTaxon) {
|
92 |
foreach ($this->taxons as $sousTaxon) {
|
91 |
$taxons[] = $sousTaxon['num_taxonomique'];
|
93 |
$taxons[] = $sousTaxon['num_nom'];
|
92 |
}
|
94 |
}
|
93 |
$criteres[] = "nt IN (".implode(',', array_unique($taxons)) .")";
|
95 |
$criteres[] = "nom_sel_nn IN (".implode(',', array_unique($taxons)) .")";
|
94 |
}
|
96 |
}
|
95 |
return "(".implode(' OR ',array_unique($criteres)).")";
|
97 |
return "(".implode(' OR ',array_unique($criteres)).")";
|
96 |
}
|
98 |
}
|
Line 97... |
Line 99... |
97 |
|
99 |
|