]> andersk Git - sql-web.git/blob - tpl/main.php
be194997022dd7993053c9e584a821c9eb436138
[sql-web.git] / tpl / main.php
1 <?php
2
3 include 'head.php';
4
5 if (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                 $usage += $db['nBytes'];
31                 if ($total>0)
32                         $percentage = $db['nBytes']/$total;
33                 else $percentage = 0;
34                 echo printBar($percentage, $db['Name'], sprintSize($db['nBytes']));
35                 echo '</td><td>';
36                 echo '<input type="submit" name="dropask[',$db['Name'],']" value="drop">';
37                 echo '</td></tr>';
38         }
39         if ($total>0)
40                 $percentage = $usage/$total;
41         else
42                 $percentage = 0;
43         echo printBar($percentage, '<b>TOTAL</b>', sprintSize($usage).' / '.sprintSize($total));
44 ?>
45 </form>
46 </table>
47
48 <form method="post">
49 <p><span style="width: 150px;"><label for="p1">new database:</label></span> <input type="text" name="newdb">
50 <input type=submit value="Add"></p>
51 </form>
52
53 <?php
54
55 include 'foot.php';
56
57 ?>
This page took 0.026124 seconds and 3 git commands to generate.