76 lines
2.6 KiB
PHP
76 lines
2.6 KiB
PHP
<?php
|
|
/**
|
|
* Navigation sidebar - BackOffice.
|
|
*/
|
|
|
|
$unreadCount = 0;
|
|
try {
|
|
$dbNav = getDatabase();
|
|
$unreadCount = (int) $dbNav->query('SELECT COUNT(*) FROM contact_messages WHERE is_read = 0')->fetchColumn();
|
|
} catch (Throwable) {
|
|
}
|
|
|
|
$currentPage = basename($_SERVER['PHP_SELF']);
|
|
?>
|
|
<aside class="admin-sidebar">
|
|
<div class="admin-sidebar__brand">
|
|
<span class="admin-sidebar__logo">Tony<span>.</span></span>
|
|
<span class="admin-sidebar__sub">BackOffice</span>
|
|
</div>
|
|
|
|
<nav class="admin-sidebar__nav" aria-label="Navigation backoffice">
|
|
<a href="dashboard.php" class="admin-nav-item <?= $currentPage === 'dashboard.php' ? 'is-active' : '' ?>">
|
|
Dashboard
|
|
</a>
|
|
|
|
<a href="index.php" class="admin-nav-item <?= $currentPage === 'index.php' ? 'is-active' : '' ?>">
|
|
Projets
|
|
</a>
|
|
|
|
<a href="messages.php" class="admin-nav-item <?= $currentPage === 'messages.php' ? 'is-active' : '' ?>">
|
|
Messages
|
|
<?php if ($unreadCount > 0): ?>
|
|
<span class="admin-nav-badge"><?= $unreadCount ?></span>
|
|
<?php endif; ?>
|
|
</a>
|
|
|
|
<a href="services.php" class="admin-nav-item <?= $currentPage === 'services.php' ? 'is-active' : '' ?>">
|
|
Services
|
|
</a>
|
|
|
|
<a href="content.php" class="admin-nav-item <?= $currentPage === 'content.php' ? 'is-active' : '' ?>">
|
|
Contenu & SEO
|
|
</a>
|
|
|
|
<a href="analytics.php" class="admin-nav-item <?= $currentPage === 'analytics.php' ? 'is-active' : '' ?>">
|
|
Analytics
|
|
</a>
|
|
|
|
<div class="admin-nav-separator"></div>
|
|
|
|
<a href="security.php" class="admin-nav-item <?= $currentPage === 'security.php' ? 'is-active' : '' ?>">
|
|
Securite & Admins
|
|
</a>
|
|
|
|
<a href="settings.php" class="admin-nav-item <?= $currentPage === 'settings.php' ? 'is-active' : '' ?>">
|
|
Parametres
|
|
</a>
|
|
</nav>
|
|
|
|
<div class="admin-sidebar__footer">
|
|
<a href="../index.php" class="admin-sidebar__view-site">
|
|
Acceder au site
|
|
</a>
|
|
|
|
<span class="admin-sidebar__user">
|
|
<?= Security::e((string) ($_SESSION['admin_username'] ?? 'Admin')) ?>
|
|
</span>
|
|
|
|
<form method="post" action="/admin/logout.php" class="admin-sidebar__logout" style="margin:0;">
|
|
<?= Security::csrfInput() ?>
|
|
<button type="submit" style="all:unset;display:inline-flex;align-items:center;gap:0.5rem;cursor:pointer;color:inherit;">
|
|
Deconnexion
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</aside>
|