Subversion Repositories Sites.tela-botanica.org

Rev

Rev 364 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
87 alex 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
*@package cartographie
22
//Auteur original :
23
*@author                Alexandre GRANIER <alexandre@tela-botanica.org>
24
//Autres auteurs :
25
*@copyright         Tela-Botanica 2000-2004
26
*@version             03 mai 2004
27
// +-----------------------------------------------------------------------------------------------+
28
//
29
// $Id: cartographie.php,v 1.6 2005/03/14 09:43:13 alex Exp $
30
// FICHIER : $RCSfile: cartographie.php,v $
31
// AUTEUR    : $Author: alex $
32
// VERSION : $Revision: 1.6 $
33
// DATE        : $Date: 2005/03/14 09:43:13 $
34
*/
35
 
36
include_once 'client/cartographie/configuration/car_config.inc.php' ;
37
if (isset($lang)) {
38
    include_once CAR_CHEMIN_APPLI."/langues/car_langue_$lang.inc.php" ;
39
} else {
40
    include_once CAR_CHEMIN_APPLI.'/langues/car_langue_fr.inc.php' ;
41
}
42
 
43
include_once CAR_CHEMIN_APPLI.'/bibliotheque/lib.carto.php' ;
44
include_once CAR_CHEMIN_APPLI.'/bibliotheque/car_cartographie.fonct.php' ;
45
include_once 'HTML/QuickForm.php' ;
46
 
47
// Ajout d'une feuille de style externe
48
GEN_stockerStyleExterne ('cartographie', 'client/cartographie/cartographie.css') ;
49
 
50
if (isset($GLOBALS['logout']) && $GLOBALS['logout']==1) {
51
    $GLOBALS['car_auth']->logout();
52
}
53
//================================================================================================
54
//================================================================================================
55
function AUTH_formulaire_login() {
56
 
57
     // l'url de la page en cours
208 jpm 58
    $url = $GLOBALS['car_url'];
59
	$url->addQueryString('historique_cartes', $GLOBALS['historique_cartes']);
60
	$url->addQueryString('fin', true);
61
 
87 alex 62
    $res = '<h2 class="titre2_cartographie">'.CAR_TEXTE_IDENTIFICATION_2.'</h2>';
63
    $res .= "<div>".CAR_LAIUS_INSCRIPTION."&nbsp;<a href=\"".CAR_CHEMIN_INSCRIPTION."\">".CAR_S_INSCRIRE."</a></div>\n" ;
64
    $res .= '<h2 class="titre2_cartographie">'.CAR_TEXTE_IDENTIFICATION_1.'</h2>';
208 jpm 65
    $form = new HTML_QuickForm ('inscription', 'post', preg_replace('/&amp;/', '&', $url->getURL())) ;
87 alex 66
    $form->addElement ('text', 'username', CAR_EMAIL) ;
67
    $form->addElement ('password', 'password', CAR_MOT_DE_PASSE) ;
68
    $form->addElement('submit', 'connexion', CAR_VALIDER);
69
 
70
    $res .= $form->toHTML() ;
71
 
72
    //$res .= "<div>".CAR_TEXTE_PERDU."</div>\n" ;
73
    return $res;
74
}
75
 
