<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000;
}
a {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000;
text-decoration:underline;
}
a:hover {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #fff;
text-decoration:underline;
}
.over:hover {
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
color: #fff;
background-color:#333;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<?php
$dossier = '.';
$n = strip_tags($_GET['n']);
//Nombre de derniers
if($n=='') {
$n = 10;
}
else {
$n = $n;
}
function scan_dossier($rep)
{
global $dir_objects;
$temp = opendir($rep);
while (false !== ($object = readdir($temp)))
{
if ($object != "." && $object != "..")
{
if (!is_dir($rep.'/'.$object))
{
$filename = $rep .'/'. $object;
$file_object['time'] = filemtime($filename);
$file_object['name'] = $object;
$file_object['ext'] = $extension=pathinfo($filename,PATHINFO_EXTENSION);
//$file_object['img'] = image_extension($filename);
// $file_object['lien'] = $filename;
$file_object['lien'] = '<span style="color:#FF6600;">'.$rep.'</span> / '.$object.'';
$dir_objects[] = $file_object;
}
elseif (is_dir($rep.'/'.$object))
{
scan_dossier($rep.'/'.$object);
}
}
}
}
scan_dossier($dossier);
array_multisort($dir_objects, SORT_DESC);
array_splice($dir_objects,$n);
echo '<table cellspacing="0" width="600"><tr><td><b><u>Nom</u></b></td><td><b><u>Ajouté le</u></b></td><td><form name="form" id="form">
<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu(\'parent\',this,0)">
<option>Affichage</option>
<option value="?n=20">last 20</option>
<option value="?n=50">last 50</option>
<option value="?n=100">last 100</option>
</select>
</form></td></tr>';
for($i=0;$i<count($dir_objects);$i++)
{
echo "<tr class=\"over\"><td>".$dir_objects[$i]['lien']."</td><td>".date("d/m/Y \&\a\g\\r\a\\v\e\; H:i:s", $dir_objects[$i]['time'])."</td><td> </td></tr>";
}
echo "\t\t</table>";
?></body>
</html>