Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 319 | Rev 333 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 319 Rev 322
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 5.1.1                                                                                    |
4
// | PHP version 5.1.1                                                                                    |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of eFlore-Fiche.                                                                   |
8
// | This file is part of eFlore-Fiche.                                                                   |
9
// |                                                                                                      |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: effi_cel.action.php,v 1.9 2007-11-06 10:54:03 jp_milcent Exp $
24
// CVS : $Id: effi_cel.action.php,v 1.9 2007-11-06 10:54:03 jp_milcent Exp $
25
/**
25
/**
26
* Fichier d'action du module eFlore-Fiche : Cel
26
* Fichier d'action du module eFlore-Fiche : Cel
27
*
27
*
28
* Appel Carnet en ligne
28
* Appel Carnet en ligne
29
* 
29
* 
30
*
30
*
31
*@package eFlore
31
*@package eFlore
32
*@subpackage ef_fiche
32
*@subpackage ef_fiche
33
//Auteur original :
33
//Auteur original :
34
*@author        David Delon <dd@clapas.net>
34
*@author        David Delon <dd@clapas.net>
35
//Autres auteurs :
35
//Autres auteurs :
36
*@author        aucun
36
*@author        aucun
37
*@copyright     Tela-Botanica 2000-2006
37
*@copyright     Tela-Botanica 2000-2006
38
*@version       $Revision: 1.9 $ $Date: 2007-11-06 10:54:03 $
38
*@version       $Revision: 1.9 $ $Date: 2007-11-06 10:54:03 $
39
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
40
*/
40
*/
41
 
41
 
42
// +------------------------------------------------------------------------------------------------------+
42
// +------------------------------------------------------------------------------------------------------+
43
// |                                            ENTETE du PROGRAMME                                       |
43
// |                                            ENTETE du PROGRAMME                                       |
44
// +------------------------------------------------------------------------------------------------------+
44
// +------------------------------------------------------------------------------------------------------+
45
 
45
 
46
// +------------------------------------------------------------------------------------------------------+
46
// +------------------------------------------------------------------------------------------------------+
47
// |                                            CORPS du PROGRAMME                                        |
47
// |                                            CORPS du PROGRAMME                                        |
48
// +------------------------------------------------------------------------------------------------------+
48
// +------------------------------------------------------------------------------------------------------+
49
 
49
 
50
 
50
 
51
 
51
 
52
// TODO : CSS specifique (id)
52
// TODO : CSS specifique (id)
53
 
53
 
