<?php
$file=glob("pdf/*.pdf");
foreach($file as $nome){
echo "file $nome ultima apertura: ".date("d.m.Y H:i:s.", fileatime("pdf/".$nome))."<br>";
}
function dir_list($directory = FALSE)
{
$dirs= array();
$files = array();
if ($handle = opendir("./" . $directory))
{
while ($file = readdir($handle))
{
if (is_dir("./{$directory}/{$file}"))
{
if ($file != "." & $file != "..") $dirs[] = $file; }
else
{
if ($file != "." & $file != "..") $files[] = $file; }
}
}
closedir($handle);
reset($dirs); sort($dirs); reset($dirs);
reset($files); sort($files); reset($files);
echo ""; while(list($key, $value) = each($dirs))
{
$d++; echo "<li><a href=\"{$value}\">{$value}/</a>\n"; }
echo "</ul>\n"; echo ""; while(list($key, $value) = each($files))
{
$f++; echo "<li id='lista_pdf'><a href=\"/consorzio-bus-car{$directory}{$value}\">{$value}</a><br/><br/>"; }
echo "</ul>\n";
if (!$d) $d = "0"; if (!$f) $f = "0"; echo "<br/><br/>Sono presenti <strong>{$f}</strong> pdf.</strong>\n"; }
dir_list("/pdf_decreti/");
?>