Line 62... |
Line 62... |
62 |
public function getStations($params) {
|
62 |
public function getStations($params) {
|
63 |
$json = null;
|
63 |
$json = null;
|
64 |
$requete = 'SELECT utm_secteur, utm_x, utm_y, wgs84_latitude AS latitude, wgs84_longitude AS longitude '.
|
64 |
$requete = 'SELECT utm_secteur, utm_x, utm_y, wgs84_latitude AS latitude, wgs84_longitude AS longitude '.
|
65 |
'FROM cel_obs AS co '.
|
65 |
'FROM cel_obs AS co '.
|
66 |
' LEFT JOIN cel_zones_geo AS l '.
|
66 |
' LEFT JOIN cel_zones_geo AS l '.
|
67 |
' ON (l.nom = co.zone_geo AND l.id_zone_geo = co.ce_zone_geo) '.
|
67 |
' ON (l.id_zone_geo = co.ce_zone_geo) '.
|
68 |
"WHERE transmission = '1' ".
|
68 |
"WHERE transmission = '1' ".
|
69 |
$this->construireWhereDept().
|
69 |
$this->construireWhereDept().
|
70 |
$this->construireWhereCommune().
|
70 |
$this->construireWhereCommune().
|
71 |
$this->construireWhereUtilisateur().
|
71 |
$this->construireWhereUtilisateur().
|
72 |
$this->construireWhereNumTaxon().
|
72 |
$this->construireWhereNumTaxon().
|
Line 135... |
Line 135... |
135 |
' nom_sel, nom_ret, nom_sel_nn, nom_ret_nn, nt, famille, '.
|
135 |
' nom_sel, nom_ret, nom_sel_nn, nom_ret_nn, nt, famille, '.
|
136 |
' lieudit, zone_geo, date_observation, milieu, commentaire, '.
|
136 |
' lieudit, zone_geo, date_observation, milieu, commentaire, '.
|
137 |
' utm_secteur, utm_x, utm_y, id_zone_geo, date_transmission '.
|
137 |
' utm_secteur, utm_x, utm_y, id_zone_geo, date_transmission '.
|
138 |
'FROM cel_obs AS co '.
|
138 |
'FROM cel_obs AS co '.
|
139 |
' LEFT JOIN cel_zones_geo AS l '.
|
139 |
' LEFT JOIN cel_zones_geo AS l '.
|
140 |
" ON (l.nom = co.zone_geo AND l.id_zone_geo = co.ce_zone_geo) ".
|
140 |
" ON (l.id_zone_geo = co.ce_zone_geo) ".
|
141 |
"WHERE transmission = '1' ".
|
141 |
"WHERE transmission = '1' ".
|
142 |
$this->construireWhereCoordonnees().
|
142 |
$this->construireWhereCoordonnees().
|
143 |
$this->construireWhereUtilisateur().
|
143 |
$this->construireWhereUtilisateur().
|
144 |
$this->construireWhereNumTaxon().
|
144 |
$this->construireWhereNumTaxon().
|
145 |
$this->construireWhereNomTaxon().
|
145 |
$this->construireWhereNomTaxon().
|
Line 280... |
Line 280... |
280 |
$json = null;
|
280 |
$json = null;
|
Line 281... |
Line 281... |
281 |
|
281 |
|
282 |
$requete = 'SELECT SQL_CALC_FOUND_ROWS DISTINCT nom_ret, nom_ret_nn, nt, famille '.
|
282 |
$requete = 'SELECT SQL_CALC_FOUND_ROWS DISTINCT nom_ret, nom_ret_nn, nt, famille '.
|
283 |
'FROM cel_obs AS co '.
|
283 |
'FROM cel_obs AS co '.
|
284 |
' LEFT JOIN cel_zones_geo AS l '.
|
284 |
' LEFT JOIN cel_zones_geo AS l '.
|
285 |
' ON (l.nom = co.zone_geo AND l.id_zone_geo = co.ce_zone_geo) '.
|
285 |
' ON (l.id_zone_geo = co.ce_zone_geo) '.
|
286 |
"WHERE transmission = '1' ".
|
286 |
"WHERE transmission = '1' ".
|
287 |
" AND nom_ret != '' ".
|
287 |
" AND nom_ret != '' ".
|
288 |
$this->construireWhereDept().
|
288 |
$this->construireWhereDept().
|
289 |
$this->construireWhereCommune().
|
289 |
$this->construireWhereCommune().
|
Line 514... |
Line 514... |
514 |
' LEFT JOIN cel_obs_images coi '.
|
514 |
' LEFT JOIN cel_obs_images coi '.
|
515 |
' ON (coi.id_image = ci.id_image) '.
|
515 |
' ON (coi.id_image = ci.id_image) '.
|
516 |
' LEFT JOIN cel_obs AS co '.
|
516 |
' LEFT JOIN cel_obs AS co '.
|
517 |
' ON coi.id_observation = co.id_observation '.
|
517 |
' ON coi.id_observation = co.id_observation '.
|
518 |
' LEFT JOIN locations AS l '.
|
518 |
' LEFT JOIN locations AS l '.
|
519 |
' ON (l.nom = co.zone_geo AND l.id_zone_geo = co.ce_zone_geo) '.
|
519 |
' ON (l.id_zone_geo = co.ce_zone_geo) '.
|
520 |
"WHERE transmission = '1' ".
|
520 |
"WHERE transmission = '1' ".
|
521 |
($type == 'date.photo' ? " AND (date_prise_de_vue LIKE ".str_replace('-', ':', $param).") " : '').
|
521 |
($type == 'date.photo' ? " AND (date_prise_de_vue LIKE ".str_replace('-', ':', $param).") " : '').
|
522 |
($type == 'date.ajout' ? " AND date_creation LIKE $param " : '').
|
522 |
($type == 'date.ajout' ? " AND date_creation LIKE $param " : '').
|
523 |
($type == 'date.liaison' ? " AND date_liaison LIKE $param " : '').
|
523 |
($type == 'date.liaison' ? " AND date_liaison LIKE $param " : '').
|
524 |
// TODO: recherche sur le xml
|
524 |
// TODO: recherche sur le xml
|
Line 668... |
Line 668... |
668 |
' LEFT JOIN cel_obs_images coi'.
|
668 |
' LEFT JOIN cel_obs_images coi'.
|
669 |
' ON (ci.id_image = coi.id_image) '.
|
669 |
' ON (ci.id_image = coi.id_image) '.
|
670 |
' LEFT JOIN cel_obs AS co '.
|
670 |
' LEFT JOIN cel_obs AS co '.
|
671 |
' ON (coi.id_observation = co.id_observation) '.
|
671 |
' ON (coi.id_observation = co.id_observation) '.
|
672 |
' LEFT JOIN cel_zones_geo AS l '.
|
672 |
' LEFT JOIN cel_zones_geo AS l '.
|
673 |
" ON (l.nom = co.zone_geo AND l.id_zone_geo = co.ce_zone_geo) ".
|
673 |
" ON (l.id_zone_geo = co.ce_zone_geo) ".
|
674 |
"WHERE transmission = '1' ".
|
674 |
"WHERE transmission = '1' ".
|
675 |
$this->construireWhereCoordonnees().
|
675 |
$this->construireWhereCoordonnees().
|
676 |
$this->construireWhereUtilisateur().
|
676 |
$this->construireWhereUtilisateur().
|
677 |
$this->construireWhereNumTaxon().
|
677 |
$this->construireWhereNumTaxon().
|
678 |
$this->construireWhereNomTaxon().
|
678 |
$this->construireWhereNomTaxon().
|