Newer
Older

Thomas Lake
committed
<? exec("/usr/local/bin/shame.py -a", $Shame);
$smarty->assign('title',"The SUCS Hall of Shame");
$o="<div style='text-align: center;'><img src=\"/images/shame.php\" alt=\"pie chart of top 12 disk users\"/></div>";
$o.="<table align=\"center\">\n";
$o.="\t<tr><th align=\"center\">User</th><th align=\"center\">Home Directory Size</th></tr>\n";
for ( $i=1 ; $i < 13 /*(count($Shame) - 1)*/; $i++)

Thomas Lake
committed
{
list($space, $place, $user, $size) = preg_split("/ +/", $Shame[$i]);
if ($size > 0)
$o.="\t<tr><td align=\"center\">$user</td><td align=\"center\">${size}B</td></tr>\n";
}
exec("df -h /home",$dfraw);
$dfout=explode(" ",$dfraw[1]);
$o.="\t<tr><td align=\"center\" colspan=\"2\">".$dfout[8]." used of ".$dfout[7]. " (".$dfout[9]." available)</td></tr>\n";

Thomas Lake
committed
$o.="</table>\n";
$o.=$Shame[count($Shame) - 1];
$o.="<br />\n";
//readfile("tail.html");
$smarty->assign('body', $o);
?>