]> andersk Git - sql-web.git/blame_incremental - tpl/main.php
check quotas function
[sql-web.git] / tpl / main.php
... / ...
CommitLineData
1<?php
2
3include 'head.php';
4
5if (isset($i_dropask)) {
6 $dropdbs = array_keys($i_dropask);
7 echo '<form method="post">';
8 foreach($dropdbs as $dbname) {
9 $msg[] = 'Are you sure you want to drop `'.$dbname.'`? <input style="position:absolute; right:20px;" type="submit" name="drop['.$dbname.']" value="Yes">';
10 }
11 echo '</form>';
12}
13
14?>
15<h2>Databases</h2>
16
17<form method="post">
18<?php printErrors($err); ?>
19<?php printMsgs($msg); ?>
20</form>
21
22<table width="100%">
23<form method="post">
24<?php
25 $bytes = $User->getBytes();
26 $usage = $bytes['nBytes'];
27 $total = $bytes['nBytesHard'];
28 foreach($myDBs as $db) {
29 echo '<tr><td width="100%">';
30 if ($total>0)
31 $percentage = $db['nBytes']/$total;
32 else $percentage = 0;
33 echo printBar($percentage, $db['Name'], str_replace(' ', '&nbsp;', sprintSize($db['nBytes'])));
34 echo '</td><td>';
35 echo '<input type="submit" name="dropask[',$db['Name'],']" value="drop">';
36 echo '</td></tr>';
37 }
38 if ($total>0) {
39 $percentage = $usage/$total;
40 } else {
41 $percentage = 0;
42 }
43 echo '<tr><td colspan=2>';
44 echo '<hr />';
45 echo '</td></tr>';
46 echo '<tr><td colspan=2>';
47 echo printBar($percentage, '<b>TOTAL&nbsp;USED</b>', str_replace(' ', '&nbsp;', sprintSize($usage).' of '.sprintSize($total)));
48 echo '</td></tr>';
49?>
50</form>
51</table>
52
53<form method="post">
54<p><span style="width: 150px;"><label for="p1">new database:</label></span> <input type="text" name="newdb">
55<input type=submit value="Add"></p>
56</form>
57
58<?php
59
60include 'foot.php';
61
62?>
This page took 0.026754 seconds and 5 git commands to generate.