- Implemented the full Fat Bottom Grille storefront and staff dashboard.
Highlights include configurable menus, specials, cart/checkout, taxes, customer accounts with email 2FA, newsletters, analytics, refunds, PDF/CSV exports, Square/Mailgun adapters, and optional MySQL migration. See README.md for setup and production configuration. Verified PHP/JavaScript syntax, responsive layouts, registration, 2FA, checkout, dashboard workflows, settings persistence, and PDF generation. Real Square, Mailgun, and MySQL connections require credentials/server access. Square implementation follows the official Payments API and Refunds API.
This commit is contained in:
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
use FatBottom\Core\View;
|
||||
|
||||
$businessName = (string) $config->get('business.name', 'Fat Bottom Grille');
|
||||
$isAdmin = isset($adminPage);
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#09131d">
|
||||
<meta name="description" content="Order burgers, burritos, dinner plates, sides, and drinks online from Fat Bottom Grille in Keyser, West Virginia.">
|
||||
<title><?= e($title ?? $businessName) ?> | <?= e($businessName) ?></title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/assets/app.css">
|
||||
<?php if (!empty($squareEnabled) && !empty($squareAppId) && !empty($squareLocationId)): ?>
|
||||
<script src="<?= $squareEnvironment === 'production'
|
||||
? 'https://web.squarecdn.com/v1/square.js'
|
||||
: 'https://sandbox.web.squarecdn.com/v1/square.js' ?>"></script>
|
||||
<?php endif; ?>
|
||||
</head>
|
||||
<body class="<?= $isAdmin ? 'admin-body' : 'store-body' ?>">
|
||||
<a class="skip-link" href="#main">Skip to content</a>
|
||||
|
||||
<?php if ($isAdmin): ?>
|
||||
<div class="admin-shell">
|
||||
<?php View::partial('partials/admin-nav', compact('adminPage', 'config', 'currentUser')); ?>
|
||||
<div class="admin-content">
|
||||
<header class="admin-topbar">
|
||||
<div>
|
||||
<span class="eyebrow">Staff workspace</span>
|
||||
<h1><?= e($title ?? 'Dashboard') ?></h1>
|
||||
</div>
|
||||
<div class="admin-top-actions">
|
||||
<a class="button button-ghost button-small" href="/" target="_blank" rel="noopener">View Store</a>
|
||||
<form action="/logout" method="post">
|
||||
<?= csrf_field() ?>
|
||||
<button class="button button-small" type="submit">Sign Out</button>
|
||||
</form>
|
||||
</div>
|
||||
</header>
|
||||
<?php View::partial('partials/flash', compact('flashMessages')); ?>
|
||||
<main id="main" class="admin-main">
|
||||
<?php require $templatePath; ?>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="announcement">
|
||||
<span><?= e($config->get('business.announcement')) ?></span>
|
||||
<span class="announcement-detail"><?= e($config->get('business.hours')) ?></span>
|
||||
</div>
|
||||
<header class="site-header">
|
||||
<div class="container nav-wrap">
|
||||
<a class="brand" href="/" aria-label="<?= e($businessName) ?> home">
|
||||
<span class="brand-mark">FB</span>
|
||||
<span class="brand-copy">
|
||||
<strong><?= e($businessName) ?></strong>
|
||||
<small>Keyser, West Virginia</small>
|
||||
</span>
|
||||
</a>
|
||||
<button class="nav-toggle" type="button" aria-expanded="false" aria-controls="site-nav">
|
||||
<span></span><span></span><span></span>
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</button>
|
||||
<nav class="site-nav" id="site-nav" aria-label="Main navigation">
|
||||
<a class="<?= active_path('/') ?>" href="/">Home</a>
|
||||
<a class="<?= active_path('/menu') ?>" href="/menu">Order Online</a>
|
||||
<?php if ($currentUser): ?>
|
||||
<?php if (in_array($currentUser['role'], ['admin', 'manager', 'staff'], true)): ?>
|
||||
<a href="/admin">Dashboard</a>
|
||||
<?php endif; ?>
|
||||
<a class="<?= active_path('/account') ?>" href="/account">My Account</a>
|
||||
<?php else: ?>
|
||||
<a class="<?= active_path('/login') ?>" href="/login">Sign In</a>
|
||||
<?php endif; ?>
|
||||
<a class="cart-link" href="/cart">
|
||||
Your Order
|
||||
<span class="cart-count"><?= (int) ($currentCart['item_count'] ?? 0) ?></span>
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<?php View::partial('partials/flash', compact('flashMessages')); ?>
|
||||
<main id="main">
|
||||
<?php require $templatePath; ?>
|
||||
</main>
|
||||
<footer class="site-footer">
|
||||
<div class="container footer-grid">
|
||||
<div>
|
||||
<div class="footer-brand"><?= e($businessName) ?></div>
|
||||
<p>Good food, generous portions, and a seat at the table in Keyser.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Visit</h2>
|
||||
<address>
|
||||
<?= e($config->get('business.street')) ?><br>
|
||||
<?= e($config->get('business.city')) ?>, <?= e($config->get('business.state')) ?>
|
||||
<?= e($config->get('business.postal_code')) ?>
|
||||
</address>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Get In Touch</h2>
|
||||
<?php if ($config->get('business.phone')): ?>
|
||||
<a href="tel:<?= e(preg_replace('/[^0-9+]/', '', (string) $config->get('business.phone'))) ?>">
|
||||
<?= e($config->get('business.phone')) ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($config->get('business.email')): ?>
|
||||
<a href="mailto:<?= e($config->get('business.email')) ?>"><?= e($config->get('business.email')) ?></a>
|
||||
<?php endif; ?>
|
||||
<?php if (!$config->get('business.phone') && !$config->get('business.email')): ?>
|
||||
<p>Contact details coming soon.</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div>
|
||||
<h2>Hours</h2>
|
||||
<p><?= e($config->get('business.hours')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container footer-bottom">
|
||||
<span>© <?= date('Y') ?> <?= e($businessName) ?></span>
|
||||
<span>410 W Piedmont St, Keyser, WV</span>
|
||||
</div>
|
||||
</footer>
|
||||
<?php endif; ?>
|
||||
|
||||
<script src="/assets/app.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user