add a dropdown to choose the databases backup to ease restores

This commit is contained in:
Antoine Beaupré 2007-05-30 20:05:05 +00:00
parent 8f7c385161
commit e8f383e5fd
1 changed files with 28 additions and 0 deletions

View File

@ -47,6 +47,34 @@ if (is_array($r)) {
?>
<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">
<input type="hidden" name="id" value="<?php echo $id ?>" />
<table cellspacing="0" cellpadding="4">