Subversion Repositories Sites.obs-saisons.fr

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 aurelien 1
<?php
2
 
3
//vim: set expandtab tabstop=4 shiftwidth=4:
4
// +-----------------------------------------------------------------------------------------------+
5
// | PHP version 4.0                                                                               |
6
// +-----------------------------------------------------------------------------------------------+
7
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group                                      |
8
// +-----------------------------------------------------------------------------------------------+
9
// | This source file is subject to version 2.0 of the PHP license,                                |
10
// | that is bundled with this package in the file LICENSE, and is                                 |
11
// | available at through the world-wide-web at                                                    |
12
// | http://www.php.net/license/2_02.txt.                                                          |
13
// | If you did not receive a copy of the PHP license and are unable to                            |
14
// | obtain it through the world-wide-web, please send a note to                                   |
15
// | license@php.net so we can mail you a copy immediately.                                        |
16
// +-----------------------------------------------------------------------------------------------+
17
/**
18
*
19
*Page permettant l'affichage des informations de cartographie des inscrits
20
*
21
*La page contient les fonctions propres à GSite permettant d'afficher en sortie les styles
22
*(inclusion du fichier : lib.putsyle.php), le corps de la page (fonction : putFrame) et son pied de page (fonction : putFooter).
23
*
24
*@package carto_ad
25
//Auteur original :
26
*@author                Alexandre GRANIER <alexandre@tela-botanica.org>
27
//Autres auteurs :
28
*@author                Jean-Pascal MILCENT <jpm@tela-botanica.org>
29
*@copyright         Tela-Botanica 2000-2003
30
*@version             01 avril 2002
31
// +-----------------------------------------------------------------------------------------------+
32
//
33
// $Id: carto_ad.php,v 1.9 2003/05/06 12:49:27 alex Exp $
34
// FICHIER : $RCSfile: carto_ad.php,v $
35
// AUTEUR    : $Author: alex $
36
// VERSION : $Revision: 1.9 $
37
// DATE        : $Date: 2003/05/06 12:49:27 $
38
*/
39
 
40
 
41
include_once 'modules/client/carto_ad/carto-common_ad.php';
42
include_once 'php/context.php';
43
include_once 'php/auth.php';
44
global $var_style;
45
$var_style='alex';
46
include_once 'php/lib/pack.lib.carto.php';
47
 
48
//================================================================================================
49
//================================================================================================
50
 
