<html>
    <head>
        <title>home.e-mats.org: statistics</title>
    </head>
    <style type='text/css'>
        BODY {
            font-family:     verdana, sans-serif;
            font-size:    11px;    
        }
        TD {
            font-family:     verdana, sans-serif;
            font-size:    11px;
            background:    #cccccc;
        }
        TD.fisk {
            border:        1px solid #000000;
        }
    </style>
<body>
<table>
<tr><td class='fisk'><center>status for dword</center></td>
<tr><td class='fisk'>
<?php
    $disks 
= array ("c:""d:""j:""k:""l:""m:""n:");

    function 
format_bytes($total) {
        if (
$total > (pow(1024,3))) {
            return 
round(($total pow(1024,3)), 2) . "gb";
        } elseif (
$total pow(10242)) {
            return 
round(($total pow(1024,2)), 2) . "mb";
        } elseif (
$total 1024) {
            return 
round(($total 1024), 2) . "kb";
        } else {
            return 
$total "bytes";    
        }
    }
    
    print (
"<table width='100%'>\n");

    while (list(
$idx$disk) = each($disks)) {
        print(
"<tr><td>" $disk "</td><td>" format_bytes(diskfreespace($disk ."\\")) . "</td></tr>\n");
    }
    
    print (
"</table>\n");

    
exec("net statistics workstation"$output);
    
$line explode(" "$output[3]);
    
$time $line[2] . " " $line[3];
    
$time strtotime($time);
    
    print (
"last reboot at<br>\n");
    print (
date("d-M-Y (H:i)"$time));
?>
</td></tr></table>
</body>
</html>