Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 975 Rev 989
Line 50... Line 50...
50
		$this->verifierParametres();
50
		$this->verifierParametres();
51
		$this->initialiserConfiguration();
51
		$this->initialiserConfiguration();
52
		$resultats = '';
52
		$resultats = '';
53
		$this->traiterRessources();
53
		$this->traiterRessources();
Line -... Line 54...
-
 
54
 
54
 
55
		$req = $this->assemblerLaRequete();
55
		$resultat = $this->resultat = $this->Bdd->recupererTous($this->assemblerLaRequete());
56
		$resultat = $this->resultat = $this->Bdd->recupererTous($req);
56
		$versionResultat = $this->obtenirResultat($resultat);
57
		$versionResultat = $this->obtenirResultat($resultat);
57
		return $versionResultat;
58
		return $versionResultat;
Line 229... Line 230...
229
                RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE);
230
                RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE);
230
		} elseif ($resultat) {
231
		} elseif ($resultat) {
231
			if ((count($this->ressources)) != 0) {
232
			if ((count($this->ressources)) != 0) {
232
				//$Atraiter = array_filter($resultat[0],function($var){return ($var != '');});
233
				//$Atraiter = array_filter($resultat[0],function($var){return ($var != '');});
233
				foreach ($resultat[0] as $champs => $valeur) {
234
				foreach ($resultat[0] as $champs => $valeur) {
234
					if ($valeur !== '') {
235
					if ($valeur !== null) {
235
						$Atraiter[$champs] = $valeur;
236
						$Atraiter[$champs] = $valeur;
236
					}
237
					}
237
				}
238
				}
238
				if (!empty($Atraiter)) {
239
				if (!empty($Atraiter)) {
239
					$this->traiterValeursEcologiques($Atraiter);
240
					$this->traiterValeursEcologiques($Atraiter);
Line 256... Line 257...
256
 
257
 
Line 257... Line 258...
257
	//+----- modification svg -----+
258
	//+----- modification svg -----+
258
 
259
 
Line 259... Line 260...
259
 
260
 
-
 
261
 
-
 
262
	public function traiterValeursEcologiques($valeur) {
-
 
263
		$this->valeurs_champs = $valeur;
260
 
264
 
261
	public function traiterValeursEcologiques($valeur){
265
		foreach($this->valeurs_champs as $cle => $val){
262
		$this->valeurs_champs = $valeur;
266
			if ($val === null) {
263
 
267
				$this->valeurs_en_pourcentage[$cle] = null;
264
		foreach($this->valeurs_champs as $cle => $val){
268
			} else {
265
				if (preg_match("/ve_humidite_edaph/", $cle)) {
269
				if (preg_match("/ve_humidite_edaph/", $cle)) {
266
					$this->valeurs_en_pourcentage[$cle] = round($val/13,1);
270
					$this->valeurs_en_pourcentage[$cle] = round($val/13,1);
-
 
271
				} elseif (preg_match("/ve_salinite/", $cle)) {
267
				} elseif (preg_match("/ve_salinite/", $cle)) {
272
					$this->valeurs_en_pourcentage[$cle] = round(($val+1)/11,1);
268
					$this->valeurs_en_pourcentage[$cle] = round(($val+1)/11,1);
273
				} else {
Line 269... Line 274...
269
				} else {
274
					$this->valeurs_en_pourcentage[$cle] = round($val/10,1);
270
					$this->valeurs_en_pourcentage[$cle] = round($val/10,1);
275
				}
Line 310... Line 315...
310
				" b.code = BINARY '%s' AND c.code = BINARY '%s' LIMIT 0, 100",
315
				" b.code = BINARY '%s' AND c.code = BINARY '%s' LIMIT 0, 100",
311
				$valeur,
316
				$valeur,
312
				$this->champs_ontologiques[$champs]),
317
				$this->champs_ontologiques[$champs]),
313
				Bdd::MODE_OBJET);
318
				Bdd::MODE_OBJET);
314
		} catch (Exception $e) {
319
		} catch (Exception $e) {
315
			$val = "";
320
			$val = false;
316
		}
321
		}
317
		return $val;
322
		return $val;
318
	}
323
	}
Line 319... Line 324...
319
 
324