add a dropdown to choose the databases backup to ease restores
This commit is contained in:
parent
8f7c385161
commit
e8f383e5fd
|
@ -47,6 +47,34 @@ if (is_array($r)) {
|
||||||
?>
|
?>
|
||||||
<h3><?php printf(_("Restore a SQL backup for database %s"),$r["db"]); ?></h3>
|
<h3><?php printf(_("Restore a SQL backup for database %s"),$r["db"]); ?></h3>
|
||||||
|
|
||||||
|
<form action="sql_dorestore.php" method="post">
|
||||||
|
<input type="hidden" name="id" value="<?php echo $id ?>" />
|
||||||
|
<table cellspacing="0" cellpadding="4">
|
||||||
|
<tr class="lst2">
|
||||||
|
<th><label for="restfile"><?php __("Please choose the filename containing SQL data to be restored."); ?></label></th>
|
||||||
|
<td><select class="int" id="restfile" name="restfile">
|
||||||
|
<?php
|
||||||
|
// Open a known directory, and proceed to read its contents
|
||||||
|
$dir = getuserpath(). $r['dir'];
|
||||||
|
if (is_dir($dir)) {
|
||||||
|
if ($dh = opendir($dir)) {
|
||||||
|
while (($file = readdir($dh)) !== false) {
|
||||||
|
if (filetype($dir . '/' . $file) == 'file') {
|
||||||
|
echo '<option value="' . $r['dir'] . '/' . $file . '">'. $file . '</option>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir($dh);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><input class="inb" type="submit" name="submit" value="<?php __("Restore my database"); ?>" /></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
<?php __("OR");?>
|
||||||
<form action="sql_dorestore.php" method="post">
|
<form action="sql_dorestore.php" method="post">
|
||||||
<input type="hidden" name="id" value="<?php echo $id ?>" />
|
<input type="hidden" name="id" value="<?php echo $id ?>" />
|
||||||
<table cellspacing="0" cellpadding="4">
|
<table cellspacing="0" cellpadding="4">
|
||||||
|
|
Loading…
Reference in New Issue