Subversion Repositories Applications.papyrus

Rev

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

Rev 1081 Rev 1189
Line 24... Line 24...
24
//Autres auteurs :
24
//Autres auteurs :
25
*@copyright         Tela-Botanica 2000-2004
25
*@copyright         Tela-Botanica 2000-2004
26
*@version             03 mai 2004
26
*@version             03 mai 2004
27
// +-----------------------------------------------------------------------------------------------+
27
// +-----------------------------------------------------------------------------------------------+
28
//
28
//
29
// $Id: cartographie.php,v 1.6 2006-12-01 13:23:17 florian Exp $
29
// $Id: cartographie.php,v 1.7 2007-01-04 16:53:02 alexandre_tb Exp $
30
// FICHIER : $RCSfile: cartographie.php,v $
30
// FICHIER : $RCSfile: cartographie.php,v $
31
// AUTEUR    : $Author: florian $
31
// AUTEUR    : $Author: alexandre_tb $
32
// VERSION : $Revision: 1.6 $
32
// VERSION : $Revision: 1.7 $
33
// DATE        : $Date: 2006-12-01 13:23:17 $
33
// DATE        : $Date: 2007-01-04 16:53:02 $
34
*/
34
*/
35
include_once PAP_CHEMIN_RACINE.'/client/bottin/configuration/bottin.config.inc.php';
35
include_once PAP_CHEMIN_RACINE.'/client/bottin/configuration/bottin.config.inc.php';
36
include_once INS_CHEMIN_APPLI.'configuration/cartographie.config.inc.php';
36
include_once INS_CHEMIN_APPLI.'configuration/cartographie.config.inc.php';
37
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.fonct.php';
37
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.fonct.php';
38
include_once INS_CHEMIN_APPLI.'bibliotheque/lib.carto.php';
38
include_once INS_CHEMIN_APPLI.'bibliotheque/lib.carto.php';
Line 39... Line 39...
39
 
39
 
