Subversion Repositories Applications.annuaire

Rev

Rev 257 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 257 Rev 293
1
<?php
1
<?php
-
 
2
// declare(encoding='UTF-8');
2
/**
3
/**
3
* PHP Version 5
4
 * Service 
4
*
5
 *
5
* @category  PHP
6
 * @category	php 5.2
6
* @package   annuaire
7
 * @package		Annuaire::Services
7
* @author    aurelien <aurelien@tela-botanica.org>
8
 * @author		Aurélien PERONNET <aurelien@tela-botanica.org>
-
 
9
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
* @copyright 2010 Tela-Botanica
10
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
9
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
10
* @version   SVN: <svn_id>
12
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
11
* @link      /doc/annuaire/
13
 * @version		$Id$
12
*/
14
 */
13
 
-
 
14
Class NbInscrits extends JRestService {
15
class NbInscrits extends JRestService {
15
 
16
 
16
	public function getRessource() {
17
	public function getRessource() {
17
		$this->getElement(array());
18
		$this->getElement(array());
18
	}
19
	}
19
	
20
	
20
	public function getElement($uid){
21
	public function getElement($uid){
21
 
-
 
22
		$id_annuaire = Config::get('annuaire_defaut');
22
		$id_annuaire = Config::get('annuaire_defaut');
23
		
23
		
24
		if(isset($uid[0])) {
24
		if (isset($uid[0])) {
25
			$id_annuaire = $uid[0]; 
25
			$id_annuaire = $uid[0]; 
26
		}
26
		}
27
		
27
		
28
		$json = true;
28
		$json = true;
29
		if(isset($uid[1]) && $uid[1] == 'html') {
29
		if (isset($uid[1]) && $uid[1] == 'html') {
30
			$json = false;
30
			$json = false;
31
		} 
31
		} 
32
 
32
 
33
	    $controleur = new AnnuaireControleur();
33
	    $controleur = new AnnuaireControleur();
34
		$valeurs = $controleur->chargerNombreAnnuaireListeInscrits($id_annuaire);
34
		$valeurs = $controleur->chargerNombreAnnuaireListeInscrits($id_annuaire);
35
		
35
		
36
		if(!$json) {
36
		if (!$json) {
-
 
37
			$valeurs = 
37
			$valeurs = '<html>
38
			'<html>'."\n".
38
							</head>
39
			'	</head>'."\n".
39
							<meta content="text/html; charset='.Config::get('sortie_encodage').'" http-equiv="Content-Type">
40
			'		<meta content="text/html; charset='.Config::get('sortie_encodage').'" http-equiv="Content-Type">'."\n".
40
							</head>'.
41
			'	</head>'."\n".
41
							'<body>
42
			'	<body>'."\n".
42
								<div id="contenu">'.$valeurs.'
-
 
43
								</div>
43
			'		<div id="contenu">'.$valeurs.'</div>'."\n".
44
							</body>'.
44
			'	</body>'."\n".
45
						'</html>';
45
			'</html>';
46
		} 
46
		} 
47
 
47
 
48
		$this->envoyer($valeurs,'text/html',Config::get('sortie_encodage'),$json);
48
		$this->envoyer($valeurs, 'text/html', Config::get('sortie_encodage'), $json);
49
	}
49
	}
50
}
50
}
51
?>
51
?>