Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 303 | Rev 314 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 303 Rev 308
Line 54... Line 54...
54
class Cartes {
54
class Cartes {
55
	private $tab_code_insee = array();
55
	private $tab_code_insee = array();
56
	private $src_map;
56
	private $src_map;
Line 57... Line 57...
57
	
57
	
-
 
58
	public function consulter($ressources, $param) {
-
 
59
		$this->ressources = $ressources;
-
 
60
		$this->param = $param;
-
 
61
		
58
	public function consulter($ressources, $param) {
62
		$this->traiterParametres();
59
		// Initialisation des variables
63
		// Initialisation des variables
-
 
64
		$tab_retour = array();
-
 
65
		
-
 
66
		
-
 
67
		$tab_retour['contenu_page'] = $this->calculerRepartition($this->info);
-
 
68
		print_r($this->calculerRepartition($this->info));
-
 
69
	}
-
 
70
	
60
		$tab_retour = array();
71
	private function traiterParametres() {
61
		if ($param['miniature']==true) {
72
		if ($this->param['retour.format'] == 'min') {
62
			$this->src_map = 'france_utm_miniature.jpg';
73
			$this->src_map = 'france_utm_miniature.jpg';
63
		} else {
74
		} else {
64
			$this->src_map = 'france_utm_600x564.jpg';
75
			$this->src_map = 'france_utm_600x564.jpg';
65
		}
76
		}
66
		// +-----------------------------------------------------------------------------------------------------------+
77
		// +-----------------------------------------------------------------------------------------------------------+
67
		// Ajout du code du r�f�rentiel
78
		// Ajout du code du r�f�rentiel
Line 68... Line 79...
68
		$this->info['referentiel'] = 'bdtfx';
79
		$this->info['referentiel'] = 'bdtfx';
69
		
80
		
70
		// +-----------------------------------------------------------------------------------------------------------+
81
		// +-----------------------------------------------------------------------------------------------------------+
71
		// R�cup�ration d'infos g�n�rales
82
		// R�cup�ration d'infos g�n�rales
72
		$this->info['nn'] = 141;
83
		/*$this->info['nn'] = 141;
73
		$this->info['nt'] = 8522;
84
		$this->info['nt'] = 8522;
74
		$this->info['nom'] = 'Acer campestre L.';
85
		$this->info['nom'] = 'Acer campestre L.';
75
		$this->info['nom_ss_auteur'] = 'Acer campestre';
-
 
-
 
86
		$this->info['nom_ss_auteur'] = 'Acer campestre';*/
-
 
87
		$this->info['nn'] = $this->param['masque.nn'];
76
		$this->info['miniature'] = false;
88
		$this->info['nt'] = $this->param['masque.nt'];
77
		
89
		$this->info['nom'] = $this->param['masque.ns'].' '.$this->param['masque.au'];
78
		$tab_retour['contenu_page'] = $this->calculerRepartition($this->info);
90
		$this->info['nom_ss_auteur'] = $this->param['masque.ns'];
Line 79... Line 91...
79
		print_r($this->calculerRepartition($this->info));
91
		$this->info['miniature'] = $this->param['retour.format'];
80
	}
-
 
81
	
-
 
82
	private function calculerRepartition($param) {
92
	}
83
		// Initialisation
93
	
84
		//require_once '../bibliotheque/jpeg/JPEG.php';
-
 
85
		$text = '';
-
 
86
		// Lecture commentaires embarqu�s dans la page
-
 
87
		
-
 
88
		// Si miniature 
-
 
89
		
94
	private function calculerRepartition($param) {
90
		
95
		$text = '';
91
	
96
		// Lecture commentaires embarqu�s dans la page
Line 92... Line 97...
92
		$jpg_txt = file_get_contents(Config::get('Cartes.chemin').str_replace('jpg', 'txt', $this->src_map));
97
		$jpg_txt = file_get_contents(Config::get('Cartes.chemin').str_replace('jpg', 'txt', $this->src_map));
Line 419... Line 424...
419
	    	imagejpeg($img_sophy, Config::get('cache.stockageChemin').$dest_map_sophy, $qualite);
424
	    	imagejpeg($img_sophy, Config::get('cache.stockageChemin').$dest_map_sophy, $qualite);
Line 420... Line 425...
420
		    
425
		    
Line 421... Line 426...
421
		    //imagedestroy($img);
426
		    //imagedestroy($img);
422
	
427
	
423
		    $retour = '';
428
		    $retour = '';
424
		    if ($param['miniature'] != true)  {
429
		    if ($this->info['miniature'] !== 'min')  {
425
		    	$retour.="<div id=\"descriptions\">";
430
		    	$retour.="<div id=\"descriptions\">";
426
				$retour.="<h2 id=\"titre_description_general\">Donn&eacute;es disponibles : </h2>";
431
				$retour.="<h2 id=\"titre_description_general\">Donn&eacute;es disponibles : </h2>";
427
		    	$retour.= "<div id=\"description_defaut\" class=\"description\">";
432
		    	$retour.= "<div id=\"description_defaut\" class=\"description\">";
Line 596... Line 601...
596
		}
601
		}
597
	}
602
	}
Line 598... Line 603...
598
	
603
	
599
	public function recupererDonnees() {
604
	public function recupererDonnees() {
600
		// Recherche nom correspondant au numero nomenclatural en cours (pour etablir le lien avec les donnees moissonnes).
-
 
601
		$nom = 'Acer campestre L.';//$this->formaterNom($rawNom);
-
 
Line 602... Line 605...
602
		$nom_ss_auteur = 'Acer campestre';//$this->formaterNomSansAuteur($rawNom);
605
		// Recherche nom correspondant au numero nomenclatural en cours (pour etablir le lien avec les donnees moissonnes).
603
	
606
	
604
		// R�cuperation donn�e inventaire
607
		// R�cuperation donn�e inventaire
605
		$queryCel = "SELECT 'cel' as collection_code,  location, id_location, date_observation,  ".
608
		$queryCel = "SELECT 'cel' as collection_code,  location, id_location, date_observation,  ".
Line 612... Line 615...
612
		// Collection code = 'flore' (Cenlr)
615
		// Collection code = 'flore' (Cenlr)
613
		$queryCenlr = "SELECT collection_code, locality as location, county as id_location, ".
616
		$queryCenlr = "SELECT collection_code, locality as location, county as id_location, ".
614
						"	STR_TO_DATE(concat(year, '/',month, '/',day), '%Y/%m/%d') as date_observation, latitude as y_utm , ". 
617
						"	STR_TO_DATE(concat(year, '/',month, '/',day), '%Y/%m/%d') as date_observation, latitude as y_utm , ". 
615
				    	"	longitude as x_utm , max_altitude as sector,  collector_name as identifiant ".
618
				    	"	longitude as x_utm , max_altitude as sector,  collector_name as identifiant ".
616
						"FROM tb_hit_indexation.raw_occurrence_record ".
619
						"FROM tb_hit_indexation.raw_occurrence_record ".
617
						"WHERE scientific_name = ".$this->getBdd()->proteger($nom).
620
						"WHERE scientific_name = ".$this->getBdd()->proteger($this->info['nom']).
618
						"	AND collection_code = 'flore' ".
621
						"	AND collection_code = 'flore' ".
619
						"	AND  deleted IS NULL";
622
						"	AND  deleted IS NULL";
620
		$inventoriesCenlr = $this->getBdd()->recupererTous($queryCenlr);
623
		$inventoriesCenlr = $this->getBdd()->recupererTous($queryCenlr);
Line 621... Line 624...
621
	
624
	
622
	
625
	
623
		// Collection code = 'FLORE - VAR' (Cbnmed)
626
		// Collection code = 'FLORE - VAR' (Cbnmed)
624
		$queryCbnmed = "SELECT collection_code, locality as location, county as id_location, ".
627
		$queryCbnmed = "SELECT collection_code, locality as location, county as id_location, ".
625
						"	STR_TO_DATE(concat(ifnull(year,0),'/', ifnull(month,0), '/',ifnull(day,0)), '%Y/%m/%d') as date_observation, ".
628
						"	STR_TO_DATE(concat(ifnull(year,0),'/', ifnull(month,0), '/',ifnull(day,0)), '%Y/%m/%d') as date_observation, ".
626
						"	latitude as y_utm , longitude as x_utm , max_altitude as sector, collector_name as identifiant ".
629
						"	latitude as y_utm , longitude as x_utm , max_altitude as sector, collector_name as identifiant ".
627
						"FROM tb_hit_indexation.raw_occurrence_record ".
630
						"FROM tb_hit_indexation.raw_occurrence_record ".
628
						"WHERE scientific_name = ".$this->getBdd()->proteger($nom).
631
						"WHERE scientific_name = ".$this->getBdd()->proteger($this->info['nom']).
629
						"	AND collection_code='FLORE - VAR' ".
632
						"	AND collection_code='FLORE - VAR' ".
Line 630... Line 633...
630
						"	AND  (deleted IS NULL OR deleted = '0000-00-00 00:00:00')";
633
						"	AND  (deleted IS NULL OR deleted = '0000-00-00 00:00:00')";
631
		$inventoriesCbnmed = $this->getBdd()->recupererTous($queryCbnmed);
634
		$inventoriesCbnmed = $this->getBdd()->recupererTous($queryCbnmed);
632
	
635
	
633
		// Collection code = 'sophy'
636
		// Collection code = 'sophy'
634
		$querySophy = "SELECT 'sophy' as collection_code, lieu_station_nom as location, lieu_commune_code_insee as id_location, ".
637
		$querySophy = "SELECT 'sophy' as collection_code, lieu_station_nom as location, lieu_commune_code_insee as id_location, ".
635
						"	observation_date as date_observation, lieu_station_utm_est as x_utm , ". 
638
						"	observation_date as date_observation, lieu_station_utm_est as x_utm , ". 
636
				    	"	lieu_station_utm_nord as y_utm , lieu_station_utm_zone as sector,  observateur_nom_complet as identifiant ".
639
				    	"	lieu_station_utm_nord as y_utm , lieu_station_utm_zone as sector,  observateur_nom_complet as identifiant ".
Line 637... Line 640...
637
						"FROM sophy_tapir ".
640
						"FROM sophy_tapir ".
638
						"WHERE nom_scientifique_complet = ".$this->getBdd()->proteger($nom_ss_auteur);
641
						"WHERE nom_scientifique_complet = ".$this->getBdd()->proteger($this->info['nom_ss_auteur']);