Website Summary Files Commits Branches @commit @diff @stats
path: root / views / archive / topbar.php
blob: b00a33d6bcee3923ce6c849b516114b76880a3b4 (plain) (blame)
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
<?php
    require_once "../../models/database.php";
    require_once "../../models/webpage.php";
    require_once "../../models/user.php";

    $currentPageId = explode('/', $_SERVER['REQUEST_URI'], 4)[2];
    $currentPage = Database\Webpage::fromDBwid($currentPageId);
    $requester = Database\User::fromDBuid($currentPage->RequesterUID);

    $previousPageId = $currentPage->previousPageId();
    $nextPageId = $currentPage->nextPageId();
?>

<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: <?= $requester->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>