Subversion Repositories eFlore/Applications.bibliobota

Rev

Rev 6 | Rev 9 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
// +------------------------------------------------------------------------------------------------------+
// | PHP version 5.1.1                                                                                    |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of eFlore.                                                                         |
// |                                                                                                      |
// | Foobar is free software; you can redistribute it and/or modify                                       |
// | it under the terms of the GNU General Public License as published by                                 |
// | the Free Software Foundation; either version 2 of the License, or                                    |
// | (at your option) any later version.                                                                  |
// |                                                                                                      |
// | Foobar 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 General Public License for more details.                                                         |
// |                                                                                                      |
// | You should have received a copy of the GNU General Public License                                    |
// | along with Foobar; if not, write to the Free Software                                                |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id$
/**
* Titre
*
* Description
*
*@package eFlore
*@subpackage ef_fiche
//Auteur original :
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author        aucun
*@copyright     Tela-Botanica 2000-2006
*@version       $Revision$ $Date$
// +------------------------------------------------------------------------------------------------------+
*/

// +------------------------------------------------------------------------------------------------------+
// |                                            ENTETE du PROGRAMME                                       |
// +------------------------------------------------------------------------------------------------------+
/** Inclusion du fichier de configuration de l'application Revue. */
//require_once BB_CHEMIN_APPLI.'bb_revue/configuration/bbre_config.inc.php';

// +------------------------------------------------------------------------------------------------------+
// |                                            CORPS du PROGRAMME                                        |
// +------------------------------------------------------------------------------------------------------+
// Initialisation de la variable à retourner
$retour = '';
$retour .= '<!-- BiblioBota - Revue : DEBUT -->'."\n";
$retour .= '<div id="biblio_revue">';
// Titre de la page
$retour .= '<h1>'.'Liste des revues indexées dans la base de données du projet BiblioBota.'.'</h1>';

$query_tot =    'SELECT COUNT(*) AS cpt '.
                                'FROM '.$GLOBALS['tbl']['collection'].' '.
                                'WHERE B_C_CACHER = 0';
$do_query_tot = mysql_query($query_tot) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_tot));
$tmp_total = mysql_fetch_object($do_query_tot);
$nb_total = $tmp_total->cpt;
mysql_free_result($do_query_tot);

