Subversion Repositories eFlore/Archives.eflore-consultation-v1

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 jpm 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 Integrateur 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: eflore_statistique.fonct.php,v 1.1 2005-05-24 15:57:48 jpm Exp $
25
/**
26
* Fonction pour réaliser les statistiques.
27
*
28
*@package eFlore
29
*@subpackage Ancien
30
//Auteur original :
31
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
32
//Autres auteurs :
33
*@author        Aucun
34
*@copyright     Tela-Botanica 2000-2005
35
*@version       $Revision: 1.1 $ $Date: 2005-05-24 15:57:48 $
36
// +------------------------------------------------------------------------------------------------------+
37
*/
38
 
39
// +------------------------------------------------------------------------------------------------------+
40
// |                                            LISTE des FONCTION                                        |
41
// +------------------------------------------------------------------------------------------------------+
42
/**
43
* La fonction efloreDonneeStat() stocke dans la table EFLORE_STAT_DONNEE les informations sur une recherche effectuée
44
*dans l'index des plantes du site de Tela Botanica.
45
*
46
*Cette fonction ne retourne rien dans la page mais insère des donnés dans une table MySql.
47
*
48
* @global integer numtaxo contient le numéro taxonomique du taxon.
49
* @param string $baseURL chaîne contenant l'URL du codument eflore
50
* @return null
51
*/
52
function efloreDonneeStat($tab_donnee)
53
{
54
    $date_jour = strftime("%d-%m-%Y");
55
    $heure_jour = strftime("%H:%M:%S");
56
    $date_mysql= strftime("%Y-%m-%d %H:%M:%S");
57
    $tps_unix_maintenant = time();
58
 
59
    $domaine = gethostbyaddr($_SERVER['REMOTE_ADDR']);//récupére le nom du domaine
60
 
61
    $requete_01 = 'SELECT MAX('.NC_ID.') FROM '.EF_BDD_NOM.'.'.NOM_TABLE_STAT;
62
    $resultat_01 = mysql_query($requete_01) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
63
    if (!empty($resultat_01)) {
64
        $id_max = mysql_result($resultat_01, 0, 0);
65
    } else {
66
        $id_max = 0;
67
    };
68
 
69
    $nouveau_id = $id_max +1;
70
 
71
    $tab_donnee_copie = $tab_donnee;
72
 
73
    $requete_02 = 'INSERT INTO '.EF_BDD_NOM.'.'.NOM_TABLE_STAT.' ('.NC_ID.', '.NC_IP.', '.NC_DOMAINE.', '.NC_NAVIGATEUR.', '.NC_DH_MYSQL.', '.NC_TPS.', '.NC_DATE;
74
 
75
    while($element = each($tab_donnee)) {
76
        $requete_02 .= ', '.$element['key'];
77
    }
78
 
79
    $requete_02 .= ') VALUES ('.$nouveau_id.', "'.$_SERVER['REMOTE_ADDR'].'", "'.$domaine.'", "'.$_SERVER['HTTP_USER_AGENT'].'", "'.$date_mysql.'", '.$tps_unix_maintenant.', "'.$date_jour.' '.$heure_jour.'"';
80
 
81
    while($element = each($tab_donnee_copie)) {
82
        $requete_02 .= ', "'.$element['value'].'"';
83
    }
84
 
85
    $requete_02 .= ');';
86
 
87
    mysql_query($requete_02) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
88
}
89
 
90
//-- Fin du code source  ------------------------------------------------------------
91
?>