Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 859 Rev 884
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
* PHP Version 5
-
 
5
*
-
 
6
* @category  PHP
-
 
7
* @package   jrest
-
 
8
* @author    David Delon <david.delon@clapas.net>
-
 
9
* @author    Aurélien Peronnet <aurelien@tela-botanica.org>
-
 
10
* @copyright 2010 Tela-Botanica
-
 
11
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
-
 
12
* @version   SVN: <svn_id>
-
 
13
* @link      /doc/jrest/
-
 
14
*/
4
 
-
 
5
David Delon 2008
-
 
6
 
-
 
7
 Cecill / GPL V3
-
 
8
 
-
 
9
 */
-
 
10
 
-
 
11
// in : utf8
15
 
12
// out : utf8
16
 
-
 
17
/**
-
 
18
* InventoryObservationCount.php
-
 
19
*
13
/*
20
* in : utf8
14
 * InventoryObservationCount.php
21
* out : utf8
15
 *
22
*
16
 * Cas d'utilisation :
23
* Cas d'utilisation :
17
 * Service recherche du nombre a partir de divers critères
24
* Service recherche du nombre a partir de divers critères
18
 *
25
*
19
 * 2: Le service recherche le nombre d'images correspondant au critères demandé
26
* 2: Le service recherche le nombre d'images correspondant au critères demandé
20
 * 3: Le service renvoie le nombre calcule
27
* 3: Le service renvoie le nombre calcule
21
*/
28
*/
22
class InventoryObservationCount extends Cel {
29
class InventoryObservationCount extends Cel {
23
 
30
 
24
	/**
31
	/**
25
	 *  renvoie le nombre d' observations  correspondant aux criteres
32
	 *  renvoie le nombre d' observations  correspondant aux criteres
26
	 *	uid[0] : utilisateur obligatoire
33
	 *	uid[0] : utilisateur obligatoire
27
	 *	uid[1] : criteres de filtrage de la forme critere1=valeur1&critere2=valeur2
34
	 *	uid[1] : criteres de filtrage de la forme critere1=valeur1&critere2=valeur2
28
	 *  
35
	 *  
29
	*/
36
	*/
30
	function getElement($uid)
37
	function getElement($uid)
31
	{
38
	{
32
		// Controle detournement utilisateur
39
		// Controle detournement utilisateur
33
		$this->controleUtilisateur($uid[0]);
40
		$this->controleUtilisateur($uid[0]);
34
 
41
 
35
		$chercheur_observations = new RechercheObservation($this->config);
42
		$chercheur_observations = new RechercheObservation($this->config);
36
 
43
 
37
		$criteres = array();
44
		$criteres = array();
38
 
45
 
39
		if(isset($uid[1]))
46
		if(isset($uid[1]))
40
		{
47
		{
41
			$criteres = $chercheur_observations->parserRequeteCriteres($uid[1]) ;
48
			$criteres = $chercheur_observations->parserRequeteCriteres($uid[1]) ;
42
		}
49
		}
43
 
50
 
44
		$retour = $chercheur_observations->compterObservations($uid[0], $criteres);
51
		$retour = $chercheur_observations->compterObservations($uid[0], $criteres);
45
 
52
 
46
		$retour_encode = json_encode($retour) ;
53
		$retour_encode = json_encode($retour) ;
47
		header("content-type: application/json") ;
54
		header("content-type: application/json") ;
48
		print $retour_encode ;
55
		print $retour_encode ;
49
		exit() ;
56
		exit() ;
50
	}
57
	}
51
}
58
}
52
?>
59
?>