Subversion Repositories eFlore/Archives.eflore-consultation-v1

Compare Revisions

Ignore whitespace Rev 1 → Rev 2

/trunk/bibliotheque/eflore_statistique.fonct.php
New file
0,0 → 1,91
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2005 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of Integrateur 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: eflore_statistique.fonct.php,v 1.1 2005-05-24 15:57:48 jpm Exp $
/**
* Fonction pour réaliser les statistiques.
*
*@package eFlore
*@subpackage Ancien
//Auteur original :
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2005
*@version $Revision: 1.1 $ $Date: 2005-05-24 15:57:48 $
// +------------------------------------------------------------------------------------------------------+
*/
 
// +------------------------------------------------------------------------------------------------------+
// | LISTE des FONCTION |
// +------------------------------------------------------------------------------------------------------+
/**
* La fonction efloreDonneeStat() stocke dans la table EFLORE_STAT_DONNEE les informations sur une recherche effectuée
*dans l'index des plantes du site de Tela Botanica.
*
*Cette fonction ne retourne rien dans la page mais insère des donnés dans une table MySql.
*
* @global integer numtaxo contient le numéro taxonomique du taxon.
* @param string $baseURL chaîne contenant l'URL du codument eflore
* @return null
*/
function efloreDonneeStat($tab_donnee)
{
$date_jour = strftime("%d-%m-%Y");
$heure_jour = strftime("%H:%M:%S");
$date_mysql= strftime("%Y-%m-%d %H:%M:%S");
$tps_unix_maintenant = time();
$domaine = gethostbyaddr($_SERVER['REMOTE_ADDR']);//récupére le nom du domaine
$requete_01 = 'SELECT MAX('.NC_ID.') FROM '.EF_BDD_NOM.'.'.NOM_TABLE_STAT;
$resultat_01 = mysql_query($requete_01) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
if (!empty($resultat_01)) {
$id_max = mysql_result($resultat_01, 0, 0);
} else {
$id_max = 0;
};
$nouveau_id = $id_max +1;
$tab_donnee_copie = $tab_donnee;
$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;
while($element = each($tab_donnee)) {
$requete_02 .= ', '.$element['key'];
}
$requete_02 .= ') VALUES ('.$nouveau_id.', "'.$_SERVER['REMOTE_ADDR'].'", "'.$domaine.'", "'.$_SERVER['HTTP_USER_AGENT'].'", "'.$date_mysql.'", '.$tps_unix_maintenant.', "'.$date_jour.' '.$heure_jour.'"';
while($element = each($tab_donnee_copie)) {
$requete_02 .= ', "'.$element['value'].'"';
}
$requete_02 .= ');';
 
mysql_query($requete_02) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
}
 
//-- Fin du code source ------------------------------------------------------------
?>