| [1] | 1 | <?php |
|---|
| 2 | /* |
|---|
| [802] | 3 | $Id: sql_list.php,v 1.8 2006/02/16 16:26:28 benjamin Exp $ |
|---|
| [1] | 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: Benjamin Sonntag |
|---|
| 27 | Purpose of file: Manage the MySQL database of a member |
|---|
| 28 | ---------------------------------------------------------------------- |
|---|
| 29 | */ |
|---|
| 30 | require_once("../class/config.php"); |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | $r=$mysql->get_dblist(); |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | include("head.php"); |
|---|
| 37 | ?> |
|---|
| 38 | </head> |
|---|
| 39 | <body> |
|---|
| [104] | 40 | <h3><?php __("MySQL Databases"); ?></h3> |
|---|
| [1] | 41 | <?php |
|---|
| 42 | if ($error) { |
|---|
| [104] | 43 | echo "<p class=\"error\">$error</p><p> </p>"; |
|---|
| [1] | 44 | } |
|---|
| 45 | |
|---|
| 46 | if ($r) { |
|---|
| 47 | |
|---|
| 48 | echo "<p>"._("help_sql_list_ok")."</p>"; |
|---|
| 49 | ?> |
|---|
| 50 | |
|---|
| 51 | <form method="post" action="sql_del.php"> |
|---|
| 52 | <table cellspacing="0" cellpadding="4"> |
|---|
| 53 | <tr><th> </th><th><?php __("Database"); ?></th><th><?php __("Backup"); ?></th><th><?php __("Restore"); ?></th><th><?php __("Size"); ?></th></tr> |
|---|
| 54 | |
|---|
| 55 | <?php |
|---|
| 56 | $col=1; |
|---|
| 57 | for($i=0;$i<count($r);$i++) { |
|---|
| 58 | $val=$r[$i]; |
|---|
| [2478] | 59 | $val['size'] = $mysql->get_db_size($val['db']); |
|---|
| [1] | 60 | $col=3-$col; |
|---|
| 61 | ?> |
|---|
| 62 | <tr class="lst<?php echo $col; ?>"> |
|---|
| [104] | 63 | <td align="center"><input type="checkbox" class="inc" id="del_<?php echo $val["name"]; ?>" name="del_<?php echo $val["name"]; ?>" value="<?php echo $val["name"]; ?>" /></td> |
|---|
| [1] | 64 | <td><label for="del_<?php echo $val["name"]; ?>"><?php echo $val["db"]; ?></label></td> |
|---|
| 65 | <td><a href="sql_bck.php?id=<?php echo $val["name"] ?>"><?php __("Backup"); ?></a></td> |
|---|
| 66 | <td><a href="sql_restore.php?id=<?php echo $val["name"] ?>"><?php __("Restore"); ?></a></td> |
|---|
| [109] | 67 | <td><code><?php echo format_size($val["size"]); ?></code></td> |
|---|
| [1] | 68 | </tr> |
|---|
| 69 | <?php |
|---|
| 70 | |
|---|
| 71 | |
|---|
| 72 | } |
|---|
| 73 | ?> |
|---|
| 74 | <tr><td colspan="5"> |
|---|
| [104] | 75 | <input type="submit" name="sub" value="<?php __("Delete the checked databases"); ?>" class="inb" /> |
|---|
| [1] | 76 | </td></tr> |
|---|
| 77 | </table> |
|---|
| 78 | </form> |
|---|
| 79 | |
|---|
| 80 | <p> </p> |
|---|
| 81 | <p> |
|---|
| 82 | <?php if ($quota->cancreate("mysql")) { ?> |
|---|
| [102] | 83 | <a href="sql_add.php"><?php __("Create a new database"); ?></a><br /><br /> |
|---|
| [1] | 84 | <?php } ?> |
|---|
| [102] | 85 | <a href="sql_passchg.php"><?php __("Change the SQL password"); ?></a><br /><br /> |
|---|
| 86 | <a href="sql_getparam.php"><?php __("Get the current SQL parameters"); ?></a><br /><br /> |
|---|
| [1] | 87 | |
|---|
| 88 | </p> |
|---|
| 89 | |
|---|
| 90 | <?php |
|---|
| 91 | } else { |
|---|
| 92 | echo "<p>"._("help_sql_list_no")."</p>"; |
|---|
| 93 | |
|---|
| 94 | ?> |
|---|
| 95 | <form method="post" action="sql_addmain.php"> |
|---|
| 96 | <table cellspacing="0" cellpadding="4"> |
|---|
| [802] | 97 | <tr class="lst2"><th><?php __("Username"); ?></th><td><code><?php echo $mem->user["login"]; ?></code></td></tr> |
|---|
| [796] | 98 | <tr class="lst1"><th><label for="pass"><?php __("Password"); ?></label></th><td><code><input class="int" type="password" name="pass" id="pass" value="" /></code></td></tr> |
|---|
| [1] | 99 | <tr class="lst2"><th><?php __("SQL Server"); ?></th><td><code><?php echo $mysql->server; ?></code></td></tr> |
|---|
| 100 | <tr class="lst1"><th><?php __("Database"); ?></th><td><code><?php echo $mem->user["login"]; ?></code></td></tr> |
|---|
| [104] | 101 | <tr><td><input type="submit" class="inb" name="submit" value="<?php __("Create my main database"); ?>" /></td></tr> |
|---|
| [1] | 102 | </table> |
|---|
| 103 | </form> |
|---|
| 104 | <?php |
|---|
| 105 | } |
|---|
| 106 | ?> |
|---|
| 107 | |
|---|
| 108 | </body> |
|---|
| 109 | </html> |
|---|