| Line 109... |
Line 109... |
| 109 |
$this->construireWhereRectangleStationOR()." OR ".
|
109 |
$this->construireWhereRectangleStationOR()." OR ".
|
| 110 |
$this->construireWhereRectangleCommuneOR().") ".
|
110 |
$this->construireWhereRectangleCommuneOR().") ".
|
| 111 |
$this->construireWhereDept().
|
111 |
$this->construireWhereDept().
|
| 112 |
$this->construireWhereCommune().
|
112 |
$this->construireWhereCommune().
|
| 113 |
$this->construireWhereUtilisateur().
|
113 |
$this->construireWhereUtilisateur().
|
| 114 |
$this->construireWhereNumTaxon().
|
114 |
$this->construireWhereNumTaxonAvecSousTaxons().
|
| 115 |
$this->construireWhereNomTaxon().
|
115 |
$this->construireWhereNomTaxon().
|
| 116 |
$this->construireWhereReferentiel().
|
116 |
$this->construireWhereReferentiel().
|
| 117 |
$this->construireWhereDate().
|
117 |
$this->construireWhereDate().
|
| 118 |
$this->construireWhereCommentaire().
|
118 |
$this->construireWhereCommentaire().
|
| 119 |
$this->construireWherePhotosSeulement().
|
119 |
$this->construireWherePhotosSeulement().
|
| 120 |
$this->construireWhereProjet().
|
120 |
$this->construireWhereProjet().
|
| 121 |
$this->construireWhereTag().
|
121 |
$this->construireWhereTag().
|
| 122 |
$this->construireWhereNombreDeJours().
|
122 |
$this->construireWhereNombreDeJours().
|
| 123 |
' GROUP BY id_coord';
|
123 |
' GROUP BY id_coord';
|
| 124 |
|
124 |
|
| 125 |
$resultats_emplacements = $this->executerRequete($requete);
|
125 |
$resultats_emplacements = $this->executerRequete($requete);
|
| 126 |
$emplacements = $this->traiterEmplacements($resultats_emplacements, $this->compterObservations($params));
|
126 |
$emplacements = $this->traiterEmplacements($resultats_emplacements, $this->compterObservations($params));
|
| 127 |
return $emplacements;
|
127 |
return $emplacements;
|
| 128 |
}
|
128 |
}
|
| Line 146... |
Line 146... |
| 146 |
$this->construireWhereRectangleStationOR()." OR ".
|
146 |
$this->construireWhereRectangleStationOR()." OR ".
|
| 147 |
$this->construireWhereRectangleCommuneOR().") ".
|
147 |
$this->construireWhereRectangleCommuneOR().") ".
|
| 148 |
$this->construireWhereDept().
|
148 |
$this->construireWhereDept().
|
| 149 |
$this->construireWhereCommune().
|
149 |
$this->construireWhereCommune().
|
| 150 |
$this->construireWhereUtilisateur().
|
150 |
$this->construireWhereUtilisateur().
|
| 151 |
$this->construireWhereNumTaxon().
|
151 |
$this->construireWhereNumTaxonAvecSousTaxons().
|
| 152 |
$this->construireWhereNomTaxon().
|
152 |
$this->construireWhereNomTaxon().
|
| 153 |
$this->construireWhereReferentiel().
|
153 |
$this->construireWhereReferentiel().
|
| 154 |
$this->construireWhereDate().
|
154 |
$this->construireWhereDate().
|
| 155 |
$this->construireWhereCommentaire().
|
155 |
$this->construireWhereCommentaire().
|
| 156 |
$this->construireWherePhotosSeulement().
|
156 |
$this->construireWherePhotosSeulement().
|
| 157 |
$this->construireWhereProjet().
|
157 |
$this->construireWhereProjet().
|
| 158 |
$this->construireWhereTag().
|
158 |
$this->construireWhereTag().
|
| 159 |
$this->construireWhereNombreDeJours();
|
159 |
$this->construireWhereNombreDeJours();
|
| 160 |
//echo $requete;exit;
|
- |
|
| - |
|
160 |
|
| 161 |
$resultats_nb_obs = $this->executerRequete($requete);
|
161 |
$resultats_nb_obs = $this->executerRequete($requete);
|
| 162 |
return $resultats_nb_obs[0]['nb'];
|
162 |
return $resultats_nb_obs[0]['nb'];
|
| 163 |
}
|
163 |
}
|
| Line 164... |
Line 164... |
| 164 |
|
164 |
|
| Line 330... |
Line 330... |
| 330 |
" ON (l.nom = co.zone_geo AND l.id_zone_geo = co.ce_zone_geo) ".
|
330 |
" ON (l.nom = co.zone_geo AND l.id_zone_geo = co.ce_zone_geo) ".
|
| 331 |
"WHERE transmission = '1' ".
|
331 |
"WHERE transmission = '1' ".
|
| 332 |
(($this->communeEstDemandee()) ? $this->construireWhereCommuneSansCoordonneesAvecSensibles() : $this->construireWhereCoordonneesSansSensibles()).
|
332 |
(($this->communeEstDemandee()) ? $this->construireWhereCommuneSansCoordonneesAvecSensibles() : $this->construireWhereCoordonneesSansSensibles()).
|
| 333 |
$this->construireWhereDept().
|
333 |
$this->construireWhereDept().
|
| 334 |
$this->construireWhereUtilisateur().
|
334 |
$this->construireWhereUtilisateur().
|
| 335 |
$this->construireWhereNumTaxon().
|
335 |
$this->construireWhereNumTaxonAvecSousTaxons().
|
| 336 |
$this->construireWhereNomTaxon().
|
336 |
$this->construireWhereNomTaxon().
|
| 337 |
$this->construireWhereReferentiel().
|
337 |
$this->construireWhereReferentiel().
|
| 338 |
$this->construireWhereDate().
|
338 |
$this->construireWhereDate().
|
| 339 |
$this->construireWhereCommentaire().
|
339 |
$this->construireWhereCommentaire().
|
| 340 |
$this->construireWherePhotosSeulement().
|
340 |
$this->construireWherePhotosSeulement().
|
| Line 954... |
Line 954... |
| 954 |
$utilisateur = $this->proteger($utilisateur);
|
954 |
$utilisateur = $this->proteger($utilisateur);
|
| 955 |
$sql = " AND co.courriel_utilisateur = $utilisateur ";
|
955 |
$sql = " AND co.courriel_utilisateur = $utilisateur ";
|
| 956 |
}
|
956 |
}
|
| 957 |
return $sql;
|
957 |
return $sql;
|
| 958 |
}
|
958 |
}
|
| - |
|
959 |
|
| 959 |
|
960 |
|
| 960 |
private function construireWhereNumTaxon() {
|
961 |
private function construireWhereNumTaxon() {
|
| 961 |
$sql = '';
|
962 |
$sql = '';
|
| 962 |
// Récupération des coordonnées depuis l'id station
|
963 |
// Récupération des coordonnées depuis l'id station
|
| 963 |
extract($this->parametres);
|
964 |
extract($this->parametres);
|
| 964 |
if (isset($this->parametres['num_taxon']) && !$this->etreNull($num_taxon)) {
|
965 |
if (isset($this->parametres['num_taxon']) && !$this->etreNull($num_taxon)) {
|
| - |
|
966 |
$num_taxon = $this->proteger($num_taxon);
|
| - |
|
967 |
$sql = " AND nt = $num_taxon ";
|
| - |
|
968 |
}
|
| - |
|
969 |
return $sql;
|
| - |
|
970 |
}
|
| - |
|
971 |
|
| - |
|
972 |
private function construireWhereNumTaxonAvecSousTaxons() {
|
| - |
|
973 |
$sql = '';
|
| - |
|
974 |
// Récupération des coordonnées depuis l'id station
|
| - |
|
975 |
extract($this->parametres);
|
| - |
|
976 |
if (isset($this->parametres['num_taxon']) && !$this->etreNull($num_taxon)) {
|
| - |
|
977 |
$sous_taxons = $this->obtenirSousTaxons($this->parametres['num_taxon']);
|
| 965 |
$num_taxon = $this->proteger($num_taxon);
|
978 |
$num_taxon = $this->proteger($num_taxon);
|
| - |
|
979 |
if(!empty($sous_taxons)) {
|
| - |
|
980 |
$sql_in_sous_tax = implode(',', $sous_taxons);
|
| - |
|
981 |
$sql = " AND (nt = $num_taxon OR ".
|
| - |
|
982 |
"nom_sel_nn IN (".$sql_in_sous_tax.") OR ".
|
| - |
|
983 |
"nom_ret_nn IN (".$sql_in_sous_tax.") ".
|
| - |
|
984 |
") ";
|
| - |
|
985 |
}
|
| - |
|
986 |
else {
|
| 966 |
$sql = " AND nt = $num_taxon ";
|
987 |
$sql = " AND nt = $num_taxon ";
|
| - |
|
988 |
}
|
| 967 |
}
|
989 |
}
|
| 968 |
return $sql;
|
990 |
return $sql;
|
| 969 |
}
|
991 |
}
|
| - |
|
992 |
|
| - |
|
993 |
private function obtenirSousTaxons($nt) {
|
| - |
|
994 |
$referentiel = 'bdtfx';
|
| - |
|
995 |
if($this->parametres['referentiel'] && $this->parametres['referentiel'] != "" && $this->parametres['referentiel'] != '*') {
|
| - |
|
996 |
$referentiel = $this->parametres['referentiel'];
|
| - |
|
997 |
}
|
| - |
|
998 |
$nn_sous_taxons = array();
|
| - |
|
999 |
$sous_taxons = $this->obtenirSousTaxonsPourNt($referentiel, $nt);
|
| - |
|
1000 |
foreach($sous_taxons as $sous_tax) {
|
| - |
|
1001 |
$nn_sous_taxons[] = $sous_tax['num_nom'];
|
| - |
|
1002 |
}
|
| - |
|
1003 |
return $nn_sous_taxons;
|
| - |
|
1004 |
}
|
| Line 970... |
Line 1005... |
| 970 |
|
1005 |
|
| 971 |
private function construireWhereProjet() {
|
1006 |
private function construireWhereProjet() {
|
| 972 |
$sql = '';
|
1007 |
$sql = '';
|
| 973 |
// Récupération des coordonnées depuis l'id station
|
1008 |
// Récupération des coordonnées depuis l'id station
|