Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 333 Rev 362
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) {
65
		if ($this->analyserRessources() == true) {
66
			$resultat = $this->formerLegende();
66
			$resultat = $this->formerLegende();
67
		} else {
67
		} else {
68
			$this->traiterParametres();
68
			$this->traiterParametres();
69
			$resultat = $this->formerCarte();
69
			$resultat = $this->formerCarte();
70
		}
70
		}
71
		return $resultat;
71
		return $resultat;
72
	}
72
	}
73
	
73
	
74
	public function formerCarte() {
74
	public function formerCarte() {
75
		$this->creerFormateur();
75
		$this->creerFormateur();
76
		$this->cartesFormateur->initialiserImage();
76
		$this->cartesFormateur->initialiserImage();
77
			
-
 
-
 
77
		$inventories = '';
-
 
78
		if ($this->cartesFormateur->testerParametresProjets() == true) {
78
		$inventories = $this->cartesFormateur->chargerDonnees();
79
			$inventories = $this->cartesFormateur->chargerDonnees();
-
 
80
		}
79
		$retour = '';
81
		$retour = '';
80
		if (is_array($inventories) && $inventories !== array()){
82
		if (is_array($inventories) && $inventories !== array()){
81
			$this->chargerVille();// Connection referentiel communes
83
			$this->chargerVille();// Connection referentiel communes
82
			list($text, $merge) = $this->calculerRepartition($inventories);
84
			list($text, $merge) = $this->calculerRepartition($inventories);
83
			// Définition des couleurs des points
85
			// Définition des couleurs des points
84
			$couleurs = $this->cartesFormateur->definirCouleurs();
86
			$couleurs = $this->cartesFormateur->definirCouleurs();
85
			if ($text) {
87
			if ($text) {
86
				$usemap = $this->cartesFormateur->dessinerPoint($text, $merge, $couleurs);
88
				$usemap = $this->cartesFormateur->dessinerPoint($text, $merge, $couleurs);
87
			}
89
			}
88
			if (isset($usemap)) {
90
			if (isset($usemap)) {
89
				$this->cartesFormateur->img();
91
				$this->cartesFormateur->img();
90
				$retour = $this->cartesFormateur->formaterCartes($usemap);
92
				$retour = $this->cartesFormateur->formaterCartes($usemap);
91
			}
93
			}
92
		}
94
		}
93
		if ($retour == '') {
95
		if ($retour == '') {
94
			$retour = $this->formaterCarteVide();
96
			$retour = $this->formaterCarteVide();
95
		}
97
		}
96
		$resultat = new ResultatService();
98
		$resultat = new ResultatService();
97
		$resultat->corps = ($this->info['retour'] == self::MIME_MAP) ? $retour : file_get_contents($retour);
99
		$resultat->corps = ($this->info['retour'] == self::MIME_MAP) ? $retour : file_get_contents($retour);
98
		$resultat->mime = ($this->info['retour'] == self::MIME_MAP) ? self::MIME_MAP : self::MIME_PNG;
100
		$resultat->mime = ($this->info['retour'] == self::MIME_MAP) ? self::MIME_MAP : self::MIME_PNG;
99
		return $resultat;
101
		return $resultat;
100
	}
102
	}
101
	
103
	
102
	public function creerFormateur(){
104
	public function creerFormateur(){
103
		$projet = ucwords($this->info['projet']);
105
		$projet = ucwords($this->info['projet']);
104
		$Classe = $projet.'Formateur';
106
		$Classe = $projet.'Formateur';
105
		$chemin = dirname(__FILE__).DS.'cartes'.DS;
107
		$chemin = dirname(__FILE__).DS.'cartes'.DS;
106
		$cheminClasse = $chemin.$Classe.'.php';
108
		$cheminClasse = $chemin.$Classe.'.php';
107
		$cheminInterface = $chemin.'Formateur.php';
109
		$cheminInterface = $chemin.'Formateur.php';
108
		if (file_exists($cheminInterface)) {
110
		if (file_exists($cheminInterface)) {
109
			include_once $cheminInterface;
111
			include_once $cheminInterface;
110
			if (file_exists($cheminClasse)) {
112
			if (file_exists($cheminClasse)) {
111
				include_once $cheminClasse;
113
				include_once $cheminClasse;
112
				$this->cartesFormateur = new $Classe($this->info);
114
				$this->cartesFormateur = new $Classe($this->info);
113
			} else {
115
			} else {
114
				$message = "La classe '$Classe' est introuvable.";Debug::printr($message);
116
				$message = "La classe '$Classe' est introuvable.";Debug::printr($message);
115
				throw new Exception($message);
117
				throw new Exception($message);
116
			}
118
			}
117
		}
119
		}
118
	}
120
	}
