Subversion Repositories eFlore/Archives.herbiers

Rev

Rev 2 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 8
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of Herbier - Cartographie.                                                         |
8
// | This file is part of Herbier - Cartographie.                                                         |
9
// |                                                                                                      |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
23
// +------------------------------------------------------------------------------------------------------+
24
// CVS : $Id: hb_carto.php,v 1.1 2005-11-23 10:32:32 jp_milcent Exp $
24
// CVS : $Id: hb_carto.php,v 1.2 2006-10-31 10:31:36 jp_milcent Exp $
25
/**
25
/**
26
* Application fournissant une cartographie des herbiers
26
* Application fournissant une cartographie des herbiers
27
*
27
*
28
* Fournit la carte des herbiers enregistrés dans la base de données.
28
* Fournit la carte des herbiers enregistrés dans la base de données.
29
*
29
*
30
*@package Herbier-Cartographie
30
*@package Herbier-Cartographie
31
//Auteur original :
31
//Auteur original :
32
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
32
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
33
//Autres auteurs :
33
//Autres auteurs :
34
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
34
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
35
*@copyright     Tela-Botanica 2000-2005
35
*@copyright     Tela-Botanica 2000-2005
36
*@version       $Revision: 1.1 $ $Date: 2005-11-23 10:32:32 $
36
*@version       $Revision: 1.2 $ $Date: 2006-10-31 10:31:36 $
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
*/
38
*/
39
 
39
 
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
// |                                            ENTETE du PROGRAMME                                       |
41
// |                                            ENTETE du PROGRAMME                                       |
42
// +------------------------------------------------------------------------------------------------------+
42
// +------------------------------------------------------------------------------------------------------+
43
/** Inclusion du fichier de configuration de l'application Herbier - Cartographie. */
43
/** Inclusion du fichier de configuration de l'application Herbier - Cartographie. */
44
require_once HB_CHEMIN_APPLI.'hb_carto'.GEN_SEP.'configuration'.GEN_SEP.'hbca_config.inc.php';
44
require_once HB_CHEMIN_MODULE.'hb_carto'.GEN_SEP.'configuration'.GEN_SEP.'hbca_config.inc.php';
45
 
45
 
46
/** Inclusion de la classe principale d'Herbier : herbier */
46
/** Inclusion de la classe principale d'Herbier : herbier */
47
//require_once HB_CHEMIN_BIBLIO.'hb_herbier.class.php';
47
//require_once HB_CHEMIN_BIBLIO.'hb_herbier.class.php';
48
/** Inclusion de la classe Herbier : collection */
48
/** Inclusion de la classe Herbier : collection */
49
//require_once HB_CHEMIN_BIBLIO.'hb_collection.class.php';
49
//require_once HB_CHEMIN_BIBLIO.'hb_collection.class.php';
50
/** Inclusion de la classe Herbier : indic */
50
/** Inclusion de la classe Herbier : indic */
51
//require_once HB_CHEMIN_BIBLIO.'hb_indic.class.php';
51
//require_once HB_CHEMIN_BIBLIO.'hb_indic.class.php';
52
/** Inclusion de la classe Herbier : indic_hist */
52
/** Inclusion de la classe Herbier : indic_hist */
53
//require_once HB_CHEMIN_BIBLIO.'hb_indic_hist.class.php';
53
//require_once HB_CHEMIN_BIBLIO.'hb_indic_hist.class.php';
54
/** Inclusion de la classe Herbier : organisation */
54
/** Inclusion de la classe Herbier : organisation */
55
//require_once HB_CHEMIN_BIBLIO.'hb_organisation.class.php';
55
//require_once HB_CHEMIN_BIBLIO.'hb_organisation.class.php';
56
/** Inclusion de la classe Herbier : type */
56
/** Inclusion de la classe Herbier : type */
57
//require_once HB_CHEMIN_BIBLIO.'hb_type.class.php';
57
//require_once HB_CHEMIN_BIBLIO.'hb_type.class.php';
58
/** Inclusion de la classe Herbier : equipe */
58
/** Inclusion de la classe Herbier : equipe */
59
//require_once HB_CHEMIN_BIBLIO.'hb_equipe.class.php';
59
//require_once HB_CHEMIN_BIBLIO.'hb_equipe.class.php';
60
 
