Subversion Repositories eFlore/Applications.cel

Rev

Rev 857 | Rev 1014 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 857 Rev 996
1
<?php
1
<?php
2
// ATTENTION ! Classe compatible uniquement avec nouveau format de bdd du cel //
2
// ATTENTION ! Classe compatible uniquement avec nouveau format de bdd du cel //
3
 
3
 
4
/**
4
/**
5
 * @author David Delon <aurelien@tela-botanica.org>
5
 * @author David Delon <aurelien@tela-botanica.org>
6
 * @author Aurélien Peronnet <david@tela-botanica.org>
6
 * @author Aurélien Peronnet <david@tela-botanica.org>
7
 * @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
7
 * @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
8
 * @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
8
 * @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
9
 * @version $Id$
9
 * @version $Id$
10
 * @copyright © 2010, David Delon, Aurélien Peronnet
10
 * @copyright © 2010, David Delon, Aurélien Peronnet
11
*/
11
*/
12
 
12
 
13
/**
13
/**
14
 * InventoryLocationList.php  
14
 * InventoryLocationList.php  
15
 * 
15
 * 
16
 * in : utf8
16
 * in : utf8
17
 * out : utf8
17
 * out : utf8
18
 * Cas d'utilisation :
18
 * Cas d'utilisation :
19
 * Service listage des zones géographiques d'un utilisateur
19
 * Service listage des zones géographiques d'un utilisateur
20
 */ 
20
 */ 
21
class InventoryLocationList extends Cel {
21
class InventoryLocationList extends Cel {
22
	
22
	
23
	function getElement($uid){
23
	function getElement($uid){
24
		
24
		
25
		// Controle detournement utilisateur
25
		// Controle detournement utilisateur
26
	    session_start();
-
 
27
	 	$this->controleUtilisateur($uid[0]);
26
	 	$this->controleUtilisateur($uid[0]);
28
 
27
 
29
		$retour = array();
28
		$retour = array();
30
 
29
 
31
        $requete_zones_geo = 'SELECT DISTINCT ce_zone_geo, zone_geo, lieudit, station FROM cel_obs '.
30
        $requete_zones_geo = 'SELECT DISTINCT ce_zone_geo, zone_geo, lieudit, station FROM cel_obs '.
32
							 'WHERE ce_utilisateur = '.$this->proteger($uid[0]).' '.
31
							 'WHERE ce_utilisateur = '.$this->proteger($uid[0]).' '.
33
							 'ORDER BY ce_zone_geo ASC, zone_geo ASC, lieudit ASC, station ASC';
32
							 'ORDER BY ce_zone_geo ASC, zone_geo ASC, lieudit ASC, station ASC';
34
 
33
 
35
        $resultat_zones_geo = $this->requeter($requete_zones_geo);
34
        $resultat_zones_geo = $this->requeter($requete_zones_geo);
36
 
35
 
37
        if (is_array($resultat_zones_geo)) {
36
        if (is_array($resultat_zones_geo)) {
38
	        $retour = $resultat_zones_geo;
37
	        $retour = $resultat_zones_geo;
39
    	}
38
    	}
40
 
39
 
41
		$output = json_encode($retour);
40
		$output = json_encode($retour);
42
 
41
 
43
		header("content-type: application/json");
42
		header("content-type: application/json");
44
		print($output);
43
		print($output);
45
		return true;
44
		return true;
46
 
45
 
47
	}
46
	}
48
}
47
}
49
/* +--Fin du code ---------------------------------------------------------------------------------------+
48
/* +--Fin du code ---------------------------------------------------------------------------------------+
50
* $Log$
49
* $Log$
51
* Revision 1.6  2008-01-30 08:57:28  ddelon
50
* Revision 1.6  2008-01-30 08:57:28  ddelon
52
* fin mise en place mygwt
51
* fin mise en place mygwt
53
*
52
*
54
* Revision 1.5  2007-05-22 12:54:09  ddelon
53
* Revision 1.5  2007-05-22 12:54:09  ddelon
55
* Securisation acces utilisateur
54
* Securisation acces utilisateur
56
*
55
*
57
*
56
*
58
*
57
*
59
*/
58
*/
60
?>
59
?>