119
	private function analyserRessources() {
121
	private function analyserRessources() {
120
		$ok = false;
122
		$ok = false;
121
		if (isset($this->ressources[0]) && $this->ressources[0] == 'legende') {
123
		if (isset($this->ressources[0]) && $this->ressources[0] == 'legende') {
122
			$ok = true;
124
			$ok = true;
123
		}
125
		}
124
		return $ok;
126
		return $ok;
125
	}
127
	}
126
	
128
	
127
	private function formerLegende() {
129
	private function formerLegende() {
128
		$classe = 'LegendeCartes';
130
		$classe = 'LegendeCartes';
129
		require_once dirname(__FILE__).DS.'cartes'.DS.$classe.'.php';
131
		require_once dirname(__FILE__).DS.'cartes'.DS.$classe.'.php';
130
		$sousService = new $classe(new Conteneur());
132
		$sousService = new $classe(new Conteneur());
131
		$resultat = $sousService->consulter($this->ressources, $this->param);
133
		$resultat = $sousService->consulter($this->ressources, $this->param);
132
		return $resultat;
134
		return $resultat;
133
	}
135
	}
134
	
136
	
135
	private function traiterParametres() {
137
	private function traiterParametres() {
136
		$this->info['miniature'] = (isset($this->param['retour.format'])) ? $this->param['retour.format'] : false;
138
		$this->info['miniature'] = (isset($this->param['retour.format'])) ? $this->param['retour.format'] : false;
137
		$this->info['src_map'] = ($this->info['miniature'] == 'min') ? 'france_utm_miniature.png' : 'france_utm_600x564.png';
139
		$this->info['src_map'] = ($this->info['miniature'] == 'min') ? 'france_utm_miniature.png' : 'france_utm_600x564.png';
138
		$this->info['retour'] = (isset($this->param['retour'])) ? $this->param['retour'] : self::MIME_PNG ;
140
		$this->info['retour'] = (isset($this->param['retour'])) ? $this->param['retour'] : self::MIME_PNG ;
139
		// Ajout du code du référentiel
141
		// Ajout du code du référentiel
140
		$this->info['referentiel'] = 'bdtfx';
142
		$this->info['referentiel'] = 'bdtfx';
141
		$projets = array('cenlr', 'cel', 'cbnmed', 'sophy', 'general');
143
		$projets = array('cenlr', 'cel', 'cbnmed', 'sophy', 'general');
142
		if (isset($this->param['projet']) && in_array($this->param['projet'], $projets)) {
144
		if (isset($this->param['projet']) && in_array($this->param['projet'], $projets)) {
143
			$this->info['projet'] = $this->param['projet'];
145
			$this->info['projet'] = $this->param['projet'];
144
		} else {
146
		} else {
145
			$this->info['projet'] = 'general';
147
			$this->info['projet'] = 'general';
146
		}
148
		}
147
		// Récupération d'infos générales
149
		// Récupération d'infos générales
148
		// donnees exemple nn = 141; nt = 8522; nom = 'Acer campestre L.'; nom_ss_auteur = 'Acer campestre';
150
		// donnees exemple nn = 141; nt = 8522; nom = 'Acer campestre L.'; nom_ss_auteur = 'Acer campestre';
149
		$this->info['nn'] = $this->param['masque.nn'];
151
		$this->info['nn'] = $this->param['masque.nn'];
150
		$this->info['nt'] = $this->param['masque.nt'];
152
		$this->info['nt'] = $this->param['masque.nt'];
151
		$this->info['nom'] = $this->param['masque.ns'].' '.$this->param['masque.au'];
153
		$this->info['nom'] = $this->param['masque.ns'].' '.$this->param['masque.au'];
152
		$this->info['nom_ss_auteur'] = $this->param['masque.ns'];
154
		$this->info['nom_ss_auteur'] = $this->param['masque.ns'];
153
	}
155
	}
