Subversion Repositories Applications.papyrus

Rev

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

Rev 820 Rev 1081
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.5 2006-04-19 13:49:04 alexandre_tb Exp $
29
// $Id: cartographie.php,v 1.6 2006-12-01 13:23:17 florian Exp $
30
// FICHIER : $RCSfile: cartographie.php,v $
30
// FICHIER : $RCSfile: cartographie.php,v $
31
// AUTEUR    : $Author: alexandre_tb $
31
// AUTEUR    : $Author: florian $
32
// VERSION : $Revision: 1.5 $
32
// VERSION : $Revision: 1.6 $
33
// DATE        : $Date: 2006-04-19 13:49:04 $
33
// DATE        : $Date: 2006-12-01 13:23:17 $
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 45... Line 45...
45
		return $res ;
45
		return $res ;
46
	}
46
	}
47
}
47
}
Line 48... Line 48...
48
 
48
 
-
 
49
//================================================================================================
-
 
50
function construit_hierarchie(&$info_zone, &$carto_config, $info_zone_hierarchie, &$monde) {
-
 
51
	static $i=0;
-
 
52
	$i++;
-
 
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') ;
-
 
59
			    		
-
 
60
	//requete pour trouver les fils de la carte de depart voulue
-
 
61
	$requete_zone_fils = 'SELECT * FROM carto_zone_hierarchie '.
-
 
62
						 'WHERE czh_id_zone_pere='.$info_zone_hierarchie->czh_id_zone;/*echo $requete_zone_fils;*/
-
 
63
	$resultat_zone_fils = $GLOBALS['ins_db']->query($requete_zone_fils) ;
-
 
64
	if (DB::isError($resultat_zone_fils )) {
-
 
65
    	echo ($resultat_zone_fils->getMessage().'<br />'.$resultat_zone_fils->getDebugInfo()).'<br />'.$requete_zone_fils ;
-
 
66
	}
-
 
67
	
-
 
68
	if ($resultat_zone_fils->numRows()!=0) {
-
 
69
		while ($ligne_zone_fils  = $resultat_zone_fils ->fetchRow(DB_FETCHMODE_OBJECT)) {
-
 
70
			//requete pour obtenir toutes les infos (repartition par zones, nom des tables et champs pour les couleurs,.. ) pour la carte à afficher
-
 
71
			$requete_01 = 'SELECT '.$ligne_zone_fils->czh_nom_champs_id_pere.',count('.$ligne_zone_fils->czh_nom_champs_id_pere.') AS nbr'.
-
 
72
			    		  ' FROM '.$carto_config['cc_table1'].', '.$ligne_zone_fils->czh_nom_table_info_couleur;
-
 
73
			if ($carto_config['cc_table2']!=0) $requete_01 .=  ', '.$carto_config['cc_table2'];     
-
 
74
			$requete_01 .= ' WHERE '.$ligne_zone_fils->czh_champs_jointure_annuaire.' = '.$ligne_zone_fils->czh_nom_champs_id;
-
 
75
			if ($carto_config['cc_sql']!='') $requete_01 .=  ' AND ('.$carto_config['cc_sql'].')';
-
 
76
			$requete_01 .= ' GROUP BY '.$ligne_zone_fils->czh_nom_champs_id_pere;
-
 
77
			$resultat_01 = $GLOBALS['ins_db']->query($requete_01) ;
-
 
78
			if (DB::isError($resultat_01)) {
-
 
79
			    echo ($resultat_01->getMessage().'<br />'.$resultat_01->getDebugInfo()).'<br />'.$requete_01 ;
-
 
80
			}    
-
 
81
			$tableau_repartition=array();    
-
 
82
			while ($ligne_01 = $resultat_01->fetchRow(DB_FETCHMODE_OBJECT)) {
-
 
83
				$id=$ligne_zone_fils->czh_nom_champs_id_pere;
-
 
84
			    $tableau_repartition[$ligne_01->$id] = $ligne_01->nbr; 		
-
 
85
			}
-
 
86
			$info_zone[$i]['nom_table_zone'] =$info_zone_hierarchie->czh_nom_table_info_couleur;
-
 
87
			$info_zone[$i]['nom_chp_id_zone'] =$info_zone_hierarchie->czh_nom_champs_id;
-
 
88
			$info_zone[$i]['nom_chp_nom_zone'] =$info_zone_hierarchie->czh_nom_champs_intitule;
-
 
89
			$info_zone[$i]['nom_chp_rouge'] =$info_zone_hierarchie->czh_nom_champs_couleur_R;
-
 
90
			$info_zone[$i]['nom_chp_vert'] =$info_zone_hierarchie->czh_nom_champs_couleur_V;
-
 
91
			$info_zone[$i]['nom_chp_bleu'] =$info_zone_hierarchie->czh_nom_champs_couleur_B;
-
 
92
			$info_zone[$i]['nom_chp_zone_sup'] =$info_zone_hierarchie->czh_nom_champs_id_pere;
-
 
93
			$info_zone[$i]['tableau_valeurs_zone'] = $tableau_repartition;
-
 
94
			if ($i == 1) {				
-
 
95
				$monde->_info_table_zg = $info_zone[1];		    
-
 
96
				$monde->definirCouleurs('255', '255', '255','255', '250', '130','255', '204', '0','255', '153', '0') ;
-
 
97
				construit_hierarchie($info_zone, $carto_config, $ligne_zone_fils, $monde);						
-
 
98
			} else {
-
 
99
				$monde->_info_table_zg = $info_zone[$i];	
-
 
100
	    		construit_hierarchie($info_zone, $carto_config, $ligne_zone_fils, $monde->fils[$info_zone_hierarchie->czh_code_alpha]);
-
 
101
			}					
-
 
102
		}								
-
 
103
	}
Line 49... Line 104...
49
//================================================================================================
104
}
50
 
-
 
51
function afficherContenuCorps() 
105
 
52
{
106
function afficherContenuCorps() {
53
    global $image_x;
107
    global $image_x;
54
    global $image_y;
108
    global $image_y;
55
    global $historique_cartes;
109
    global $historique_cartes;
Line 65... Line 119...
65
    $resultat = $GLOBALS['ins_db']->query($requete) ;
119
    $resultat = $GLOBALS['ins_db']->query($requete) ;
66
    if (DB::isError($resultat)) {
120
    if (DB::isError($resultat)) {
67
       	die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
121
       	die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
68
    }
122
    }
69
    if ($resultat->numRows()>0) {
123
    if ($resultat->numRows()>0) {
241
    } else {
278
    } else {
242
    	return '<p class="zone_alert">'.INS_FAUT_CONFIGURER_CARTO.'</p>'."\n";
279
    	return '<p class="zone_alert">'.INS_FAUT_CONFIGURER_CARTO.'</p>'."\n";
243
    }
280
    }
244
}
281
}
Line 245... Line 282...
245
 
282
 
246
 
283
 
247
//-- Fin du code source    ------------------------------------------------------------
284
//-- Fin du code source    ------------------------------------------------------------
-
 
285
/*
-
 
286
* $Log: not supported by cvs2svn $
-
 
287
* Revision 1.5  2006/04/19 13:49:04  alexandre_tb
248
/*
288
* correction de bug sur l'utilisation de l'id_menu de papyrus
249
* $Log: not supported by cvs2svn $
289
*
250
* Revision 1.4  2006/04/10 14:01:36  florian
290
* Revision 1.4  2006/04/10 14:01:36  florian
251
* uniformisation de l'appli bottin: plus qu'un fichier de fonctions
291
* uniformisation de l'appli bottin: plus qu'un fichier de fonctions
252
*
292
*