| [702] | 1 | <?php |
|---|
| 2 | /* |
|---|
| [704] | 3 | $Id: quota_show_all.php,v 1.3 2005/08/01 19:38:53 anarcat Exp $ |
|---|
| [702] | 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 | */ |
|---|
| 30 | require_once("../class/config.php"); |
|---|
| 31 | |
|---|
| 32 | include("head.php"); |
|---|
| 33 | ?> |
|---|
| 34 | </head> |
|---|
| 35 | <body> |
|---|
| [703] | 36 | <h3><?php __("Quotas"); ?></h3> |
|---|
| [702] | 37 | |
|---|
| 38 | <?php |
|---|
| 39 | |
|---|
| 40 | if (! ($user_list = $admin->get_list())) { |
|---|
| 41 | $error = $err->errstr(); |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | $class = ($class== 'lst1' ? 'lst2' : 'lst1'); |
|---|
| 45 | print "<table><tr class=\"$class\">"; |
|---|
| 46 | $ql = $quota->qlist(); |
|---|
| 47 | reset($ql); |
|---|
| 48 | print "<td>User</td>"; |
|---|
| 49 | $sequence = array(); |
|---|
| 50 | foreach ($ql as $key => $name) { |
|---|
| 51 | print "<td>$name</td>"; |
|---|
| 52 | $sequence[] = $key; |
|---|
| 53 | } |
|---|
| 54 | print "</tr>"; |
|---|
| 55 | $u = array(); |
|---|
| 56 | foreach ($user_list as $user) { |
|---|
| 57 | $u[$user['uid']] = $user['login']; |
|---|
| 58 | } |
|---|
| [704] | 59 | asort($u); |
|---|
| [702] | 60 | foreach ($u as $uid => $login) { |
|---|
| 61 | $class = ($class== 'lst1' ? 'lst2' : 'lst1'); |
|---|
| 62 | print "<tr class=\"$class\"><td>"; |
|---|
| 63 | print $login.'('.$uid.")</td>"; |
|---|
| 64 | $mem->su($uid); |
|---|
| 65 | if (!($quots = $quota->getquota())) { |
|---|
| 66 | $error = $err->errstr(); |
|---|
| 67 | } |
|---|
| 68 | foreach($sequence as $key) { |
|---|
| 69 | $q = $quots[$key]; |
|---|
| 70 | if ($q['u'] > $q['t']) { |
|---|
| 71 | $style = ' style="color: red"'; |
|---|
| 72 | } else { |
|---|
| 73 | $style = ''; |
|---|
| 74 | } |
|---|
| [703] | 75 | print "<td $style>".str_replace(" ", " ", m_quota::display_val($key, $q['u']).'/'.m_quota::display_val($key, $q['t'])).'</td>'; |
|---|
| [702] | 76 | } |
|---|
| 77 | print "</tr>"; |
|---|
| 78 | $mem->unsu(); |
|---|
| 79 | } |
|---|
| 80 | print "</table>"; |
|---|
| 81 | |
|---|
| 82 | ?> |
|---|
| 83 | </body> |
|---|
| 84 | </html> |
|---|