60
 
61
// Appel du fichier de traduction des textes de l'application Cartographie de Herbier
61
// Appel du fichier de traduction des textes de l'application Cartographie de Herbier
62
if (file_exists(HBCA_CHEMIN_LANGUES.'hbca_langue_'.HB_I18N.'.inc.php')) {
62
if (file_exists(HBCA_CHEMIN_LANGUES.'hbca_langue_'.HB_I18N.'.inc.php')) {
63
    /** Inclusion du fichier de traduction de l'application Lien Favoris. */
63
    /** Inclusion du fichier de traduction de l'application Lien Favoris. */
64
    include_once HBCA_CHEMIN_LANGUES.'hbca_langue_'.HB_I18N.'.inc.php';
64
    include_once HBCA_CHEMIN_LANGUES.'hbca_langue_'.HB_I18N.'.inc.php';
65
} else {
65
} else {
66
    /** Inclusion du fichier de traduction fr par défaut. */
66
    /** Inclusion du fichier de traduction fr par défaut. */
67
    include_once HBCA_CHEMIN_LANGUES.'hbca_langue_fr.inc.php';
67
    include_once HBCA_CHEMIN_LANGUES.'hbca_langue_fr.inc.php';
68
}
68
}
69
/** Inclusion du fichier fournissant des informations pour la cartographie. */
69
/** Inclusion du fichier fournissant des informations pour la cartographie. */
70
require_once HBCA_CHEMIN_BIBLIO.'hbca_information.fonct.php';
70
require_once HBCA_CHEMIN_BIBLIO.'hbca_information.fonct.php';
71
 
71
 
72
/** Inclusion de la bibliothèque Cartographie. */
72
/** Inclusion de la bibliothèque Cartographie. */
73
require_once HB_CHEMIN_BIBLIO_CARTO.'carto_carte.class.php';
73
require_once HB_CHEMIN_BIBLIO_CARTO.'carto_carte.class.php';
74
 
74
 
75
// Initialisation de la variable à retourner
75
// Initialisation de la variable à retourner
76
$sortie .= '<!-- Herbier - Cartographie : DEBUT -->'."\n";
76
$sortie .= '<!-- Herbier - Cartographie : DEBUT -->'."\n";
77
 
77
 
78
// +------------------------------------------------------------------------------------------------------+
78
// +------------------------------------------------------------------------------------------------------+
79
// |                                            CORPS du PROGRAMME                                        |
79
// |                                            CORPS du PROGRAMME                                        |
80
// +------------------------------------------------------------------------------------------------------+
80
// +------------------------------------------------------------------------------------------------------+
81
 
81
 
82
global $NOM_FICHIER;
82
global $NOM_FICHIER;
83
global $image_x;
83
global $image_x;
84
global $image_y;
84
global $image_y;
85
global $historique_cartes;
85
global $historique_cartes;
86
global $liste_zone_carte;
86
global $liste_zone_carte;
87
 
87
 
88
$requete =  'SELECT *, COUNT(CD_ID_Departement) AS nbr '.
88
$requete =  'SELECT *, COUNT(CD_ID_Departement) AS nbr '.
89
            'FROM '.HB_BDD_NOM.'.HERBIERS_ORGANISATION, '.HB_BDD_NOM_CARTO.'.carto_DEPARTEMENT '.
89
            'FROM '.HB_BDD_NOM.'.HERBIERS_ORGANISATION, '.HB_BDD_NOM_CARTO.'.carto_DEPARTEMENT '.
90
            'WHERE COUNTRY_CODE = "fr" '.
90
            'WHERE COUNTRY_CODE = "fr" '.
91
            'AND CD_ID_Departement = if (substring(ZIP,1,2)<>"97", if (substring(ZIP,1,2)<>"98", substring(ZIP, 1,2),substring(ZIP,1,3)), substring(ZIP,1,3)) '.
91
            'AND CD_ID_Departement = if (substring(ZIP,1,2)<>"97", if (substring(ZIP,1,2)<>"98", substring(ZIP, 1,2),substring(ZIP,1,3)), substring(ZIP,1,3)) '.
92
            'GROUP BY CD_ID_Departement';
