]>
Commit | Line | Data |
---|---|---|
dc478ec8 JP |
1 | <?php |
2 | ||
3 | include 'head.php'; | |
4 | ||
e47be57b JP |
5 | if (isset($i_dropask)) { |
6 | $dropdbs = array_keys($i_dropask); | |
53f8750e | 7 | echo '<form method="post" action="', $URI,'">'; |
e47be57b | 8 | foreach($dropdbs as $dbname) { |
9840d102 | 9 | $msg1[] = 'Are you sure you want to drop `'.$dbname.'`? <input style="position:absolute; right:20px;" type="submit" name="drop['.$dbname.']" value="Yes">'; |
e47be57b JP |
10 | } |
11 | echo '</form>'; | |
12 | } | |
13 | ||
dc478ec8 | 14 | ?> |
aaf1710a | 15 | <h3>Databases</h3> |
1389493c | 16 | |
53f8750e | 17 | <form method="post" action="<?=$URI?>"> |
9840d102 JP |
18 | <?php printErrors($err1); ?> |
19 | <?php printMsgs($msg1); ?> | |
e47be57b | 20 | </form> |
377015e0 | 21 | |
88b7d384 | 22 | <table width="100%"> |
53f8750e | 23 | <form method="post" action="<?=$URI?>"> |
2ea5a69f | 24 | <?php |
88b7d384 JP |
25 | $bytes = $User->getBytes(); |
26 | $usage = $bytes['nBytes']; | |
27 | $total = $bytes['nBytesHard']; | |
9840d102 JP |
28 | if (!count($myDBs)) { |
29 | echo '<tr><td width="100%"><em>You have no databases. Add one below.</em></td></tr>'; | |
30 | } else | |
2ea5a69f | 31 | foreach($myDBs as $db) { |
88b7d384 | 32 | echo '<tr><td width="100%">'; |
88b7d384 JP |
33 | if ($total>0) |
34 | $percentage = $db['nBytes']/$total; | |
35 | else $percentage = 0; | |
9c70b481 | 36 | echo printBar($percentage, $db['Name'], str_replace(' ', ' ', sprintSize($db['nBytes']))); |
88b7d384 | 37 | echo '</td><td>'; |
e47be57b | 38 | echo '<input type="submit" name="dropask[',$db['Name'],']" value="drop">'; |
88b7d384 | 39 | echo '</td></tr>'; |
2ea5a69f | 40 | } |
9c70b481 | 41 | if ($total>0) { |
88b7d384 | 42 | $percentage = $usage/$total; |
9c70b481 | 43 | } else { |
88b7d384 | 44 | $percentage = 0; |
9c70b481 JP |
45 | } |
46 | echo '<tr><td colspan=2>'; | |
47 | echo '<hr />'; | |
48 | echo '</td></tr>'; | |
49 | echo '<tr><td colspan=2>'; | |
50 | echo printBar($percentage, '<b>TOTAL USED</b>', str_replace(' ', ' ', sprintSize($usage).' of '.sprintSize($total))); | |
51 | echo '</td></tr>'; | |
2ea5a69f | 52 | ?> |
88b7d384 JP |
53 | </form> |
54 | </table> | |
2ea5a69f | 55 | |
53f8750e | 56 | <form method="post" action="<?=$URI?>"> |
7a5afe9c | 57 | <p align="right"><span style="width: 150px; font-style: italic;"><label for="p1">new database:</label></span> <?=$Login->getUsername()?>+<input type="text" name="newdb"> |
e476b401 | 58 | <input type=submit value="add"></p> |
377015e0 | 59 | </form> |
1389493c | 60 | |
aaf1710a | 61 | <h3>Manage Data</h3> |
da0d337f | 62 | <p>One interface we recommend for managing SQL data is <a href="https://scripts.mit.edu/~sql/phpMyAdmin/" target="_blank">phpMyAdmin</a>. Feel free to use it after you've created your databases.</p> |
4a77eeb5 | 63 | |
dc478ec8 JP |
64 | <?php |
65 | ||
66 | include 'foot.php'; | |
67 | ||
68 | ?> |