Subversion Repositories eFlore/Applications.bibliobota

Compare Revisions

Ignore whitespace Rev 1 → Rev 2

/trunk/applications/bb_consultation/bbc_info_fascicule.inc.php
New file
0,0 → 1,234
<?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_fascicule.inc.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
/**
* Appli bb_consultation : gestion des informations avancées "fascicule" de Biblio Bota
*
* Ce fichier permet d'afficher les informations concernant les "fascicules" d'un organisme lié à 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 |
// +------------------------------------------------------------------------------------------------------+
 
global $locusfasc;
// DEBUT FASCICULE
 
// $unex est composé de :
// - [0] nom de collection
// - [1] point de départ de la requete
 
$unex = explode('-', $tableau['fasc']);
 
$tableau['locusfasc'] = $locusfasc;
if ($tableau['locusfasc'] == '') {
$tableau['locusfasc'] = 0;
}
$requete = 'SELECT '.$tbl['str'].'.B_S_IDSTR,'.$tbl['str'].'.B_S_NOM, '.$tbl['collection'].'.B_C_NOMCOMPLET '.
'FROM '.$tbl['str'].', '.$tbl['collection'].' '.
'WHERE '.$tbl['str'].'.B_S_IDSTR = '.$tbl['collection'].'.B_C_LKSTR '.
'AND B_C_CRAI = "'.$unex[0].'"';
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$nb_titre = mysql_num_rows($resultat);
 
if ($nb_titre != 1) {
$sortie .= '<p class="erreur"><strong>'.'Erreur de récupération des noms (str et coll)'.'</stong>'.' : '.
$requete.' '.'donne'.' '.$nb_titre.' '.'résultats'.'</p>'."\n";
} else {
$ligne = mysql_fetch_object($resultat);
$le_numero = $ligne->B_S_IDSTR;
$le_nom = $ligne->B_S_NOM;
$la_coll = $ligne->B_C_NOMCOMPLET;
mysql_free_result($resultat);
$tableau['args'] = '&amp;arg_0=str%3D'.$le_numero.'&amp;arg_1=coll%3D'.$le_numero.
'&amp;arg_2=book%3D'.$le_numero.'&amp;arg_3=media%3D'.$le_numero;
$tableau['pass'] = $le_numero;
 
if ($tableau['locusfasc'] > 0) {
$tableau['pstart'] = $tableau['locusfasc'];
$depart = $tableau['locusfasc'];
} else {
$depart = $tableau['pstart'];
}
if ($depart == '') {
$depart = 0;
}
// Affichage de la navigation avancée : retour aux collections
$sortie .= CreateNavigBiblio('goback', 'coll', $tableau, 'Retour aux périodiques', 1);
// Affichage du titre de la page
$sortie .= '<h1>'.$le_nom.' '.':'.' '.'fascicules'.'</h1>'."\n";
$sortie .= '<h2>'.'du périodique'.' '.$la_coll.'</h2>'."\n";
// Comptage du nombre total de données
$requete = 'SELECT COUNT(*) AS COMPTE '.
'FROM '.$tbl['serie'].', '.$tbl['fascicule'].' '.
'WHERE B_SER_CRAICOLL = B_F_CRAICOLL '.
'AND B_SER_IDSERIE = B_F_CRAISERIE '.
'AND B_F_CRAICOLL = "'.$unex[0].'" '.
'AND B_F_CACHER = 0';
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$ligne = mysql_fetch_object($resultat);
$num_c = $ligne->COMPTE;
mysql_free_result($resultat);
$requete = 'SELECT '.$tbl['serie'].'.*, '.$tbl['fascicule'].'.*, '.$tbl['collection'].'.* '.
'FROM '.$tbl['serie'].', '.$tbl['fascicule'].', '.$tbl['collection'].' '.
'WHERE B_C_CRAI = B_SER_CRAICOLL '.
'AND B_SER_CRAICOLL = B_F_CRAICOLL '.
'AND B_SER_IDSERIE = B_F_CRAISERIE '.
'AND B_F_CRAICOLL = "'.$unex[0].'" '.
'ORDER BY B_F_NUMERO DESC '.
'LIMIT '.$depart.', '.$var_biblio['how_bloc'];
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
$num = mysql_num_rows($resultat);
// Affichage du nombre de résultat trouvé
$tableau['step'] = $var_biblio['how_bloc'];
$tableau['pend'] = $num_c;
$tableau['libelle'] = 'fascicule';
$tableau['feminin'] = 0;
$tableau['locusfasc'] = $tableau['pstart'];
$sortie .= '<p id="frag_nbre_resultat">';
$sortie .= FRAG_afficherTxtNbreResultat('bbpopup', $tableau, $num, $num_c);
$sortie .= '</p>'."\n";
// Fragmenteur de pages, pour une navigation plus facile
$frag = new fragmenteur(' - ', 10, BB_URL_COURANTE_CONSULTATION_AVANCEE.'&amp;fasc='.$tableau['fasc']);
$frag_txt = $frag->fragmente($tableau, $num_c);
if (($frag->nb_pages)>1) {
$sortie .= '<p class="frag_navigation">'.$frag_txt.'</p>'."\n";
}
$sortie .= '<ul id="bb_liste_fascicule">'."\n";
while ($ligne = mysql_fetch_object($resultat)) {
$nom = $ligne->B_C_NOMCOMPLET;
$crai = $ligne->B_F_CRAICOLL;
$serie = $ligne->B_F_CRAISERIE;
$titreserie = $ligne->B_SER_SOUSTITRE;
$fasc = $ligne->B_F_NUMERO;
$titre = $ligne->B_F_TITRE;
$nbpages = $ligne->B_F_NBPAGES;
$date = $ligne->B_F_DATE;
$image = $ligne->B_F_IMAGE;
$comment = $ligne->B_F_COMMENT;
$datemaj = $ligne->B_F_MAJFICHE;
$tableau['pass'] = $crai.'-'.$serie.'-'.$fasc;
$sortie .= '<li>'."\n";
// Affichage de l'image du fascicule
if ($image != '') {
$sortie .= '<img class="bb_img_fascicule" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$image.'" alt="'.'Image de la couverture du fascicule'.'" />'."\n";
}
// Affichage des informations sur le fascicule
$sortie .= '<b>'.$nom.'</b>';
if ($titreserie != '') {
$sortie .= ', <b>'.$titreserie.'</b>';
}
$sortie .= ', '.$titre."\n";
 
if ($date > 0) {
$sortie .= ' - '.FormateDateYYYYMMJJ($date);
}
if ($nbpages > 0) {
$sortie .= ' - '.$nbpages.' p.';
}
if ($comment != '') {
$sortie .= ' - '.$comment;
}
// Comptage du nombre d'articles indexés pour le fascicule
$query_ser = 'SELECT COUNT(*) AS CPT '.
'FROM '.$tbl['article'].', '.$tbl['item'].' '.
'WHERE B_A_CRAICOLL = "'.$crai.'" '.
'AND B_A_CRAISERIE = '.$serie.' '.
'AND B_A_CRAIFASC = "'.$fasc.'" '.
'AND B_I_IDITEM = B_A_IDART '.
'AND B_I_CACHER = 0';
$result_ser = mysql_query($query_ser) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_ser));
$nb_ser = mysql_num_rows($result_ser);
if($nb_ser != 1) {
die ('<p><b>'.'Echec du programme'.' '.':'.' '.'</b> '.'Nombre de comptages incohérent'.' '.'('.$nb_ser.')'.'</p>'."\n");
}
$row_ser = mysql_fetch_object($result_ser);
$intobiblio = $row_ser->CPT;
mysql_free_result($result_ser);
// Affichage de la consultation des articles
if ($intobiblio > 1) {
$pluriel_art = 's';
} else {
$pluriel_art = '';
}
if ($intobiblio > 0) {
$sortie .= CreateNavigBiblio('goto', 'art', $tableau, $intobiblio.' article'.$pluriel_art.' '.'indexé'.$pluriel_art, 0);
}
// Affichage des Voir Aussi Fascicules ... s'il y'en a
$UnVoirAussi = new VoirAussi($crai.'-'.$serie.'-'.$fasc, $tbl['fascicule']);
if ($UnVoirAussi->NbVA > 0) {
$sortie .= ' '.'-'.' '.'Consulter'.' '.':'.' ';
$liste_va = $UnVoirAussi->ListerVoirAussi();
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'] != '') {
$ret .= ' - '.'<em>'.$liste_va[$i]['desc'].'</em>';
}
}
}
$sortie .= '</li>'."\n";
}
$sortie .= '</ul>'."\n";
mysql_free_result($resultat);
}
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>