92
            'GROUP BY CD_ID_Departement';
93
 
93
 
94
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
94
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
95
$tableau_organisation = array();
95
$tableau_organisation = array();
96
while ($ligne = mysql_fetch_object($resultat)) {
96
while ($ligne = mysql_fetch_object($resultat)) {
97
    $tableau_organisation[$ligne->CD_ID_Departement] = $ligne->nbr;
97
    $tableau_organisation[$ligne->CD_ID_Departement] = $ligne->nbr;
98
}
98
}
99
 
99
 
100
$info_dpt_france['nom_table_zone'] = HB_BDD_NOM_CARTO.'.carto_DEPARTEMENT';
100
$info_dpt_france['nom_table_zone'] = HB_BDD_NOM_CARTO.'.carto_DEPARTEMENT';
101
$info_dpt_france['nom_chp_id_zone'] = 'CD_ID_Departement';
101
$info_dpt_france['nom_chp_id_zone'] = 'CD_ID_Departement';
102
$info_dpt_france['nom_chp_nom_zone'] = 'CD_Intitule_departement';
102
$info_dpt_france['nom_chp_nom_zone'] = 'CD_Intitule_departement';
103
$info_dpt_france['nom_chp_rouge'] = 'CD_Couleur_R';
103
$info_dpt_france['nom_chp_rouge'] = 'CD_Couleur_R';
104
$info_dpt_france['nom_chp_vert'] = 'CD_Couleur_V';
104
$info_dpt_france['nom_chp_vert'] = 'CD_Couleur_V';
105
$info_dpt_france['nom_chp_bleu'] = 'CD_Couleur_B';
105
$info_dpt_france['nom_chp_bleu'] = 'CD_Couleur_B';
106
$info_dpt_france['nom_chp_zone_sup'] = 'CD_ID_Pays';
106
$info_dpt_france['nom_chp_zone_sup'] = 'CD_ID_Pays';
107
$info_dpt_france['tableau_valeurs_zone'] = $tableau_organisation;
107
$info_dpt_france['tableau_valeurs_zone'] = $tableau_organisation;
108
 
108
 
109
// Instanciation du tableau contenant les champs de la table action
109
// Instanciation du tableau contenant les champs de la table action
110
$info_table_action['nom_table_action'] = HB_BDD_NOM_CARTO.'.carto_ACTION';
110
$info_table_action['nom_table_action'] = HB_BDD_NOM_CARTO.'.carto_ACTION';
111
$info_table_action['nom_chp_id_carte'] = 'CA_ID_Carte';
111
$info_table_action['nom_chp_id_carte'] = 'CA_ID_Carte';
112
$info_table_action['nom_chp_id_zg_action'] = 'CA_ID_Zone_geo';
112
$info_table_action['nom_chp_id_zg_action'] = 'CA_ID_Zone_geo';
113
$info_table_action['nom_chp_type_zg'] = 'CA_Type_zone';
113
$info_table_action['nom_chp_type_zg'] = 'CA_Type_zone';
114
$info_table_action['nom_chp_action'] = 'CA_Action';
114
$info_table_action['nom_chp_action'] = 'CA_Action';
115
$info_table_action['nom_chp_id_carte_destination'] = 'CA_ID_Carte_destination';
115
$info_table_action['nom_chp_id_carte_destination'] = 'CA_ID_Carte_destination';
116
 
116
 
117
// On cree tout d'abords l'arborescence
117
// On cree tout d'abords l'arborescence
118
$france = new Carto_Carte(  'france', 
118
$france = new Carto_Carte(  'france', 
119
                            'fr', 
119
                            'fr', 
120
                            'France', 
120
                            'France', 
121
                            CAR_FICHIER_CARTE_FR_DPT_MASQUE, 
121
                            CAR_FICHIER_CARTE_FR_DPT_MASQUE, 
122
                            CAR_FICHIER_CARTE_FR_DPT, 
122
                            CAR_FICHIER_CARTE_FR_DPT, 
123
                            HB_CHEMIN_CARTE, 
123
                            HB_CHEMIN_CARTE, 
124
                            $info_dpt_france, 
124
                            $info_dpt_france, 
125
                            $info_table_action);
125
                            $info_table_action);
