158 lines
8.1 KiB
PHP
158 lines
8.1 KiB
PHP
<?php
|
|
$app = appConfig();
|
|
$company = $app['company'];
|
|
$metaTitle = isset($pageTitle) ? $pageTitle . ' | ' . $company['name'] : $company['name'];
|
|
$metaDescription = $metaDescription ?? 'Professionelle Fotobox-Vermietung mit klaren Preisen, einfacher Anfrage und digitaler Bildübergabe.';
|
|
$isAdminArea = str_contains($viewPath, '/admin/');
|
|
$styleVersion = is_file(dirname(__DIR__) . '/assets/styles.css') ? (string) filemtime(dirname(__DIR__) . '/assets/styles.css') : '1';
|
|
$scriptVersion = is_file(dirname(__DIR__) . '/assets/app.js') ? (string) filemtime(dirname(__DIR__) . '/assets/app.js') : '1';
|
|
$currentPath = currentPath();
|
|
|
|
$publicNav = [
|
|
['label' => 'Fotobox', 'path' => '/fotobox', 'activePaths' => ['/fotobox', '/leistungen']],
|
|
['label' => 'Preise', 'path' => '/preise'],
|
|
['label' => 'Ablauf', 'path' => '/ablauf'],
|
|
['label' => 'FAQ', 'path' => '/faq'],
|
|
['label' => 'Kontakt', 'path' => '/kontakt'],
|
|
];
|
|
|
|
$adminNav = [
|
|
['label' => 'Dashboard', 'path' => '/admin'],
|
|
['label' => 'Anfragen', 'path' => '/admin/anfragen'],
|
|
['label' => 'Buchungen', 'path' => '/admin/buchungen'],
|
|
['label' => 'Kalender', 'path' => '/admin/kalender'],
|
|
['label' => 'Kunden', 'path' => '/admin/kunden'],
|
|
['label' => 'Rechnungen', 'path' => '/admin/rechnungen'],
|
|
['label' => 'Einstellungen', 'path' => '/admin/einstellungen'],
|
|
];
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title><?= h($metaTitle) ?></title>
|
|
<meta name="description" content="<?= h($metaDescription) ?>">
|
|
<meta property="og:type" content="website">
|
|
<meta property="og:title" content="<?= h($metaTitle) ?>">
|
|
<meta property="og:description" content="<?= h($metaDescription) ?>">
|
|
<meta property="og:url" content="<?= h($company['website']) ?>">
|
|
<link rel="stylesheet" href="<?= h(asset('assets/styles.css')) ?>?v=<?= h($styleVersion) ?>">
|
|
<script defer src="<?= h(asset('assets/app.js')) ?>?v=<?= h($scriptVersion) ?>"></script>
|
|
</head>
|
|
<body class="<?= $isAdminArea ? 'theme-admin' : 'theme-public' ?>">
|
|
<div class="page-shell">
|
|
<?php if (!$isAdminArea): ?>
|
|
<div class="topbar">
|
|
<div class="topbar-inner">
|
|
<span><?= h($company['service_area']) ?></span>
|
|
<span><?= h($company['response_time']) ?></span>
|
|
<a href="mailto:<?= h($company['email']) ?>"><?= h($company['email']) ?></a>
|
|
<a href="tel:<?= h($company['phone']) ?>"><?= h($company['phone']) ?></a>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<header class="site-header <?= $isAdminArea ? 'site-header-admin' : 'site-header-public' ?>">
|
|
<div class="header-inner">
|
|
<a class="brand" href="<?= h($isAdminArea ? url('admin') : url('/')) ?>">
|
|
<span class="brand-mark">FM</span>
|
|
<span class="brand-copy">
|
|
<strong><?= h($company['name']) ?></strong>
|
|
<small><?= h($isAdminArea ? 'Verwaltung & Buchungen' : $company['tagline']) ?></small>
|
|
</span>
|
|
</a>
|
|
|
|
<?php if ($isAdminArea): ?>
|
|
<nav class="site-nav site-nav-admin" aria-label="Admin-Navigation">
|
|
<?php foreach ($adminNav as $item): ?>
|
|
<a class="<?= str_starts_with($currentPath, $item['path']) && ($item['path'] !== '/admin' || $currentPath === '/admin') ? 'is-active' : '' ?>" href="<?= h(url($item['path'])) ?>"><?= h($item['label']) ?></a>
|
|
<?php endforeach; ?>
|
|
</nav>
|
|
<div class="header-actions">
|
|
<a class="button-secondary" href="<?= h(url('admin/create')) ?>">Manuelle Buchung</a>
|
|
<form method="post" action="<?= h(url('admin/logout')) ?>">
|
|
<?= csrfField() ?>
|
|
<button type="submit" class="ghost-button">Abmelden</button>
|
|
</form>
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="public-header-shell">
|
|
<button
|
|
type="button"
|
|
class="nav-toggle"
|
|
data-nav-toggle
|
|
aria-expanded="false"
|
|
aria-controls="public-navigation"
|
|
>
|
|
<span class="nav-toggle-box" aria-hidden="true">
|
|
<span></span>
|
|
<span></span>
|
|
<span></span>
|
|
</span>
|
|
<span>Menü</span>
|
|
</button>
|
|
<div class="public-header-controls" id="public-navigation" data-nav-menu>
|
|
<nav class="site-nav site-nav-public" aria-label="Hauptnavigation">
|
|
<?php foreach ($publicNav as $item): ?>
|
|
<?php $isActive = in_array($currentPath, $item['activePaths'] ?? [$item['path']], true); ?>
|
|
<a class="<?= $isActive ? 'is-active' : '' ?>" href="<?= h(url($item['path'])) ?>"><?= h($item['label']) ?></a>
|
|
<?php endforeach; ?>
|
|
</nav>
|
|
<div class="menu-meta">
|
|
<span><?= h($company['service_area']) ?></span>
|
|
<a href="mailto:<?= h($company['email']) ?>"><?= h($company['email']) ?></a>
|
|
</div>
|
|
<div class="header-actions header-actions-public">
|
|
<a class="contact-chip" href="tel:<?= h($company['phone']) ?>">
|
|
<span>Telefon</span>
|
|
<strong><?= h($company['phone']) ?></strong>
|
|
</a>
|
|
<a class="button-primary" href="<?= h(url('verfuegbarkeit')) ?>">Verfügbarkeit prüfen</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</header>
|
|
|
|
<main class="site-main">
|
|
<?php require $viewPath; ?>
|
|
</main>
|
|
|
|
<?php if (!$isAdminArea): ?>
|
|
<footer class="site-footer">
|
|
<div class="footer-grid">
|
|
<div>
|
|
<h2><?= h($company['name']) ?></h2>
|
|
<p><?= h($company['tagline']) ?></p>
|
|
<p><?= h($company['service_area']) ?></p>
|
|
</div>
|
|
<div>
|
|
<h3>Kontakt</h3>
|
|
<a href="mailto:<?= h($company['email']) ?>"><?= h($company['email']) ?></a>
|
|
<a href="tel:<?= h($company['phone']) ?>"><?= h($company['phone']) ?></a>
|
|
<span><?= h($company['address']['street']) ?></span>
|
|
<span><?= h($company['address']['postal_code'] . ' ' . $company['address']['city']) ?></span>
|
|
</div>
|
|
<div>
|
|
<h3>Seiten</h3>
|
|
<a href="<?= h(url('fotobox')) ?>">Fotobox</a>
|
|
<a href="<?= h(url('preise')) ?>">Preise</a>
|
|
<a href="<?= h(url('buchen')) ?>">Buchen</a>
|
|
<a href="<?= h(url('faq')) ?>">FAQ</a>
|
|
</div>
|
|
<div>
|
|
<h3>Rechtliches</h3>
|
|
<a href="<?= h(url('impressum')) ?>">Impressum</a>
|
|
<a href="<?= h(url('datenschutz')) ?>">Datenschutz</a>
|
|
<a href="<?= h(url('mietbedingungen')) ?>">Mietbedingungen</a>
|
|
<a href="<?= h(url('admin/login')) ?>">Verwaltung</a>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
<?php endif; ?>
|
|
</div>
|
|
</body>
|
|
</html>
|