51
function putFrame ()
52
{
53
 
54
 
55
    global $GS_GLOBAL;
56
    global $AUTH_GLOBAL;
57
    global $image_x;
58
    global $image_y;
59
    global $historique_cartes;
60
    global $mailer;
61
    global $fin;
62
    global $sendpwd;//utilisé dans tb_ad.php
63
    global $titre, $corps;//utilisé dans tb_ad.php
64
    global $select;//utilisé dans tb_ad.php
65
    global $liste_zone_carte;
66
 
67
    //===========================================================================================================
68
    $requete_01 =
69
        "SELECT *,count(cp_id_continent) as nbr".
70
        " FROM annuaire_tela, carto_PAYS".
71
        " WHERE u_country = cp_id_pays".
72
        " AND u_show = 3".
73
        " GROUP BY cp_id_continent";
74
 
75
    $resultat_01 = mysql_query ($requete_01) or die('
76
            <H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'.
77
            '<b>Requete : </b>'.$requete_01.
78
            '<br/><br/><b>Erreur : </b>'.mysql_error());
79
 
80
    $tableau_ad_continent=array();
81
 
82
    while ($ligne_01 = mysql_fetch_object($resultat_01)) {
83
        $tableau_ad_continent[$ligne_01->CP_ID_Continent] = $ligne_01->nbr;
84
 
85
    }
86
    $info_continent['nom_table_zone'] = 'carto_CONTINENT';
87
    $info_continent['nom_chp_id_zone'] = 'CC_ID_Continent';
88
    $info_continent['nom_chp_nom_zone'] = 'CC_Intitule_continent';
89
    $info_continent['nom_chp_rouge'] = 'CC_Couleur_R';
90
    $info_continent['nom_chp_vert'] = 'CC_Couleur_V';
91
    $info_continent['nom_chp_bleu'] = 'CC_Couleur_B';
92
    $info_continent['nom_chp_zone_sup'] = '';
93
    $info_continent['tableau_valeurs_zone'] = $tableau_ad_continent;
94
 
95
    //============================================================================================================
96
 
97
    $requete_02 =
98
        'SELECT CC_ID_Continent'.
99
        ' FROM carto_CONTINENT';
100
 
101
    $resultat_02 = mysql_query ($requete_02) or die('
102
            <H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'.
103
            '<b>Requete : </b>'.$requete_02.
104
            '<br/><br/><b>Erreur : </b>'.mysql_error());
105
 
106
    while ($ligne_02 = mysql_fetch_object($resultat_02)) {
107
        $requete_03 =
108
             'SELECT *, count(cp_id_pays) as nbr '.
109
            ' FROM annuaire_tela, carto_PAYS'.
110
            ' WHERE u_country = cp_id_pays'.
111
            ' AND cp_id_continent = "'.$ligne_02->CC_ID_Continent.'"'.
112
            ' AND u_show = 3'.
113
            ' GROUP BY cp_id_pays';
114
 
115
        $resultat_03 = mysql_query ($requete_03) or die('
116
            <H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'.
117
            '<b>Requete : </b>'.$requete_01.
118
            '<br/><br/><b>Erreur : </b>'.mysql_error());
119
 
120
        $tableau_ad_pays = array();
121
 
122
        while ($ligne_03 = mysql_fetch_object($resultat_03)) {
123
            $tableau_ad_pays[$ligne_03->CP_ID_Pays] = $ligne_03->nbr;
124
        }
125
 
126
        $info_pays[$ligne_02->CC_ID_Continent]['nom_table_zone'] = 'carto_PAYS';
127
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_id_zone'] = 'CP_ID_Pays';
128
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_nom_zone'] = 'CP_Intitule_pays';
129
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_rouge'] = 'CP_Couleur_R';
130
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_vert'] = 'CP_Couleur_V';
131
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_bleu'] = 'CP_Couleur_B';
132
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_zone_sup'] = 'CP_ID_Continent';
133
        $info_pays[$ligne_02->CC_ID_Continent]['tableau_valeurs_zone'] = $tableau_ad_pays;
134
    }
135
 
136
    //============================================================================================================
137
 
138
    $requete_04 = "SELECT * ,count(cd_id_departement) as nbr".
139
        " FROM annuaire_tela, carto_DEPARTEMENT".
140
        " WHERE u_country = 'fr'".
141
        " AND u_french_dpt = cd_id_departement".
142
        " AND u_show = 3".
143
        " GROUP BY cd_id_Departement";
144
 
145
    $resultat_04 = mysql_query ($requete_04) or die('
146
            <H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'.
147
            '<b>Requete : </b>'.$requete_01.
148
            '<br/><br/><b>Erreur : </b>'.mysql_error());
149
 
150
    $tableau_ad_dpt_france = array();
151
 
152
    while ($ligne_04 = mysql_fetch_object($resultat_04)) {
153
        $tableau_ad_dpt_france[$ligne_04->CD_ID_Departement] = $ligne_04->nbr;
154
    }
155
 
156
    $info_dpt_france['nom_table_zone'] = 'carto_DEPARTEMENT';
157
    $info_dpt_france['nom_chp_id_zone'] = 'CD_ID_Departement';
158
    $info_dpt_france['nom_chp_nom_zone'] = 'CD_Intitule_departement';
159
    $info_dpt_france['nom_chp_rouge'] = 'CD_Couleur_R';
160
    $info_dpt_france['nom_chp_vert'] = 'CD_Couleur_V';
161
    $info_dpt_france['nom_chp_bleu'] = 'CD_Couleur_B';
162
    $info_dpt_france['nom_chp_zone_sup'] = 'CD_ID_Pays';
163
    $info_dpt_france['tableau_valeurs_zone'] = $tableau_ad_dpt_france;
164
 
165
    //============================================================================================================
166
    // On cree tout d'abords l'arborescence
167
 
168
    $monde = new Carto_Carte ('continent', '', 'Monde', 'monde_masque5c.png', 'monde5c.png', 'Local/tela/carto/', $info_continent);
169
 
170
    $monde->historique_cartes = $historique_cartes;
171
    $monde->image_x = $image_x;
172
    $monde->image_y = $image_y;
173
    $monde->liste_zone_carte = $liste_zone_carte;
174
    $monde->url = "document.php?project=tela&locale=fr&doc=adherents&page=".$GS_GLOBAL['current_page_ndx'];
175
 
176
    foreach ($info_pays as $cle => $valeur) {
177
        $requete_05 =
178
            "SELECT CDC_Titre_carte, CDC_ID_Carte, CDC_Carte_fond, CDC_Carte_masque, CDC_ID_Zone_geo_carte".
179
            " FROM carto_DESCRIPTION_CARTE, carto_ACTION ".
180
            " WHERE CA_ID_Zone_geo = '$cle'".
181
            " AND CA_Type_zone = 1".
182
            " AND CA_ID_Carte_destination = CDC_ID_Carte";
183
 
184
        $resultat_05 = mysql_query ($requete_05) or die('
185
            <H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'.
186
            '<b>Requete : </b>'.$requete_01.
187
            '<br/><br/><b>Erreur : </b>'.mysql_error());
188
 
189
        $ligne_05 = mysql_fetch_object($resultat_05);
190
 
191
        $monde->ajouterFils($ligne_05->CDC_ID_Carte, $ligne_05->CDC_ID_Zone_geo_carte, $ligne_05->CDC_Titre_carte,
192
                                        $ligne_05->CDC_Carte_masque, $ligne_05->CDC_Carte_fond, $valeur);
193
 
194
    }
195
 
196
    $monde->fils['europe']->ajouterFils('france', 'fr', 'France' ,'france_masque.png', 'france_region.png', $info_dpt_france);
197
 
198
    // Une fois l'arborescence créee on lance la methode donnerFormulaireImage() pour recuperer la carte
199
    // (dans $img). S'il n'y a pas de carte a afficher donnerFormulaireImage() renvoi false. On peut alors recuperer
200
    // le niveau ou on en est grace a $monde->historique (du type continent*namerique*ca).
201
    $res = '';
202
 
203
 
204
    $img = false;
205
    if ($mailer == 1 || $fin == true) {
206
        $objet_carte = cxt_getVariable ($GS_GLOBAL['mysql_db'], $GS_GLOBAL['link'], "carte");
207
        $monde = unserialize($objet_carte);}
208
    else {
209
        $img = $monde->donnerFormulaireImage();
210
    }
211
 
212
    // On teste donc img
213
 
214
    if (!$img ) {
215
        include 'modules/client/carto_ad/tb_ad.php';
216
        return $res;
217
    }
218
    else {
219
        $historique_carte = new Carto_HistoriqueCarte ($monde, '&gt;', 'lien_non_souligne');
220
        $res .= '<tr><td>'."\n";
221
        $res .= '<table summary="" cellspacing="5" cellpadding="0" border="0">'."\n";
222
        $res .= '<tr><td><b>';
223
        $res .= $historique_carte->afficherHistoriqueCarte();
224
        $res .= '</b></td></tr>';
225
 
226
        $tab = explode('*',$monde->historique);
227
        $res .= carto_ad_consulterNbreInscrits($tab[(count($tab)-1)]);
228
 
229
        $res .= '<tr><td>';
230
        $res .= $img;
231
        $res .= '</td></tr>';
232
        $res .= '<tr><td>&nbsp;</td></tr>'."\n";
233
        $res .= '<tr class="texte_tb"><td align="center">';
234
        $res .= '<b>Cliquez sur une zone de la carte pour zoomer.</b>';
235
        $res .= '<br>La couleur est proportionnelle au nombre d\'adhérents.</td></tr>';
236
        $res .= '<tr><td>&nbsp;</td></tr>'."\n";
237
        $res .= '<tr class="insTitle1"><td>Avertissement et déni de responsabilité : </td></tr>'."\n";
238
        $res .= '
239
<tr class="textJustify"><td>
240
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,
241
 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é
242
 de l\'association ni n\'impliquent de reconnaissance officielle de sa part.
243
</td></tr>'."\n";
244
        $res .= '<tr><td>&nbsp;</td></tr>'."\n";
245
        $res .= '</table></td></tr>';
246
 
247
        return $res;
248
    }
249
}
250
//-- Fin du code source    ------------------------------------------------------------
251
/*
252
* $Log: carto_ad.php,v $
253
* Revision 1.9  2003/05/06 12:49:27  alex
254
* remplacement include par include_once
255
*
256
* Revision 1.8  2003/03/07 15:20:32  jpm
257
* Correction d'une erreur de texte.
258
*
259
* Revision 1.7  2003/02/28 08:43:33  jpm
260
* Gestion des nouvelles tables MySql carto.
261
*
262
* Revision 1.6  2003/02/21 13:50:19  jpm
263
* Mise à jour nouvel objet Carto_Carte.
264
*
265
* Revision 1.5  2003/02/17 14:33:52  jpm
266
* Modification pour être compatible avec la nouvelle classe carte.
267
*
268
*
269
*/
270
?>