Line 53... |
Line 53... |
53 |
$id_participant = $params['id_participant'];
|
53 |
$id_participant = $params['id_participant'];
|
Line 54... |
Line 54... |
54 |
|
54 |
|
55 |
$requete_creation_station = 'INSERT INTO ods_stations '.
|
55 |
$requete_creation_station = 'INSERT INTO ods_stations '.
|
56 |
'(os_ce_participant, os_nom, os_ce_commune, os_latitude, os_longitude, os_altitude, os_ce_environnement, os_commentaire) '.
|
56 |
'(os_ce_participant, os_nom, os_ce_commune, os_latitude, os_longitude, os_altitude, os_ce_environnement, os_commentaire) '.
|
57 |
'VALUES ('.
|
57 |
'VALUES ('.
|
58 |
$this->bdd->quote($id_participant).','.
|
58 |
$this->proteger($id_participant).','.
|
59 |
$this->bdd->quote($params['station_nom']).','.
|
59 |
$this->proteger($params['station_nom']).','.
|
60 |
$this->bdd->quote($params['station_commune']).','.
|
60 |
$this->proteger($params['station_commune']).','.
|
61 |
$this->bdd->quote($params['station_lat']).','.
|
61 |
$this->proteger($params['station_lat']).','.
|
62 |
$this->bdd->quote($params['station_lon']).','.
|
62 |
$this->proteger($params['station_lon']).','.
|
63 |
$this->bdd->quote($params['station_alt']).','.
|
63 |
$this->proteger($params['station_alt']).','.
|
64 |
$this->bdd->quote($params['station_milieu']).','.
|
64 |
$this->proteger($params['station_milieu']).','.
|
Line 65... |
Line 65... |
65 |
$this->bdd->quote($params['station_description']).')';
|
65 |
$this->proteger($params['station_description']).')';
|
Line 66... |
Line 66... |
66 |
|
66 |
|
67 |
$creation_station = $this->executerRequeteSimple($requete_creation_station);
|
67 |
$creation_station = $this->executerRequeteSimple($requete_creation_station);
|
Line 91... |
Line 91... |
91 |
return;
|
91 |
return;
|
92 |
}
|
92 |
}
|
Line 93... |
Line 93... |
93 |
|
93 |
|
94 |
$requete_modification_station = 'UPDATE ods_stations '.
|
94 |
$requete_modification_station = 'UPDATE ods_stations '.
|
95 |
'SET '.
|
95 |
'SET '.
|
96 |
'os_nom ='.$this->bdd->quote($params['station_nom']).','.
|
96 |
'os_nom ='.$this->proteger($params['station_nom']).','.
|
97 |
'os_latitude ='.$this->bdd->quote($params['station_commune']).','.
|
97 |
'os_latitude ='.$this->proteger($params['station_commune']).','.
|
98 |
'os_latitude ='.$this->bdd->quote($params['station_lat']).','.
|
98 |
'os_latitude ='.$this->proteger($params['station_lat']).','.
|
99 |
'os_longitude ='.$this->bdd->quote($params['station_lon']).','.
|
99 |
'os_longitude ='.$this->proteger($params['station_lon']).','.
|
100 |
'os_altitude ='.$this->bdd->quote($params['station_alt']).','.
|
100 |
'os_altitude ='.$this->proteger($params['station_alt']).','.
|
101 |
'os_ce_environnement ='.$this->bdd->quote($params['station_milieu']).','.
|
101 |
'os_ce_environnement ='.$this->proteger($params['station_milieu']).','.
|
102 |
'os_commentaire ='.$this->bdd->quote($params['station_description']).' '.
|
102 |
'os_commentaire ='.$this->proteger($params['station_description']).' '.
|
103 |
'WHERE os_ce_particant = '.$this->bdd->quote($id_participant).' '.
|
103 |
'WHERE os_ce_particant = '.$this->proteger($id_participant).' '.
|
Line 104... |
Line 104... |
104 |
'AND os_id_station = '.$this->bdd->quote($id_station);
|
104 |
'AND os_id_station = '.$this->proteger($id_station);
|
Line 105... |
Line 105... |
105 |
|
105 |
|
106 |
$modification_station = $this->executerRequeteSimple($requete_creation_station);
|
106 |
$modification_station = $this->executerRequeteSimple($requete_creation_station);
|
Line 131... |
Line 131... |
131 |
} else {
|
131 |
} else {
|
132 |
return;
|
132 |
return;
|
133 |
}
|
133 |
}
|
Line 134... |
Line 134... |
134 |
|
134 |
|
135 |
$requete_suppression_station = 'DELETE FROM ods_stations '.
|
135 |
$requete_suppression_station = 'DELETE FROM ods_stations '.
|
136 |
'WHERE os_ce_particant = '.$this->bdd->quote($id_participant).' '.
|
136 |
'WHERE os_ce_particant = '.$this->proteger($id_participant).' '.
|
Line 137... |
Line 137... |
137 |
'AND os_id_station = '.$this->bdd->quote($id_station);
|
137 |
'AND os_id_station = '.$this->proteger($id_station);
|
138 |
|
138 |
|
Line 139... |
Line 139... |
139 |
// TODO : supprimer également tout ce qui est associé à la station (observations, etc...)
|
139 |
// TODO : supprimer également tout ce qui est associé à la station (observations, etc...)
|
Line 150... |
Line 150... |
150 |
|
150 |
|
151 |
// +---------------------------------------------------------------------------------------------------------------+
|
151 |
// +---------------------------------------------------------------------------------------------------------------+
|
152 |
// METHODES D'ACCES A LA BASE DE DONNEES
|
152 |
// METHODES D'ACCES A LA BASE DE DONNEES
|
Line 153... |
Line 153... |
153 |
private function obtenirListeStationPourParticipant($id_participant) {
|
153 |
private function obtenirListeStationPourParticipant($id_participant) {
|
Line 154... |
Line 154... |
154 |
|
154 |
|
Line 155... |
Line 155... |
155 |
$requete_liste_station = 'SELECT * FROM ods_stations WHERE os_ce_participant = '.$this->bdd->quote($id_participant);
|
155 |
$requete_liste_station = 'SELECT * FROM ods_stations WHERE os_ce_participant = '.$this->proteger($id_participant);
|
Line 167... |
Line 167... |
167 |
return $liste_station_formatees;
|
167 |
return $liste_station_formatees;
|
168 |
}
|
168 |
}
|
Line 169... |
Line 169... |
169 |
|
169 |
|
Line 170... |
Line 170... |
170 |
private function obtenirInformationsStation($id_station) {
|
170 |
private function obtenirInformationsStation($id_station) {
|
Line 171... |
Line 171... |
171 |
|
171 |
|
Line 172... |
Line 172... |
172 |
$requete_infos_station = 'SELECT * FROM ods_stations WHERE os_id_station = '.$this->bdd->quote($id_station);
|
172 |
$requete_infos_station = 'SELECT * FROM ods_stations WHERE os_id_station = '.$this->proteger($id_station);
|
Line 200... |
Line 200... |
200 |
return $station_champs_formates;
|
200 |
return $station_champs_formates;
|
201 |
}
|
201 |
}
|
Line 202... |
Line 202... |
202 |
|
202 |
|
Line 203... |
Line 203... |
203 |
private function obtenirInformationsCommuneParId($id_commune) {
|
203 |
private function obtenirInformationsCommuneParId($id_commune) {
|
204 |
|
204 |
|
Line 205... |
Line 205... |
205 |
$requete_infos_commune = 'SELECT * FROM ods_communes WHERE oc_id_commune = '.$this->bdd->quote($id_commune);
|
205 |
$requete_infos_commune = 'SELECT * FROM ods_communes WHERE oc_id_commune = '.$this->proteger($id_commune);
|
206 |
$infos_commune = $this->executerRequete($requete_infos_commune);
|
206 |
$infos_commune = $this->executerRequete($requete_infos_commune);
|
Line 207... |
Line 207... |
207 |
|
207 |
|
Line 208... |
Line 208... |
208 |
return $infos_commune;
|
208 |
return $infos_commune;
|
209 |
}
|
209 |
}
|
Line 210... |
Line 210... |
210 |
|
210 |
|
211 |
private function obtenirInformationsCommuneParCodeInsee($code_insee_commune) {
|
211 |
private function obtenirInformationsCommuneParCodeInsee($code_insee_commune) {
|