54
class Cartes {
54
class Cartes {
55
	private $tab_code_insee = array();
55
	private $tab_code_insee = array();
56
	public $src_map;
56
	public $src_map;
57
	private $cartesFormateur = null;
57
	private $cartesFormateur = null;
58
	const MIME_MAP = 'text/html';
58
	const MIME_MAP = 'text/html';
59
	const MIME_PNG = 'image/png';
59
	const MIME_PNG = 'image/png';
60
	
60
	
61
	public function consulter($ressources, $param) {
61
	public function consulter($ressources, $param) {
62
		// Initialisation des variables
62
		// Initialisation des variables
63
		$this->ressources = $ressources;
63
		$this->ressources = $ressources;
64
		$this->param = $param;
64
		$this->param = $param;
-
 
65
		if ($this->analyserRessources() == true) {
-
 
66
			$resultat = $this->formerLegende();
-
 
67
		} else {
65
		$this->traiterParametres();
68
			$this->traiterParametres();
-
 
69
			$resultat = $this->formerCarte();
-
 
70
		}
-
 
71
		return $resultat;
-
 
72
	}
-
 
73
	
-
 
74
	public function formerCarte() {
66
		$this->creerFormateur();
75
		$this->creerFormateur();
67
		$this->cartesFormateur->initialiserImage();
76
		$this->cartesFormateur->initialiserImage();
68
		
77
			
69
		$inventories = $this->cartesFormateur->chargerDonnees();
78
		$inventories = $this->cartesFormateur->chargerDonnees();
70
		$retour = '';
79
		$retour = '';
71
		if (is_array($inventories) && $inventories !== array()){
80
		if (is_array($inventories) && $inventories !== array()){
72
			// Connection referentiel communes 
81
			$this->chargerVille();// Connection referentiel communes
73
			$this->chargerVille();
-
 
74
			list($text, $merge) = $this->calculerRepartition($inventories);
82
			list($text, $merge) = $this->calculerRepartition($inventories);
75
			// Définition des couleurs des points
83
			// Définition des couleurs des points
76
			$couleurs = $this->cartesFormateur->definirCouleurs();
84
			$couleurs = $this->cartesFormateur->definirCouleurs();
77
			if ($text) {
85
			if ($text) {
78
				$usemap = $this->cartesFormateur->dessinerPoint($text, $merge, $couleurs);
86
				$usemap = $this->cartesFormateur->dessinerPoint($text, $merge, $couleurs);
79
			}
87
			}
80
			if (isset($usemap)) {
88
			if (isset($usemap)) {
81
				$this->cartesFormateur->img();
89
				$this->cartesFormateur->img();
82
				$retour = $this->cartesFormateur->formaterCartes($usemap);
90
				$retour = $this->cartesFormateur->formaterCartes($usemap);
83
			}
91
			}
84
		}
92
		}
85
		if ($retour == '') {
93
		if ($retour == '') {
86
			$retour = $this->formaterCarteVide();
94
			$retour = $this->formaterCarteVide();
87
		}
95
		}
88
		$resultat = new ResultatService();
96
		$resultat = new ResultatService();
89
		$resultat->corps = ($this->info['retour'] == self::MIME_MAP) ? $retour : file_get_contents($retour);
97
		$resultat->corps = ($this->info['retour'] == self::MIME_MAP) ? $retour : file_get_contents($retour);
90
		$resultat->mime = ($this->info['retour'] == self::MIME_MAP) ? self::MIME_MAP : self::MIME_PNG;
98
		$resultat->mime = ($this->info['retour'] == self::MIME_MAP) ? self::MIME_MAP : self::MIME_PNG;
91
		return $resultat;
99
		return $resultat;
92
	}
100
	}
93
	
101
	
94
	public function creerFormateur(){
102
	public function creerFormateur(){
95
		$projet = ucwords($this->info['projet']);
103
		$projet = ucwords($this->info['projet']);
96
		$Classe = $projet.'Formateur';
104
		$Classe = $projet.'Formateur';
97
		$chemin = dirname(__FILE__).DS.'cartes'.DS;
105
		$chemin = dirname(__FILE__).DS.'cartes'.DS;
98
		$cheminClasse = $chemin.$Classe.'.php';
106
		$cheminClasse = $chemin.$Classe.'.php';
99
		$cheminInterface = $chemin.'Formateur.php';
107
		$cheminInterface = $chemin.'Formateur.php';
100
		if (file_exists($cheminInterface)) {
108
		if (file_exists($cheminInterface)) {
101
			include_once $cheminInterface;
109
			include_once $cheminInterface;
102
			if (file_exists($cheminClasse)) {
110
			if (file_exists($cheminClasse)) {
103
				include_once $cheminClasse;
111
				include_once $cheminClasse;
104
				$this->cartesFormateur = new $Classe($this->info);
112
				$this->cartesFormateur = new $Classe($this->info);
105
			} else {
113
			} else {
106
				$message = "La classe '$Classe' est introuvable.";Debug::printr($message);
114
				$message = "La classe '$Classe' est introuvable.";Debug::printr($message);
107
				throw new Exception($message);
115
				throw new Exception($message);
108
			}
116
			}
109
		}
117
		}
110
	}
118
	}
-
 
119
	private function analyserRessources() {
-
 
120
		$ok = false;
-
 
121
		if (isset($this->ressources[0]) && $this->ressources[0] == 'legende') {
-
 
122
			$ok = true;
-
 
123
		}
-
 
124
		return $ok;
-
 
125
	}
-
 
126
	
-
 
127
	private function formerLegende() {
-
 
128
		$classe = 'LegendeCartes';
-
 
129
		require_once dirname(__FILE__).DS.'cartes'.DS.$classe.'.php';
-
 
130
		$sousService = new $classe(new Conteneur());
-
 
131
		$resultat = $sousService->consulter($this->ressources, $this->param);
-
 
132
		return $resultat;
-
 
133
	}
111
	
134
	
112
	private function traiterParametres() {
135
	private function traiterParametres() {
113
		$this->info['miniature'] = (isset($this->param['retour.format'])) ? $this->param['retour.format'] : false;
136
		$this->info['miniature'] = (isset($this->param['retour.format'])) ? $this->param['retour.format'] : false;
114
		$this->info['src_map'] = ($this->info['miniature'] == 'min') ? 'france_utm_miniature.png' : 'france_utm_600x564.png';
137
		$this->info['src_map'] = ($this->info['miniature'] == 'min') ? 'france_utm_miniature.png' : 'france_utm_600x564.png';
115
		$this->info['retour'] = (isset($this->param['retour'])) ? $this->param['retour'] : self::MIME_PNG ;
138
		$this->info['retour'] = (isset($this->param['retour'])) ? $this->param['retour'] : self::MIME_PNG ;
116
		// Ajout du code du référentiel
139
		// Ajout du code du référentiel
117
		$this->info['referentiel'] = 'bdtfx';
140
		$this->info['referentiel'] = 'bdtfx';
118
		$projets = array('cenlr', 'cel', 'cbnmed', 'sophy', 'general');
141
		$projets = array('cenlr', 'cel', 'cbnmed', 'sophy', 'general');
119
		if (isset($this->param['projet']) && in_array($this->param['projet'], $projets)) {
142
		if (isset($this->param['projet']) && in_array($this->param['projet'], $projets)) {
120
			$this->info['projet'] = $this->param['projet'];
143
			$this->info['projet'] = $this->param['projet'];
121
		} else {
144
		} else {
122
			$this->info['projet'] = 'general';
145
			$this->info['projet'] = 'general';
123
		}
146
		}
124
		// Récupération d'infos générales
147
		// Récupération d'infos générales
125
		// donnees exemple nn = 141; nt = 8522; nom = 'Acer campestre L.'; nom_ss_auteur = 'Acer campestre';
148
		// donnees exemple nn = 141; nt = 8522; nom = 'Acer campestre L.'; nom_ss_auteur = 'Acer campestre';
126
		$this->info['nn'] = $this->param['masque.nn'];
149
		$this->info['nn'] = $this->param['masque.nn'];
127
		$this->info['nt'] = $this->param['masque.nt'];
150
		$this->info['nt'] = $this->param['masque.nt'];
128
		$this->info['nom'] = $this->param['masque.ns'].' '.$this->param['masque.au'];
151
		$this->info['nom'] = $this->param['masque.ns'].' '.$this->param['masque.au'];
129
		$this->info['nom_ss_auteur'] = $this->param['masque.ns'];
152
		$this->info['nom_ss_auteur'] = $this->param['masque.ns'];
130
	}
153
	}
131
	
154
	
132
	private function chargerVille() {
155
	private function chargerVille() {
133
		$requete = "SELECT * FROM tb_cel.locations";
156
		$requete = "SELECT * FROM tb_cel.locations";
134
		$villes = $this->getBdd()->recupererTous($requete);
157
		$villes = $this->getBdd()->recupererTous($requete);
135
		foreach ($villes as $ville) {
158
		foreach ($villes as $ville) {
136
			$this->tab_code_insee[$ville['insee_code']] = $ville;
159
			$this->tab_code_insee[$ville['insee_code']] = $ville;
137
		}
160
		}
138
	}
161
	}
139
	
162
	
140
	private function calculerRepartition($inventories) {
163
	private function calculerRepartition($inventories) {
141
		$text = '';
164
		$text = '';
142
		// Recuperation du positionnement de la carte
165
		// Recuperation du positionnement de la carte
143
		$png_txt = file_get_contents(Config::get('Cartes.chemin').str_replace('png', 'txt', $this->info['src_map']));
166
		$png_txt = file_get_contents(Config::get('Cartes.chemin').str_replace('png', 'txt', $this->info['src_map']));
144
		parse_str($png_txt);
167
		parse_str($png_txt);
145
		// "Resolution" calculer à partir du fichier $png_txt par fuseau
168
		// "Resolution" calculer à partir du fichier $png_txt par fuseau
146
		$p['31T'] = ($X231T - $X131T) / ($X231TUTM - $X131TUTM);
169
		$p['31T'] = ($X231T - $X131T) / ($X231TUTM - $X131TUTM);
147
		$p['32T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM);
170
		$p['32T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM);
148
		$p['30T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM);
171
		$p['30T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM);
149
		
172
		
150
		$text = array();
173
		$text = array();
151
		$merge = array();
174
		$merge = array();
152
		foreach ($inventories as $inventory){
175
		foreach ($inventories as $inventory){
153
			$utm = $this->cartesFormateur->chercherVille($inventory, $this->tab_code_insee);
176
			$utm = $this->cartesFormateur->chercherVille($inventory, $this->tab_code_insee);
154
			// Ultime tentative 
177
			// Ultime tentative 
155
			if (!$utm) {
178
			if (!$utm) {
156
				$requete = "SELECT *  FROM tb_cel.locations WHERE name LIKE ".$this->getBdd()->proteger($inventory['location']);
179
				$requete = "SELECT *  FROM tb_cel.locations WHERE name LIKE ".$this->getBdd()->proteger($inventory['location']);
157
				$utm = $this->getBdd()->recupererTous($requete);
180
				$utm = $this->getBdd()->recupererTous($requete);
158
			}
181
			}
159
 
182
 
160
			// Si des doublons sur la commune : pas d'affichage , il vaut mieux ne rien afficher que d'afficher des erreurs.
183
			// Si des doublons sur la commune : pas d'affichage , il vaut mieux ne rien afficher que d'afficher des erreurs.
161
			if (sizeof($utm) == 1) {
184
			if (sizeof($utm) == 1) {
162
				$utm = $utm[0];
185
				$utm = $utm[0];
163
					
186
					
164
				// On centre le point au milieu de la maille 10x10 par defaut ...
187
				// On centre le point au milieu de la maille 10x10 par defaut ...
165
				$utm = $this->chercherCentreMaille($utm);
188
				$utm = $this->chercherCentreMaille($utm);
166
					
189
					
167
				// Calcul coordonnes x, y sur l'image
190
				// Calcul coordonnes x, y sur l'image
168
				if ($utm['sector']=='31T') {// Fuseau 31 T
191
				if ($utm['sector']=='31T') {// Fuseau 31 T
169
					$x = (($utm['x_utm'] - $X131TUTM) * $p['31T'] ) + $X131T;
192
					$x = (($utm['x_utm'] - $X131TUTM) * $p['31T'] ) + $X131T;
170
					$y = $Y231T - (($utm['y_utm'] - $Y131TUTM) * $p['31T'] );
193
					$y = $Y231T - (($utm['y_utm'] - $Y131TUTM) * $p['31T'] );
171
				} elseif ($utm['sector'] == '32T') {// Fuseau 32 T : une rotation + translation est appliqu�e
194
				} elseif ($utm['sector'] == '32T') {// Fuseau 32 T : une rotation + translation est appliqu�e
172
					$cosa = cos(deg2rad($angle3132));
195
					$cosa = cos(deg2rad($angle3132));
173
					$sina = sin(deg2rad($angle3132));
196
					$sina = sin(deg2rad($angle3132));
174
					$xp = (($utm['x_utm'] - $X132TUTM) * $cosa) + (($utm['y_utm']- $Y132TUTM) * $sina);
197
					$xp = (($utm['x_utm'] - $X132TUTM) * $cosa) + (($utm['y_utm']- $Y132TUTM) * $sina);
175
					$yp = (-($utm['x_utm'] - $X132TUTM)* $sina) + (($utm['y_utm'] - $Y132TUTM) * $cosa);
198
					$yp = (-($utm['x_utm'] - $X132TUTM)* $sina) + (($utm['y_utm'] - $Y132TUTM) * $cosa);
176
					$x = ($xp * $p['32T'] ) + $X132T;
199
					$x = ($xp * $p['32T'] ) + $X132T;
177
					$y = $Y232T-($yp * $p['32T'] );
200
					$y = $Y232T-($yp * $p['32T'] );
178
				} elseif ($utm['sector'] == '30T') {// Fuseau 30 T : une rotation + translation est appliqu�e
201
				} elseif ($utm['sector'] == '30T') {// Fuseau 30 T : une rotation + translation est appliqu�e
179
					$cosa = cos(deg2rad($angle3031));
202
					$cosa = cos(deg2rad($angle3031));
180
					$sina = sin(deg2rad($angle3031));
203
					$sina = sin(deg2rad($angle3031));
181
					$xp = (($utm['x_utm'] - $X130TUTM) * $cosa) + (($utm['y_utm'] - $Y130TUTM) * $sina);
204
					$xp = (($utm['x_utm'] - $X130TUTM) * $cosa) + (($utm['y_utm'] - $Y130TUTM) * $sina);
182
					$yp = (-($utm['x_utm'] - $X130TUTM) * $sina) + (($utm['y_utm'] - $Y130TUTM) * $cosa);
205
					$yp = (-($utm['x_utm'] - $X130TUTM) * $sina) + (($utm['y_utm'] - $Y130TUTM) * $cosa);
183
					$x = ($xp * $p['30T'] ) + $X130T;
206
					$x = ($xp * $p['30T'] ) + $X130T;
184
					$y = $Y230T - ($yp * $p['30T'] );
207
					$y = $Y230T - ($yp * $p['30T'] );
185
				}
208
				}
186
				$x = round($x);
209
				$x = round($x);
187
				$y = round($y);
210
				$y = round($y);
188
					
211
					
189
					
212
					
190
				if ($utm['name'] != null) {
213
				if ($utm['name'] != null) {
191
					$name = utf8_decode($utm['name']);
214
					$name = utf8_decode($utm['name']);
192
				}
215
				}
193
				$comment = ($this->info['retour'] == self::MIME_MAP) ? $this->cartesFormateur->formerCommentaire($utm, $inventory) : '';
216
				$comment = ($this->info['retour'] == self::MIME_MAP) ? $this->cartesFormateur->formerCommentaire($utm, $inventory) : '';
194
				// On stocke les commentaires pour affichage dans les tooltips
217
				// On stocke les commentaires pour affichage dans les tooltips
195
				// Commentaire deja présent ? : on ajoute à la suite
218
				// Commentaire deja présent ? : on ajoute à la suite
196
				list($text, $merge) = $this->cartesFormateur->stockerCommentaire($text, $merge, $name, $comment, $inventory['collection_code'],$x,$y); 
219
				list($text, $merge) = $this->cartesFormateur->stockerCommentaire($text, $merge, $name, $comment, $inventory['collection_code'],$x,$y); 
197
			}
220
			}
198
		}
221
		}
199
			
222
			
200
		return array($text, $merge);
223
		return array($text, $merge);
201
	}
224
	}
202
	
225
	
203
 
226
 
204
	
227
	
205
	private function formaterCarteVide() {
228
	private function formaterCarteVide() {
206
		$this->cheminCartesBase = Config::get('Cartes.chemin');
229
		$this->cheminCartesBase = Config::get('Cartes.chemin');
207
		$dest_map['vide'] = 'vide_'.$this->info['src_map'];
230
		$dest_map['vide'] = 'vide_'.$this->info['src_map'];
208
		$img['vide'] = imagecreatefromjpeg($this->cheminCartesBase.$this->info['src_map']);
231
		$img['vide'] = imagecreatefromjpeg($this->cheminCartesBase.$this->info['src_map']);
209
		imagepng($img['vide'], Config::get('cache.stockageChemin').$dest_map['vide'], 9);
232
		imagepng($img['vide'], Config::get('cache.stockageChemin').$dest_map['vide'], 9);
210
		$retour = Config::get('cel_dst').$dest_map['vide'];
233
		$retour = Config::get('cel_dst').$dest_map['vide'];
211
		if ($this->info['retour'] == self::MIME_MAP) {
234
		if ($this->info['retour'] == self::MIME_MAP) {
212
			$retour =  "<img src=\"".$retour."\" style=\"border:none; cursor:crosshair\" alt=\"\" />\n";
235
			$retour =  "<img src=\"".$retour."\" style=\"border:none; cursor:crosshair\" alt=\"\" />\n";
213
		}
236
		}
214
		return $retour;
237
		return $retour;
215
	}
238
	}
216
	
239
	
217
 
240
 
218
	
241
	
219
	
242
	
220
	//+----------------------------------------------------------------------------------------------------------------+
243
	//+----------------------------------------------------------------------------------------------------------------+
221
	// sous fonction de calculer répartition
244
	// sous fonction de calculer répartition
222
	
245
	
223
	
246
	
224
	private function chercherCentreMaille($utm) {
247
	private function chercherCentreMaille($utm) {
225
		$pad = str_repeat ('0' ,(7 - strlen( $utm['x_utm'])));
248
		$pad = str_repeat ('0' ,(7 - strlen( $utm['x_utm'])));
226
		$utm['x_utm'] = $pad.$utm['x_utm'];
249
		$utm['x_utm'] = $pad.$utm['x_utm'];
227
	
250
	
228
		$pad = str_repeat ('0' ,(7 - strlen( $utm['y_utm'])));
251
		$pad = str_repeat ('0' ,(7 - strlen( $utm['y_utm'])));
229
		$utm['y_utm'] = $pad.$utm['y_utm'];
252
		$utm['y_utm'] = $pad.$utm['y_utm'];
230
	
253
	
231
		$utm['x_utm'] = substr($utm['x_utm'] ,0,3);
254
		$utm['x_utm'] = substr($utm['x_utm'] ,0,3);
232
		$utm['x_utm'] = $utm['x_utm'].'5000';
255
		$utm['x_utm'] = $utm['x_utm'].'5000';
233
	
256
	
234
		$utm['y_utm'] = substr($utm['y_utm'] ,0,3);
257
		$utm['y_utm'] = substr($utm['y_utm'] ,0,3);
235
		$utm['y_utm'] = $utm['y_utm'].'5000';
258
		$utm['y_utm'] = $utm['y_utm'].'5000';
236
		return $utm;
259
		return $utm;
237
	}
260
	}
238
 
261
 
239
	//+----------------------------------------------------------------------------------------------------------------+
262
	//+----------------------------------------------------------------------------------------------------------------+
240
	// Méthodes d'accès aux objets du Framework
263
	// Méthodes d'accès aux objets du Framework
241
	/**
264
	/**
242
	* Méthode de connection à la base de données sur demande.
265
	* Méthode de connection à la base de données sur demande.
243
	* Tous les services web n'ont pas besoin de s'y connecter.
266
	* Tous les services web n'ont pas besoin de s'y connecter.
244
	*/
267
	*/
245
	protected function getBdd() {
268
	protected function getBdd() {
246
		if (! isset($this->Bdd)) {
269
		if (! isset($this->Bdd)) {
247
			$this->Bdd = new Bdd();
270
			$this->Bdd = new Bdd();
248
		}
271
		}
249
	return $this->Bdd;
272
	return $this->Bdd;
250
	}
273
	}
251
	
274
	
252
 
275
 
253
	
276
	
254
}
277
}
255
?>
278
?>