New file |
0,0 → 1,270 |
<?php |
|
//vim: set expandtab tabstop=4 shiftwidth=4: |
// +-----------------------------------------------------------------------------------------------+ |
// | PHP version 4.0 | |
// +-----------------------------------------------------------------------------------------------+ |
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | |
// +-----------------------------------------------------------------------------------------------+ |
// | This source file is subject to version 2.0 of the PHP license, | |
// | that is bundled with this package in the file LICENSE, and is | |
// | available at through the world-wide-web at | |
// | http://www.php.net/license/2_02.txt. | |
// | If you did not receive a copy of the PHP license and are unable to | |
// | obtain it through the world-wide-web, please send a note to | |
// | license@php.net so we can mail you a copy immediately. | |
// +-----------------------------------------------------------------------------------------------+ |
/** |
* |
*Page permettant l'affichage des informations de cartographie des inscrits |
* |
*La page contient les fonctions propres à GSite permettant d'afficher en sortie les styles |
*(inclusion du fichier : lib.putsyle.php), le corps de la page (fonction : putFrame) et son pied de page (fonction : putFooter). |
* |
*@package carto_ad |
//Auteur original : |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2003 |
*@version 01 avril 2002 |
// +-----------------------------------------------------------------------------------------------+ |
// |
// $Id: carto_ad.php,v 1.9 2003/05/06 12:49:27 alex Exp $ |
// FICHIER : $RCSfile: carto_ad.php,v $ |
// AUTEUR : $Author: alex $ |
// VERSION : $Revision: 1.9 $ |
// DATE : $Date: 2003/05/06 12:49:27 $ |
*/ |
|
|
include_once 'modules/client/carto_ad/carto-common_ad.php'; |
include_once 'php/context.php'; |
include_once 'php/auth.php'; |
global $var_style; |
$var_style='alex'; |
include_once 'php/lib/pack.lib.carto.php'; |
|
//================================================================================================ |
//================================================================================================ |
|
function putFrame () |
{ |
|
|
global $GS_GLOBAL; |
global $AUTH_GLOBAL; |
global $image_x; |
global $image_y; |
global $historique_cartes; |
global $mailer; |
global $fin; |
global $sendpwd;//utilisé dans tb_ad.php |
global $titre, $corps;//utilisé dans tb_ad.php |
global $select;//utilisé dans tb_ad.php |
global $liste_zone_carte; |
|
//=========================================================================================================== |
$requete_01 = |
"SELECT *,count(cp_id_continent) as nbr". |
" FROM annuaire_tela, carto_PAYS". |
" WHERE u_country = cp_id_pays". |
" AND u_show = 3". |
" GROUP BY cp_id_continent"; |
|
$resultat_01 = mysql_query ($requete_01) or die(' |
<H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'. |
'<b>Requete : </b>'.$requete_01. |
'<br/><br/><b>Erreur : </b>'.mysql_error()); |
|
$tableau_ad_continent=array(); |
|
while ($ligne_01 = mysql_fetch_object($resultat_01)) { |
$tableau_ad_continent[$ligne_01->CP_ID_Continent] = $ligne_01->nbr; |
|
} |
$info_continent['nom_table_zone'] = 'carto_CONTINENT'; |
$info_continent['nom_chp_id_zone'] = 'CC_ID_Continent'; |
$info_continent['nom_chp_nom_zone'] = 'CC_Intitule_continent'; |
$info_continent['nom_chp_rouge'] = 'CC_Couleur_R'; |
$info_continent['nom_chp_vert'] = 'CC_Couleur_V'; |
$info_continent['nom_chp_bleu'] = 'CC_Couleur_B'; |
$info_continent['nom_chp_zone_sup'] = ''; |
$info_continent['tableau_valeurs_zone'] = $tableau_ad_continent; |
|
//============================================================================================================ |
|
$requete_02 = |
'SELECT CC_ID_Continent'. |
' FROM carto_CONTINENT'; |
|
$resultat_02 = mysql_query ($requete_02) or die(' |
<H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'. |
'<b>Requete : </b>'.$requete_02. |
'<br/><br/><b>Erreur : </b>'.mysql_error()); |
|
while ($ligne_02 = mysql_fetch_object($resultat_02)) { |
$requete_03 = |
'SELECT *, count(cp_id_pays) as nbr '. |
' FROM annuaire_tela, carto_PAYS'. |
' WHERE u_country = cp_id_pays'. |
' AND cp_id_continent = "'.$ligne_02->CC_ID_Continent.'"'. |
' AND u_show = 3'. |
' GROUP BY cp_id_pays'; |
|
$resultat_03 = mysql_query ($requete_03) or die(' |
<H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'. |
'<b>Requete : </b>'.$requete_01. |
'<br/><br/><b>Erreur : </b>'.mysql_error()); |
|
$tableau_ad_pays = array(); |
|
while ($ligne_03 = mysql_fetch_object($resultat_03)) { |
$tableau_ad_pays[$ligne_03->CP_ID_Pays] = $ligne_03->nbr; |
} |
|
$info_pays[$ligne_02->CC_ID_Continent]['nom_table_zone'] = 'carto_PAYS'; |
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_id_zone'] = 'CP_ID_Pays'; |
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_nom_zone'] = 'CP_Intitule_pays'; |
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_rouge'] = 'CP_Couleur_R'; |
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_vert'] = 'CP_Couleur_V'; |
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_bleu'] = 'CP_Couleur_B'; |
$info_pays[$ligne_02->CC_ID_Continent]['nom_chp_zone_sup'] = 'CP_ID_Continent'; |
$info_pays[$ligne_02->CC_ID_Continent]['tableau_valeurs_zone'] = $tableau_ad_pays; |
} |
|
//============================================================================================================ |
|
$requete_04 = "SELECT * ,count(cd_id_departement) as nbr". |
" FROM annuaire_tela, carto_DEPARTEMENT". |
" WHERE u_country = 'fr'". |
" AND u_french_dpt = cd_id_departement". |
" AND u_show = 3". |
" GROUP BY cd_id_Departement"; |
|
$resultat_04 = mysql_query ($requete_04) or die(' |
<H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'. |
'<b>Requete : </b>'.$requete_01. |
'<br/><br/><b>Erreur : </b>'.mysql_error()); |
|
$tableau_ad_dpt_france = array(); |
|
while ($ligne_04 = mysql_fetch_object($resultat_04)) { |
$tableau_ad_dpt_france[$ligne_04->CD_ID_Departement] = $ligne_04->nbr; |
} |
|
$info_dpt_france['nom_table_zone'] = 'carto_DEPARTEMENT'; |
$info_dpt_france['nom_chp_id_zone'] = 'CD_ID_Departement'; |
$info_dpt_france['nom_chp_nom_zone'] = 'CD_Intitule_departement'; |
$info_dpt_france['nom_chp_rouge'] = 'CD_Couleur_R'; |
$info_dpt_france['nom_chp_vert'] = 'CD_Couleur_V'; |
$info_dpt_france['nom_chp_bleu'] = 'CD_Couleur_B'; |
$info_dpt_france['nom_chp_zone_sup'] = 'CD_ID_Pays'; |
$info_dpt_france['tableau_valeurs_zone'] = $tableau_ad_dpt_france; |
|
//============================================================================================================ |
// On cree tout d'abords l'arborescence |
|
$monde = new Carto_Carte ('continent', '', 'Monde', 'monde_masque5c.png', 'monde5c.png', 'Local/tela/carto/', $info_continent); |
|
$monde->historique_cartes = $historique_cartes; |
$monde->image_x = $image_x; |
$monde->image_y = $image_y; |
$monde->liste_zone_carte = $liste_zone_carte; |
$monde->url = "document.php?project=tela&locale=fr&doc=adherents&page=".$GS_GLOBAL['current_page_ndx']; |
|
foreach ($info_pays as $cle => $valeur) { |
$requete_05 = |
"SELECT CDC_Titre_carte, CDC_ID_Carte, CDC_Carte_fond, CDC_Carte_masque, CDC_ID_Zone_geo_carte". |
" FROM carto_DESCRIPTION_CARTE, carto_ACTION ". |
" WHERE CA_ID_Zone_geo = '$cle'". |
" AND CA_Type_zone = 1". |
" AND CA_ID_Carte_destination = CDC_ID_Carte"; |
|
$resultat_05 = mysql_query ($requete_05) or die(' |
<H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'. |
'<b>Requete : </b>'.$requete_01. |
'<br/><br/><b>Erreur : </b>'.mysql_error()); |
|
$ligne_05 = mysql_fetch_object($resultat_05); |
|
$monde->ajouterFils($ligne_05->CDC_ID_Carte, $ligne_05->CDC_ID_Zone_geo_carte, $ligne_05->CDC_Titre_carte, |
$ligne_05->CDC_Carte_masque, $ligne_05->CDC_Carte_fond, $valeur); |
|
} |
|
$monde->fils['europe']->ajouterFils('france', 'fr', 'France' ,'france_masque.png', 'france_region.png', $info_dpt_france); |
|
// Une fois l'arborescence créee on lance la methode donnerFormulaireImage() pour recuperer la carte |
// (dans $img). S'il n'y a pas de carte a afficher donnerFormulaireImage() renvoi false. On peut alors recuperer |
// le niveau ou on en est grace a $monde->historique (du type continent*namerique*ca). |
$res = ''; |
|
|
$img = false; |
if ($mailer == 1 || $fin == true) { |
$objet_carte = cxt_getVariable ($GS_GLOBAL['mysql_db'], $GS_GLOBAL['link'], "carte"); |
$monde = unserialize($objet_carte);} |
else { |
$img = $monde->donnerFormulaireImage(); |
} |
|
// On teste donc img |
|
if (!$img ) { |
include 'modules/client/carto_ad/tb_ad.php'; |
return $res; |
} |
else { |
$historique_carte = new Carto_HistoriqueCarte ($monde, '>', 'lien_non_souligne'); |
$res .= '<tr><td>'."\n"; |
$res .= '<table summary="" cellspacing="5" cellpadding="0" border="0">'."\n"; |
$res .= '<tr><td><b>'; |
$res .= $historique_carte->afficherHistoriqueCarte(); |
$res .= '</b></td></tr>'; |
|
$tab = explode('*',$monde->historique); |
$res .= carto_ad_consulterNbreInscrits($tab[(count($tab)-1)]); |
|
$res .= '<tr><td>'; |
$res .= $img; |
$res .= '</td></tr>'; |
$res .= '<tr><td> </td></tr>'."\n"; |
$res .= '<tr class="texte_tb"><td align="center">'; |
$res .= '<b>Cliquez sur une zone de la carte pour zoomer.</b>'; |
$res .= '<br>La couleur est proportionnelle au nombre d\'adhérents.</td></tr>'; |
$res .= '<tr><td> </td></tr>'."\n"; |
$res .= '<tr class="insTitle1"><td>Avertissement et déni de responsabilité : </td></tr>'."\n"; |
$res .= ' |
<tr class="textJustify"><td> |
La représentation et l\'utilisation des frontières, des noms géographiques et autres données employés sur les cartes et utilisés dans les listes, |
les tableaux, les documents et les bases de données de ce site ne sont pas garanties sans erreurs, de même qu\'elles n\'engagent pas la responsabilité |
de l\'association ni n\'impliquent de reconnaissance officielle de sa part. |
</td></tr>'."\n"; |
$res .= '<tr><td> </td></tr>'."\n"; |
$res .= '</table></td></tr>'; |
|
return $res; |
} |
} |
//-- Fin du code source ------------------------------------------------------------ |
/* |
* $Log: carto_ad.php,v $ |
* Revision 1.9 2003/05/06 12:49:27 alex |
* remplacement include par include_once |
* |
* Revision 1.8 2003/03/07 15:20:32 jpm |
* Correction d'une erreur de texte. |
* |
* Revision 1.7 2003/02/28 08:43:33 jpm |
* Gestion des nouvelles tables MySql carto. |
* |
* Revision 1.6 2003/02/21 13:50:19 jpm |
* Mise à jour nouvel objet Carto_Carte. |
* |
* Revision 1.5 2003/02/17 14:33:52 jpm |
* Modification pour être compatible avec la nouvelle classe carte. |
* |
* |
*/ |
?> |