289 lines
17 KiB
PHP
289 lines
17 KiB
PHP
<?php
|
|
/**
|
|
* Header & Navigatiebalk voor Fociz
|
|
*/
|
|
|
|
require_once __DIR__ . '/auth.php';
|
|
$currentUser = $currentUser ?? require_auth();
|
|
$currentPage = basename($_SERVER['PHP_SELF']);
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="nl" class="dark">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title><?= htmlspecialchars($pageTitle ?? 'Fociz — Focus, Dagplanning & Roadmap') ?></title>
|
|
<!-- Tailwind CSS CDN -->
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<script>
|
|
tailwind.config = {
|
|
darkMode: 'class',
|
|
theme: {
|
|
extend: {
|
|
colors: {
|
|
brand: {
|
|
50: '#f0fdf4',
|
|
500: '#10b981',
|
|
600: '#059669',
|
|
700: '#047857',
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<!-- Lucide Icons -->
|
|
<script src="https://unpkg.com/lucide@latest"></script>
|
|
<style>
|
|
body {
|
|
background-color: #090d16;
|
|
color: #f1f5f9;
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
|
}
|
|
::-webkit-scrollbar { width: 8px; height: 8px; }
|
|
::-webkit-scrollbar-track { background: #0f172a; }
|
|
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
|
|
::-webkit-scrollbar-thumb:hover { background: #475569; }
|
|
</style>
|
|
<body class="min-h-screen flex flex-col antialiased selection:bg-emerald-500 selection:text-white">
|
|
|
|
<?php
|
|
// Include flashy omgevingsindicator (Dev = Rood, Live = Groen)
|
|
require_once __DIR__ . '/env_badge.php';
|
|
?>
|
|
|
|
<?php if ($currentUser): ?>
|
|
<header class="sticky top-0 z-40 bg-[#0c121e]/90 backdrop-blur-md border-b border-slate-800/80">
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
<div class="flex items-center justify-between h-16">
|
|
<!-- Brand Logo (met linker padding zodat het badge vrij staat) -->
|
|
<div class="flex items-center space-x-6 pl-28 sm:pl-36">
|
|
<a href="/planner.php" class="flex items-center space-x-2.5 group">
|
|
<div class="w-9 h-9 rounded-xl bg-gradient-to-tr from-emerald-600 to-teal-400 flex items-center justify-center text-slate-950 font-black text-lg shadow-md shadow-emerald-500/20 group-hover:scale-105 transition">
|
|
F
|
|
</div>
|
|
<div class="flex flex-col">
|
|
<span class="text-xl font-bold tracking-tight text-white leading-none">Fociz</span>
|
|
<span class="text-[10px] text-emerald-400 tracking-wider font-semibold uppercase">Focus & Structuur</span>
|
|
</div>
|
|
</a>
|
|
|
|
<!-- Nav Tabs -->
|
|
<nav class="hidden md:flex items-center space-x-1">
|
|
<a href="/planner.php" class="flex items-center space-x-2 px-3.5 py-2 rounded-lg text-sm font-medium transition <?= $currentPage === 'planner.php' ? 'bg-emerald-500/10 text-emerald-400 border border-emerald-500/20' : 'text-slate-400 hover:text-slate-200 hover:bg-slate-800/60' ?>">
|
|
<i data-lucide="calendar" class="w-4 h-4"></i>
|
|
<span>Dagplanning</span>
|
|
</a>
|
|
<a href="/brainstorm.php" class="flex items-center space-x-2 px-3.5 py-2 rounded-lg text-sm font-medium transition <?= in_array($currentPage, ['brainstorm.php', 'brainstorm_canvas.php']) ? 'bg-emerald-500/10 text-emerald-400 border border-emerald-500/20' : 'text-slate-400 hover:text-slate-200 hover:bg-slate-800/60' ?>">
|
|
<i data-lucide="lightbulb" class="w-4 h-4"></i>
|
|
<span>Brainstorm</span>
|
|
</a>
|
|
<a href="/roadmap.php" class="flex items-center space-x-2 px-3.5 py-2 rounded-lg text-sm font-medium transition <?= $currentPage === 'roadmap.php' ? 'bg-emerald-500/10 text-emerald-400 border border-emerald-500/20' : 'text-slate-400 hover:text-slate-200 hover:bg-slate-800/60' ?>">
|
|
<i data-lucide="map" class="w-4 h-4"></i>
|
|
<span>Roadmap</span>
|
|
</a>
|
|
<a href="/integrations.php" class="flex items-center space-x-2 px-3.5 py-2 rounded-lg text-sm font-medium transition <?= $currentPage === 'integrations.php' ? 'bg-emerald-500/10 text-emerald-400 border border-emerald-500/20' : 'text-slate-400 hover:text-slate-200 hover:bg-slate-800/60' ?>">
|
|
<i data-lucide="layers" class="w-4 h-4"></i>
|
|
<span>Integraties</span>
|
|
</a>
|
|
<?php if ($currentUser['role'] === 'ADMIN'): ?>
|
|
<a href="/users.php" class="flex items-center space-x-2 px-3.5 py-2 rounded-lg text-sm font-medium transition <?= $currentPage === 'users.php' ? 'bg-emerald-500/10 text-emerald-400 border border-emerald-500/20' : 'text-slate-400 hover:text-slate-200 hover:bg-slate-800/60' ?>">
|
|
<i data-lucide="users" class="w-4 h-4"></i>
|
|
<span>Team & Invites</span>
|
|
</a>
|
|
<?php endif; ?>
|
|
</nav>
|
|
</div>
|
|
|
|
<!-- Right side: User, Notifications & 2FA Status -->
|
|
<div class="flex items-center space-x-2.5">
|
|
<button type="button" onclick="openNotificationModal()" class="relative p-2 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition" title="Meldingen & Agenda Herinneringen">
|
|
<i data-lucide="bell" class="w-4 h-4"></i>
|
|
<span id="focizNotificationDot" class="hidden absolute top-1.5 right-1.5 w-2 h-2 rounded-full bg-blue-500 animate-pulse"></span>
|
|
</button>
|
|
|
|
<div class="hidden sm:flex items-center space-x-1.5 px-2.5 py-1 rounded-full bg-emerald-500/10 border border-emerald-500/25 text-emerald-400 text-xs font-medium">
|
|
<i data-lucide="shield-check" class="w-3.5 h-3.5"></i>
|
|
<span>2FA Actief</span>
|
|
</div>
|
|
|
|
<div class="text-right hidden sm:block">
|
|
<div class="text-xs font-semibold text-slate-200"><?= htmlspecialchars($currentUser['name']) ?></div>
|
|
<div class="text-[10px] text-slate-500">
|
|
<?= $currentUser['role'] === 'ADMIN' ? 'Beheerder' : 'Collega' ?> • <?= htmlspecialchars($currentUser['email']) ?>
|
|
</div>
|
|
</div>
|
|
|
|
<a href="/auth/logout.php" title="Veilig uitloggen" class="p-2 rounded-lg text-slate-400 hover:text-red-400 hover:bg-red-500/10 border border-transparent hover:border-red-500/20 transition">
|
|
<i data-lucide="log-out" class="w-4 h-4"></i>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Mobile Navigation -->
|
|
<div class="flex md:hidden items-center justify-around py-2 border-t border-slate-800/60 text-xs">
|
|
<a href="/planner.php" class="flex flex-col items-center py-1 <?= $currentPage === 'planner.php' ? 'text-emerald-400 font-bold' : 'text-slate-400' ?>">
|
|
<i data-lucide="calendar" class="w-4 h-4 mb-0.5"></i>
|
|
<span>Planning</span>
|
|
</a>
|
|
<a href="/brainstorm.php" class="flex flex-col items-center py-1 <?= in_array($currentPage, ['brainstorm.php', 'brainstorm_canvas.php']) ? 'text-emerald-400 font-bold' : 'text-slate-400' ?>">
|
|
<i data-lucide="lightbulb" class="w-4 h-4 mb-0.5"></i>
|
|
<span>Brainstorm</span>
|
|
</a>
|
|
<a href="/roadmap.php" class="flex flex-col items-center py-1 <?= $currentPage === 'roadmap.php' ? 'text-emerald-400 font-bold' : 'text-slate-400' ?>">
|
|
<i data-lucide="map" class="w-4 h-4 mb-0.5"></i>
|
|
<span>Roadmap</span>
|
|
</a>
|
|
<a href="/integrations.php" class="flex flex-col items-center py-1 <?= $currentPage === 'integrations.php' ? 'text-emerald-400 font-bold' : 'text-slate-400' ?>">
|
|
<i data-lucide="layers" class="w-4 h-4 mb-0.5"></i>
|
|
<span>Koppelingen</span>
|
|
</a>
|
|
<button type="button" onclick="openNotificationModal()" class="flex flex-col items-center py-1 text-slate-400 hover:text-white">
|
|
<i data-lucide="bell" class="w-4 h-4 mb-0.5"></i>
|
|
<span>Meldingen</span>
|
|
</button>
|
|
<?php if ($currentUser['role'] === 'ADMIN'): ?>
|
|
<a href="/users.php" class="flex flex-col items-center py-1 <?= $currentPage === 'users.php' ? 'text-emerald-400 font-bold' : 'text-slate-400' ?>">
|
|
<i data-lucide="users" class="w-4 h-4 mb-0.5"></i>
|
|
<span>Team</span>
|
|
</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Fociz Agenda Notificaties Modal -->
|
|
<div id="focizNotificationModal" class="hidden fixed inset-0 z-50 bg-black/80 backdrop-blur-sm items-center justify-center p-4">
|
|
<div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md overflow-hidden shadow-2xl animate-in fade-in zoom-in-95 duration-200">
|
|
<!-- Modal Header -->
|
|
<div class="p-5 border-b border-slate-800/80 flex items-center justify-between">
|
|
<div class="flex items-center space-x-2.5">
|
|
<div class="w-9 h-9 rounded-xl bg-blue-500/10 border border-blue-500/30 text-blue-400 flex items-center justify-center font-bold">
|
|
<i data-lucide="bell-ring" class="w-4 h-4"></i>
|
|
</div>
|
|
<div>
|
|
<h3 class="text-sm font-bold text-white">Agenda Push Meldingen</h3>
|
|
<p class="text-[11px] text-slate-400">Persoonlijke waarschuwingen bij actuele afspraken</p>
|
|
</div>
|
|
</div>
|
|
<button type="button" onclick="closeNotificationModal()" class="text-slate-500 hover:text-white p-1 rounded-lg transition">
|
|
<i data-lucide="x" class="w-4 h-4"></i>
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Inhoud Formulier -->
|
|
<form onsubmit="saveNotificationPreferences(event)" class="p-5 space-y-4 text-xs">
|
|
<!-- Browser Permissie Banner -->
|
|
<div id="notifPermGranted" class="hidden p-3 rounded-xl bg-emerald-500/10 border border-emerald-500/30 text-emerald-300 flex items-center justify-between">
|
|
<div class="flex items-center space-x-2">
|
|
<i data-lucide="check-circle" class="w-4 h-4 text-emerald-400 flex-shrink-0"></i>
|
|
<span class="text-[11px]">Browser pushberichten zijn actief</span>
|
|
</div>
|
|
<button type="button" onclick="focizTestNotification()" class="px-2 py-1 rounded-lg bg-emerald-500/20 hover:bg-emerald-500/30 text-emerald-300 font-semibold text-[10px] transition">
|
|
Test Melding
|
|
</button>
|
|
</div>
|
|
|
|
<div id="notifPermRequest" class="p-3 rounded-xl bg-blue-500/10 border border-blue-500/30 text-blue-200 flex items-center justify-between">
|
|
<div class="flex items-center space-x-2">
|
|
<i data-lucide="bell" class="w-4 h-4 text-blue-400 flex-shrink-0"></i>
|
|
<span class="text-[11px]">Toestemming browser vereist</span>
|
|
</div>
|
|
<button type="button" onclick="focizRequestPermission()" class="px-2.5 py-1 rounded-lg bg-blue-600 hover:bg-blue-500 text-white font-bold text-[10px] transition shadow">
|
|
Inschakelen
|
|
</button>
|
|
</div>
|
|
|
|
<div id="notifPermDenied" class="hidden p-3 rounded-xl bg-red-500/10 border border-red-500/30 text-red-300 text-[11px] leading-relaxed">
|
|
<i data-lucide="alert-triangle" class="w-4 h-4 text-red-400 inline mr-1 -mt-0.5"></i>
|
|
Browser meldingen zijn geblokkeerd. Klik op het slotje links in de browser adresbalk om meldingen toe te staan.
|
|
</div>
|
|
|
|
<!-- Toggle Meldingen Inschakelen -->
|
|
<div class="flex items-center justify-between p-3 rounded-xl bg-slate-950/60 border border-slate-800">
|
|
<div>
|
|
<span class="font-semibold text-white block">Meldingen Actief</span>
|
|
<span class="text-[10px] text-slate-400">Automatisch waarschuwen bij naderende afspraken</span>
|
|
</div>
|
|
<label class="relative inline-flex items-center cursor-pointer">
|
|
<input type="checkbox" id="notifEnabledInput" class="sr-only peer">
|
|
<div class="w-9 h-5 bg-slate-800 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-blue-600"></div>
|
|
</label>
|
|
</div>
|
|
|
|
<!-- Vooraankondigingstijd -->
|
|
<div>
|
|
<label class="block font-semibold text-slate-300 mb-1">
|
|
Hoeveel tijd van tevoren waarschuwen?
|
|
</label>
|
|
<select id="notifLeadTimeSelect" class="w-full bg-slate-950 border border-slate-800 rounded-xl px-3 py-2 text-white focus:outline-none focus:border-blue-500">
|
|
<option value="0">0 minuten (Precies op aanvangstijd)</option>
|
|
<option value="2">2 minuten van tevoren</option>
|
|
<option value="5" selected>5 minuten van tevoren (Aanbevolen)</option>
|
|
<option value="10">10 minuten van tevoren</option>
|
|
<option value="15">15 minuten van tevoren</option>
|
|
<option value="30">30 minuten van tevoren</option>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Aantal Herhalingen & Interval Grid -->
|
|
<div class="grid grid-cols-2 gap-3">
|
|
<div>
|
|
<label class="block font-semibold text-slate-300 mb-1">
|
|
Aantal herhalingen
|
|
</label>
|
|
<select id="notifRepeatCountSelect" class="w-full bg-slate-950 border border-slate-800 rounded-xl px-3 py-2 text-white focus:outline-none focus:border-blue-500">
|
|
<option value="1">1x (Alleen 1e melding)</option>
|
|
<option value="2" selected>2x (Aanbevolen)</option>
|
|
<option value="3">3x</option>
|
|
<option value="5">5x (Intensief)</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block font-semibold text-slate-300 mb-1">
|
|
Herhalingsinterval
|
|
</label>
|
|
<select id="notifIntervalSelect" class="w-full bg-slate-950 border border-slate-800 rounded-xl px-3 py-2 text-white focus:outline-none focus:border-blue-500">
|
|
<option value="1">Elke 1 minuut</option>
|
|
<option value="2" selected>Elke 2 minuten</option>
|
|
<option value="3">Elke 3 minuten</option>
|
|
<option value="5">Elke 5 minuten</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Geluidssignaal Toggle -->
|
|
<div class="flex items-center justify-between p-3 rounded-xl bg-slate-950/60 border border-slate-800">
|
|
<div class="flex items-center space-x-2">
|
|
<i data-lucide="volume-2" class="w-4 h-4 text-blue-400"></i>
|
|
<div>
|
|
<span class="font-semibold text-white block">Geluidssignaal</span>
|
|
<span class="text-[10px] text-slate-400">Zachte bel/chime afspelen bij melding</span>
|
|
</div>
|
|
</div>
|
|
<label class="relative inline-flex items-center cursor-pointer">
|
|
<input type="checkbox" id="notifSoundInput" checked class="sr-only peer">
|
|
<div class="w-9 h-5 bg-slate-800 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-blue-600"></div>
|
|
</label>
|
|
</div>
|
|
|
|
<div id="notifSaveStatus" class="hidden text-emerald-400 text-center font-semibold text-[11px] py-1"></div>
|
|
|
|
<!-- Knoppen -->
|
|
<div class="pt-2 flex items-center space-x-2">
|
|
<button type="button" onclick="closeNotificationModal()" class="flex-1 py-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-300 font-semibold transition">
|
|
Annuleren
|
|
</button>
|
|
<button type="submit" id="saveNotifBtn" class="flex-1 py-2 rounded-xl bg-blue-600 hover:bg-blue-500 text-white font-bold transition shadow-md shadow-blue-500/20">
|
|
Voorkeuren Opslaan
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<main class="flex-1 max-w-7xl w-full mx-auto p-4 sm:p-6 lg:p-8">
|
|
|