Subversion Repositories eFlore/Applications.bibliobota

Rev

Rev 8 | Rev 18 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 jp_milcent 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 5.1.1                                                                                    |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of eFlore.                                                                         |
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$
25
/**
26
* Titre
27
*
28
* Description
29
*
30
*@package eFlore
31
*@subpackage ef_fiche
32
//Auteur original :
33
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
34
//Autres auteurs :
35
*@author        aucun
36
*@copyright     Tela-Botanica 2000-2006
37
*@version       $Revision$ $Date$
38
// +------------------------------------------------------------------------------------------------------+
39
*/
40
 
41
// +------------------------------------------------------------------------------------------------------+
42
// |                                            ENTETE du PROGRAMME                                       |
43
// +------------------------------------------------------------------------------------------------------+
44
/** Inclusion du fichier de configuration de l'application Revue. */
45
//require_once BB_CHEMIN_APPLI.'bb_revue/configuration/bbre_config.inc.php';
46
 
47
// +------------------------------------------------------------------------------------------------------+
48
// |                                            CORPS du PROGRAMME                                        |
49
// +------------------------------------------------------------------------------------------------------+
50
// Initialisation de la variable à retourner
51
$retour = '';
52
$retour .= '<!-- BiblioBota - Revue : DEBUT -->'."\n";
8 jp_milcent 53
$retour .= '<div id="biblio_revue">';
5 jp_milcent 54
// Titre de la page
8 jp_milcent 55
$retour .= '<h1>'.'Liste des revues indexées dans la base de données du projet BiblioBota.'.'</h1>';
5 jp_milcent 56
 
57
$query_tot =	'SELECT COUNT(*) AS cpt '.
58
				'FROM '.$GLOBALS['tbl']['collection'].' '.
59
				'WHERE B_C_CACHER = 0';
60
$do_query_tot = mysql_query($query_tot) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_tot));
61
$tmp_total = mysql_fetch_object($do_query_tot);
62
$nb_total = $tmp_total->cpt;
63
mysql_free_result($do_query_tot);
64
 
65
if ($nb_total == 0) {
66
	$retour .= '<p>'.'Pas encore de revues indexées...'.'</p>'."\n";
67
} else {
68
    $query =    'SELECT '.$GLOBALS['tbl']['collection'].'.* '.
69
                'FROM '.$GLOBALS['tbl']['collection'].' '.
70
                'WHERE B_C_CACHER = 0 '.
71
                'ORDER BY B_C_NOMCOMPLET ';
72
	$do_query = mysql_query($query) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query));
73
	$nb_results = mysql_num_rows($do_query);
74
 
75
	$o = 1;
8 jp_milcent 76
	$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";
77
	$retour .= '<thead><tr>'.
78
			'<th>Collection</th>'.
79
			'<th>Date début</th>'.
80
			'<th>Date fin</th>'.
9 jp_milcent 81
			'<th title="Nombre de fascicules pour la collection, toutes séries confondues">Nombre fascicules</th>'.
8 jp_milcent 82
			'<th>Périodicité</th>'.
83
			'<th>Contact</th>'.
84
			'<th title="Nom du dernier fascicule dans la dernière série">Dernier fascicule</th>'.
85
			'<th title="Date de mise à jour du dernier fascicule dans la dernière série">Date dernier fascicule</th>'.
86
			'</tr></thead>'."\n";
5 jp_milcent 87
	while ($row = mysql_fetch_object($do_query)) {
9 jp_milcent 88
		$query_fasc =	'SELECT '.$GLOBALS['tbl']['fascicule'].'.* '.
89
                		'FROM '.$GLOBALS['tbl']['fascicule'].' '.
90
						'WHERE  B_F_CRAICOLL = "'.$row->B_C_CRAI.'" '.
91
						'AND B_F_CACHER = 0 '.
92
						'ORDER BY B_F_CRAISERIE, B_F_NUMERO DESC';
8 jp_milcent 93
		//echo $query_fasc;
94
		$do_query_fasc = mysql_query($query_fasc) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_fasc));
95
		$aso_fasc_serie = array();
9 jp_milcent 96
		$aso_fasc = array();
8 jp_milcent 97
		while ($row_fasc = mysql_fetch_object($do_query_fasc)) {
98
			if (!isset($aso_fasc_serie[$row_fasc->B_F_CRAISERIE])) {
9 jp_milcent 99
				$aso_fasc_serie[$row_fasc->B_F_CRAISERIE] = $row_fasc->B_F_CRAISERIE;
100
				$aso_fasc['nbre_fasc'] = 1;
101
				$aso_fasc['nom_fin_serie'] = $row_fasc->B_SER_SOUSTITRE;
102
				$aso_fasc['nom_fin_fasc'] = $row_fasc->B_F_TITRE;
103
				$aso_fasc['date_fin_fasc'] = date('d/m/Y', $row_fasc->B_F_MAJFICHE);
8 jp_milcent 104
			} else {
9 jp_milcent 105
				$aso_fasc['nbre_fasc']++;
8 jp_milcent 106
			}
107
		}
108
		ksort($aso_fasc_serie, SORT_DESC);
