From b496a01f04c204030f3f3d299be2fa2c92658b23 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Wed, 30 Jan 2013 11:17:16 +0000 Subject: [PATCH] Indentation de fichiers sur les quotas --- bureau/admin/menu_quota.php | 54 ++++++++++++++++----------------- bureau/admin/quota_show.php | 59 ++++++++++++++++++++----------------- 2 files changed, 59 insertions(+), 54 deletions(-) diff --git a/bureau/admin/menu_quota.php b/bureau/admin/menu_quota.php index 33bab1d3..9d78237b 100644 --- a/bureau/admin/menu_quota.php +++ b/bureau/admin/menu_quota.php @@ -31,42 +31,42 @@ reset($qlist); $col=1; -if (!is_array($q)) { - // "No quotas for this account, or quotas currently unavailable - return; +if (!is_array($q) || empty($q) ) { + // "No quotas for this account, or quotas currently unavailable + return; } $first=true; while (list($key,$val)=each($qlist)) { - $col=3-$col; + $col=3-$col; - // FIXME: rewrite it - if (($key == 'bw_web' || $key == 'web') && (isset($q[$key]["t"]) && $q[$key]["t"] > 0)) { - if ($first) { - echo '
' . _("Quotas") . '
'; - $first=false; - } + // FIXME: rewrite it + if (($key == 'bw_web' || $key == 'web') && (isset($q[$key]["t"]) && $q[$key]["t"] > 0)) { + if ($first) { + echo '
' . _("Quotas") . '
'; + $first=false; + } - if ($key == 'web') { - $q[$key]["u"] = $q[$key]["u"] * 1024; - $q[$key]["t"] = $q[$key]["t"] * 1024; - } + if ($key == 'web') { + $q[$key]["u"] = $q[$key]["u"] * 1024; + $q[$key]["t"] = $q[$key]["t"] * 1024; + } - $usage_percent = (int) ($q[$key]["u"] / $q[$key]["t"] * 100); - $usage_color = ($q[$key]["u"] > $q[$key]["t"] ? '#f00' : '#0f0'); - $usage_color = ((85 < $usage_percent && $usage_percent < 100) ? '#ff0' : $usage_color); // yellow + $usage_percent = (int) ($q[$key]["u"] / $q[$key]["t"] * 100); + $usage_color = ($q[$key]["u"] > $q[$key]["t"] ? '#f00' : '#0f0'); + $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 "
"; - echo '
' . /* _($val) */ $key . ' ' . $usage_percent . '%' . ' (' . format_size($q[$key]["u"]) . ' / ' . format_size($q[$key]["t"]) . ')
'; - echo "
"; - echo "
"; - echo '
'; - echo '
 
'; - echo '
'; - echo "
"; - } + echo "
"; + echo '
' . /* _($val) */ $key . ' ' . $usage_percent . '%' . ' (' . format_size($q[$key]["u"]) . ' / ' . format_size($q[$key]["t"]) . ')
'; + echo "
"; + echo "
"; + echo '
'; + echo '
 
'; + echo '
'; + echo "
"; + } } ?> diff --git a/bureau/admin/quota_show.php b/bureau/admin/quota_show.php index 0ebb2a32..140c84bb 100644 --- a/bureau/admin/quota_show.php +++ b/bureau/admin/quota_show.php @@ -36,33 +36,38 @@ include_once("head.php");
getquota(); -if (!is_array($q)) { - echo "

"._("No quotas for this account, or quotas currently unavailable!")."

"; -} else { - echo ""; - $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 ""; - echo ""; - } elseif ($key == 'web') { - echo " "; - } else { - echo " "; - } +echo "
"._("Quota").""._("Used").""._("Total")."
"; - if ($q[$key]["u"] >= $q[$key]["t"]) echo ""; - echo _($val); - if ($q[$key]["u"] >= $q[$key]["t"]) echo ""; +if (!is_array($q) || empty($q) ) { + echo "

"._("No quotas for this account, or quotas currently unavailable!")."

"; + include_once("foot.php"); + die(); +} - if ($key == 'bw_web') { - echo " 
". format_size($q[$key]["u"]) ." ". format_size($q[$key]["t"]) ." ". format_size($q[$key]["u"] * 1024) . " ". format_size($q[$key]["t"] * 1024) ." ".$q[$key]["u"]." ".$q[$key]["t"]." 
"; +echo ""; +$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 ""; + echo ""; + } elseif ($key == 'web') { + echo " "; + } else { + echo " "; + } + + echo ""; + } +echo "
"._("Quota").""._("Used").""._("Total")."
"; + if ($q[$key]["u"] >= $q[$key]["t"]) echo ""; + echo _($val); + if ($q[$key]["u"] >= $q[$key]["t"]) echo ""; + + if ($key == 'bw_web') { + echo " ". format_size($q[$key]["u"]) ." ". format_size($q[$key]["t"]) ." ". format_size($q[$key]["u"] * 1024) . " ". format_size($q[$key]["t"] * 1024) ." ".$q[$key]["u"]." ".$q[$key]["t"]." 
"; + +include_once("foot.php"); - echo ""; - } - echo ""; -} ?> -