126
 
126
 
127
$france->historique_cartes = $historique_cartes;
127
$france->historique_cartes = $historique_cartes;
128
$france->image_x = $image_x;
128
$france->image_x = $image_x;
129
$france->image_y = $image_y;
129
$france->image_y = $image_y;
130
$france->liste_zone_carte = $liste_zone_carte;
130
$france->liste_zone_carte = $liste_zone_carte;
131
$france->url = HB_URL_COURANTE;
131
$france->url = HB_URL_COURANTE;
132
 
132
 
133
// Une fois l'arborescence creee on lance la methode donnerFormulaireImage() pour recuperer la carte
133
// Une fois l'arborescence creee on lance la methode donnerFormulaireImage() pour recuperer la carte
134
// (dans $carte_france). S'il n'y a pas de carte a afficher donnerFormulaireImage() renvoi false. On peut alors recuperer
134
// (dans $carte_france). S'il n'y a pas de carte a afficher donnerFormulaireImage() renvoi false. On peut alors recuperer
135
// le niveau ou on en est grace a $france->historique (du type france*34).
135
// le niveau ou on en est grace a $france->historique (du type france*34).
136
$img_carte_france = $france->donnerFormulaireImage();
136
$img_carte_france = $france->donnerFormulaireImage();
137
 
137
 
138
// On teste $donc carte_france
138
// On teste $donc carte_france
139
if (!$img_carte_france) {
139
if (!$img_carte_france) {
140
    include 'hbca_herbier_liste.inc.php';
140
    include 'hbca_herbier_liste.inc.php';
141
} else {
141
} else {
142
    // Construction du titre de la carte et de l'historique de navigation dans les cartes
142
    // Construction du titre de la carte et de l'historique de navigation dans les cartes
143
    $historique_carte = new Carto_Historique($france, '&gt;', 'lien_non_souligne');
143
    $historique_carte = new Carto_Historique($france, '&gt;', 'lien_non_souligne');
144
    $tab = explode('*', $france->historique);
144
    $tab = explode('*', $france->historique);
145
    $id_carte = $tab[(count($tab) - 1)];
145
    $id_carte = $tab[(count($tab) - 1)];
146
    $requete_historique =   'SELECT CDC_Titre_carte, CDC_Type_zone_carte, CDC_ID_Zone_geo_carte '.
146
    $requete_historique =   'SELECT CDC_Titre_carte, CDC_Type_zone_carte, CDC_ID_Zone_geo_carte '.
147
                            'FROM '.HB_BDD_NOM_CARTO.'.carto_DESCRIPTION_CARTE '.
147
                            'FROM '.HB_BDD_NOM_CARTO.'.carto_DESCRIPTION_CARTE '.
148
                            'WHERE CDC_ID_Carte = "'.$id_carte.'"';
148
                            'WHERE CDC_ID_Carte = "'.$id_carte.'"';
149
    $resultat_historique = mysql_query($requete_historique) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete_historique));
149
    $resultat_historique = mysql_query($requete_historique) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete_historique));
150
    $ligne_historique = mysql_fetch_object($resultat_historique);
150
    $ligne_historique = mysql_fetch_object($resultat_historique);
151
    $structure_nbre = hbca_consulterNbreStructure($id_carte, $ligne_historique->CDC_Type_zone_carte, $ligne_historique->CDC_ID_Zone_geo_carte);
151
    $structure_nbre = hbca_consulterNbreStructure($id_carte, $ligne_historique->CDC_Type_zone_carte, $ligne_historique->CDC_ID_Zone_geo_carte);
152
    $titre = '';
152
    $titre = '';
153
    if ($structure_nbre == 0) {
153
    if ($structure_nbre == 0) {
154
        $titre .= $ligne_historique->CDC_Titre_carte.' : aucun organisme répertorié';
154
        $titre .= $ligne_historique->CDC_Titre_carte.' : aucun organisme répertorié';
155
    } else if ($structure_nbre == 1) {
155
    } else if ($structure_nbre == 1) {
156
        $titre .= $ligne_historique->CDC_Titre_carte.' : '.$structure_nbre.' organisme répertorié';
156
        $titre .= $ligne_historique->CDC_Titre_carte.' : '.$structure_nbre.' organisme répertorié';
157
    } else {
157
    } else {
158
        $titre .= $ligne_historique->CDC_Titre_carte.' : '.$structure_nbre.' organismes répertoriés';
158
        $titre .= $ligne_historique->CDC_Titre_carte.' : '.$structure_nbre.' organismes répertoriés';
159
    }
159
    }
