Subversion Repositories eFlore/Applications.bibliobota

Rev

Rev 6 | Rev 9 | 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>Abreviation</th>'.
80
			'<th>Date début</th>'.
81
			'<th>Date fin</th>'.
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="Nombre de fascicules dans la dernière série">Nombre fascicule</th>'.
86
			'<th title="Date de mise à jour du dernier fascicule dans la dernière série">Date dernier fascicule</th>'.
87
			'</tr></thead>'."\n";
5 jp_milcent 88
	while ($row = mysql_fetch_object($do_query)) {
8 jp_milcent 89
		$query_fasc =	'SELECT B_SER_SOUSTITRE, '.$GLOBALS['tbl']['fascicule'].'.* '.
90
                		'FROM '.$GLOBALS['tbl']['fascicule'].' INNER JOIN '.$GLOBALS['tbl']['serie'].' ON B_F_CRAISERIE = B_SER_IDSERIE AND B_F_CRAICOLL = B_SER_CRAICOLL '.
91
                		'WHERE  B_F_CRAICOLL = "'.$row->B_C_CRAI.'" '.
92
                		'AND B_F_CACHER = 0 '.
93
                		'ORDER BY B_F_CRAISERIE, B_F_NUMERO DESC';
94
		//echo $query_fasc;
95
		$do_query_fasc = mysql_query($query_fasc) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $query_fasc));
96
		$aso_fasc_serie = array();
97
		while ($row_fasc = mysql_fetch_object($do_query_fasc)) {
98
			if (!isset($aso_fasc_serie[$row_fasc->B_F_CRAISERIE])) {
99
				$aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['nbre_fasc'] = 1;
100
				$aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['nom_fin_serie'] = $row_fasc->B_SER_SOUSTITRE;
101
				$aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['nom_fin_fasc'] = $row_fasc->B_F_TITRE;
102
				$aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['date_fin_fasc'] = date('d/m/Y', $row_fasc->B_F_MAJFICHE);
103
			} else {
104
				$aso_fasc_serie[$row_fasc->B_F_CRAISERIE]['nbre_fasc']++;
105
			}
106
		}
107
		ksort($aso_fasc_serie, SORT_DESC);
5 jp_milcent 108
        $id = $row->B_C_CRAI;
109
        $idlink = $row->B_C_IDLINK;
110
        $nom_complet = $row->B_C_NOMCOMPLET;
111
        $abreviation = $row->B_C_ABREGE;
112
        $date_debut = $row->B_C_DATECREATION;
113
        $suite_de = $row->B_C_FAISUITE;
114
        $date_fin = $row->B_C_DATEFIN;
115
        $periodicite = $row->B_C_PERIODICITE;
116
        $contact_nom = $row->B_C_CONTACTNOM;
117
        $contact_mail = $row->B_C_CONTACTMAIL;
118
        $logo = $row->B_C_IMAGE;
119
        $commentaires = $row->B_C_COMMENT;
120
        $date_maj = $row->B_C_MAJFICHE;
8 jp_milcent 121
		$retour .= '<tbody><tr>';
122
		$retour .= '<th>';
5 jp_milcent 123
        if ($nom_complet != '') {
124
            $retour .= '<h5 class="bbre_titre">'.$nom_complet.'</h5>';
8 jp_milcent 125
            if ($suite_de != '') {
126
				$retour .= '<p><span class="bb_intitule">Fait suite à :</span> '.$suite_de.'</p>';
127
			}
5 jp_milcent 128
            if ($commentaires != '') {
129
            	$retour .= '<p>'.$commentaires.'</p>';
130
        	}
131
            if ($logo != '') {
8 jp_milcent 132
            	$retour .= '<img class="bbre_couverture" src="'.BB_CHEMIN_IMAGES_ILLUSTRATION.$logo.'" alt="Couverture de la revue '.$nom_complet.'"/>';
5 jp_milcent 133
        	}
8 jp_milcent 134
        	$retour .= '<p class="texte_inactif">Id. coll. : '.$id.' - Mise à jour : '.date('d/m/Y', $date_maj).'</p>';
135
 
5 jp_milcent 136
        }
8 jp_milcent 137
        $retour .= '</th>';
138
		$retour .= '<td>';
5 jp_milcent 139
		if ($abreviation != '') {
8 jp_milcent 140
			$retour .= $abreviation;
5 jp_milcent 141
		}
8 jp_milcent 142
		$retour .= '</td>';
143
		$retour .= '<td>';
5 jp_milcent 144
		if ($date_debut != '') {
8 jp_milcent 145
			$retour .= $date_debut;
5 jp_milcent 146
		}
8 jp_milcent 147
		$retour .= '</td>';
148
		$retour .= '<td>';
5 jp_milcent 149
		if ($date_fin != '') {
8 jp_milcent 150
			$retour .= $date_fin;
5 jp_milcent 151
		}
8 jp_milcent 152
		$retour .= '</td>';
153
		$retour .= '<td>';
5 jp_milcent 154
		if ($periodicite != '') {
8 jp_milcent 155
			$retour .= $periodicite;
5 jp_milcent 156
		}
8 jp_milcent 157
		$retour .= '</td>';
158
		$retour .= '<td>';
5 jp_milcent 159
		if ($contact_nom != '') {
160
			if ($contact_mail != '') {
8 jp_milcent 161
				$retour .= '<a href="mailto:'.$contact_mail.'">'.$contact_nom.'</a>';
5 jp_milcent 162
			} else {
8 jp_milcent 163
				$retour .= $contact_nom;
5 jp_milcent 164
			}
165
		}
8 jp_milcent 166
		$retour .= '</td>';
167
		$retour .= '<td>';
168
		$aso_fasc = current($aso_fasc_serie);
169
		$retour .= $aso_fasc['nom_fin_fasc'];
170
		$retour .= '</td>';
171
		$retour .= '<td>';
172
		$retour .= $aso_fasc['nbre_fasc'];
173
		$retour .= '</td>';
174
		$retour .= '<td>';
175
		$retour .= $aso_fasc['date_fin_fasc'];
176
		$retour .= '</td>';
177
		$retour .= '</tr></tbody>'."\n";
5 jp_milcent 178
        $o++;
179
    }
8 jp_milcent 180
    $retour .= '</table>'."\n";
5 jp_milcent 181
    mysql_free_result($do_query);
182
}
8 jp_milcent 183
$retour .= '</div>';
5 jp_milcent 184
$retour .= '<!-- BiblioBota - Revue : FIN -->'."\n";
185
$sortie .= $retour;
186
 
187
/* +--Fin du code ----------------------------------------------------------------------------------------+
188
*
189
* $Log$
8 jp_milcent 190
* Revision 1.2  2006/05/29 14:19:07  jp_milcent
191
* Ajout d'une classe css à l'image de la couverture de la revue.
192
* Correction du chemin d'accés à l'image.
193
*
6 jp_milcent 194
* Revision 1.1  2006/05/23 16:20:50  jp_milcent
195
* Ajout de l'application affichant la liste des revues disponibles dans la base de données de BiblioBota.
5 jp_milcent 196
*
6 jp_milcent 197
*
5 jp_milcent 198
* +-- Fin du code ----------------------------------------------------------------------------------------+
199
*/
200
?>