Subversion Repositories Applications.annuaire

Rev

Rev 257 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 257 Rev 293
Line 1... Line 1...
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 {
Line 15... Line 16...
15
 
16
 
16
	public function getRessource() {
17
	public function getRessource() {
17
		$this->getElement(array());
18
		$this->getElement(array());
Line 18... Line 19...
18
	}
19
	}
19
	
-
 
20
	public function getElement($uid){
20
	
Line 21... Line 21...
21
 
21
	public function getElement($uid){
22
		$id_annuaire = Config::get('annuaire_defaut');
22
		$id_annuaire = Config::get('annuaire_defaut');
23
		
23
		
Line 24... Line 24...
24
		if(isset($uid[0])) {
24
		if (isset($uid[0])) {
25
			$id_annuaire = $uid[0]; 
25
			$id_annuaire = $uid[0]; 
26
		}
26
		}
27
		
27
		
Line 28... Line 28...
28
		$json = true;
28
		$json = true;
29
		if(isset($uid[1]) && $uid[1] == 'html') {
29
		if (isset($uid[1]) && $uid[1] == 'html') {
Line 30... Line 30...
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
							</head>
38
			'<html>'."\n".
39
							<meta content="text/html; charset='.Config::get('sortie_encodage').'" http-equiv="Content-Type">
39
			'	</head>'."\n".
40
							</head>'.
40
			'		<meta content="text/html; charset='.Config::get('sortie_encodage').'" http-equiv="Content-Type">'."\n".
Line 41... Line 41...
41
							'<body>
41
			'	</head>'."\n".
42
								<div id="contenu">'.$valeurs.'
42
			'	<body>'."\n".
43
								</div>
43
			'		<div id="contenu">'.$valeurs.'</div>'."\n".
44
							</body>'.
44
			'	</body>'."\n".
45
						'</html>';
45
			'</html>';