Indentation de fichiers sur les quotas
This commit is contained in:
parent
01e220f6ce
commit
b496a01f04
|
@ -31,42 +31,42 @@ reset($qlist);
|
||||||
$col=1;
|
$col=1;
|
||||||
|
|
||||||
|
|
||||||
if (!is_array($q)) {
|
if (!is_array($q) || empty($q) ) {
|
||||||
// "No quotas for this account, or quotas currently unavailable
|
// "No quotas for this account, or quotas currently unavailable
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$first=true;
|
$first=true;
|
||||||
while (list($key,$val)=each($qlist)) {
|
while (list($key,$val)=each($qlist)) {
|
||||||
$col=3-$col;
|
$col=3-$col;
|
||||||
|
|
||||||
// FIXME: rewrite it
|
// FIXME: rewrite it
|
||||||
if (($key == 'bw_web' || $key == 'web') && (isset($q[$key]["t"]) && $q[$key]["t"] > 0)) {
|
if (($key == 'bw_web' || $key == 'web') && (isset($q[$key]["t"]) && $q[$key]["t"] > 0)) {
|
||||||
if ($first) {
|
if ($first) {
|
||||||
echo '<dt id="#quotas">' . _("Quotas") . '</dt>';
|
echo '<dt id="#quotas">' . _("Quotas") . '</dt>';
|
||||||
$first=false;
|
$first=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($key == 'web') {
|
if ($key == 'web') {
|
||||||
$q[$key]["u"] = $q[$key]["u"] * 1024;
|
$q[$key]["u"] = $q[$key]["u"] * 1024;
|
||||||
$q[$key]["t"] = $q[$key]["t"] * 1024;
|
$q[$key]["t"] = $q[$key]["t"] * 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
$usage_percent = (int) ($q[$key]["u"] / $q[$key]["t"] * 100);
|
$usage_percent = (int) ($q[$key]["u"] / $q[$key]["t"] * 100);
|
||||||
$usage_color = ($q[$key]["u"] > $q[$key]["t"] ? '#f00' : '#0f0');
|
$usage_color = ($q[$key]["u"] > $q[$key]["t"] ? '#f00' : '#0f0');
|
||||||
$usage_color = ((85 < $usage_percent && $usage_percent < 100) ? '#ff0' : $usage_color); // yellow
|
$usage_color = ((85 < $usage_percent && $usage_percent < 100) ? '#ff0' : $usage_color); // yellow
|
||||||
|
|
||||||
$url = ($key == 'bw_web' ? 'stats_show_per_month.php' : 'quota_show.php');
|
$url = ($key == 'bw_web' ? 'stats_show_per_month.php' : 'quota_show.php');
|
||||||
|
|
||||||
echo "<dd>";
|
echo "<dd>";
|
||||||
echo '<div><a href="' . $url . '">' . /* _($val) */ $key . ' ' . $usage_percent . '%' . ' (' . format_size($q[$key]["u"]) . ' / ' . format_size($q[$key]["t"]) . ')</a></div>';
|
echo '<div><a href="' . $url . '">' . /* _($val) */ $key . ' ' . $usage_percent . '%' . ' (' . format_size($q[$key]["u"]) . ' / ' . format_size($q[$key]["t"]) . ')</a></div>';
|
||||||
echo "</dd>";
|
echo "</dd>";
|
||||||
echo "<dd>";
|
echo "<dd>";
|
||||||
echo '<div style="width: 100%; background: #fff;">';
|
echo '<div style="width: 100%; background: #fff;">';
|
||||||
echo '<div style="width: ' . ($usage_percent > 100 ? 100 : $usage_percent) . '%; background: ' . $usage_color . ';"> </div>';
|
echo '<div style="width: ' . ($usage_percent > 100 ? 100 : $usage_percent) . '%; background: ' . $usage_color . ';"> </div>';
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
echo "</dd>";
|
echo "</dd>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -36,33 +36,38 @@ include_once("head.php");
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<?php
|
||||||
$q=$quota->getquota();
|
$q=$quota->getquota();
|
||||||
if (!is_array($q)) {
|
if (!is_array($q) || empty($q) ) {
|
||||||
echo "<p class=\"error\">"._("No quotas for this account, or quotas currently unavailable!")."</p>";
|
echo "<p class=\"error\">"._("No quotas for this account, or quotas currently unavailable!")."</p>";
|
||||||
} else {
|
include_once("foot.php");
|
||||||
echo "<table cellspacing=\"0\" cellpadding=\"4\"><tr><th>"._("Quota")."</th><th>"._("Used")."</th><th>"._("Total")."</th></tr>";
|
die();
|
||||||
$qlist=$quota->qlist();
|
}
|
||||||
reset($qlist);
|
|
||||||
$col=1;
|
|
||||||
while (list($key,$val)=each($qlist)) {
|
|
||||||
if ( !isset($q[$key]) || !$q[$key]["t"]) continue;
|
|
||||||
$col=3-$col;
|
|
||||||
echo "<tr class=\"lst$col\">";
|
|
||||||
echo "<td>";
|
|
||||||
if ($q[$key]["u"] >= $q[$key]["t"]) echo "<font class=\"over\">";
|
|
||||||
echo _($val);
|
|
||||||
if ($q[$key]["u"] >= $q[$key]["t"]) echo "</font>";
|
|
||||||
|
|
||||||
if ($key == 'bw_web') {
|
echo "<table cellspacing=\"0\" cellpadding=\"4\" class='tlist'>";
|
||||||
echo " </td><td align=\"center\">". format_size($q[$key]["u"]) ." </td><td align=\"center\">". format_size($q[$key]["t"]) ." </td>";
|
echo "<tr><th>"._("Quota")."</th><th>"._("Used")."</th><th>"._("Total")."</th></tr>";
|
||||||
} elseif ($key == 'web') {
|
$qlist=$quota->qlist();
|
||||||
echo " </td><td align=\"center\">". format_size($q[$key]["u"] * 1024) . " </td><td align=\"center\">". format_size($q[$key]["t"] * 1024) ." </td>";
|
reset($qlist);
|
||||||
} else {
|
$col=1;
|
||||||
echo " </td><td align=\"center\">".$q[$key]["u"]." </td><td align=\"center\">".$q[$key]["t"]." </td>";
|
while (list($key,$val)=each($qlist)) {
|
||||||
}
|
if ( !isset($q[$key]) || !$q[$key]["t"]) continue;
|
||||||
|
$col=3-$col;
|
||||||
|
echo "<tr class=\"lst$col\">";
|
||||||
|
echo "<td>";
|
||||||
|
if ($q[$key]["u"] >= $q[$key]["t"]) echo "<font class=\"over\">";
|
||||||
|
echo _($val);
|
||||||
|
if ($q[$key]["u"] >= $q[$key]["t"]) echo "</font>";
|
||||||
|
|
||||||
|
if ($key == 'bw_web') {
|
||||||
|
echo " </td><td>". format_size($q[$key]["u"]) ." </td><td>". format_size($q[$key]["t"]) ." </td>";
|
||||||
|
} elseif ($key == 'web') {
|
||||||
|
echo " </td><td>". format_size($q[$key]["u"] * 1024) . " </td><td>". format_size($q[$key]["t"] * 1024) ." </td>";
|
||||||
|
} else {
|
||||||
|
echo " </td><td>".$q[$key]["u"]." </td><td>".$q[$key]["t"]." </td>";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "</tr>";
|
||||||
|
}
|
||||||
|
echo "</table>";
|
||||||
|
|
||||||
|
include_once("foot.php");
|
||||||
|
|
||||||
echo "</tr>";
|
|
||||||
}
|
|
||||||
echo "</table>";
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<?php include_once("foot.php"); ?>
|
|
||||||
|
|
Loading…
Reference in New Issue