2006-04-26 12:28:53 +00:00
|
|
|
<?php
|
|
|
|
/*
|
|
|
|
$Id: quota_show_all.php,v 1.4 2005/10/06 16:18:25 anarcat Exp $
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
AlternC - Web Hosting System
|
|
|
|
Copyright (C) 2002 by the AlternC Development Team.
|
|
|
|
http://alternc.org/
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
Based on:
|
|
|
|
Valentin Lacambre's web hosting softwares: http://altern.org/
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
LICENSE
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License (GPL)
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
To read the license please visit http://www.gnu.org/copyleft/gpl.html
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
Original Author of file:
|
|
|
|
Purpose of file:
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
require_once("../class/config.php");
|
|
|
|
|
|
|
|
include("head.php");
|
|
|
|
?>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h3><?php __("Quotas"); ?></h3>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
2006-05-25 13:14:23 +00:00
|
|
|
$quota_utilise = 0;
|
|
|
|
$tot = 0;
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
if ($mem->user['uid'] == "2000")
|
|
|
|
$user_list = $admin->get_list(1);
|
|
|
|
else{
|
|
|
|
$user_list = $admin->get_list(0);
|
|
|
|
$user_list[] = $mem->user;
|
|
|
|
}
|
|
|
|
$class = ($class== 'lst1' ? 'lst2' : 'lst1');
|
|
|
|
print "<table><tr class=\"$class\">";
|
|
|
|
$ql = $quota->qlist();
|
|
|
|
reset($ql);
|
2006-04-28 16:50:20 +00:00
|
|
|
print "<td>"._("User")."</td>";
|
2006-04-26 12:28:53 +00:00
|
|
|
$sequence = array();
|
|
|
|
foreach ($ql as $key => $name) {
|
|
|
|
print "<td>$name</td>";
|
|
|
|
$sequence[] = $key;
|
|
|
|
}
|
|
|
|
print "</tr>";
|
|
|
|
$u = array();
|
|
|
|
foreach ($user_list as $user) {
|
|
|
|
$u[$user['uid']] = $user['login'];
|
|
|
|
}
|
|
|
|
asort($u);
|
|
|
|
foreach ($u as $uid => $login) {
|
|
|
|
$class = ($class== 'lst1' ? 'lst2' : 'lst1');
|
|
|
|
print "<tr class=\"$class\"><td>";
|
|
|
|
print $login.'('.$uid.")</td>";
|
|
|
|
$mem->su($uid);
|
|
|
|
if (!($quots = $quota->getquota())) {
|
|
|
|
$error = $err->errstr();
|
|
|
|
}
|
|
|
|
foreach($sequence as $key) {
|
|
|
|
$q = $quots[$key];
|
|
|
|
if ($q['u'] > $q['t']) {
|
|
|
|
$style = ' style="color: red"';
|
|
|
|
} else {
|
|
|
|
$style = '';
|
|
|
|
}
|
2006-05-25 13:14:23 +00:00
|
|
|
$quota_utilise = $quota_utilise + $q['u'];
|
|
|
|
$tot = $tot + $q['t'];
|
2006-04-26 12:28:53 +00:00
|
|
|
print "<td $style>".str_replace(" ", " ", m_quota::display_val($key, $q['u']).'/'.m_quota::display_val($key, $q['t'])).'</td>';
|
|
|
|
}
|
|
|
|
print "</tr>";
|
|
|
|
$mem->unsu();
|
|
|
|
}
|
2006-05-25 13:14:23 +00:00
|
|
|
|
|
|
|
echo "<br><tr height=\"15\"></tr><tr><td>"._("Total")."</td><td $style>";
|
|
|
|
echo format_size($quota_utilise)." / ".format_size($tot)."</td></tr>";
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
print "</table>";
|
|
|
|
|
|
|
|
?>
|
|
|
|
</body>
|
|
|
|
</html>
|