Subversion Repositories eFlore/Applications.bibliobota

Compare Revisions

Regard whitespace Rev 1 → Rev 2

/trunk/applications/bb_consultation/bbc_info_structure.inc.php
New file
0,0 → 1,318
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: bbc_info_structure.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Appli bb_consultation : gestion des informations avancées "structure" de Biblio Bota
*
* Ce fichier permet d'afficher les informations sur les organismes liés à la botanique.
*
*@package BiblioBota-Consultation
//Auteur original :
*@author Jean-Charles GRANGER <tela@vecteur.org>
//Autres auteurs :
*@author Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
 
// +------------------------------------------------------------------------------------------------------+
// | CORPS du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
if ($var_biblio['open_proposer_str'] == 1) {
// Si Open Moderation est ouvert, alors proposer la modification des données
$the_url_edit = BB_URL_COURANTE_ADMIN.'&amp;action=edit&ensemble=str&amp;ref='.$tableau['str'];
$sortie .= '<p>'."\n";
$sortie .= '<a href="'.$the_url_edit.'">'."\n".
'<img class="'.BB_CLASS_IMG_MODIFIER.'" src="'.BB_IMG_MODIFIER.'" alt="'.'Modifier la fiche structure'.'" />'."\n".
'</a>'."\n";
$sortie .= '<a class="texte_tb2" href="'.$the_url_edit.'">'.'Corriger la fiche...'.'</a>'."\n";
$sortie .= '</p>'."\n";
}
 
$query = 'SELECT * '.
'FROM '.$tbl['str'].', '.$tbl['pays'].', '.$tbl['typestr'].' '.
'WHERE ('.$tbl['str'].'.B_S_IDSTR = '.$tableau['str'].') '.
'AND ('.$tbl['str'].'.B_S_TYPESTR = '.$tbl['typestr'].'.B_TYPSTR_ID) '.
'AND ('.$tbl['str'].'.B_S_PAYS = '.$tbl['pays'].'.GC_ID) '.
'AND ('.$tbl['pays'].'.GC_LOCALE = "'.$GLOBALS['_GEN_commun']['i18n'].'")';
$do_query = mysql_query($query) or die('<b>Erreur de requête (choix de structure)</b> : '.$query);
$nb = mysql_num_rows($do_query);
 
