Website Summary Files Commits Branches @commit @diff @stats
path: root / views / archive / topbar.php
diff options
context:
space:
mode:
1 files changed, 34 insertions, 0 deletions
-rw-r--r--views/archive/topbar.php34
diff --git a/views/archive/topbar.php b/views/archive/topbar.php
new file mode 100644
index 0000000..f521fcb
--- /dev/null
+++ b/views/archive/topbar.php
@@ -0,0 +1,34 @@
+<!-- Dirty hack to escape all PHP dom sanitization and checks -->
+</script>
+
+<?php
+ require_once "../../models/database.php";
+ require_once "../../models/webpage.php";
+ require_once "../../models/user.php";
+
+ $currentPageId = basename(__DIR__);
+ $currentPage = Database\Webpage::fromDBwid($currentPageId);
+ $requesterUsername = Database\User::fromDBuid($currentPage->RequesterUID);
+
+ $previousPageId = Database\Webpage::getPreviousPageId($currentPage->URL, $currentPage->Date);
+ $nextPageId = Database\Webpage::getNextPageId($currentPage->URL, $currentPage->Date);
+?>
+
+<div class="navbar">
+ <div class="navbar-info">
+ <span>Title: <?= $currentPage->Title ?></span>
+ <span>Url: <?= $currentPage->URL ?></span>
+ <span>Date of archival: <?= $currentPage->Date ?></span>
+ <span>Visits: <?= $currentPage->Visits ?></span>
+ <span>Requested by: <?= $requesterUsername->Username ?></span>
+ </div>
+
+ <div class="navbar-links">
+ <? if ($previousPageId != 0): ?>
+ <a href="<?= "../$previousPageId/index.php" ?>">Previous version</a>
+ <? endif; ?>
+ <? if ($nextPageId != 0): ?>
+ <a href="<?= "../$nextPageId/index.php" ?>">Next version</a>
+ <? endif; ?>
+ </div>
+</div>