Subversion Repositories Applications.papyrus

Rev

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

Rev 1189 Rev 1292
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.7 2007-01-04 16:53:02 alexandre_tb Exp $
29
// $Id: cartographie.php,v 1.8 2007-04-06 08:35:46 neiluj Exp $
30
// FICHIER : $RCSfile: cartographie.php,v $
30
// FICHIER : $RCSfile: cartographie.php,v $
31
// AUTEUR    : $Author: alexandre_tb $
31
// AUTEUR    : $Author: neiluj $
32
// VERSION : $Revision: 1.7 $
32
// VERSION : $Revision: 1.8 $
33
// DATE        : $Date: 2007-01-04 16:53:02 $
33
// DATE        : $Date: 2007-04-06 08:35:46 $
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/cartographie.fonct.php';
38
include_once INS_CHEMIN_APPLI.'bibliotheque/lib.carto.php';
38
include_once INS_CHEMIN_APPLI.'bibliotheque/lib.carto.php';
-
 
39
include_once INS_CHEMIN_APPLI.'bibliotheque/cartographie.fonct.php';
-
 
40
//include_once 'HTML/QuickForm.php' ;
Line 39... Line 41...
39
 
41
 
40
//================================================================================================
-
 
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-----------
-
 
43
	function afficherContenuNavigation () {
-
 
44
		$res =inscription_onglets();
-
 
45
		return $res ;
-
 
46
	}
-
 
47
}
-
 
48
 
42
//================================================================================================
49
//================================================================================================
-
 
50
function construit_hierarchie(&$info_zone, &$carto_config, $info_zone_hierarchie, &$monde) {
-
 
51
	static $i=0;
-
 
52
	$i++;
-
 
53
	
-
 
54
	    		
-
 
55
	//requete pour trouver les fils de la carte de depart voulue
-
 
56
	$requete_zone_fils = 'SELECT * FROM carto_zone_hierarchie '.
-
 
57
						 'WHERE czh_id_zone_pere='.$info_zone_hierarchie->czh_id_zone;
-
 
58
	$resultat_zone_fils = $GLOBALS['ins_db']->query($requete_zone_fils) ;//$GLOBALS['debug'] .= $requete_zone_fils.'<br /><br />';
-
 
59
	if (DB::isError($resultat_zone_fils )) {
-
 
60
    	echo ($resultat_zone_fils->getMessage().'<br />'.$resultat_zone_fils->getDebugInfo()).'<br />'.$requete_zone_fils ;
-
 
61
	}
-
 
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
-
 
66
	
-
 
67
			
-
 
68
			//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.
-
 
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.', '.
-
 
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.
-
 
77
							'" AND '.$info_zone_hierarchie->czh_sql_complementaire;
-
 
78
 
-
 
79
			if ($carto_config['cc_sql']!='') $requete_01 .=  '  and ('.$carto_config['cc_sql'].')';
-
 
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';
-
 
82
			$requete_01 .= ' GROUP BY '.$ligne_zone_fils-> czh_champs_jointure_annuaire;
-
 
83
			
-
 
84
			$resultat_01 = $GLOBALS['ins_db']->query($requete_01) ;
-
 
85
			if (DB::isError($resultat_01)) {
-
 
86
			    return $resultat_01->getMessage().'<br />'.$resultat_01->getDebugInfo().'<br />'.$requete_01 ;
-
 
87
			}    
-
 
88
			$tableau_repartition=array();    
-
 
89
			while ($ligne_01 = $resultat_01->fetchRow(DB_FETCHMODE_OBJECT)) {
-
 
90
				$id=$ligne_zone_fils-> czh_champs_jointure_annuaire;
-
 
91
			    $tableau_repartition[$ligne_01->$id] = $ligne_01->nbr; 		
-
 
92
			}
-
 
93
			$info_zone[$i]['nom_table_zone'] =$ligne_zone_fils->czh_nom_table_info_couleur;
-
 
94
			$info_zone[$i]['nom_chp_id_zone'] =$ligne_zone_fils->czh_nom_champs_id;
-
 
95
			$info_zone[$i]['nom_chp_nom_zone'] =$ligne_zone_fils->czh_nom_champs_intitule;
-
 
96
			$info_zone[$i]['nom_chp_rouge'] =$ligne_zone_fils->czh_nom_champs_couleur_R;
-
 
97
			$info_zone[$i]['nom_chp_vert'] =$ligne_zone_fils->czh_nom_champs_couleur_V;
-
 
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;
-
 
101
			
-
 
102
			$monde->ajouterFils($ligne_zone_fils->czh_code_alpha, $ligne_zone_fils->czh_identifiant_table_info_couleur, 
-
 
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;
-
 
108
			
-
 
109
			if ($i == 1) {
-
 
110
				construit_hierarchie($info_zone, $carto_config, $ligne_zone_fils, $monde->fils[$ligne_zone_fils->czh_code_alpha]);						
-
 
111
			} else {
-
 
112
	    		construit_hierarchie($info_zone, $carto_config, $ligne_zone_fils, $monde->fils[$ligne_zone_fils->czh_code_alpha]);
-
 
113
			}					
-
 
114
		}								
-
 
115
	}