160
    
160
    
161
    // Sortie XHTML
161
    // Sortie XHTML
162
    $sortie .= '<h1>'.$titre.'</h1>'."\n";
162
    $sortie .= '<h1>'.$titre.'</h1>'."\n";
163
    $sortie .= '<p><strong>'.$historique_carte->afficherHistoriqueCarte().'</strong></p>'."\n";
163
    $sortie .= '<p><strong>'.$historique_carte->afficherHistoriqueCarte().'</strong></p>'."\n";
164
    
164
    
165
    $sortie .= '<h2>Cliquez sur une zone de la carte pour zoomer.</h2>'."\n";
165
    $sortie .= '<h2>Cliquez sur une zone de la carte pour zoomer.</h2>'."\n";
166
    $sortie .= '<p>La couleur est proportionnelle au nombre d\'organisations.'."\n";
166
    $sortie .= '<p>La couleur est proportionnelle au nombre d\'organisations.'."\n";
167
    
167
    
168
    $sortie .= $img_carte_france;
168
    $sortie .= $img_carte_france;
169
    
169
    
170
    $sortie .= '<h2>'.'Avertissement et déni de responsabilité : '.'</h2>'."\n";
170
    $sortie .= '<h2>'.'Avertissement et déni de responsabilité : '.'</h2>'."\n";
171
    $sortie .= '<p>'.'La représentation et l\'utilisation des frontières, des noms géographiques et autres données employés '."\n".
171
    $sortie .= '<p>'.'La représentation et l\'utilisation des frontières, des noms géographiques et autres données employés '."\n".
172
            'sur les cartes et utilisés dans les listes, les tableaux, les documents et les bases de données de ce site '."\n".
172
            'sur les cartes et utilisés dans les listes, les tableaux, les documents et les bases de données de ce site '."\n".
173
            'ne sont pas garanties sans erreurs, de même qu\'elles n\'engagent pas la responsabilité de l\'association '."\n".
173
            'ne sont pas garanties sans erreurs, de même qu\'elles n\'engagent pas la responsabilité de l\'association '."\n".
174
            'ni n\'impliquent de reconnaissance officielle de sa part.'.'</p>'."\n";
174
            'ni n\'impliquent de reconnaissance officielle de sa part.'.'</p>'."\n";
175
}
175
}
176
 
176
 
177
// +------------------------------------------------------------------------------------------------------+
177
// +------------------------------------------------------------------------------------------------------+
178
// |                                            PIED du PROGRAMME                                         |
178
// |                                            PIED du PROGRAMME                                         |
179
// +------------------------------------------------------------------------------------------------------+
179
// +------------------------------------------------------------------------------------------------------+
180
$sortie .= '<!-- Herbier - Cartographie : FIN -->'."\n";
180
$sortie .= '<!-- Herbier - Cartographie : FIN -->'."\n";
181
 
181
 
182
/* +--Fin du code ----------------------------------------------------------------------------------------+
182
/* +--Fin du code ----------------------------------------------------------------------------------------+
183
*
183
*
184
* $Log: not supported by cvs2svn $
184
* $Log: not supported by cvs2svn $
-
 
185
* Revision 1.1  2005/11/23 10:32:32  jp_milcent
-
 
186
* Ajout au dépot de l'application Herbiers.
-
 
187
* Elle doit à terme migrer dans eFlore.
-
 
188
*
185
* Revision 1.1  2005/03/09 15:55:44  jpm
189
* Revision 1.1  2005/03/09 15:55:44  jpm
186
* Ajout de l'application Cartographie des Herbiers.
190
* Ajout de l'application Cartographie des Herbiers.
187
*
191
*
188
*
192
*
189
* +-- Fin du code ----------------------------------------------------------------------------------------+
193
* +-- Fin du code ----------------------------------------------------------------------------------------+
190
*/
194
*/
191
?>
195
?>