source: bureau/admin/quota_show_all.php @ 703

Revision 703, 2.3 KB checked in by anarcat, 7 years ago (diff)

[project @ alternc: changeset 2005-08-01 18:41:47 by anarcat]
afficher les quotas sur une seule ligne mettre un bon titre

Original author: anarcat
Date: 2005-08-01 18:41:47

Line 
1<?php
2/*
3 $Id: quota_show_all.php,v 1.2 2005/08/01 18:41:47 anarcat Exp $
4 ----------------------------------------------------------------------
5 AlternC - Web Hosting System
6 Copyright (C) 2002 by the AlternC Development Team.
7 http://alternc.org/
8 ----------------------------------------------------------------------
9 Based on:
10 Valentin Lacambre's web hosting softwares: http://altern.org/
11 ----------------------------------------------------------------------
12 LICENSE
13
14 This program is free software; you can redistribute it and/or
15 modify it under the terms of the GNU General Public License (GPL)
16 as published by the Free Software Foundation; either version 2
17 of the License, or (at your option) any later version.
18
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 GNU General Public License for more details.
23
24 To read the license please visit http://www.gnu.org/copyleft/gpl.html
25 ----------------------------------------------------------------------
26 Original Author of file:
27 Purpose of file:
28 ----------------------------------------------------------------------
29*/
30require_once("../class/config.php");
31
32include("head.php");
33?>
34</head>
35<body>
36<h3><?php __("Quotas"); ?></h3>
37
38<?php
39
40if (! ($user_list = $admin->get_list())) {
41        $error = $err->errstr();
42}
43
44$class = ($class== 'lst1' ? 'lst2' : 'lst1');
45print "<table><tr class=\"$class\">";
46$ql = $quota->qlist();
47reset($ql);
48print "<td>User</td>";
49$sequence = array();
50foreach ($ql as $key => $name) {
51        print "<td>$name</td>";
52        $sequence[] = $key;
53}
54print "</tr>";
55$u = array();
56foreach ($user_list as $user) {
57  $u[$user['uid']] = $user['login'];
58}
59ksort($u);
60foreach ($u as $uid => $login) {
61$class = ($class== 'lst1' ? 'lst2' : 'lst1');
62print "<tr class=\"$class\"><td>";
63print $login.'('.$uid.")</td>";
64$mem->su($uid);
65if (!($quots = $quota->getquota())) {
66        $error = $err->errstr();
67}
68foreach($sequence as $key) {
69  $q = $quots[$key];
70  if ($q['u'] > $q['t']) {
71    $style = ' style="color: red"';
72  } else {
73    $style = '';
74  }
75  print "<td $style>".str_replace(" ", "&nbsp;", m_quota::display_val($key, $q['u']).'/'.m_quota::display_val($key, $q['t'])).'</td>';
76}
77print "</tr>";
78$mem->unsu();
79}
80print "</table>";
81
82?>
83</body>
84</html>
Note: See TracBrowser for help on using the repository browser.