Alternc  latest
Alternc logiel libre pour l'hébergement
quota_show.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * Show quotas for one user
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 include_once("head.php");
28 
29 ?>
30 <h3><?php __("Account's quotas"); ?> : </h3>
31 <hr id="topbar"/>
32 <br />
33 <?php
34 $q=$quota->getquota();
35 if (!is_array($q) || empty($q) ) {
36  $msg->raise("ALERT", "quota", _("No quotas for this account, or quotas currently unavailable!"));
37  include_once("main.php");
38  exit();
39 }
40 
41 echo "<table cellspacing=\"0\" cellpadding=\"4\" class='tlist'>";
42 echo "<tr><th>"._("Quota")."</th><th>"._("Used")."</th><th>"._("Total")."</th><th>"._("Size on disk")."</th></tr>";
43 $qlist=$quota->qlist();
44 reset($qlist);
46 while (list($key,$val)=each($qlist)) {
47  if ( !isset($q[$key]) || !$q[$key]["t"]) continue;
48  echo "<tr class=\"lst\">";
49  echo "<td>";
50  if ($q[$key]["u"] >= $q[$key]["t"]) echo "<font class=\"over\">";
51  echo _($val);
52  if ($q[$key]["u"] >= $q[$key]["t"]) echo "</font>";
53 
54  if (($key == 'web')||(isset($q[$key]['type'])&&($q[$key]['type']=='size'))) {
55  echo "&nbsp;</td><td>". format_size($q[$key]["u"] * 1024) . "&nbsp;</td><td>&nbsp;</td>";
56  } else {
57  echo "&nbsp;</td><td>".$q[$key]["u"]."&nbsp;</td><td>".$q[$key]["t"]."&nbsp;</td>";
58  }
59 
60  if (isset($q[$key]['s'])) {
61  $totalsize += $q[$key]["s"];
62  echo "<td>". format_size($q[$key]["s"] * 1024) . "&nbsp;</td>";
63  } else {
64  echo "<td>-&nbsp;</td>";
65  }
66  echo "</tr>";
67 }
68 echo "<tr><td colspan='2'></td><td align='right'><b>"._("Total").":&nbsp;</b></td><td><b>".format_size($totalsize * 1024)." / ".format_size($q['web']["t"] * 1024)."</b></td></tr>";
69 echo "</table>";
70 
71 include_once("foot.php");
72 
73 ?>
exit
Definition: adm_doadd.php:70
$msg
Definition: bootstrap.php:75
format_size($size, $html=0)
Definition: functions.php:430
__($str)
Definition: functions.php:404
$q
Definition: quota_show.php:34
$totalsize
Definition: quota_show.php:45
$qlist
Definition: quota_show.php:43
$val
Definition: tempovars.php:15
if(empty($_POST['key'])||empty($_POST['val'])) $key
Definition: tempovars.php:14