133 lines
8.7 KiB
PHP
133 lines
8.7 KiB
PHP
<?php
|
|
include 'config.php';
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Database Archives</title>
|
|
<link rel="stylesheet" href="styles.css">
|
|
<script>
|
|
function showTab() {
|
|
var tabName = document.getElementById("expansionSelect").value;
|
|
var i;
|
|
var x = document.getElementsByClassName("tab-content");
|
|
for (i = 0; i < x.length; i++) {
|
|
x[i].style.display = "none";
|
|
}
|
|
document.getElementById(tabName).style.display = "block";
|
|
}
|
|
</script>
|
|
</head>
|
|
<body onload="showTab()">
|
|
<div class="page-container">
|
|
<header class="site-header">
|
|
<div class="header-content">
|
|
<h1>Project Aatheria</h1>
|
|
<div class="dropdown-container">
|
|
<label for="expansionSelect">Select Expansion:</label>
|
|
<select id="expansionSelect" onchange="showTab()">
|
|
<?php
|
|
foreach ($fullNames as $identifier => $fullName) {
|
|
echo "<option value='$identifier'>$fullName</option>";
|
|
}
|
|
?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div class="content-wrap">
|
|
<div class="container">
|
|
<div class="table-container">
|
|
<?php
|
|
foreach ($fullNames as $identifier => $fullName) {
|
|
echo "<div id='$identifier' class='tab-content'>";
|
|
|
|
echo "<div class='site-sub-header'>";
|
|
echo "<div class='sub-header-body'>";
|
|
echo "<div class='row align-items-end'>";
|
|
echo "<div class='col'>";
|
|
echo "<h2 class='header-title'>";
|
|
echo "Database Archives";
|
|
echo "</h2>";
|
|
echo "<h3 class='header-pretitle'>";
|
|
echo "$fullName";
|
|
echo "</h3>";
|
|
echo "</div>";
|
|
echo "<div class='col-auto text-right'>";
|
|
|
|
// Fetch the latest archive details
|
|
$stmt = $main_db->prepare("SELECT downloads, archive, size, created FROM archive_logs WHERE db_identifier = ? ORDER BY created DESC LIMIT 1");
|
|
$stmt->bind_param("s", $identifier);
|
|
$stmt->execute();
|
|
$result = $stmt->get_result();
|
|
$latest = $result->fetch_assoc();
|
|
|
|
if ($latest) {
|
|
echo "<span class='download-latest-count badge badge-soft-primary'>Download Count: " . $latest['downloads'] . "</span>";
|
|
echo "<span class='download-latest-size badge badge-soft-secondary'>Size: " . formatSize($latest['size']) . "</span>";
|
|
echo "<br>";
|
|
echo "<span class='download-latest-created badge badge-soft-success mt-2'>Created: " . date("l F jS Y", strtotime($latest['created'])) . "</span>";
|
|
}
|
|
echo "<br>";
|
|
echo "<a href='download.php?file=" . $latest['archive'] . "' class='btn btn-sm btn-primary mt-3'>";
|
|
echo "<svg xmlns='http://www.w3.org/2000/svg' class='icon' aria-hidden='true' focusable='false' viewBox='0 0 512 512'><path fill='currentColor' d='M234.5 5.7c13.9-5 29.1-5 43.1 0l192 68.6C495 83.4 512 107.5 512 134.6l0 242.9c0 27-17 51.2-42.5 60.3l-192 68.6c-13.9 5-29.1 5-43.1 0l-192-68.6C17 428.6 0 404.5 0 377.4L0 134.6c0-27 17-51.2 42.5-60.3l192-68.6zM256 66L82.3 128 256 190l173.7-62L256 66zm32 368.6l160-57.1 0-188L288 246.6l0 188z'/></svg>";
|
|
echo "Download Latest $identifier Database";
|
|
echo "</a>";
|
|
$stmt->close();
|
|
echo "</div>";
|
|
echo "</div>";
|
|
echo "</div>";
|
|
echo "</div>";
|
|
echo "<div class='info-bar'>";
|
|
echo "<p>";
|
|
echo "<svg xmlns='http://www.w3.org/2000/svg' class='icon' aria-hidden='true' focusable='false' viewBox='0 0 512 512'><path fill='currentColor' d='M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z' /></svg>";
|
|
echo "Archives are generated nightly from our Live servers, retained for 30 days, and then kept monthly beyond that.</p>";
|
|
echo "</div>";
|
|
|
|
echo "<table>";
|
|
echo "<thead><tr><th style='width: 140px; text-align: center;'>Downloads</th><th style='text-align: center;'>Archive</th><th style='text-align: center;'>Size</th><th>Created</th></tr></thead>";
|
|
echo "<tbody>";
|
|
|
|
$stmt = $main_db->prepare("SELECT downloads, archive, size, created, db_version, protected FROM archive_logs WHERE db_identifier = ? ORDER BY created DESC");
|
|
$stmt->bind_param("s", $identifier);
|
|
$stmt->execute();
|
|
$result = $stmt->get_result();
|
|
|
|
while ($row = $result->fetch_assoc()) {
|
|
echo "<tr>";
|
|
echo "<td style='text-align: center;'>" . $row['downloads'] . "</td>";
|
|
echo "<td style='width:225px; text-align: center;'><a class='download-button' href='download.php?file=" . $row['archive'] . "'><svg xmlns='http://www.w3.org/2000/svg' class='icon' aria-hidden='true' focusable='false' viewBox='0 0 512 512'><path fill='currentColor' d='M234.5 5.7c13.9-5 29.1-5 43.1 0l192 68.6C495 83.4 512 107.5 512 134.6l0 242.9c0 27-17 51.2-42.5 60.3l-192 68.6c-13.9 5-29.1 5-43.1 0l-192-68.6C17 428.6 0 404.5 0 377.4L0 134.6c0-27 17-51.2 42.5-60.3l192-68.6zM256 66L82.3 128 256 190l173.7-62L256 66zm32 368.6l160-57.1 0-188L288 246.6l0 188z'/></svg>" . $row['archive'] . "</a></td>";
|
|
echo "<td style='width:100px; text-align: center;'>" . formatSize($row['size']) . "</td>";
|
|
echo "<td>" . date("l F jS Y", strtotime($row['created'])) . " (" . timeElapsedString($row['created']) . ")";
|
|
echo "<span class='db-version'><svg xmlns='http://www.w3.org/2000/svg' class='icon' aria-hidden='true' focusable='false' viewBox='0 0 448 512'><path fill='currentColor' d='M448 80l0 48c0 44.2-100.3 80-224 80S0 172.2 0 128L0 80C0 35.8 100.3 0 224 0S448 35.8 448 80zM393.2 214.7c20.8-7.4 39.9-16.9 54.8-28.6L448 288c0 44.2-100.3 80-224 80S0 332.2 0 288L0 186.1c14.9 11.8 34 21.2 54.8 28.6C99.7 230.7 159.5 240 224 240s124.3-9.3 169.2-25.3zM0 346.1c14.9 11.8 34 21.2 54.8 28.6C99.7 390.7 159.5 400 224 400s124.3-9.3 169.2-25.3c20.8-7.4 39.9-16.9 54.8-28.6l0 85.9c0 44.2-100.3 80-224 80S0 476.2 0 432l0-85.9z'/></svg> " . $row['db_version'] . "</span>";
|
|
if ($row['protected'] == 1) {
|
|
echo "<span class='db-protected'><svg xmlns='http://www.w3.org/2000/svg' class='icon' aria-hidden='true' focusable='false' viewBox='0 0 448 512'><path fill='currentColor' d='M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z'/></svg>Protected</span>";
|
|
}
|
|
echo "</td>";
|
|
echo "</tr>";
|
|
}
|
|
|
|
$stmt->close();
|
|
|
|
echo "</tbody>";
|
|
echo "</table>";
|
|
echo "</div>";
|
|
}
|
|
?>
|
|
<p class="contribute">Would you like to help keep our databases accurate? Click <a href="https://alla.aatheria.com" target="_blank">Here</a>!</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<footer class="site-footer">
|
|
<div class="footer-content">
|
|
<p>EverQuest is a registered trademark of Daybreak Game Company LLC.<br>
|
|
EQEmulator and Project Aatheria are not associated or affiliated in any way with Daybreak Game Company LLC.</p><br>
|
|
<p>© 2024 Project Aatheria. All rights reserved.</p>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
</body>
|
|
</html>
|