-
 
Line 116... Line 43...
116
}
43
//================================================================================================
-
 
44
 
117
 
45
function afficherContenuCorps() 
118
function afficherContenuCorps() {
46
{
119
    global $image_x;
47
    global $image_x;
120
    global $image_y;
48
    global $image_y;
121
    global $historique_cartes;
49
    global $historique_cartes;
122
    global $mailer;
50
    global $mailer;
123
    global $fin;
51
    global $fin;
124
    global $sendpwd;//utilisé dans liste_inscrit.php
52
    global $sendpwd;//utilisé dans liste_inscrit.php
Line 125... Line 53...
125
    global $select;//utilisé dans liste_inscrit.php
53
    global $select;//utilisé dans liste_inscrit.php
126
    global $liste_zone_carte;
54
    global $liste_zone_carte;
127
    
55
    
128
	//=================================================================================================
56
//=================================================================================================
129
	//Gestion de la configuration    
57
//Gestion de la configuration    
130
    $requete = 'SELECT * FROM carto_config WHERE cc_menu_id='.$GLOBALS['_GEN_commun']['info_menu']->gm_id_menu;
58
    $requete = 'SELECT * FROM carto_config WHERE cc_menu_id='.$_GET['menu'];
131
    $resultat = $GLOBALS['ins_db']->query($requete) ;
59
    $resultat = $GLOBALS['ins_db']->query($requete) ;
132
    if (DB::isError($resultat)) {
60
    if (DB::isError($resultat)) {
133
       	die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
61
       	die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
-
 
62
    }
-
 
63
    if ($resultat->numRows()>0) {
-
 
64
       	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
-
 
65
        	//valeurs par defaut enregistrees dans la table
-
 
66
        	$titre=$ligne['cc_titre_carto'];
-
 
67
        	$nom_table1=$ligne['cc_table1'];
-
 
68
        	$nom_table2=$ligne['cc_table2'];
-
 
69
        	$nom_champs_pays=$ligne['cc_pays'];
-
 
70
        	$nom_champs_cp=$ligne['cc_cp'];
-
 
71
        	$requete_sql=$ligne['cc_sql'];
-
 
72
        }
-
 
73
            
-
 
74
//=================================================================================================
-
 
75
    $requete_01 = 'SELECT CP_ID_Continent,count(cp_id_continent) AS nbr'.
-
 
76
        		  ' FROM '.$nom_table1.', carto_PAYS';
-
 
77
    if ($nom_table2!=0) $requete_01 .=  ', '.$nom_table2;     
-
 
78
    $requete_01 .= ' WHERE '.$nom_champs_pays.' = cp_id_pays';
-
 
79
    if ($requete_sql!='') $requete_01 .=  ' AND ('.$requete_sql.')';
-
 
80
    $requete_01 .= ' GROUP BY cp_id_continent';
-
 
81
    $resultat_01 = $GLOBALS['ins_db']->query($requete_01) ;
-
 
82
    if (DB::isError($resultat_01)) {
-
 
83
        die ($resultat_01->getMessage().'<br />'.$resultat_01->getDebugInfo()) ;
-
 
84
    }    
-
 
85
    $tableau_ad_continent=array();    
-
 
86
    while ($ligne_01 = $resultat_01->fetchRow(DB_FETCHMODE_OBJECT)) {
-
 
87
        $tableau_ad_continent[$ligne_01->CP_ID_Continent] = $ligne_01->nbr; 
-
 
88
    
-
 
89
    }
-
 
90
    $info_continent['nom_table_zone'] = 'carto_CONTINENT';
-
 
91
    $info_continent['nom_chp_id_zone'] = 'CC_ID_Continent';
-
 
92
    $info_continent['nom_chp_nom_zone'] = 'CC_Intitule_continent';
-
 
93
    $info_continent['nom_chp_rouge'] = 'CC_Couleur_R';
-
 
94
    $info_continent['nom_chp_vert'] = 'CC_Couleur_V';
-
 
95
    $info_continent['nom_chp_bleu'] = 'CC_Couleur_B';
-
 
96
    $info_continent['nom_chp_zone_sup'] = '';
-
 
97
    $info_continent['tableau_valeurs_zone'] = $tableau_ad_continent;
-
 
98
    
-
 
99
    //============================================================================================================
-
 
100
    
-
 
101
    $requete_02 = 'SELECT CC_ID_Continent FROM carto_CONTINENT';
-
 
102
    
-
 
103
    $resultat_02 = $GLOBALS['ins_db']->query($requete_02) ;
-
 
104
    if (DB::isError($resultat_02)) {
-
 
105
        die ($resultat_02->getMessage().'<br />'.$resultat_02->getDebugInfo()) ;
-
 
106
    }
-
 
107
    
-
 
108
    while ($ligne_02 = $resultat_02->fetchRow(DB_FETCHMODE_OBJECT)) {
-
 
109
        $requete_03 = 'SELECT CP_ID_Pays, count(cp_id_pays) as nbr '.
-
 
110
                      ' FROM '.$nom_table1.', carto_PAYS';
-
 
111
        if ($nom_table2!=0) $requete_03 .=  ', '.$nom_table2;
-
 
112
        $requete_03 .= ' WHERE '.$nom_champs_pays.'= cp_id_pays';
-
 
113
        if ($requete_sql!='') $requete_03 .=  ' AND ('.$requete_sql.')';
-
 
114
        $requete_03 .= ' AND cp_id_continent = "'.$ligne_02->CC_ID_Continent.'"'.
-
 
115
                       ' GROUP BY cp_id_pays';
-
 
116
        $resultat_03 = $GLOBALS['ins_db']->query($requete_03) ;
-
 
117
        if (DB::isError($resultat_03)) {
-
 
118
            die ($resultat_03->getMessage().'<br />'.$resultat_03->getDebugInfo()) ;
-
 
119
        }
-
 
120
        
-
 
121
        $tableau_ad_pays = array();
Line 134... Line 122...
134
    }
122
        while ($ligne_03 = $resultat_03->fetchRow(DB_FETCHMODE_OBJECT)) {
135
    if ($resultat->numRows()>0) {
123
            $tableau_ad_pays[$ligne_03->CP_ID_Pays] = $ligne_03->nbr; 
136
    	$carto_config = $resultat->fetchRow(DB_FETCHMODE_ASSOC);
124
        }
137
        
-
 
138
	   	//on affiche les infos lorsqu'on regarde une fiche
125
        
139
	   	if ( isset($_GET['voir_abonnement']) or isset($_GET['voir_actus']) or isset($_GET['voir_ressources']) or isset($_GET['voir_competences']) ) {
126
        $info_pays[$ligne_02->CC_ID_Continent]['nom_table_zone'] = 'carto_PAYS';
140
	   		$res = affiche_onglet_info();
127
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_id_zone'] = 'CP_ID_Pays';
141
	   	} else {	    	
128
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_nom_zone'] = 'CP_Intitule_pays';
142
			//requete pour afficher la carte de depart voulue dans la conf. 
129
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_rouge'] = 'CP_Couleur_R';
143
			$requete_zone_hierarchie = 'SELECT * FROM carto_zone_hierarchie WHERE czh_id_zone='.$carto_config['cc_ce_premiere_carte'];
130
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_vert'] = 'CP_Couleur_V';
144
			$resultat_zone_hierarchie = $GLOBALS['ins_db']->query($requete_zone_hierarchie) ;
-
 
145
			if (DB::isError($resultat_zone_hierarchie )) {
-
 
146
		    	echo ($resultat_zone_hierarchie->getMessage().'<br />'.$resultat_zone_hierarchie->getDebugInfo()) ;
131
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_bleu'] = 'CP_Couleur_B';
147
			}    
-
 
148
			$ligne_zone_hierarchie  = $resultat_zone_hierarchie ->fetchRow(DB_FETCHMODE_OBJECT);
132
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_zone_sup'] = 'CP_ID_Continent';
149
			
133
        $info_pays[$ligne_02->CC_ID_Continent]['tableau_valeurs_zone'] = $tableau_ad_pays;
150
			//initialisation de la variable 2 dimensions, contenant les infos specifiques a chaque echelle de territoire 
134
    }
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
135
    //============================================================================================================
153
			$requete_01 = 'SELECT '.$ligne_zone_hierarchie-> czh_champs_jointure_annuaire.',count('.$ligne_zone_hierarchie-> czh_champs_jointure_annuaire.') AS nbr'.
136
		//if (!isset($_POST['historique_cartes']) && INS_ECHELLE_DEPART!='france') {
154
			    		  ' FROM '.$carto_config['cc_table1']; //.', '.$ligne_zone_fils->czh_nom_table_info_couleur;
137
			$requete_04 = 'SELECT CD_ID_Departement, count(cd_id_departement) as nbr'.
155
			if ($carto_config['cc_table2']!='') $requete_01 .=  ', '.$carto_config['cc_table2'].' as '.$ligne_zone_hierarchie->czh_code_alpha.' ';
138
	    	    	      ' FROM '.$nom_table1.', carto_DEPARTEMENT'.
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)) {
139
	        			  ' WHERE '.$nom_champs_pays.' = "fr"'.
161
			    echo $resultat_01->getMessage().'<br />'.$resultat_01->getDebugInfo().'<br />'.$requete_01 ;
140
						  ' AND SUBSTRING('.$nom_champs_cp.' FROM 1 FOR 2) = cd_id_Departement'.
162
			}    
-
 
163
			
141
	        			  ' GROUP BY cd_id_Departement';
164
			$info_zone=array();    
142
	    	$resultat_04 = $GLOBALS['ins_db']->query ($requete_04) ;
165
			while ($ligne_01 = $resultat_01->fetchRow(DB_FETCHMODE_OBJECT)) {
143
	    	$tableau_ad_dpt_france = array();
166
				$id=$ligne_zone_hierarchie-> czh_champs_jointure_annuaire;
144
	    	while ($ligne_04 = $resultat_04->fetchRow(DB_FETCHMODE_OBJECT)) {
167
			    $tableau_repartition[$ligne_01->$id] = $ligne_01->nbr; 		
145
	    		$tableau_ad_dpt_france[$ligne_04->CD_ID_Departement] = $ligne_04->nbr;
168
			}
146
	    	}
169
			$info_zone['nom_table_zone'] =$ligne_zone_hierarchie->czh_nom_table_info_couleur;
147
	    	$info_dpt_france['nom_table_zone'] = 'carto_DEPARTEMENT';
170
			$info_zone['nom_chp_id_zone'] =$ligne_zone_hierarchie->czh_nom_champs_id;
148
	    	$info_dpt_france['nom_chp_id_zone'] = 'CD_ID_Departement';
171
			$info_zone['nom_chp_nom_zone'] =$ligne_zone_hierarchie->czh_nom_champs_intitule;
149
	    	$info_dpt_france['nom_chp_nom_zone'] = 'CD_Intitule_departement';
172
			$info_zone['nom_chp_rouge'] =$ligne_zone_hierarchie->czh_nom_champs_couleur_R;
150
	    	$info_dpt_france['nom_chp_rouge'] = 'CD_Couleur_R';
-
 
151
	    	$info_dpt_france['nom_chp_vert'] = 'CD_Couleur_V';
173
			$info_zone['nom_chp_vert'] =$ligne_zone_hierarchie->czh_nom_champs_couleur_V;
152
	    	$info_dpt_france['nom_chp_bleu'] = 'CD_Couleur_B';
174
			$info_zone['nom_chp_bleu'] =$ligne_zone_hierarchie->czh_nom_champs_couleur_B;
153
	    	$info_dpt_france['nom_chp_zone_sup'] = 'CD_ID_Pays';
175
			$info_zone['nom_chp_zone_sup'] =$ligne_zone_hierarchie->czh_nom_champs_id_pere;
-
 
176
			$info_zone['tableau_valeurs_zone'] = $tableau_repartition;
-
 
177
			
-
 
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') ;	 
-
 
Line -... Line 154...
-
 
154
	    	$info_dpt_france['tableau_valeurs_zone'] = $tableau_ad_dpt_france;
-
 
155
	    //}    
-
 
156
    
-
 
157
    //============================================================================================================
-
 
158
 
-
 
159
    
182
			$monde->champs_jointure = $ligne_zone_hierarchie->czh_champs_jointure_annuaire;   
160
    //============================================================================================================
183
			$monde->sql_complementaire = $ligne_zone_hierarchie->czh_sql_complementaire;
161
    // On cree tout d'abord l'arborescence
184
			construit_hierarchie($info_zone, $carto_config, $ligne_zone_hierarchie, $monde);				
162
    
185
		//$GLOBALS['debug'] .= '<pre>'.print_r($monde, true).'</pre>';
163
    $monde = new Carto_Carte('continent', '', 'Monde', 'monde_masque5c.png', 'monde5c.png', INS_CHEMIN_APPLI.'presentations/fonds/', $info_continent);    
186
 
164
    $monde->definirCouleurs('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ;    
187
			if (isset($_REQUEST['historique_cartes'])) {
165
    if (isset($_POST['historique_cartes'])) {
188
				$monde->historique_cartes = $_REQUEST['historique_cartes'];
166
    	$monde->historique_cartes = $_POST['historique_cartes'];
189
			} else {
167
    } else {
190
				$monde->historique_cartes = INS_ECHELLE_DEPART;
168
    	$monde->historique_cartes = INS_ECHELLE_DEPART;
-
 
169
    }
-
 
170
    $monde->image_x = $image_x;
-
 
171
    $monde->image_y = $image_y;
-
 
172
    $monde->liste_zone_carte = $liste_zone_carte;
-
 
173
    $monde->url = $GLOBALS['ins_url']->getURL();
-
 
174
    
-
 
175
    foreach ($info_pays as $cle => $valeur) {
-
 
176
        $requete_05 = 
-
 
177
            "SELECT CDC_Titre_carte, CDC_ID_Carte, CDC_Carte_fond, CDC_Carte_masque, CDC_ID_Zone_geo_carte".
-
 
178
            " FROM carto_DESCRIPTION_CARTE, carto_ACTION ".
-
 
179
            " WHERE CA_ID_Zone_geo = '$cle'".
-
 
180
            " AND CA_Type_zone = 1".
-
 
181
            " AND CA_ID_Carte_destination = CDC_ID_Carte";
-
 
182
        
-
 
183
        $resultat_05 = $GLOBALS['ins_db']->query ($requete_05) ;
-
 
184
        if (DB::isError($resultat_05)) {
-
 
185
            die ($resultat_05->getMessage().'<br />'.$resultat_05->getDebugInfo()) ;
-
 
186
        }        
-
 
187
        $ligne_05 = $resultat_05->fetchRow(DB_FETCHMODE_OBJECT);        
-
 
188
        $monde->ajouterFils($ligne_05->CDC_ID_Carte, $ligne_05->CDC_ID_Zone_geo_carte, $ligne_05->CDC_Titre_carte, 
-
 
189
                                        $ligne_05->CDC_Carte_masque, $ligne_05->CDC_Carte_fond, $valeur);
191
			}
190
        $monde->fils[$ligne_05->CDC_ID_Carte]->definirCouleurs ('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ;
192
			$monde->image_x = $image_x;
191
    }
193
			$monde->image_y = $image_y;
192
    
194
			$monde->liste_zone_carte = $liste_zone_carte;
193
    $monde->fils['europe']->ajouterFils('france', 'fr', 'France' ,'france_masque.png', 'france.png', $info_dpt_france);
195
			$monde->url = $GLOBALS['ins_url']->getURL();
194
    $monde->fils['europe']->fils['france']->definirCouleurs ('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ;
196
		
195
    
197
			// Une fois l'arborescence créée on lance la methode donnerFormulaireImage() pour recuperer la carte
196
    // Une fois l'arborescence créée on lance la methode donnerFormulaireImage() pour recuperer la carte
198
			// (dans $img). S'il n'y a pas de carte a afficher donnerFormulaireImage() renvoi false. On peut alors recuperer
197
    // (dans $img). S'il n'y a pas de carte a afficher donnerFormulaireImage() renvoi false. On peut alors recuperer
199
			// le niveau ou on en est grace a $monde->historique (du type continent*namerique*ca).
198
    // le niveau ou on en est grace a $monde->historique (du type continent*namerique*ca).
200
			    
199
        
201
			$img = false;
200
    $img = false;
202
			if ($mailer == 1 || $fin == true) {
201
    if ($mailer == 1 || $fin == true) {
203
			    $objet_carte = $_SESSION['carte'] ;
202
        $objet_carte = $_SESSION['carte'] ;
204
			    $monde = unserialize($objet_carte);}
203
        $monde = unserialize($objet_carte);}
205
			else {
204
    else {
206
			    $img = $monde->donnerFormulaireImage();
205
        $img = $monde->donnerFormulaireImage();
207
			}
206
    }
208
			       
207
           
209
			// Quoi qu'il arrive, on ouvre la balise formulaire
208
    // Quoi qu'il arrive, on ouvre la balise formulaire
210
			if ($carto_config['cc_titre_carto']!='') $res = '<h1>'.$carto_config['cc_titre_carto'].'</h1>'."\n";
-
 
211
			else $res = '<h1>'.INS_CARTOGRAPHIE.'</h1>'."\n";
209
    if ($titre!='') $res = '<h1>'.$titre.'</h1>'."\n";
212
			$res .= '<form name="formmail" action="'.$monde->url.'" method="post">'."\n";
-
 
213
			if ((INS_AFFICHE_ECHELLE)and($img)) {
-
 
214
			   	$historique_carte = new Carto_HistoriqueCarte ($monde, '&gt;', 'chemin_carto');
-
 
215
			   	
210
    else $res = '<h1>'.INS_CARTOGRAPHIE.'</h1>'."\n";
216
			   	$res .= $historique_carte->afficherHistoriqueCarte()."\n" ;
211
    $res .= '<form action="'.$monde->url.'" method="post">'."\n";
217
			}
212
    if ((INS_AFFICHE_ECHELLE)and($img)) {
218
			if (isset($_GET['voir_fiche'])) {
-
 
219
				return carto_liste_fiches($monde, $carto_config);
-
 
220
			}
-
 
221
			if (!$img ) {
-
 
222
				//include 'bibliotheque/cartographie.fonct.liste_inscrit.php';
-
 
223
				$res .= '';
-
 
224
				/*var_dump ($monde);
213
       	$historique_carte = new Carto_HistoriqueCarte ($monde, '&gt;', 'chemin_carto');
225
				if (count (explode ('*', $monde->historique)) > 2) {
214
       	$res .= $historique_carte->afficherHistoriqueCarte()."\n" ;
226
					$monde = $monde->fils['drome'] ;
215
    }
227
				} */
216
    if (!$img ) {
228
				
217
    	//include 'bibliotheque/cartographie.fonct.liste_inscrit.php';
229
			    $res .= carto_liste_fiches($monde, $carto_config);
218
        $res .= carto_liste_fiches($monde, $nom_table1, $nom_table2, $nom_champs_pays, $nom_champs_cp, $requete_sql);
230
			    return $res;
219
        return $res;
231
			} else {
220
    } else {
232
				$res .= $img;
221
    	$res .= $img;
233
			    $res .= '<p class="zone_info">'."\n";
-
 
234
				$res .= '<strong>'.INS_CLIQUER_ACCEDER.'</strong><br />'."\n";
222
        $res .= '<p class="zone_info">'."\n";
235
			    $res .= INS_COULEUR."\n".'</p>'."\n";                
223
		$res .= '<strong>'.INS_CLIQUER_ACCEDER.'</strong><br />'."\n";
236
			}
224
        $res .= INS_COULEUR."\n".'</p>'."\n";                
237
			$res .= '</form>'."\n";
225
    }
238
			
226
    $res .= '</form>'."\n";
239
	        return $res;
227
    return $res;
240
	   	}
228
    
241
	//----------------------------------------------------------------------------------------------------------------------
229
//----------------------------------------------------------------------------------------------------------------------
Line 242... Line 230...
242
	// Cas ou la carto n'a pas encore ete configuree        
230
// Cas ou la carto n'a pas encore ete configuree        
243
    } else {
231
    } else {
244
    	return '<p class="zone_alert">'.INS_FAUT_CONFIGURER_CARTO.'</p>'."\n";
232
    	return '<p class="zone_alert">'.INS_FAUT_CONFIGURER_CARTO.'</p>'."\n";
245
    }
-
 
246
}
-
 
247
 
-
 
248
 
-
 
249
//-- Fin du code source    ------------------------------------------------------------
-
 
250
/*
-
 
251
* $Log: not supported by cvs2svn $
-
 
252
* Revision 1.5  2006/04/19 13:49:04  alexandre_tb
-
 
253
* correction de bug sur l'utilisation de l'id_menu de papyrus
-
 
254
*
233
    }
255
* Revision 1.4  2006/04/10 14:01:36  florian
234
}
256
* uniformisation de l'appli bottin: plus qu'un fichier de fonctions
235
 
257
*
236
 
258
* Revision 1.3  2006/04/04 12:23:05  florian
237
//-- Fin du code source    ------------------------------------------------------------