5 jp_milcent 109
        $id = $row->B_C_CRAI;
110
        $idlink = $row->B_C_IDLINK;
111
        $nom_complet = $row->B_C_NOMCOMPLET;
112
        $abreviation = $row->B_C_ABREGE;
113
        $date_debut = $row->B_C_DATECREATION;
114
        $suite_de = $row->B_C_FAISUITE;
115
        $date_fin = $row->B_C_DATEFIN;
116
        $periodicite = $row->B_C_PERIODICITE;
117
        $contact_nom = $row->B_C_CONTACTNOM;
118
        $contact_mail = $row->B_C_CONTACTMAIL;
119
        $logo = $row->B_C_IMAGE;
120
        $commentaires = $row->B_C_COMMENT;
121
        $date_maj = $row->B_C_MAJFICHE;
8 jp_milcent 122
		$retour .= '<tbody><tr>';
123
		$retour .= '<th>';
5 jp_milcent 124
        if ($nom_complet != '') {
125
            $retour .= '<h5 class="bbre_titre">'.$nom_complet.'</h5>';
8 jp_milcent 126
            if ($suite_de != '') {
9 jp_milcent 127
				$retour .= '<p><span class="bb_intitule">Fait suite à : </span>'.$suite_de.'</p>';
8 jp_milcent 128
			}
9 jp_milcent 129
			if ($abreviation != '') {
130
				$retour .= '<p><span class="bb_intitule">Abréviation : </span>'.$abreviation.'</p>';
131
			}
5 jp_milcent 132
            if ($commentaires != '') {
133
            	$retour .= '<p>'.$commentaires.'</p>';
134
        	}
135
            if ($logo != '') {
8 jp_milcent 136
            	$retour .= '<img class="bbre_couverture" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$logo.'" alt="Couverture de la revue '.$nom_complet.'"/>';
5 jp_milcent 137
        	}
8 jp_milcent 138
        	$retour .= '<p class="texte_inactif">Id. coll. : '.$id.' - Mise à jour : '.date('d/m/Y', $date_maj).'</p>';
139
 
5 jp_milcent 140
        }
8 jp_milcent 141
        $retour .= '</th>';
142
		$retour .= '<td>';
5 jp_milcent 143
		if ($date_debut != '') {
8 jp_milcent 144
			$retour .= $date_debut;
5 jp_milcent 145
		}
8 jp_milcent 146
		$retour .= '</td>';
147
		$retour .= '<td>';
5 jp_milcent 148
		if ($date_fin != '') {
8 jp_milcent 149
			$retour .= $date_fin;
5 jp_milcent 150
		}
8 jp_milcent 151
		$retour .= '</td>';
152
		$retour .= '<td>';
9 jp_milcent 153
		$retour .= $aso_fasc['nbre_fasc'];
154
		$retour .= '</td>';
155
		$retour .= '<td>';
5 jp_milcent 156
		if ($periodicite != '') {
8 jp_milcent 157
			$retour .= $periodicite;
5 jp_milcent 158
		}
8 jp_milcent 159
		$retour .= '</td>';
160
		$retour .= '<td>';
5 jp_milcent 161
		if ($contact_nom != '') {
162
			if ($contact_mail != '') {
8 jp_milcent 163
				$retour .= '<a href="mailto:'.$contact_mail.'">'.$contact_nom.'</a>';
5 jp_milcent 164
			} else {
8 jp_milcent 165
				$retour .= $contact_nom;
5 jp_milcent 166
			}
167
		}
8 jp_milcent 168
		$retour .= '</td>';
169
		$retour .= '<td>';
170
		$retour .= $aso_fasc['nom_fin_fasc'];
171
		$retour .= '</td>';
172
		$retour .= '<td>';
173
		$retour .= $aso_fasc['date_fin_fasc'];
174
		$retour .= '</td>';
175
		$retour .= '</tr></tbody>'."\n";
5 jp_milcent 176
        $o++;
177
    }
8 jp_milcent 178
    $retour .= '</table>'."\n";
5 jp_milcent 179
    mysql_free_result($do_query);
180
}
8 jp_milcent 181
$retour .= '</div>';
5 jp_milcent 182
$retour .= '<!-- BiblioBota - Revue : FIN -->'."\n";
183
$sortie .= $retour;
184
 
185
/* +--Fin du code ----------------------------------------------------------------------------------------+
186
*
187
* $Log$
9 jp_milcent 188
* Revision 1.3  2006/07/28 12:46:47  jp_milcent
189
* Début modification de l'interface de l'appli revue.
190
*
8 jp_milcent 191
* Revision 1.2  2006/05/29 14:19:07  jp_milcent
192
* Ajout d'une classe css à l'image de la couverture de la revue.
193
* Correction du chemin d'accés à l'image.
194
*
6 jp_milcent 195
* Revision 1.1  2006/05/23 16:20:50  jp_milcent
196
* Ajout de l'application affichant la liste des revues disponibles dans la base de données de BiblioBota.
5 jp_milcent 197
*
6 jp_milcent 198
*
5 jp_milcent 199
* +-- Fin du code ----------------------------------------------------------------------------------------+
200
*/
201
?>