76
function afficherContenuCorps ()
77
{
364 jpm 78
    $image_x = null;
79
    if (isset($_POST['image_x'])) $image_x = $_POST['image_x'];
80
    $image_y = null;
81
    if (isset($_POST['image_y'])) $image_y = $_POST['image_y'];
82
    $historique_cartes = null;
83
    if (isset($_POST['historique_cartes'])) $historique_cartes = $_POST['historique_cartes'];
84
    if (isset($_GET['historique_cartes'])) $historique_cartes = $_GET['historique_cartes'];
85
    $mailer = null;
86
    if (isset($_GET['mailer'])) $mailer = $_GET['mailer'];
87
    $fin = null;
88
    if (isset($_GET['fin'])) $fin = $_GET['fin'];
89
    $sendpwd = null;//utilisé dans liste_inscrit.php
90
    if (isset($_GET['sendpwd'])) $sendpwd = $_GET['sendpwd'];
91
    $select = null;//utilisé dans liste_inscrit.php
92
    if (isset($_POST['select'])) $select = $_POST['select'];
93
    $liste_zone_carte = null;
94
    if (isset($_POST['liste_zone_carte'])) $liste_zone_carte = $_POST['liste_zone_carte'];
87 alex 95
 
96
    //===========================================================================================================
97
    $requete_01 =
98
        "SELECT *,count(cp_id_continent) as nbr".
99
        " FROM ".CAR_ANNUAIRE.", carto_PAYS".
100
        " WHERE ".CAR_CHAMPS_CE_PAYS." = cp_id_pays".
101
        " GROUP BY cp_id_continent";
102
 
103
    $resultat_01 = $GLOBALS['car_db']->query ($requete_01) ;
104
    if (DB::isError($resultat_01)) {
105
    	die ($resultat_01->getMessage().'<br />'.$resultat_01->getDebugInfo()) ;
106
    }
107
 
108
    $tableau_ad_continent=array();
109
 
110
    while ($ligne_01 = $resultat_01->fetchRow(DB_FETCHMODE_OBJECT)) {
111
        $tableau_ad_continent[$ligne_01->CP_ID_Continent] = $ligne_01->nbr;
112
 
113
    }
114
    $info_continent['nom_table_zone'] = 'carto_CONTINENT';
115
    $info_continent['nom_chp_id_zone'] = 'CC_ID_Continent';
116
    $info_continent['nom_chp_nom_zone'] = 'CC_Intitule_continent';
117
    $info_continent['nom_chp_rouge'] = 'CC_Couleur_R';
118
    $info_continent['nom_chp_vert'] = 'CC_Couleur_V';
119
    $info_continent['nom_chp_bleu'] = 'CC_Couleur_B';
120
    $info_continent['nom_chp_zone_sup'] = '';
121
    $info_continent['tableau_valeurs_zone'] = $tableau_ad_continent;
122
 
123
    //============================================================================================================
124
 
125
    $requete_02 = 'SELECT CC_ID_Continent FROM carto_CONTINENT';
126
 
127
    $resultat_02 = $GLOBALS['car_db']->query ($requete_02) ;
128
    if (DB::isError($resultat_02)) {
129
    	die ($resultat_02->getMessage().'<br />'.$resultat_02->getDebugInfo()) ;
130
    }
131
 
132
    while ($ligne_02 = $resultat_02->fetchRow(DB_FETCHMODE_OBJECT)) {
133
        $requete_03 =
134
             'SELECT *, count(cp_id_pays) as nbr '.
135
            ' FROM '.CAR_ANNUAIRE.', carto_PAYS'.
136
            ' WHERE '.CAR_CHAMPS_CE_PAYS.'= cp_id_pays'.
137
            ' AND cp_id_continent = "'.$ligne_02->CC_ID_Continent.'"'.
138
            ' GROUP BY cp_id_pays';
139
 
140
        $resultat_03 = $GLOBALS['car_db']->query ($requete_03) ;
141
        if (DB::isError($resultat_03)) {
142
        	die ($resultat_03->getMessage().'<br />'.$resultat_03->getDebugInfo()) ;
143
        }
144
 
145
        $tableau_ad_pays = array();
146
 
147
        while ($ligne_03 = $resultat_03->fetchRow(DB_FETCHMODE_OBJECT)) {
148
            $tableau_ad_pays[$ligne_03->CP_ID_Pays] = $ligne_03->nbr;
149
        }
150
 
151
        $info_pays[$ligne_02->CC_ID_Continent]['nom_table_zone'] = 'carto_PAYS';
152
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_id_zone'] = 'CP_ID_Pays';
153
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_nom_zone'] = 'CP_Intitule_pays';
154
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_rouge'] = 'CP_Couleur_R';
155
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_vert'] = 'CP_Couleur_V';
156
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_bleu'] = 'CP_Couleur_B';
157
        $info_pays[$ligne_02->CC_ID_Continent]['nom_chp_zone_sup'] = 'CP_ID_Continent';
158
        $info_pays[$ligne_02->CC_ID_Continent]['tableau_valeurs_zone'] = $tableau_ad_pays;
159
    }
160
    //============================================================================================================
161
 
162
    $requete_04 = "SELECT * ,count(cd_id_departement) as nbr".
163
        " FROM ".CAR_ANNUAIRE.", carto_DEPARTEMENT".
164
        " WHERE ".CAR_CHAMPS_CE_PAYS." = 'fr'".
165
        " AND ".CAR_CHAMPS_DPT." = cd_id_departement".
166
        " GROUP BY cd_id_Departement";
167
 
168
    $resultat_04 = $GLOBALS['car_db']->query ($requete_04) ;
169
    if (DB::isError($resultat_04)) {
170
        die('
171
            <H2 style="text-align: center; font-weight: bold; font-size: 26px;">Erreur de requête</H2>'.
172
            '<b>Requete : </b>'.$requete_04.
173
            '<br/><br/><b>Erreur : </b>'.$resultat_04->getMessage());
174
    }
175
 
176
    $tableau_ad_dpt_france = array();
177
 
178
    while ($ligne_04 = $resultat_04->fetchRow(DB_FETCHMODE_OBJECT)) {
179
        $tableau_ad_dpt_france[$ligne_04->CD_ID_Departement] = $ligne_04->nbr;
180
    }
181
 
182
    $info_dpt_france['nom_table_zone'] = 'carto_DEPARTEMENT';
183
    $info_dpt_france['nom_chp_id_zone'] = 'CD_ID_Departement';
184
    $info_dpt_france['nom_chp_nom_zone'] = 'CD_Intitule_departement';
185
    $info_dpt_france['nom_chp_rouge'] = 'CD_Couleur_R';
186
    $info_dpt_france['nom_chp_vert'] = 'CD_Couleur_V';
187
    $info_dpt_france['nom_chp_bleu'] = 'CD_Couleur_B';
188
    $info_dpt_france['nom_chp_zone_sup'] = 'CD_ID_Pays';
189
    $info_dpt_france['tableau_valeurs_zone'] = $tableau_ad_dpt_france;
190
 
191
    //============================================================================================================
192
 
193
 
194
    //============================================================================================================
195
    // On cree tout d'abord l'arborescence
196
 
197
    $monde = new Carto_Carte ('continent', '', 'Monde', 'monde_masque5c.png', 'monde5c.png', CAR_CHEMIN_APPLI.'/fonds/', $info_continent);
198
 
392 jpm 199
    $monde->definirCouleurs ('255', '255', '255','255', '250', '130','255', '165', '0','255', '50', '0') ;
87 alex 200
 
201
    $monde->historique_cartes = $historique_cartes;
202
    $monde->image_x = $image_x;
203
    $monde->image_y = $image_y;
204
    $monde->liste_zone_carte = $liste_zone_carte;
205
    $monde->url = CAR_URL;
206
 
207
    foreach ($info_pays as $cle => $valeur) {
208
        $requete_05 =
209
            "SELECT CDC_Titre_carte, CDC_ID_Carte, CDC_Carte_fond, CDC_Carte_masque, CDC_ID_Zone_geo_carte".
210
            " FROM carto_DESCRIPTION_CARTE, carto_ACTION ".
211
            " WHERE CA_ID_Zone_geo = '$cle'".
212
            " AND CA_Type_zone = 1".
213
            " AND CA_ID_Carte_destination = CDC_ID_Carte";
214
 
215
        $resultat_05 = $GLOBALS['car_db']->query ($requete_05) ;
216
        if (DB::isError($resultat_05)) {
217
        	die ($resultat_05->getMessage().'<br />'.$resultat_05->getDebugInfo()) ;
218
        }
219
 
220
        $ligne_05 = $resultat_05->fetchRow(DB_FETCHMODE_OBJECT);
364 jpm 221
        if (is_object($ligne_05)) {
222
        	$monde->ajouterFils($ligne_05->CDC_ID_Carte, $ligne_05->CDC_ID_Zone_geo_carte, $ligne_05->CDC_Titre_carte,
87 alex 223
                                        $ligne_05->CDC_Carte_masque, $ligne_05->CDC_Carte_fond, $valeur);
392 jpm 224
        	$monde->fils[$ligne_05->CDC_ID_Carte]->definirCouleurs ('255', '255', '255','255', '250', '130','255', '165', '0','255', '50', '0') ;
364 jpm 225
        }
87 alex 226
    }
227
 
228
    $monde->fils['europe']->ajouterFils('france', 'fr', 'France' ,'france_masque.png', 'france_region.png', $info_dpt_france);
392 jpm 229
    $monde->fils['europe']->fils['france']->definirCouleurs ('255', '255', '255','255', '250', '130','255', '165', '0','255', '50', '0') ;
87 alex 230
 
231
    // Une fois l'arborescence créée on lance la methode donnerFormulaireImage() pour recuperer la carte
232
    // (dans $img). S'il n'y a pas de carte a afficher donnerFormulaireImage() renvoi false. On peut alors recuperer
233
    // le niveau ou on en est grace a $monde->historique (du type continent*namerique*ca).
234
    $res = '';
235
 
236
 
237
    $img = false;
238
    if ($mailer == 1 || $fin == true) {
239
        $objet_carte = $_SESSION['carte'] ;
240
        $monde = unserialize($objet_carte);}
241
    else {
242
        $img = $monde->donnerFormulaireImage();
243
    }
244
 
245
    // On teste donc img
246
 
247
    if (!$img ) {
248
        include 'liste_inscrit.php';
249
        return $res;
250
    }
251
    else {
252
        $historique_carte = new Carto_HistoriqueCarte ($monde, '&gt;', 'chemin_carto');
253
        $res .= $historique_carte->afficherHistoriqueCarte();
254
        $res .= "<br />\n" ;
255
        $tab = explode('*',$monde->historique);
256
        $res .= carto_ad_consulterNbreInscrits($tab[(count($tab)-1)]);
257
        $res .= $img;
258
        $res .= '<div class="cliquer2">'.CAR_CLIQUER.'</div>';
259
        $res .= '<div class="couleur">'.CAR_COULEUR.'</div>'."\n";
260
        $res .= '<div class="avertissement_carto" id="d"><h2 class="titre2_cartographie">'.CAR_AVERTISSEMENT_TITRE.' : </h2>';
261
        $res .= '<span class="texte_avertissement">'.CAR_AVERTISSEMENT."</span></div>\n";
262
 
263
        return $res;
264
    }
265
}
266
 
