<meta name="viewport" content="width=device-width, initial-scale=1">
<center> <h2><a href='../uploadfile.php'> <span style='color:limegreen; font-family:arial;'>  Upload Files </span> </a></h2></center>



<?php
    function mtimecmp($a, $b) {
        $mt_a = filemtime($a);
        $mt_b = filemtime($b);

        if ($mt_a == $mt_b)
            return 0;
        else if ($mt_a < $mt_b)
            return -1;
        else
            return 1;
    }

    $file = glob($dirname."*");
    usort($file, "mtimecmp");
    $file=array_reverse($file);

    foreach ($file as $files) {
      echo "<div style='font-size:12px; float:left; background: linear-gradient(to bottom, #ffffff 0%, #99ccff 70%, #ccffcc 100%); 
      margin:4px; width:100px; height:122px; font-family:arial; padding:4px 0; border-radius:5px; border:1px solid black;'> 
      <center><a href='$files'> $files <br> <img src='$files' title='$image'  border='1px' width='80' height='80' vspace='5px'></a></center>
      <a href='../deletefile.php?do=$files'><span style='color:#000; font-size:16px;'><center> X Delete</center></span></a><br></div>";
    }

?>







<?php
echo "<style> a:hover{color:red; text-decoration:underline;}a:active, a{color:blue; text-decoration:none;} ul,li{line-height:25px;}</style>";
$b=(glob("*"));
$b=array_reverse($b);
echo "<div style='float:left; background:yellow; margin:2px; padding:5px;'> <ol style='font-family:arial;'>13 images only";
for($i=0; $i<6; $i++){
echo "<li> <a href='$b[$i]'> $b[$i]</a>  <a href='../deletefile.php?do=images/$files'><span style='color:red;'><b> X </b> </span></a></li>";
}
echo "</ol></div>";
?>

<?php
echo "<style> a:hover{color:red; text-decoration:underline;}a:active, a{color:blue; text-decoration:none;} ul,li{line-height:25px;}</style>";
$b=(glob("*"));
$b=array_reverse($b);
echo "<div style='float:left; background:yellow;margin:2px; padding:5px;'> <ol style='font-family:arial;'>";
for($i=6; $i<13; $i++){
echo "<li> <a href='$b[$i]'> $b[$i]</a>  <a href='../deletefile.php?do=images/$files'><span style='color:red;'><b> X </b> </span></a></li>";
}
echo "</ol></div>";
?>




