Rev 91 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<?php// declare(encoding='UTF-8');/*** Modèle d'accès à la base de données de saisies pour le module stations.** @package ODS_saisie* @category php 5.2* @author Aurélien Peronnet <aurelien@tela-botanica.org>* @copyright 2010 Tela-Botanica* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL* @version SVN: $Id: StationDao.php 154 2010-09-13 12:15:11Z aurelien $**/class StationDao extends Dao {const SERVICE_STATION = 'OdsStation';/*** Retourne l'ensemble des stations d'un participant.** @return array un tableau contenant les informations sur les stations du participant.*/public function getListeStations() {$url = $this->url_jrest.self::SERVICE_STATION.'/'.AppControleur::getIdUtilisateur().'/*/';$json = $this->envoyerRequeteConsultation($url);$donnees = json_decode($json, true);return $donnees;}public function getInformationsStation($id_station) {$url = $this->url_jrest.self::SERVICE_STATION.'/'.AppControleur::getIdUtilisateur().'/'.$id_station.'/';$json = $this->envoyerRequeteConsultation($url);$donnees = json_decode($json, true);return $donnees;}public function ajouterStation($valeurs_station_verifiees) {$donnees = $valeurs_station_verifiees;$donnees['id_participant'] = AppControleur::getIdUtilisateur();$url = $this->url_jrest.self::SERVICE_STATION."/";$json = $this->envoyerRequeteAjout($url, $donnees);$donnees_retour = json_decode($json, true);return $donnees_retour;}public function modifierStation($id_station, $valeurs_station_verifiees) {$donnees = $valeurs_station_verifiees;$donnees['id_participant'] = AppControleur::getIdUtilisateur();if (is_numeric($id_station)) {$url = $this->url_jrest.self::SERVICE_STATION."/$id_station";$json = $this->envoyerRequeteModif($url, $donnees);$donnees_retour = json_decode($json, true);if($donnees_retour['reponse'] == 'OK') {return true;}}return false;}}?>