Subversion Repositories Applications.annuaire

Rev

Rev 293 | Go to most recent revision | Details | Last modification | View Log | RSS feed

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