if ($nb_total == 0) {
        $retour .= '<p>'.'Pas encore de revues indexées...'.'</p>'."\n";
} else {
    $query =    'SELECT '.$GLOBALS['tbl']['collection'].'.* '.
                'FROM '.$GLOBALS['tbl']['collection'].' '.
                'WHERE B_C_CACHER = 0 '.
                'ORDER BY B_C_NOMCOMPLET ';
        $do_query = mysql_query($query) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query));
        $nb_results = mysql_num_rows($do_query);
        
        $o = 1;
        $retour .= '<table id="liste_biblio_revue" class="table_bordure" summary="Tableau résumant les informations sur les revues indexées dans la base de données du projet BiblioBota.">'."\n";
        $retour .= '<thead><tr>'.
                        '<th>Collection</th>'.
                        '<th>Abreviation</th>'.
                        '<th>Date début</th>'.
                        '<th>Date fin</th>'.
                        '<th>Périodicité</th>'.
                        '<th>Contact</th>'.
                        '<th title="Nom du dernier fascicule dans la dernière série">Dernier fascicule</th>'.
                        '<th title="Nombre de fascicules dans la dernière série">Nombre fascicule</th>'.
                        '<th title="Date de mise à jour du dernier fascicule dans la dernière série">Date dernier fascicule</th>'.
                        '</tr></thead>'."\n";
        while ($row = mysql_fetch_object($do_query)) {
                $query_fasc =   'SELECT B_SER_SOUSTITRE, '.$GLOBALS['tbl']['fascicule'].'.* '.
                                'FROM '.$GLOBALS['tbl']['fascicule'].' INNER JOIN '.$GLOBALS['tbl']['serie'].' ON B_F_CRAISERIE = B_SER_IDSERIE AND B_F_CRAICOLL = B_SER_CRAICOLL '.                            
                                'WHERE  B_F_CRAICOLL = "'.$row->B_C_CRAI.'" '.
                                'AND B_F_CACHER = 0 '.
                                'ORDER BY B_F_CRAISERIE, B_F_NUMERO DESC';
                //echo $query_fasc;
                $do_query_fasc = mysql_query($query_fasc) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_fasc));
                $aso_fasc_serie = array();
                while ($row_fasc = mysql_fetch_object($do_query_fasc)) {
                        if (!isset($aso_fasc_serie[$row_fasc->B_F_CRAISERIE])) {
                                $aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['nbre_fasc'] = 1;
                                $aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['nom_fin_serie'] = $row_fasc->B_SER_SOUSTITRE;
                                $aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['nom_fin_fasc'] = $row_fasc->B_F_TITRE;
                                $aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['date_fin_fasc'] = date('d/m/Y', $row_fasc->B_F_MAJFICHE);
                        } else {
                                $aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['nbre_fasc']++;
                        }
                }
                ksort($aso_fasc_serie, SORT_DESC);
        $id = $row->B_C_CRAI;
        $idlink = $row->B_C_IDLINK;
        $nom_complet = $row->B_C_NOMCOMPLET;
        $abreviation = $row->B_C_ABREGE;
        $date_debut = $row->B_C_DATECREATION;
        $suite_de = $row->B_C_FAISUITE;
        $date_fin = $row->B_C_DATEFIN;
        $periodicite = $row->B_C_PERIODICITE;
        $contact_nom = $row->B_C_CONTACTNOM;
        $contact_mail = $row->B_C_CONTACTMAIL;
        $logo = $row->B_C_IMAGE;
        $commentaires = $row->B_C_COMMENT;
        $date_maj = $row->B_C_MAJFICHE;
                $retour .= '<tbody><tr>';
                $retour .= '<th>';
        if ($nom_complet != '') {
            $retour .= '<h5 class="bbre_titre">'.$nom_complet.'</h5>';
            if ($suite_de != '') {
                                $retour .= '<p><span class="bb_intitule">Fait suite à :</span> '.$suite_de.'</p>';
                        }
            if ($commentaires != '') {
                $retour .= '<p>'.$commentaires.'</p>';
                }
            if ($logo != '') {
                $retour .= '<img class="bbre_couverture" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$logo.'" alt="Couverture de la revue '.$nom_complet.'"/>';
                }
                $retour .= '<p class="texte_inactif">Id. coll. : '.$id.' - Mise à jour : '.date('d/m/Y', $date_maj).'</p>';
                
        }
        $retour .= '</th>';
                $retour .= '<td>';
                if ($abreviation != '') {
                        $retour .= $abreviation;
                }
                $retour .= '</td>';
                $retour .= '<td>';
                if ($date_debut != '') {
                        $retour .= $date_debut;
                }
                $retour .= '</td>';
                $retour .= '<td>';
                if ($date_fin != '') {
                        $retour .= $date_fin;
                }
                $retour .= '</td>';
                $retour .= '<td>';
                if ($periodicite != '') {
                        $retour .= $periodicite;
                }
                $retour .= '</td>';
                $retour .= '<td>';
                if ($contact_nom != '') {
                        if ($contact_mail != '') {
                                $retour .= '<a href="mailto:'.$contact_mail.'">'.$contact_nom.'</a>';
                        } else {
                                $retour .= $contact_nom;
                        }
                }
                $retour .= '</td>';
                $retour .= '<td>';
                $aso_fasc = current($aso_fasc_serie);
                $retour .= $aso_fasc['nom_fin_fasc'];
                $retour .= '</td>';
                $retour .= '<td>';
                $retour .= $aso_fasc['nbre_fasc'];
                $retour .= '</td>';
                $retour .= '<td>';
                $retour .= $aso_fasc['date_fin_fasc'];
                $retour .= '</td>';
                $retour .= '</tr></tbody>'."\n";
        $o++;
    }
    $retour .= '</table>'."\n";
    mysql_free_result($do_query);
}
$retour .= '</div>';
$retour .= '<!-- BiblioBota - Revue : FIN -->'."\n";
$sortie .= $retour;

/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log$
* Revision 1.2  2006/05/29 14:19:07  jp_milcent
* Ajout d'une classe css à l'image de la couverture de la revue.
* Correction du chemin d'accés à l'image.
*
* Revision 1.1  2006/05/23 16:20:50  jp_milcent
* Ajout de l'application affichant la liste des revues disponibles dans la base de données de BiblioBota.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>