Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 2457 → Rev 2458

/trunk/jrest/services/InventoryLocationList.php
1,55 → 1,36
<?php
// ATTENTION ! Classe compatible uniquement avec nouveau format de bdd du cel //
 
// declare(encoding='UTF-8');
/**
* @author David Delon <david@tela-botanica.org>
* @author Aurélien Peronnet <aurelien@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @version $Id$
* @copyright © 2010, David Delon, Aurélien Peronnet
*/
* Service de listage des zones géographiques d'un utilisateur
*
* @internal Mininum PHP version : 5.2
* @category CEL
* @package Services
* @subpackage Observations
* @version 0.1
* @author Mathias CHOUET <mathias@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @author Aurelien PERONNET <aurelien@tela-botanica.org>
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
* @copyright 1999-2014 Tela Botanica <accueil@tela-botanica.org>
*/
class InventoryLocationList extends Cel {
 
/**
* InventoryLocationList.php
*
* in : utf8
* out : utf8
* Cas d'utilisation :
* Service listage des zones géographiques d'un utilisateur
*/
class InventoryLocationList extends Cel {
function getElement($uid){
public function getElement($uid) {
// Controle detournement utilisateur
$this->controleUtilisateur($uid[0]);
$idUtilisateurP = Cel::db()->proteger($uid[0]);
 
$retour = array();
$requete = 'SELECT DISTINCT ce_zone_geo, zone_geo, lieudit, station '.
'FROM cel_obs '.
"WHERE ce_utilisateur = $idUtilisateurP ".
'ORDER BY ce_zone_geo ASC, zone_geo ASC, lieudit ASC, station ASC '.
' -- '.__FILE__.':'.__LINE__;
$resultats = Cel::db()->requeter($requete);
 
$requete_zones_geo = 'SELECT DISTINCT ce_zone_geo, zone_geo, lieudit, station FROM cel_obs '.
'WHERE ce_utilisateur = '.Cel::db()->proteger($uid[0]).' '.
'ORDER BY ce_zone_geo ASC, zone_geo ASC, lieudit ASC, station ASC';
 
$resultat_zones_geo = Cel::db()->requeter($requete_zones_geo);
 
if (is_array($resultat_zones_geo)) {
$retour = $resultat_zones_geo;
}
 
$this->envoyerJson($retour);
return true;
$retour = (is_array($resultats)) ? $resultats : array();
$this->envoyerJson($retour);
return true;
}
}
/* +--Fin du code ---------------------------------------------------------------------------------------+
* $Log$
* Revision 1.6 2008-01-30 08:57:28 ddelon
* fin mise en place mygwt
*
* Revision 1.5 2007-05-22 12:54:09 ddelon
* Securisation acces utilisateur
*
*
*
*/
?>
}