$ora = date ("H:i");
$today = date ("d/m/Y");
$monthtoday = date ("m/Y");
import_request_variables('g', 'search_');
if ( empty($search_dd) ){$search_dd = $today;};
echo "Statistics $search_dd
";
echo " back to the main statistics ";
//-------------- insert the correct path ----------------------------------
$dati = file ("./external_LOG_TIMEX.dat");
$risp = is_file ("./external_LOG_TIMEX.dat");
$size = filesize ("./external_LOG_TIMEX.dat");
$ncontatti = count ($dati);
// reading statistics ARRAY
$i=0;
$j=0;
while ($i < $ncontatti)
{
$infos = explode ("<>" , $dati[$i]);
$giorno = substr ("$infos[0]", 0, 10);
$mese = substr ("$infos[0]", 3, 7);
$anno = substr ("$infos[0]", 6, 4);
if ($giorno == $search_dd)
{
$j++;
$meseanno[$i] = substr ("$infos[0]", 3, 7);
$oracon[$i] = substr ("$infos[0]", 11, 5);
$ip[$i] = $infos[1];
$host[$i] = $infos[4];
$iphost[$i] = $ip[$i] . "" . $host[$i] . "" ;
$pagina[$i] = $infos[2];
$connect[$j] = $oracon[$i] . " -" . $ip[$i] . "" . $host[$i] . " - " . $pagina[$i] ;
}
$i++;
}
$nconnect = $j ;
if ($j == 0)
{
echo "
the day $search_dd is not present in the database
";
exit;
}
else
{
// Contacts during the selected day
echo "
";
echo "Contacts during the day $search_dd: $nconnect
";
echo "
orario di connessione - utente connesso - pagina scaricata
";
$j=1;
echo "";
while ($j <= $nconnect ){echo "$connect[$j]
"; $j++;};
echo "
";
?>
// Visited pages
echo "
";
echo "Visited pages during the day $search_dd
";
$paginaX = explode(",", implode(",", $pagina));
$paginaXX = array_count_values($paginaX);
arsort ($paginaXX); reset ($paginaXX);
list ($chiave, $valore) = each ($paginaXX); $coeff = (250/$valore) ; reset ($paginaXX);
while (list ($chiave, $valore) = each ($paginaXX))
{$valore2 = round (($valore*$coeff),0);
echo "
" ;};
?>
// IP numbers and HOST
echo "
";
echo "IP numbers and DNS hosts connected during the day $search_dd
";
$ipX = explode(",", implode(",", $iphost));
$ipXX = array_count_values($ipX);
arsort ($ipXX); reset ($ipXX);
list ($chiave, $valore) = each ($ipXX); $coeff = (250/$valore) ; reset ($ipXX);
while (list ($chiave, $valore) = each ($ipXX)) {
//if ( $valore < 20){break;};
$valore2 = round (($valore*$coeff),0);
echo "
" ;};
?>
} //end else
?>
echo "
Statistics total dimension: ";
print($size/1000);
echo " Kbytes
";
?>
echo "
StatFast 1.0 by
Emiliano Principi.
";
?>