2 |
jp_milcent |
1 |
<?php
|
|
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
|
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
4 |
// | PHP version 4.1 |
|
|
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
6 |
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) |
|
|
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
8 |
// | This file is part of Herbier. |
|
|
|
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: hb_indic_hist.class.php,v 1.1 2005-11-23 10:32:32 jp_milcent Exp $
|
|
|
25 |
/**
|
|
|
26 |
* Classe H_indic_hist
|
|
|
27 |
*
|
|
|
28 |
* Classe permettant de récupérer les données concernant les "indic hist" de la base de données.
|
|
|
29 |
*
|
|
|
30 |
*@package Herbier
|
|
|
31 |
*@subpackage Classes
|
|
|
32 |
//Auteur original :
|
|
|
33 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
|
|
34 |
//Autres auteurs :
|
|
|
35 |
*@author Jean-Pascal MILCENT <jpm@clapas.org>
|
|
|
36 |
*@copyright Tela-Botanica 2000-2005
|
|
|
37 |
*@version $Revision: 1.1 $ $Date: 2005-11-23 10:32:32 $
|
|
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
39 |
*/
|
|
|
40 |
|
|
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
42 |
// | ENTETE du PROGRAMME |
|
|
|
43 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
44 |
|
|
|
45 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
46 |
// | CORPS du PROGRAMME |
|
|
|
47 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
48 |
/**
|
|
|
49 |
* Classe H_indic_hist()
|
|
|
50 |
*
|
|
|
51 |
* Contient la structure nécessaire pour
|
|
|
52 |
* représenter une table HERBIERS_INDIC_HISTORIQUE.
|
|
|
53 |
*/
|
|
|
54 |
class H_indic_hist {
|
|
|
55 |
|
|
|
56 |
/**
|
|
|
57 |
* Constructeur de H_indic_hist
|
|
|
58 |
*
|
|
|
59 |
* @param aucun
|
|
|
60 |
* @return void
|
|
|
61 |
* @access public
|
|
|
62 |
*/
|
|
|
63 |
function H_indic_hist()
|
|
|
64 |
{
|
|
|
65 |
|
|
|
66 |
}
|
|
|
67 |
/**
|
|
|
68 |
* Méthode getFromSQL() - Initialise objet H_indic_hist
|
|
|
69 |
*
|
|
|
70 |
* Initialise un objet H_indic_hist dont les propriétés
|
|
|
71 |
* contiennent l'information rataché à une indication_historique
|
|
|
72 |
* caractérisé par son $id (un entier positif) qui correspond
|
|
|
73 |
* à la clé primaire ID_INDIC de la table HERBIERS_INDIC_HISTORIQUE
|
|
|
74 |
*
|
|
|
75 |
* @param int la clé primaire de la table HERBIERS_INDIC_HISTORIQUE
|
|
|
76 |
* @return void
|
|
|
77 |
* @access public
|
|
|
78 |
*/
|
|
|
79 |
function getFromSQL($id)
|
|
|
80 |
{
|
|
|
81 |
$requete = 'SELECT ID_INDICATEUR, DATE_INDIC '.
|
|
|
82 |
'FROM '.HB_BDD_NOM.'.HERBIERS_INDIC_HISTORIQUE '.
|
|
|
83 |
'WHERE ID_INDIC = '.$id.' '.
|
|
|
84 |
'ORDER BY DATE_INDIC DESC '.
|
|
|
85 |
'LIMIT 0,1';
|
|
|
86 |
|
|
|
87 |
$resultat = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
|
|
|
88 |
$ligne = mysql_fetch_object($resultat);
|
|
|
89 |
|
|
|
90 |
if (mysql_num_rows($resultat) != 0) {
|
|
|
91 |
// Récupération du nom de l'auteur de la note dans annu_USERS
|
|
|
92 |
$requete_auteur = 'SELECT U_NAME, U_SURNAME '.
|
|
|
93 |
'FROM '.HB_BDD_NOM_ANNUAIRE.'.annuaire_tela '.
|
|
|
94 |
'WHERE U_ID = '.$ligne->ID_INDICATEUR;
|
|
|
95 |
$resultat_auteur = mysql_query($requete_auteur) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete_auteur));
|
|
|
96 |
$ligne_auteur = mysql_fetch_object($resultat_auteur);
|
|
|
97 |
$ligne->ID_INDICATEUR = $ligne_auteur->U_NAME.' '.$ligne_auteur->U_SURNAME;
|
|
|
98 |
|
|
|
99 |
// Récupération de la date
|
|
|
100 |
$ligne->DATE_INDIC = date('d-m-Y', $ligne->DATE_INDIC);
|
|
|
101 |
}
|
|
|
102 |
return H_Herbier::remplacerEsperluette($ligne);
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
}
|
|
|
106 |
|
|
|
107 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
108 |
// | PIED du PROGRAMME |
|
|
|
109 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
113 |
*
|
|
|
114 |
* $Log: not supported by cvs2svn $
|
|
|
115 |
* Revision 1.2 2005/04/06 13:29:17 jpm
|
|
|
116 |
* Ajout et modifications des objets représentant la base de données Herbier.
|
|
|
117 |
*
|
|
|
118 |
* Revision 1.1 2005/03/08 14:13:21 jpm
|
|
|
119 |
* Ajout des classes d'accès à la base de données.
|
|
|
120 |
*
|
|
|
121 |
*
|
|
|
122 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
123 |
*/
|
|
|
124 |
?>
|