2 |
jp_milcent |
1 |
<?php
|
|
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
|
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
4 |
// | PHP version 4.1 |
|
|
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
6 |
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) |
|
|
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
8 |
// | This file is part of Herbier - Cartographie. |
|
|
|
9 |
// | |
|
|
|
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 |
|
|
|
12 |
// | the Free Software Foundation; either version 2 of the License, or |
|
|
|
13 |
// | (at your option) any later version. |
|
|
|
14 |
// | |
|
|
|
15 |
// | Foobar is distributed in the hope that it will be useful, |
|
|
|
16 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
17 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
|
18 |
// | GNU General Public License for more details. |
|
|
|
19 |
// | |
|
|
|
20 |
// | You should have received a copy of the GNU General Public License |
|
|
|
21 |
// | along with Foobar; if not, write to the Free Software |
|
|
|
22 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
24 |
// CVS : $Id: hbca_herbier_liste.inc.php,v 1.1 2005-11-23 10:32:32 jp_milcent Exp $
|
|
|
25 |
/**
|
|
|
26 |
* Liste des herbiers d'une zone géographique.
|
|
|
27 |
*
|
|
|
28 |
* Fichier fournissant la liste des herbiers présents dans une zone géographique donnée.
|
|
|
29 |
*
|
|
|
30 |
*@package Herbier-Cartographie
|
|
|
31 |
//Auteur original :
|
|
|
32 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
|
|
33 |
//Autres auteurs :
|
|
|
34 |
*@author Jean-Pascal MILCENT <jpm@clapas.org>
|
|
|
35 |
*@copyright Tela-Botanica 2000-2005
|
|
|
36 |
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:32:32 $
|
|
|
37 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
38 |
*/
|
|
|
39 |
|
|
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
41 |
// | ENTETE du PROGRAMME |
|
|
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
46 |
// | CORPS du PROGRAMME |
|
|
|
47 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
48 |
$tab = explode ('*',$france->historique);
|
|
|
49 |
$numero_departement = $tab[1];
|
|
|
50 |
|
|
|
51 |
$requete_dpt = 'SELECT GFD_NAME '.
|
|
|
52 |
'FROM '.HB_BDD_NOM_CARTO.'.gen_FRENCH_DPT '.
|
|
|
53 |
'WHERE GFD_ID = '.$numero_departement;
|
|
|
54 |
$resultat_dpt = mysql_query($requete_dpt) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete_dpt));
|
|
|
55 |
$ligne_dpt = mysql_fetch_object($resultat_dpt);
|
|
|
56 |
$sortie .= '<h1>'.'Herbiers du département : '.$ligne_dpt->GFD_NAME.'</h1>'."\n";
|
|
|
57 |
|
|
|
58 |
$requete_info = 'SELECT gen_FRENCH_DPT.GFD_NAME, HERBIERS_ORGANISATION.INSTITUTION_NAME, '.
|
|
|
59 |
'HERBIERS_ORGANISATION.ID_ORG, HERBIERS_ORGANISATION.TOWN '.
|
|
|
60 |
'FROM '.HB_BDD_NOM_CARTO.'.gen_FRENCH_DPT, '.HB_BDD_NOM.'.HERBIERS_ORGANISATION '.
|
|
|
61 |
'WHERE gen_FRENCH_DPT.GFD_ID = '.$numero_departement.' '.
|
|
|
62 |
'AND gen_FRENCH_DPT.GFD_ID = '.
|
|
|
63 |
'if (substring(ZIP,1,2) <> "97", '.
|
|
|
64 |
'if (substring(ZIP,1,2) <> "98", substring(ZIP, 1,2),substring(ZIP,1,3)) , substring(ZIP,1,3))';
|
|
|
65 |
$resultat_info = mysql_query($requete_info) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete_info));
|
|
|
66 |
if (mysql_num_rows($resultat_info) != 0) {
|
|
|
67 |
$sortie .= '<ul>'."\n";
|
|
|
68 |
// Une boucle sur chaque résultat, on affiche la ville et le nom de l'institution
|
|
|
69 |
while ($ligne_info = mysql_fetch_object($resultat_info)) {
|
|
|
70 |
$sortie .= '<li><a href="'.sprintf(HB_URL_COURANTE_CONSULTATION_FICHE_HERBIER_ID, $ligne_info->ID_ORG).'">'.
|
|
|
71 |
$ligne_info->TOWN.' - '.$ligne_info->INSTITUTION_NAME.'</a></li>'."\n";
|
|
|
72 |
}
|
|
|
73 |
$sortie .= '</ul>'."\n";
|
|
|
74 |
} else {
|
|
|
75 |
$sortie .= '<p>'.'Il n\'y a aucun herbier dans ce département... '."\n".
|
|
|
76 |
'<a href="'.HB_URL_COURANTE.'" hreflang="fr">'.'Retour à la cartographie'.'</a>'."\n".
|
|
|
77 |
'</p>'."\n";
|
|
|
78 |
}
|
|
|
79 |
|
|
|
80 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
81 |
// | PIED du PROGRAMME |
|
|
|
82 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
83 |
|
|
|
84 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
85 |
*
|
|
|
86 |
* $Log: not supported by cvs2svn $
|
|
|
87 |
* Revision 1.1 2005/03/09 15:55:44 jpm
|
|
|
88 |
* Ajout de l'application Cartographie des Herbiers.
|
|
|
89 |
*
|
|
|
90 |
*
|
|
|
91 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
92 |
*/
|
|
|
93 |
?>
|