40
//================================================================================================
40
//================================================================================================
41
if ( isset($_GET['voir_fiche']) or isset($_GET['voir_abonnement']) or isset($_GET['voir_actus']) or isset($_GET['voir_ressources']) or isset($_GET['voir_competences']) ) {
41
if (isset($_GET['voir_abonnement']) or isset($_GET['voir_actus']) or isset($_GET['voir_ressources']) or isset($_GET['voir_competences']) ) {
42
	//---------------le menu de l'appli-----------
42
	//---------------le menu de l'appli-----------
43
	function afficherContenuNavigation () {
43
	function afficherContenuNavigation () {
44
		$res =inscription_onglets();
44
		$res =inscription_onglets();
45
		return $res ;
45
		return $res ;
Line 49... Line 49...
49
//================================================================================================
49
//================================================================================================
50
function construit_hierarchie(&$info_zone, &$carto_config, $info_zone_hierarchie, &$monde) {
50
function construit_hierarchie(&$info_zone, &$carto_config, $info_zone_hierarchie, &$monde) {
51
	static $i=0;
51
	static $i=0;
52
	$i++;
52
	$i++;
Line 53... Line -...
53
	
-
 
54
	//on ajoute la carto en cours en tant que fils
-
 
55
	$monde->ajouterFils($info_zone_hierarchie->czh_code_alpha, $info_zone_hierarchie->czh_identifiant_table_info_couleur,
-
 
56
						$info_zone_hierarchie->czh_nom, $info_zone_hierarchie->czh_fichier_masque,
-
 
57
						$info_zone_hierarchie->czh_fichier_image, '');
-
 
58
	$monde->fils[$info_zone_hierarchie->czh_code_alpha]->definirCouleurs ('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ;
53
	
59
			    		
54
	    		
60
	//requete pour trouver les fils de la carte de depart voulue
55
	//requete pour trouver les fils de la carte de depart voulue
61
	$requete_zone_fils = 'SELECT * FROM carto_zone_hierarchie '.
56
	$requete_zone_fils = 'SELECT * FROM carto_zone_hierarchie '.
62
						 'WHERE czh_id_zone_pere='.$info_zone_hierarchie->czh_id_zone;/*echo $requete_zone_fils;*/
57
						 'WHERE czh_id_zone_pere='.$info_zone_hierarchie->czh_id_zone;
63
	$resultat_zone_fils = $GLOBALS['ins_db']->query($requete_zone_fils) ;
58
	$resultat_zone_fils = $GLOBALS['ins_db']->query($requete_zone_fils) ;//$GLOBALS['debug'] .= $requete_zone_fils.'<br /><br />';
64
	if (DB::isError($resultat_zone_fils )) {
59
	if (DB::isError($resultat_zone_fils )) {
65
    	echo ($resultat_zone_fils->getMessage().'<br />'.$resultat_zone_fils->getDebugInfo()).'<br />'.$requete_zone_fils ;
60
    	echo ($resultat_zone_fils->getMessage().'<br />'.$resultat_zone_fils->getDebugInfo()).'<br />'.$requete_zone_fils ;
Line 66... Line 61...
66
	}
61
	}
67
	
62
	
-
 
63
	if ($resultat_zone_fils->numRows()!=0) {
-
 
64
		while ($ligne_zone_fils  = $resultat_zone_fils ->fetchRow(DB_FETCHMODE_OBJECT)) {
-
 
65
			//on ajoute la carto en cours en tant que fils
68
	if ($resultat_zone_fils->numRows()!=0) {
66
	
69
		while ($ligne_zone_fils  = $resultat_zone_fils ->fetchRow(DB_FETCHMODE_OBJECT)) {
67
			
-
 
68
			//requete pour obtenir toutes les infos (repartition par zones, nom des tables et champs pour les couleurs,.. ) pour la carte à afficher
70
			//requete pour obtenir toutes les infos (repartition par zones, nom des tables et champs pour les couleurs,.. ) pour la carte à afficher
69
			$requete_01 = 'SELECT '.$ligne_zone_fils->czh_code_alpha.'.'.$ligne_zone_fils-> czh_champs_jointure_annuaire.
71
			$requete_01 = 'SELECT '.$ligne_zone_fils->czh_nom_champs_id_pere.',count('.$ligne_zone_fils->czh_nom_champs_id_pere.') AS nbr'.
70
							',count('.$ligne_zone_fils->czh_code_alpha.'.'.$ligne_zone_fils-> czh_champs_jointure_annuaire.') AS nbr'.
-
 
71
			    		  ' FROM '.$carto_config['cc_table1']; //.', '.$ligne_zone_fils->czh_nom_table_info_couleur;
-
 
72
			if ($carto_config['cc_table2']!='') $requete_01 .=  ', '.$carto_config['cc_table2'].' as '.$info_zone_hierarchie->czh_code_alpha.', '.
72
			    		  ' FROM '.$carto_config['cc_table1'].', '.$ligne_zone_fils->czh_nom_table_info_couleur;
73
												$carto_config['cc_table2'].' as '.$ligne_zone_fils->czh_code_alpha.'';     
-
 
74
			
-
 
75
			$requete_01 .= ' WHERE '.$info_zone_hierarchie->czh_code_alpha.'.'.$info_zone_hierarchie->czh_champs_jointure_annuaire.' = "'.
-
 
76
							$ligne_zone_fils-> czh_identifiant_table_info_couleur.
73
			if ($carto_config['cc_table2']!=0) $requete_01 .=  ', '.$carto_config['cc_table2'];     
77
							'" AND '.$info_zone_hierarchie->czh_sql_complementaire;
-
 
78
 
-
 
79
			if ($carto_config['cc_sql']!='') $requete_01 .=  '  and ('.$carto_config['cc_sql'].')';
74
			$requete_01 .= ' WHERE '.$ligne_zone_fils->czh_champs_jointure_annuaire.' = '.$ligne_zone_fils->czh_nom_champs_id;
80
			if ($ligne_zone_fils-> czh_sql_complementaire != '') $requete_01 .= ' and '.$ligne_zone_fils->czh_sql_complementaire ;
-
 
81
			$requete_01 .= ' and '.$info_zone_hierarchie->czh_code_alpha.'.bfvl_ce_fiche='.$ligne_zone_fils->czh_code_alpha.'.bfvl_ce_fiche';
75
			if ($carto_config['cc_sql']!='') $requete_01 .=  ' AND ('.$carto_config['cc_sql'].')';
82
			$requete_01 .= ' GROUP BY '.$ligne_zone_fils-> czh_champs_jointure_annuaire;
76
			$requete_01 .= ' GROUP BY '.$ligne_zone_fils->czh_nom_champs_id_pere;
83
			
77
			$resultat_01 = $GLOBALS['ins_db']->query($requete_01) ;
84
			$resultat_01 = $GLOBALS['ins_db']->query($requete_01) ;
78
			if (DB::isError($resultat_01)) {
85
			if (DB::isError($resultat_01)) {
79
			    echo ($resultat_01->getMessage().'<br />'.$resultat_01->getDebugInfo()).'<br />'.$requete_01 ;
86
			    return $resultat_01->getMessage().'<br />'.$resultat_01->getDebugInfo().'<br />'.$requete_01 ;
80
			}    
87
			}    
81
			$tableau_repartition=array();    
88
			$tableau_repartition=array();    
82
			while ($ligne_01 = $resultat_01->fetchRow(DB_FETCHMODE_OBJECT)) {
89
			while ($ligne_01 = $resultat_01->fetchRow(DB_FETCHMODE_OBJECT)) {
83
				$id=$ligne_zone_fils->czh_nom_champs_id_pere;
90
				$id=$ligne_zone_fils-> czh_champs_jointure_annuaire;
84
			    $tableau_repartition[$ligne_01->$id] = $ligne_01->nbr; 		
91
			    $tableau_repartition[$ligne_01->$id] = $ligne_01->nbr; 		
85
			}
92
			}
86
			$info_zone[$i]['nom_table_zone'] =$info_zone_hierarchie->czh_nom_table_info_couleur;
93
			$info_zone[$i]['nom_table_zone'] =$ligne_zone_fils->czh_nom_table_info_couleur;
87
			$info_zone[$i]['nom_chp_id_zone'] =$info_zone_hierarchie->czh_nom_champs_id;
94
			$info_zone[$i]['nom_chp_id_zone'] =$ligne_zone_fils->czh_nom_champs_id;
88
			$info_zone[$i]['nom_chp_nom_zone'] =$info_zone_hierarchie->czh_nom_champs_intitule;
95
			$info_zone[$i]['nom_chp_nom_zone'] =$ligne_zone_fils->czh_nom_champs_intitule;
89
			$info_zone[$i]['nom_chp_rouge'] =$info_zone_hierarchie->czh_nom_champs_couleur_R;
96
			$info_zone[$i]['nom_chp_rouge'] =$ligne_zone_fils->czh_nom_champs_couleur_R;
90
			$info_zone[$i]['nom_chp_vert'] =$info_zone_hierarchie->czh_nom_champs_couleur_V;
97
			$info_zone[$i]['nom_chp_vert'] =$ligne_zone_fils->czh_nom_champs_couleur_V;
91
			$info_zone[$i]['nom_chp_bleu'] =$info_zone_hierarchie->czh_nom_champs_couleur_B;
98
			$info_zone[$i]['nom_chp_bleu'] =$ligne_zone_fils->czh_nom_champs_couleur_B;
-
 
99
			$info_zone[$i]['nom_chp_zone_sup'] =$ligne_zone_fils->czh_nom_champs_id_pere;
-
 
100
			$info_zone[$i]['tableau_valeurs_zone'] = $tableau_repartition;
92
			$info_zone[$i]['nom_chp_zone_sup'] =$info_zone_hierarchie->czh_nom_champs_id_pere;
101
			
93
			$info_zone[$i]['tableau_valeurs_zone'] = $tableau_repartition;
102
			$monde->ajouterFils($ligne_zone_fils->czh_code_alpha, $ligne_zone_fils->czh_identifiant_table_info_couleur, 
94
			if ($i == 1) {				
103
								$ligne_zone_fils->czh_nom, $ligne_zone_fils->czh_fichier_masque,
-
 
104
								$ligne_zone_fils->czh_fichier_image, $info_zone[$i]);
-
 
105
			$monde->fils[$ligne_zone_fils->czh_code_alpha]->definirCouleurs ('255', '255', '255','200', '255', '200','100', '255', '100','0', '100', '0') ;
-
 
106
			$monde->fils[$ligne_zone_fils->czh_code_alpha]->champs_jointure = $ligne_zone_fils->czh_champs_jointure_annuaire;
-
 
107
			$monde->fils[$ligne_zone_fils->czh_code_alpha]->sql_complementaire = $ligne_zone_fils->czh_sql_complementaire;
95
				$monde->_info_table_zg = $info_zone[1];		    
108
			
96
				$monde->definirCouleurs('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ;
109
			if ($i == 1) {
97
				construit_hierarchie($info_zone, $carto_config, $ligne_zone_fils, $monde);						
-
 
98
			} else {
110
				construit_hierarchie($info_zone, $carto_config, $ligne_zone_fils, $monde->fils[$ligne_zone_fils->czh_code_alpha]);						
99
				$monde->_info_table_zg = $info_zone[$i];	
111
			} else {
100
	    		construit_hierarchie($info_zone, $carto_config, $ligne_zone_fils, $monde->fils[$info_zone_hierarchie->czh_code_alpha]);
112
	    		construit_hierarchie($info_zone, $carto_config, $ligne_zone_fils, $monde->fils[$ligne_zone_fils->czh_code_alpha]);
101
			}					
113
			}					
102
		}								
114
		}								
Line 122... Line 134...
122
    }
134
    }
123
    if ($resultat->numRows()>0) {
135
    if ($resultat->numRows()>0) {
124
    	$carto_config = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
136
    	$carto_config = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
Line 125... Line 137...
125
        
137
        
126
	   	//on affiche les infos lorsqu'on regarde une fiche
138
	   	//on affiche les infos lorsqu'on regarde une fiche
127
	   	if ( isset($_GET['voir_fiche']) or isset($_GET['voir_abonnement']) or isset($_GET['voir_actus']) or isset($_GET['voir_ressources']) or isset($_GET['voir_competences']) ) {
139
	   	if ( isset($_GET['voir_abonnement']) or isset($_GET['voir_actus']) or isset($_GET['voir_ressources']) or isset($_GET['voir_competences']) ) {
128
	   		$res = affiche_onglet_info();
140
	   		$res = affiche_onglet_info();
129
	   	} else {            		    	
141
	   	} else {	    	
130
			//requete pour afficher la carte de depart voulue dans la conf. 
142
			//requete pour afficher la carte de depart voulue dans la conf. 
131
			$requete_zone_hierarchie = 'SELECT * FROM carto_zone_hierarchie WHERE czh_id_zone='.$carto_config['cc_ce_premiere_carte'];
143
			$requete_zone_hierarchie = 'SELECT * FROM carto_zone_hierarchie WHERE czh_id_zone='.$carto_config['cc_ce_premiere_carte'];
132
			$resultat_zone_hierarchie = $GLOBALS['ins_db']->query($requete_zone_hierarchie) ;
144
			$resultat_zone_hierarchie = $GLOBALS['ins_db']->query($requete_zone_hierarchie) ;
133
			if (DB::isError($resultat_zone_hierarchie )) {
145
			if (DB::isError($resultat_zone_hierarchie )) {
134
		    	echo ($resultat_zone_hierarchie->getMessage().'<br />'.$resultat_zone_hierarchie->getDebugInfo()) ;
146
		    	echo ($resultat_zone_hierarchie->getMessage().'<br />'.$resultat_zone_hierarchie->getDebugInfo()) ;
135
			}    
147
			}    
Line 136... Line 148...
136
			$ligne_zone_hierarchie  = $resultat_zone_hierarchie ->fetchRow(DB_FETCHMODE_OBJECT);
148
			$ligne_zone_hierarchie  = $resultat_zone_hierarchie ->fetchRow(DB_FETCHMODE_OBJECT);
137
			
149
			
-
 
150
			//initialisation de la variable 2 dimensions, contenant les infos specifiques a chaque echelle de territoire 
-
 
151
	    	$info_zone= array();
-
 
152
	    	//requete pour obtenir toutes les infos (repartition par zones, nom des tables et champs pour les couleurs,.. ) pour la carte à afficher
-
 
153
			$requete_01 = 'SELECT '.$ligne_zone_hierarchie-> czh_champs_jointure_annuaire.',count('.$ligne_zone_hierarchie-> czh_champs_jointure_annuaire.') AS nbr'.
-
 
154
			    		  ' FROM '.$carto_config['cc_table1']; //.', '.$ligne_zone_fils->czh_nom_table_info_couleur;
-
 
155
			if ($carto_config['cc_table2']!='') $requete_01 .=  ', '.$carto_config['cc_table2'].' as '.$ligne_zone_hierarchie->czh_code_alpha.' ';
-
 
156
			if ($carto_config['cc_sql']!='') $requete_01 .=  ' WHERE ('.$carto_config['cc_sql'].')';
-
 
157
			if ($ligne_zone_hierarchie-> czh_sql_complementaire != '') $requete_01 .= ' and '.$ligne_zone_hierarchie->czh_sql_complementaire ;
-
 
158
			$requete_01 .= ' GROUP BY '.$ligne_zone_hierarchie-> czh_champs_jointure_annuaire;
-
 
159
			$resultat_01 = $GLOBALS['ins_db']->query($requete_01) ;
-
 
160
			if (DB::isError($resultat_01)) {
-
 
161
			    echo $resultat_01->getMessage().'<br />'.$resultat_01->getDebugInfo().'<br />'.$requete_01 ;
-
 
162
			}    
-
 
163
			
-
 
164
			$info_zone=array();    
-
 
165
			while ($ligne_01 = $resultat_01->fetchRow(DB_FETCHMODE_OBJECT)) {
-
 
166
				$id=$ligne_zone_hierarchie-> czh_champs_jointure_annuaire;
-
 
167
			    $tableau_repartition[$ligne_01->$id] = $ligne_01->nbr; 		
-
 
168
			}
-
 
169
			$info_zone['nom_table_zone'] =$ligne_zone_hierarchie->czh_nom_table_info_couleur;
-
 
170
			$info_zone['nom_chp_id_zone'] =$ligne_zone_hierarchie->czh_nom_champs_id;
-
 
171
			$info_zone['nom_chp_nom_zone'] =$ligne_zone_hierarchie->czh_nom_champs_intitule;
-
 
172
			$info_zone['nom_chp_rouge'] =$ligne_zone_hierarchie->czh_nom_champs_couleur_R;
-
 
173
			$info_zone['nom_chp_vert'] =$ligne_zone_hierarchie->czh_nom_champs_couleur_V;
-
 
174
			$info_zone['nom_chp_bleu'] =$ligne_zone_hierarchie->czh_nom_champs_couleur_B;
-
 
175
			$info_zone['nom_chp_zone_sup'] =$ligne_zone_hierarchie->czh_nom_champs_id_pere;
138
			//initialisation de la variable 2 dimensions, contenant les infos specifiques a chaque echelle de territoire 
176
			$info_zone['tableau_valeurs_zone'] = $tableau_repartition;
139
	    	$info_zone= array();
177
			
140
	    	$monde = new Carto_Carte($ligne_zone_hierarchie->czh_code_alpha, '', $ligne_zone_hierarchie->czh_nom, 
178
	    	$monde = new Carto_Carte($ligne_zone_hierarchie->czh_code_alpha, '', $ligne_zone_hierarchie->czh_nom, 
-
 
179
	    							 $ligne_zone_hierarchie->czh_fichier_masque, $ligne_zone_hierarchie->czh_fichier_image,
-
 
180
			   		                 INS_CHEMIN_APPLI.'presentations/fonds/', $info_zone);
-
 
181
			$monde->definirCouleurs('255', '255', '255','200', '255', '200','100', '255', '100','0', '100', '0') ;	 
141
	    							 $ligne_zone_hierarchie->czh_fichier_masque, $ligne_zone_hierarchie->czh_fichier_image,
182
			$monde->champs_jointure = $ligne_zone_hierarchie->czh_champs_jointure_annuaire;   
142
			   		                 INS_CHEMIN_APPLI.'presentations/fonds/', '');
183
			$monde->sql_complementaire = $ligne_zone_hierarchie->czh_sql_complementaire;
143
			construit_hierarchie($info_zone, $carto_config, $ligne_zone_hierarchie, $monde);				
-
 
144
			echo '<pre>'.var_dump($monde).'</pre>';
-
 
145
				
-
 
146
				//requete 
-
 
147
	//			$requete_02 = 'SELECT CC_ID_Continent FROM carto_CONTINENT';
-
 
148
	//		
-
 
149
	//		$resultat_02 = $GLOBALS['ins_db']->query($requete_02) ;
-
 
150
	//		if (DB::isError($resultat_02)) {
-
 
151
	//		    die ($resultat_02->getMessage().'<br />'.$resultat_02->getDebugInfo()) ;
-
 
152
	//		}
-
 
153
	//		
-
 
154
	//		while ($ligne_02 = $resultat_02->fetchRow(DB_FETCHMODE_OBJECT)) {
-
 
155
	//		    $requete_03 = 'SELECT CP_ID_Pays, count(cp_id_pays) as nbr '.
-
 
156
	//		                  ' FROM '.$nom_table1.', carto_PAYS';
-
 
157
	//		    if ($nom_table2!=0) $requete_03 .=  ', '.$nom_table2;
-
 
158
	//		    $requete_03 .= ' WHERE '.$nom_champs_pays.'= cp_id_pays';
-
 
159
	//		    if ($requete_sql!='') $requete_03 .=  ' AND ('.$requete_sql.')';
-
 
160
	//		    $requete_03 .= ' AND cp_id_continent = "'.$ligne_02->CC_ID_Continent.'"'.
-
 
161
	//		                   ' GROUP BY cp_id_pays';
-
 
162
	//		    $resultat_03 = $GLOBALS['ins_db']->query($requete_03) ;
-
 
163
	//		    if (DB::isError($resultat_03)) {
-
 
164
	//		        die ($resultat_03->getMessage().'<br />'.$resultat_03->getDebugInfo()) ;
-
 
165
	//		    }
-
 
166
	//		    
-
 
167
	//		    $tableau_ad_pays = array();
-
 
168
	//		    while ($ligne_03 = $resultat_03->fetchRow(DB_FETCHMODE_OBJECT)) {
-
 
169
	//		        $tableau_ad_pays[$ligne_03->CP_ID_Pays] = $ligne_03->nbr; 
-
 
170
	//		    }
-
 
171
	//		    
-
 
172
	//		    $info_pays[$ligne_02->CC_ID_Continent]['nom_table_zone'] = 'carto_PAYS';
-
 
173
	//		    $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_id_zone'] = 'CP_ID_Pays';
-
 
174
	//		    $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_nom_zone'] = 'CP_Intitule_pays';
-
 
175
	//		    $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_rouge'] = 'CP_Couleur_R';
-
 
176
	//		    $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_vert'] = 'CP_Couleur_V';
-
 
177
	//		    $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_bleu'] = 'CP_Couleur_B';
-
 
178
	//		    $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_zone_sup'] = 'CP_ID_Continent';
-
 
179
	//		    $info_pays[$ligne_02->CC_ID_Continent]['tableau_valeurs_zone'] = $tableau_ad_pays;
-
 
180
			}
-
 
181
	//		//============================================================================================================
-
 
182
	//			//if (!isset($_POST['historique_cartes']) && INS_ECHELLE_DEPART!='france') {
-
 
183
	//				$requete_04 = 'SELECT CD_ID_Departement, count(cd_id_departement) as nbr'.
-
 
184
	//		    	    	      ' FROM '.$nom_table1.', carto_DEPARTEMENT'.
-
 
185
	//		        			  ' WHERE '.$nom_champs_pays.' = "fr"'.
-
 
186
	//							  ' AND SUBSTRING('.$nom_champs_cp.' FROM 1 FOR 2) = cd_id_Departement'.
-
 
187
	//		        			  ' GROUP BY cd_id_Departement';
-
 
188
	//		    	$resultat_04 = $GLOBALS['ins_db']->query ($requete_04) ;
-
 
189
	//		    	$tableau_ad_dpt_france = array();
-
 
190
	//		    	while ($ligne_04 = $resultat_04->fetchRow(DB_FETCHMODE_OBJECT)) {
-
 
191
	//		    		$tableau_ad_dpt_france[$ligne_04->CD_ID_Departement] = $ligne_04->nbr;
-
 
192
	//		    	}
-
 
193
	//		    	$info_dpt_france['nom_table_zone'] = 'carto_DEPARTEMENT';
-
 
194
	//		    	$info_dpt_france['nom_chp_id_zone'] = 'CD_ID_Departement';
-
 
195
	//		    	$info_dpt_france['nom_chp_nom_zone'] = 'CD_Intitule_departement';
-
 
196
	//		    	$info_dpt_france['nom_chp_rouge'] = 'CD_Couleur_R';
-
 
197
	//		    	$info_dpt_france['nom_chp_vert'] = 'CD_Couleur_V';
-
 
198
	//		    	$info_dpt_france['nom_chp_bleu'] = 'CD_Couleur_B';
-
 
199
	//		    	$info_dpt_france['nom_chp_zone_sup'] = 'CD_ID_Pays';
-
 
200
	//		    	$info_dpt_france['tableau_valeurs_zone'] = $tableau_ad_dpt_france;
-
 
201
	//		    //}    
-
 
202
	//		
-
 
203
			//============================================================================================================
184
			construit_hierarchie($info_zone, $carto_config, $ligne_zone_hierarchie, $monde);				
204
			
-
 
205
			
-
 
206
			//============================================================================================================
-
 
207
			// On cree tout d'abord l'arborescence
-
 
208
			/*
-
 
209
			$monde = new Carto_Carte('continent', '', 'Monde', 'monde_masque5c.png', 'monde5c.png',
-
 
210
			                          INS_CHEMIN_APPLI.'presentations/fonds/', $info_zone[1]);    
185
		//$GLOBALS['debug'] .= '<pre>'.print_r($monde, true).'</pre>';
211
			$monde->definirCouleurs('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ;*/    
186
 
212
			if (isset($_POST['historique_cartes'])) {
187
			if (isset($_REQUEST['historique_cartes'])) {
213
				$monde->historique_cartes = $_POST['historique_cartes'];
188
				$monde->historique_cartes = $_REQUEST['historique_cartes'];
214
			} else {
189
			} else {
215
				$monde->historique_cartes = INS_ECHELLE_DEPART;
190
				$monde->historique_cartes = INS_ECHELLE_DEPART;
216
			}
191
			}
217
			$monde->image_x = $image_x;
192
			$monde->image_x = $image_x;
218
			$monde->image_y = $image_y;
193
			$monde->image_y = $image_y;
219
			$monde->liste_zone_carte = $liste_zone_carte;
-
 
220
			$monde->url = $GLOBALS['ins_url']->getURL();
-
 
221
			/*
-
 
222
			foreach ($info_zone[2] as $cle => $valeur) {
-
 
223
			    $requete_05 = 
-
 
224
			        "SELECT CDC_Titre_carte, CDC_ID_Carte, CDC_Carte_fond, CDC_Carte_masque, CDC_ID_Zone_geo_carte".
-
 
225
			        " FROM carto_DESCRIPTION_CARTE, carto_ACTION ".
-
 
226
			        " WHERE CA_ID_Zone_geo = '$cle'".
-
 
227
			        " AND CA_Type_zone = 1".
194
			$monde->liste_zone_carte = $liste_zone_carte;
228
			        " AND CA_ID_Carte_destination = CDC_ID_Carte";
-
 
229
			    
-
 
230
			    $resultat_05 = $GLOBALS['ins_db']->query ($requete_05) ;
-
 
231
			    if (DB::isError($resultat_05)) {
-
 
232
			        die ($resultat_05->getMessage().'<br />'.$resultat_05->getDebugInfo()) ;
-
 
233
			    }        
-
 
234
			    $ligne_05 = $resultat_05->fetchRow(DB_FETCHMODE_OBJECT);        
-
 
235
			    $monde->ajouterFils($ligne_05->CDC_ID_Carte, $ligne_05->CDC_ID_Zone_geo_carte, $ligne_05->CDC_Titre_carte, 
-
 
236
			                                    $ligne_05->CDC_Carte_masque, $ligne_05->CDC_Carte_fond, $valeur);
-
 
237
			    $monde->fils[$ligne_05->CDC_ID_Carte]->definirCouleurs ('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ;
-
 
238
			}
-
 
239
			*/
-
 
240
			//$monde->fils['europe']->ajouterFils('france', 'fr', 'France' ,'france_masque.png', 'france.png', $info_zone[3]);
-
 
241
			//$monde->fils['europe']->fils['france']->definirCouleurs ('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ;
195
			$monde->url = $GLOBALS['ins_url']->getURL();
242
			
196
		
243
			// Une fois l'arborescence créée on lance la methode donnerFormulaireImage() pour recuperer la carte
197
			// Une fois l'arborescence créée on lance la methode donnerFormulaireImage() pour recuperer la carte
Line 244... Line 198...
244
			// (dans $img). S'il n'y a pas de carte a afficher donnerFormulaireImage() renvoi false. On peut alors recuperer
198
			// (dans $img). S'il n'y a pas de carte a afficher donnerFormulaireImage() renvoi false. On peut alors recuperer
Line 256... Line 210...
256
			if ($carto_config['cc_titre_carto']!='') $res = '<h1>'.$carto_config['cc_titre_carto'].'</h1>'."\n";
210
			if ($carto_config['cc_titre_carto']!='') $res = '<h1>'.$carto_config['cc_titre_carto'].'</h1>'."\n";
257
			else $res = '<h1>'.INS_CARTOGRAPHIE.'</h1>'."\n";
211
			else $res = '<h1>'.INS_CARTOGRAPHIE.'</h1>'."\n";
258
			$res .= '<form name="formmail" action="'.$monde->url.'" method="post">'."\n";
212
			$res .= '<form name="formmail" action="'.$monde->url.'" method="post">'."\n";
259
			if ((INS_AFFICHE_ECHELLE)and($img)) {
213
			if ((INS_AFFICHE_ECHELLE)and($img)) {
260
			   	$historique_carte = new Carto_HistoriqueCarte ($monde, '&gt;', 'chemin_carto');
214
			   	$historique_carte = new Carto_HistoriqueCarte ($monde, '&gt;', 'chemin_carto');
-
 
215
			   	
261
			   	$res .= $historique_carte->afficherHistoriqueCarte()."\n" ;
216
			   	$res .= $historique_carte->afficherHistoriqueCarte()."\n" ;
262
			}
217
			}
-
 
218
			if (isset($_GET['voir_fiche'])) {
-
 
219
				return carto_liste_fiches($monde, $carto_config);
-
 
220
			}
263
			if (!$img ) {
221
			if (!$img ) {
264
				//include 'bibliotheque/cartographie.fonct.liste_inscrit.php';
222
				//include 'bibliotheque/cartographie.fonct.liste_inscrit.php';
-
 
223
				$res .= '';
-
 
224
				/*var_dump ($monde);
-
 
225
				if (count (explode ('*', $monde->historique)) > 2) {
-
 
226
					$monde = $monde->fils['drome'] ;
-
 
227
				} */
-
 
228
				
265
			    $res .= carto_liste_fiches($monde, $carto_config['cc_table1'], $carto_config['cc_table2'], $carto_config['cc_pays'],$carto_config['cc_cp'], $carto_config['cc_sql']);
229
			    $res .= carto_liste_fiches($monde, $carto_config);
266
			    return $res;
230
			    return $res;
267
			} else {
231
			} else {
268
				$res .= $img;
232
				$res .= $img;
269
			    $res .= '<p class="zone_info">'."\n";
233
			    $res .= '<p class="zone_info">'."\n";
270
				$res .= '<strong>'.INS_CLIQUER_ACCEDER.'</strong><br />'."\n";
234
				$res .= '<strong>'.INS_CLIQUER_ACCEDER.'</strong><br />'."\n";
271
			    $res .= INS_COULEUR."\n".'</p>'."\n";                
235
			    $res .= INS_COULEUR."\n".'</p>'."\n";                
272
			}
236
			}
273
			$res .= '</form>'."\n";
237
			$res .= '</form>'."\n";
-
 
238
			
274
	        return $res;
239
	        return $res;
275
	    
240
	   	}
276
	//----------------------------------------------------------------------------------------------------------------------
241
	//----------------------------------------------------------------------------------------------------------------------
277
	// Cas ou la carto n'a pas encore ete configuree        
242
	// Cas ou la carto n'a pas encore ete configuree        
278
    } else {
243
    } else {
279
    	return '<p class="zone_alert">'.INS_FAUT_CONFIGURER_CARTO.'</p>'."\n";
244
    	return '<p class="zone_alert">'.INS_FAUT_CONFIGURER_CARTO.'</p>'."\n";
280
    }
245
    }