<?php

$conn=pg_pconnect("dbname=emecmistica user=postgres"); 
$esp=chr(13);
$tab=chr(9);

$totaux="totaux";
$hui=time();

$hui=date("d/m/Y", $hui);
$exphui=explode ("/", $hui);
$imp=implode("_", $exphui);


$contenu="Estatisticas del $imp $esp $esp";
include "st1.php3";
$contenu="$contenu $texto";
include "st2.php3";
$contenu= "$contenu $texto";
include "st6.php3";
$contenu= "$contenu $texto";
include "st4.php3";
$contenu= "$contenu $texto";
include "st5.php3";
$contenu= "$contenu $texto";


$fichier="/home/httpd/html/mistica/bdadmin/estadisticas/stat/stat"."$imp".".txt";
$si=file_exists($fichier);
if ($si) {
$nj=1;
while (file_exists($fichier)) {
$fichier="/home/httpd/html/mistica/bdadmin/estadisticas/stat/stat"."$imp"."_$nj".".txt";
$nj++;
}
}
clearstatcache; 

$expfich=explode ("/", $fichier);
$nbexp=count($expfich);
$nbexp=$nbexp-1;
$url="http://funredes.org/mistica/bdadmin/estadisticas/stat/$expfich[$nbexp]";    


        $fp = fopen($fichier,"a+");
        fputs($fp,$contenu);
        fclose($fp);

include "tete.php3";
echo "<br><H1><a href=\"$url\">Pueden bajar el archivo texto de las estadisticas</a></H1>";



?>
