-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdb.php
executable file
·59 lines (48 loc) · 1.34 KB
/
db.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<script type="text/javascript">
var auto_refresh = setInterval(
function ()
{
$('#a').load('backup.php').fadeIn("slow");
}, 1000); // refresh every 10000 milliseconds
</script>
<style>
.trs:nth-child(2n+1){
background-color:#CCC;}
</style>
<div id="a"></div>
<table bgcolor="" border="0" cellspacing="1" style=" border:#666 solid 1px;width:500px;margin-left:50px; margin-bottom:20px;">
<tr bgcolor="#3B5998" style="color:#FFF; background:#3B5998; font-size:15px; font-weight:bold;">
<td>
</td>
<td>
File Name
</td>
<td align="center">
Action
</td>
</tr>
<?php
// List the files
$dir = opendir ("./DB_backup");
$count=0;
while (false !== ($file = readdir($dir))) {
// Print the filenames that have .sql extension
if (strpos($file,'.sql',1)) {
$count++;
// Remove the sql extension part in the filename
$filenameboth = str_replace('.sql', '', $file);
// Print the cells
echo '<tr class="trs">';
echo "<td width='15'><img src='icons/b_selboard.png'></td>";
echo '<td>'.$filenameboth.".sql".'</td>';
echo "<td align='center'>"."<a href='DB_backup/" . $filenameboth . ".sql'>
<img src='icons/download-database-icon.png' height='20' />
Download</a>"."</td>";
echo "</tr>";
}
}
?>
<tr >
<td colspan="3" height="20" bgcolor="#3B5998"></td>
</tr>
</table>