Display list of backups per date

This commit is contained in:
Matt Pass
2015-10-08 09:27:34 +01:00
parent 815578eb34
commit cb6d339183
2 changed files with 74 additions and 0 deletions

29
lib/backup-versions.css Normal file
View File

@@ -0,0 +1,29 @@
/* First, reset everything to a standard */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
border: 0;
margin: 0;
padding: 0;
outline: 0;
font-size: 12px;
vertical-align: top;
}
body {overflow: hidden;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
h1 {font-size: 36px; font-weight: normal; color: #888; margin-bottom: 20px}
a {color: #fff; text-decoration: none}
.backup-versions {font-family: arial, verdana, helvetica, sans-serif; background-color: #1c1c19; color: #fff; padding: 20px}

45
lib/backup-versions.php Normal file
View File

@@ -0,0 +1,45 @@
<?php
// Load common functions
include("headers.php");
include_once("settings-common.php");
$text = $_SESSION['text'];
$t = $text['backup-versions'];
$file = str_replace("|","/",xssClean($_GET['file'],'html'));
$fileCountInfo = getVersionsCount(dirname($file),basename($file));
$versions = $fileCountInfo['count'];
?>
<!DOCTYPE html>
<html>
<head>
<title>ICEcoder <?php echo $ICEcoder["versionNo"];?> backup version control</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" type="text/css" href="backup-versions.css?microtime=<?php echo microtime(true);?>">
</head>
<body class="backup-versions">
<h1 id="title"><?php echo $versions." ".($versions != 1 ? $t["backups"] : $t["backup"])." ".$t['available for'].":";?></h1>
<h2><?php echo $file;?></h2>
<br>
<?php
$dateCounts = $fileCountInfo['dateCounts'];
$displayVersions = $versions;
foreach ($dateCounts as $key => $value) {
echo "<b>".date("jS M Y",strtotime($key))." (".$value." ".($value != 1 ? $t["backups"] : $t["backup"]).")</b>";
echo '<br>';
for ($j=0; $j<$value; $j++) {
echo "Backup ".$displayVersions.'<br>';
$displayVersions--;
}
echo '<br>';
}
?>
</body>
</html>