267
 
268
//-- Fin du code source    ------------------------------------------------------------
269
/*
270
* $Log: cartographie.php,v $
271
* Revision 1.6  2005/03/14 09:43:13  alex
272
* changement des couleurs
273
*
274
* Revision 1.5  2005/03/11 15:58:21  alex
275
* suppression d'une phrase
276
*
277
* Revision 1.2  2005/03/11 15:18:36  alex
278
* migration version 4
279
*
280
* Revision 1.1  2004/11/30 13:37:32  tam
281
* installation
282
*
283
* Revision 1.1.1.1  2004/11/23 17:48:17  tam
284
* Importation
285
*
286
* Revision 1.1  2004/11/23 17:29:40  tam
287
* installation
288
*
289
* Revision 1.2  2004/06/18 08:48:03  alex
290
* améliorations diverses
291
*
292
* Revision 1.1  2004/06/09 13:56:47  alex
293
* corrections diverses
294
*
295
* Revision 1.9  2003/05/06 12:49:27  alex
296
* remplacement include par include_once
297
*
298
* Revision 1.8  2003/03/07 15:20:32  jpm
299
* Correction d'une erreur de texte.
300
*
301
* Revision 1.7  2003/02/28 08:43:33  jpm
302
* Gestion des nouvelles tables MySql carto.
303
*
304
* Revision 1.6  2003/02/21 13:50:19  jpm
305
* Mise à jour nouvel objet Carto_Carte.
306
*
307
* Revision 1.5  2003/02/17 14:33:52  jpm
308
* Modification pour être compatible avec la nouvelle classe carte.
309
*
310
*
311
*/
312
?>