154
	
156
	
155
	private function chargerVille() {
157
	private function chargerVille() {
156
		$requete = "SELECT * FROM tb_cel.locations";
158
		$requete = "SELECT * FROM tb_cel.locations";
157
		$villes = $this->getBdd()->recupererTous($requete);
159
		$villes = $this->getBdd()->recupererTous($requete);
158
		foreach ($villes as $ville) {
160
		foreach ($villes as $ville) {
159
			$this->tab_code_insee[$ville['insee_code']] = $ville;
161
			$this->tab_code_insee[$ville['insee_code']] = $ville;
160
		}
162
		}
161
	}
163
	}
162
	
164
	
163
	private function calculerRepartition($inventories) {
165
	private function calculerRepartition($inventories) {
164
		$text = '';
166
		$text = '';
165
		// Recuperation du positionnement de la carte
167
		// Recuperation du positionnement de la carte
166
		$png_txt = file_get_contents(Config::get('Cartes.chemin').str_replace('png', 'txt', $this->info['src_map']));
168
		$png_txt = file_get_contents(Config::get('Cartes.chemin').str_replace('png', 'txt', $this->info['src_map']));
167
		parse_str($png_txt);
169
		parse_str($png_txt);
168
		// "Resolution" calculer à partir du fichier $png_txt par fuseau
170
		// "Resolution" calculer à partir du fichier $png_txt par fuseau
169
		$p['31T'] = ($X231T - $X131T) / ($X231TUTM - $X131TUTM);
171
		$p['31T'] = ($X231T - $X131T) / ($X231TUTM - $X131TUTM);
170
		$p['32T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM);
172
		$p['32T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM);
171
		$p['30T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM);
173
		$p['30T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM);
172
		
174
		
173
		$text = array();
175
		$text = array();
174
		$merge = array();
176
		$merge = array();
175
		foreach ($inventories as $inventory){
177
		foreach ($inventories as $inventory){
176
			$utm = $this->cartesFormateur->chercherVille($inventory, $this->tab_code_insee);
178
			$utm = $this->cartesFormateur->chercherVille($inventory, $this->tab_code_insee);
177
			// Ultime tentative 
179
			// Ultime tentative 
178
			if (!$utm) {
180
			if (!$utm) {
179
				$requete = "SELECT *  FROM tb_cel.locations WHERE name LIKE ".$this->getBdd()->proteger($inventory['location']);
181
				$requete = "SELECT *  FROM tb_cel.locations WHERE name LIKE ".$this->getBdd()->proteger($inventory['location']);
180
				$utm = $this->getBdd()->recupererTous($requete);
182
				$utm = $this->getBdd()->recupererTous($requete);
181
			}
183
			}
182
 
184
 
183
			// Si des doublons sur la commune : pas d'affichage , il vaut mieux ne rien afficher que d'afficher des erreurs.
185
			// Si des doublons sur la commune : pas d'affichage , il vaut mieux ne rien afficher que d'afficher des erreurs.
184
			if (sizeof($utm) == 1) {
186
			if (sizeof($utm) == 1) {
185
				$utm = $utm[0];
187
				$utm = $utm[0];
186
					
188
					
187
				// On centre le point au milieu de la maille 10x10 par defaut ...
189
				// On centre le point au milieu de la maille 10x10 par defaut ...
188
				$utm = $this->chercherCentreMaille($utm);
190
				$utm = $this->chercherCentreMaille($utm);
189
					
191
					
190
				// Calcul coordonnes x, y sur l'image
192
				// Calcul coordonnes x, y sur l'image
191
				if ($utm['sector']=='31T') {// Fuseau 31 T
193
				if ($utm['sector']=='31T') {// Fuseau 31 T
192
					$x = (($utm['x_utm'] - $X131TUTM) * $p['31T'] ) + $X131T;
194
					$x = (($utm['x_utm'] - $X131TUTM) * $p['31T'] ) + $X131T;
193
					$y = $Y231T - (($utm['y_utm'] - $Y131TUTM) * $p['31T'] );
195
					$y = $Y231T - (($utm['y_utm'] - $Y131TUTM) * $p['31T'] );
194
				} elseif ($utm['sector'] == '32T') {// Fuseau 32 T : une rotation + translation est appliqu�e
196
				} elseif ($utm['sector'] == '32T') {// Fuseau 32 T : une rotation + translation est appliqu�e
195
					$cosa = cos(deg2rad($angle3132));
197
					$cosa = cos(deg2rad($angle3132));
196
					$sina = sin(deg2rad($angle3132));
198
					$sina = sin(deg2rad($angle3132));
197
					$xp = (($utm['x_utm'] - $X132TUTM) * $cosa) + (($utm['y_utm']- $Y132TUTM) * $sina);
199
					$xp = (($utm['x_utm'] - $X132TUTM) * $cosa) + (($utm['y_utm']- $Y132TUTM) * $sina);
198
					$yp = (-($utm['x_utm'] - $X132TUTM)* $sina) + (($utm['y_utm'] - $Y132TUTM) * $cosa);
200
					$yp = (-($utm['x_utm'] - $X132TUTM)* $sina) + (($utm['y_utm'] - $Y132TUTM) * $cosa);
199
					$x = ($xp * $p['32T'] ) + $X132T;
201
					$x = ($xp * $p['32T'] ) + $X132T;
200
					$y = $Y232T-($yp * $p['32T'] );
202
					$y = $Y232T-($yp * $p['32T'] );
201
				} elseif ($utm['sector'] == '30T') {// Fuseau 30 T : une rotation + translation est appliqu�e
203
				} elseif ($utm['sector'] == '30T') {// Fuseau 30 T : une rotation + translation est appliqu�e
202
					$cosa = cos(deg2rad($angle3031));
204
					$cosa = cos(deg2rad($angle3031));
203
					$sina = sin(deg2rad($angle3031));
205
					$sina = sin(deg2rad($angle3031));
204
					$xp = (($utm['x_utm'] - $X130TUTM) * $cosa) + (($utm['y_utm'] - $Y130TUTM) * $sina);
206
					$xp = (($utm['x_utm'] - $X130TUTM) * $cosa) + (($utm['y_utm'] - $Y130TUTM) * $sina);
205
					$yp = (-($utm['x_utm'] - $X130TUTM) * $sina) + (($utm['y_utm'] - $Y130TUTM) * $cosa);
207
					$yp = (-($utm['x_utm'] - $X130TUTM) * $sina) + (($utm['y_utm'] - $Y130TUTM) * $cosa);
206
					$x = ($xp * $p['30T'] ) + $X130T;
208
					$x = ($xp * $p['30T'] ) + $X130T;
207
					$y = $Y230T - ($yp * $p['30T'] );
209
					$y = $Y230T - ($yp * $p['30T'] );
208
				}
210
				}
209
				$x = round($x);
211
				$x = round($x);
210
				$y = round($y);
212
				$y = round($y);
211
					
213
					
212
					
214
					
213
				if ($utm['name'] != null) {
215
				if ($utm['name'] != null) {
214
					$name = utf8_decode($utm['name']);
216
					$name = utf8_decode($utm['name']);
215
				}
217
				}
216
				$comment = ($this->info['retour'] == self::MIME_MAP) ? $this->cartesFormateur->formerCommentaire($utm, $inventory) : '';
218
				$comment = ($this->info['retour'] == self::MIME_MAP) ? $this->cartesFormateur->formerCommentaire($utm, $inventory) : '';
217
				// On stocke les commentaires pour affichage dans les tooltips
219
				// On stocke les commentaires pour affichage dans les tooltips
218
				// Commentaire deja présent ? : on ajoute à la suite
220
				// Commentaire deja présent ? : on ajoute à la suite
219
				list($text, $merge) = $this->cartesFormateur->stockerCommentaire($text, $merge, $name, $comment, $inventory['collection_code'],$x,$y); 
221
				list($text, $merge) = $this->cartesFormateur->stockerCommentaire($text, $merge, $name, $comment, $inventory['collection_code'],$x,$y); 
220
			}
222
			}
221
		}
223
		}
222
			
224
			
223
		return array($text, $merge);
225
		return array($text, $merge);
224
	}
226
	}
225
	
227
	
226
 
228
 
227
	
229
	
228
	private function formaterCarteVide() {
230
	private function formaterCarteVide() {
229
		$this->cheminCartesBase = Config::get('Cartes.chemin');
231
		$this->cheminCartesBase = Config::get('Cartes.chemin');
230
		$dest_map['vide'] = 'vide_'.$this->info['src_map'];
232
		$dest_map['vide'] = 'vide_'.$this->info['src_map'];
231
		$img['vide'] = imagecreatefrompng($this->cheminCartesBase.$this->info['src_map']);
233
		$img['vide'] = imagecreatefrompng($this->cheminCartesBase.$this->info['src_map']);
232
		imagepng($img['vide'], Config::get('cache.stockageChemin').$dest_map['vide'], 9);
234
		imagepng($img['vide'], Config::get('cache.stockageChemin').$dest_map['vide'], 9);
233
		$retour = Config::get('cel_dst').$dest_map['vide'];
235
		$retour = Config::get('cel_dst').$dest_map['vide'];
234
		if ($this->info['retour'] == self::MIME_MAP) {
236
		if ($this->info['retour'] == self::MIME_MAP) {
235
			$retour =  "<img src=\"".$retour."\" style=\"border:none; cursor:crosshair\" alt=\"\" />\n";
237
			$retour =  "<img src=\"".$retour."\" style=\"border:none; cursor:crosshair\" alt=\"\" />\n";
236
		}
238
		}
237
		return $retour;
239
		return $retour;
238
	}
240
	}
239
	
241
	
240
 
242
 
241
	
243
	
242
	
244
	
243
	//+----------------------------------------------------------------------------------------------------------------+
245
	//+----------------------------------------------------------------------------------------------------------------+
244
	// sous fonction de calculer répartition
246
	// sous fonction de calculer répartition
245
	
247
	
246
	
248
	
247
	private function chercherCentreMaille($utm) {
249
	private function chercherCentreMaille($utm) {
248
		$pad = str_repeat ('0' ,(7 - strlen( $utm['x_utm'])));
250
		$pad = str_repeat ('0' ,(7 - strlen( $utm['x_utm'])));
249
		$utm['x_utm'] = $pad.$utm['x_utm'];
251
		$utm['x_utm'] = $pad.$utm['x_utm'];
250
	
252
	
251
		$pad = str_repeat ('0' ,(7 - strlen( $utm['y_utm'])));
253
		$pad = str_repeat ('0' ,(7 - strlen( $utm['y_utm'])));
252
		$utm['y_utm'] = $pad.$utm['y_utm'];
254
		$utm['y_utm'] = $pad.$utm['y_utm'];
253
	
255
	
254
		$utm['x_utm'] = substr($utm['x_utm'] ,0,3);
256
		$utm['x_utm'] = substr($utm['x_utm'] ,0,3);
255
		$utm['x_utm'] = $utm['x_utm'].'5000';
257
		$utm['x_utm'] = $utm['x_utm'].'5000';
256
	
258
	
257
		$utm['y_utm'] = substr($utm['y_utm'] ,0,3);
259
		$utm['y_utm'] = substr($utm['y_utm'] ,0,3);
258
		$utm['y_utm'] = $utm['y_utm'].'5000';
260
		$utm['y_utm'] = $utm['y_utm'].'5000';
259
		return $utm;
261
		return $utm;
260
	}
262
	}
261
 
263
 
262
	//+----------------------------------------------------------------------------------------------------------------+
264
	//+----------------------------------------------------------------------------------------------------------------+
263
	// Méthodes d'accès aux objets du Framework
265
	// Méthodes d'accès aux objets du Framework
264
	/**
266
	/**
265
	* Méthode de connection à la base de données sur demande.
267
	* Méthode de connection à la base de données sur demande.
266
	* Tous les services web n'ont pas besoin de s'y connecter.
268
	* Tous les services web n'ont pas besoin de s'y connecter.
267
	*/
269
	*/
268
	protected function getBdd() {
270
	protected function getBdd() {
269
		if (! isset($this->Bdd)) {
271
		if (! isset($this->Bdd)) {
270
			$this->Bdd = new Bdd();
272
			$this->Bdd = new Bdd();
271
		}
273
		}
272
	return $this->Bdd;
274
	return $this->Bdd;
273
	}
275
	}
274
	
276
	
275
 
277
 
276
	
278
	
277
}
279
}
278
?>
280
?>