if ($nb == 0) {
$sortie .= '<p class="erreur">'.
'<b>Erreur !</b> :<br /><br/>aucune structure ne correspond à l\'identifiant str='.$tableau['str'].'.'.
'</p>'."\n";
} else if ($nb > 1) {
$sortie .= '<p class="erreur">'.
'<b>Erreur !</b> :<br /><br />le moteur bbc_information a trouvé plusieurs données pour l\'identifiant str='.$tableau['str'].'.'.
'</p>'."\n";
} else {
$row = mysql_fetch_object($do_query);
$get_nom = $row->B_S_NOM;
$get_sigle = $row->B_S_SIGLE;
$get_service = $row->B_S_SERVICE;
$get_typestr = $row->B_TYPSTR_LABEL;
$get_numtypestr = $row->B_S_TYPESTR;
$get_datecreation = $row->B_S_DATECREATION;
$get_nbrperso = $row->B_S_NBRPERSO;
$get_vocactiv = $row->B_S_VOCACTIV;
$get_adresse1 = $row->B_S_ADRESSE1;
$get_adresse2 = $row->B_S_ADRESSE2;
$get_cp = $row->B_S_CODEPOSTAL;
$get_ville = $row->B_S_VILLE;
$get_pays = $row->GC_NAME;
$get_tel = $row->B_S_TEL;
$get_fax = $row->B_S_FAX;
$get_mail = $row->B_S_MAIL;
$get_image = $row->B_S_IMAGE;
$get_comment = $row->B_S_COMMENT;
$get_majfiche = $row->B_S_MAJFICHE;
mysql_free_result($do_query);
// Titre de la structure
$sortie .= '<h1 class="titlePage">';
$sortie .= $get_nom;
if ($get_sigle != '') {
$sortie .= ' ('.$get_sigle.')';
}
$sortie .= '</h1>'."\n";
// Type de structure et vocation
$sortie .= '<h2 class="insTitle1">'.'Type de structure, vocation'.'</h2>'."\n";
$sortie .= '<p>'."\n";
if ($get_typestr != '') {
$sortie .= '<span class="champ_cle">'.'Type de structure :'.'</span> <span class="champ_valeur">'.$get_typestr.'</span>'."\n";
}
if ($get_vocactiv != '') {
if ($get_typestr != '') {
$sortie .= '<br />'."\n";
}
$sortie .= '<span class="champ_cle">'.'Vocation / Activité :'.'</span> <span class="champ_valeur">'.$get_vocactiv.'</span>'."\n";
}
$sortie .= '</p>'."\n";
// Bloc d'adresse
$sortie .= '<h2 class="insTitle1">'.'Adresse'.'</h2>'."\n";
$sortie .= '<p>'."\n";
if ($get_service != '') {
$sortie .= $get_service."\n";
}
if ($get_adresse1 != '') {
if ($get_service != '') {
$sortie .= '<br />'."\n";
}
$sortie .= $get_adresse1."\n";
}
if ($get_adresse2 != '') {
if (($get_service != '') || ($get_adresse1 != '')) {
$sortie .= '<br />'."\n";
}
$sortie .= $get_adresse2."\n";
}
if ($get_cp != '') {
if (($get_service != '') || ($get_adresse1 != '') || ($get_adresse2 != '')) {
$sortie .= '<br />'."\n";
}
$sortie .= $get_cp."\n";
}
if ($get_ville != '') {
$sortie .= ' '.$get_ville."\n";
}
if ($get_pays != '') {
if (($get_service != '') || ($get_adresse1 != '') || ($get_ville != '') || ($get_cp != '')) {
$sortie .= '<br />'."\n";
}
$sortie .= $get_pays."\n";
}
// Bloc contact
$sortie .= '<br /><br />'."\n";
if ($get_tel != '') {
$sortie .= '<span class="champ_cle">'.'Téléphone :'.'</span> <span class="champ_valeur">'.$get_tel.'</span>'."\n";
}
if ($get_fax != '') {
if ($get_tel != '') {
$sortie .= '<br />'."\n";
}
$sortie .= '<span class="champ_cle">'.'Fax :'.'</span> <span class="champ_valeur">'.$get_fax.'</span>'."\n";
}
if ($get_mail != '') {
if (($get_fax != '') || ($get_tel != '')) {
$sortie .= '<br />'."\n";
}
$sortie .= '<span class="champ_cle">'.'Courriel :'.'</span> '.
'<span class="champ_valeur"> '.
'<a href="mailto:'.$get_mail.'">'.$get_mail.'</a>'.
'</span>'."\n";
}
// Logo ou image de la structure
if ($get_image != '') {
$sortie .= '<img class="bb_img_structure" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$get_image.'" '.
'alt="'.'Illustration de la structure : '.$get_nom.'" />';
}
$sortie .= '</p>'."\n";
// Bloc info supplémentaires
if ($get_nbrperso > 0 OR $get_datecreation > 0 OR $get_comment != '') {
$sortie .= '<h2 class="insTitle1">'.'Informations supplémentaires'.'</h2>'."\n";
$sortie .= '<p>'."\n";
// Calcul de la date de création
if ($get_datecreation > 0) {
$sortie .= '<span class="champ_cle">'.'Date de création :'.'</span> '.
'<span class="champ_valeur">'.FormateDateYYYYMMJJ($get_datecreation).'</span>'."\n";
}
// Nbre de salariés ou de membres
if ($get_nbrperso > 0) {
if ($get_datecreation > 0) {
$sortie .= '<br />'."\n";
}
if ($get_numtypestr == 3) {
$sticker = 'salariés';
} else {
$sticker = 'membres';
}
$sortie .= '<span class="champ_cle">'.'Nombre de '.$sticker.' :'.'</span> '.
'<span class="champ_valeur">'.$get_nbrperso.'</span>'."\n";
}
// Info - commentaires
if ($get_comment != '') {
if (($get_datecreation > 0) || ($get_nbrperso > 0)) {
$sortie .= '<br />'."\n";
}
$sortie .= '<span class="champ_cle">'.'Informations complémentaires :'.'</span> '.
'<span class="champ_valeur">'.$get_comment.'</span>'."\n";
}
$sortie .= '</p>'."\n";
}
// A partir d'ici on affiche les liens de la structure
$sortie .= '<h2 class="insTitle1">'.'Liens web'.'</h2>'."\n";
$sortie .= '<p>'."\n";
$query_lk = 'SELECT '.$tbl['link'].'.* '.
'FROM '.$tbl['link'].' '.
'WHERE '.$tbl['link'].'.B_L_LKSTR = '.$tableau['str'].' '.
'AND B_L_CACHER = 0 '.
'ORDER BY B_L_TITRE';
$do_query_lk = mysql_query($query_lk) or die('<b>Erreur de requête (liens web)</b> : '.$query_lk);
$nb_lk = mysql_num_rows($do_query_lk);
if ($nb_lk == 0) {
$sortie .= 'Pas de lien web référencé.';
} else {
$o = 1;
while ($row = mysql_fetch_object($do_query_lk)) {
$idlink = $row->B_L_IDLINK;
$titrelink = $row->B_L_TITRE;
$urllink = $row->B_L_URL;
$resumlink = $row->B_L_RESUMCLE;
$comlink = $row->B_L_COMMENT;
$datelink = $row->B_L_MAJFICHE;
$get_part = $row->B_L_PARTENAIRE;
$get_ref = $row->B_L_REFERENCE;
$sortie .= '<img class="'.BB_CLASS_IMG_WEB.'" src="'.BB_IMG_WEB.'" alt="'.'Lien Web'.'" /> '."\n";
$sortie .= '<a href="'.$urllink.'" target="_blank">';
if ($titrelink != '') {
$sortie .= $titrelink;
} else {
$sortie .= $urllink;
}
$sortie .= '</a>'."\n";
if ($resumlink != '') {
$sortie .= ' - '.$resumlink;
}
if ($comlink != '') {
$sortie .= ' - '.$comlink;
}
// if ($datelink > 0) $sortie .= " [".date('d/m/Y',$datelink)."]";
if (($nb_lk - $o) > 0) {
$sortie .= '<br />'."\n";
}
if ($get_ref == 1) {
$sortie .= ' <img class="'.BB_CLASS_IMG_REFERENCE.'" src="'.BB_IMG_REFERENCE.'" alt="'.'Site Référence'.'" /> '."\n";
}
if ($get_part == 1) {
$sortie .= ' <img class="'.BB_CLASS_IMG_PARTENAIRE.'" src="'.BB_IMG_PARTENAIRE.'" alt="'.'Site Partenaire de Tela Botanica'.'" /> '."\n";
}
$o++;
}
}
$sortie .= '</p>'."\n";
mysql_free_result($do_query_lk);
// Là on affiche les Voir Aussi Structures ... si y'en a
$UnVoirAussi = new VoirAussi($tableau['str'],$tbl['str']);
if ($UnVoirAussi->NbVA > 0) {
$liste_va = $UnVoirAussi->ListerVoirAussi();
$sortie .= '<h2 class="insTitle1">'.'Voir Aussi'.'</h2>'."\n";
for ($i = 0; $i == (($UnVoirAussi->NbVA) - 1); $i++) {
$sortie .= '<img class="'.BB_CLASS_IMG_ICONE.'" src="'.$liste_va[$i]['icon_src'].'" alt="'.$liste_va[$i]['icon_alt'].'" /> ';
$sortie .= '<a '.$liste_va[$i]['target'].'>'.$liste_va[$i]['texte'].'</a>';
if ($liste_va[$i]['desc'] != '') {
$sortie .= ' - '.'<i>'.$liste_va[$i]['desc'].'</i>';
}
if (($i != 0) && ($i < ($UnVoirAussi->NbVA))) {
$sortie .= '<br />'."\n";
}
}
$sortie .= '<br />'."\n";
}
// Affichage des méta données
$sortie .= '<p class="bb_txt_centre texte_inactif">'.
'Dernière mise à jour de la fiche : '.date('d/m/Y',$get_majfiche).' - fiche '.$tableau['str'].
'</p>'."\n\n";
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/05/17 10:10:08 jpm
* Correction des bogues avant mise en ligne du site v4.
*
* Revision 1.1 2004/09/16 12:06:31 jpm
* Décomposition du fichier information en plusieurs fichiers.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>