mirror of
https://github.com/myronblair/tomsjavajive
synced 2026-06-30 17:50:32 -05:00
Initial commit
This commit is contained in:
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
/**
|
||||
* Tom's Java Jive - Header Include
|
||||
*/
|
||||
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/db.php';
|
||||
require_once __DIR__ . '/../config/config.php';
|
||||
require_once __DIR__ . '/auth.php';
|
||||
|
||||
$cartCount = 0;
|
||||
$cart = $_SESSION['cart'] ?? [];
|
||||
foreach ($cart as $qty) {
|
||||
$cartCount += $qty;
|
||||
}
|
||||
|
||||
$isLoggedIn = CustomerAuth::isLoggedIn();
|
||||
$customerUser = $isLoggedIn ? CustomerAuth::getUser() : null;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?= $pageTitle ?? SITE_NAME ?></title>
|
||||
<!-- SEO Meta Tags -->
|
||||
<meta name="description" content="<?= htmlspecialchars($metaDescription ?? "Premium artisan coffee beans freshly roasted and delivered to your door. Shop single origin, blends, and specialty coffee from Tom's Java Jive.") ?>">
|
||||
<meta name="keywords" content="<?= htmlspecialchars($metaKeywords ?? "artisan coffee, coffee beans, single origin coffee, fresh roasted coffee, Weatherford Texas coffee, specialty coffee") ?>">
|
||||
<meta name="robots" content="<?= $metaRobots ?? 'index, follow' ?>">
|
||||
<link rel="canonical" href="<?= $canonicalUrl ?? 'https://tomsjavajive.com' . strtok($_SERVER['REQUEST_URI'], '?') ?>">
|
||||
<meta property="og:type" content="<?= $ogType ?? 'website' ?>">
|
||||
<meta property="og:site_name" content="Tom's Java Jive">
|
||||
<meta property="og:title" content="<?= htmlspecialchars($metaTitle ?? ($pageTitle ?? "Tom's Java Jive")) ?>">
|
||||
<meta property="og:description" content="<?= htmlspecialchars($metaDescription ?? "Premium artisan coffee beans freshly roasted and delivered to your door.") ?>">
|
||||
<meta property="og:url" content="<?= $canonicalUrl ?? 'https://tomsjavajive.com' . $_SERVER['REQUEST_URI'] ?>">
|
||||
<meta property="og:image" content="<?= $ogImage ?? 'https://tomsjavajive.com/assets/images/og-image.jpg' ?>">
|
||||
<meta property="og:locale" content="en_US">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="<?= htmlspecialchars($metaTitle ?? ($pageTitle ?? "Tom's Java Jive")) ?>">
|
||||
<meta name="twitter:description" content="<?= htmlspecialchars($metaDescription ?? "Premium artisan coffee beans freshly roasted and delivered to your door.") ?>">
|
||||
<meta name="twitter:image" content="<?= $ogImage ?? 'https://tomsjavajive.com/assets/images/og-image.jpg' ?>">
|
||||
<?php if (empty($suppressSchema)): ?>
|
||||
<script type="application/ld+json">
|
||||
{"@context":"https://schema.org","@graph":[{"@type":["LocalBusiness","Store","FoodEstablishment"],"@id":"https://tomsjavajive.com/#business","name":"Tom's Java Jive","description":"Premium artisan coffee beans freshly roasted and shipped to your door. Specializing in single origin, signature blends, and specialty roasts from Weatherford, Texas.","url":"https://tomsjavajive.com","telephone":"+18175550120","email":"hello@tomsjavajive.com","priceRange":"$$","currenciesAccepted":"USD","paymentAccepted":"Credit Card, PayPal","servesCuisine":"Coffee","address":{"@type":"PostalAddress","addressLocality":"Weatherford","addressRegion":"TX","postalCode":"76086","addressCountry":"US"},"geo":{"@type":"GeoCoordinates","latitude":32.7554,"longitude":-97.7981},"hasOfferCatalog":{"@type":"OfferCatalog","name":"Coffee Products","itemListElement":[{"@type":"Offer","itemOffered":{"@type":"Product","name":"Single Origin Coffee Beans","description":"Hand-selected single origin beans from around the world, freshly roasted to order."}},{"@type":"Offer","itemOffered":{"@type":"Product","name":"Signature Blend Coffee","description":"Tom's signature house blends crafted for balanced, full-flavored cups."}}]}},{"@type":"WebSite","@id":"https://tomsjavajive.com/#website","url":"https://tomsjavajive.com","name":"Tom's Java Jive","publisher":{"@id":"https://tomsjavajive.com/#business"},"potentialAction":{"@type":"SearchAction","target":"https://tomsjavajive.com/shop.php?search={search_term_string}","query-input":"required name=search_term_string"}}]}
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($breadcrumbs)): ?>
|
||||
<script type="application/ld+json">
|
||||
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":<?= json_encode(array_map(function($b,$i){return["@type"=>"ListItem","position"=>$i+1,"name"=>$b['name'],"item"=>$b['url']];},$breadcrumbs,array_keys($breadcrumbs)),JSON_UNESCAPED_SLASHES) ?>}
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($productSchema)): ?>
|
||||
<script type="application/ld+json"><?= json_encode($productSchema,JSON_UNESCAPED_SLASHES) ?></script>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- PWA Meta Tags -->
|
||||
<meta name="theme-color" content="#FF5E1A">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
||||
<meta name="apple-mobile-web-app-title" content="Java Jive">
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="apple-touch-icon" href="/assets/icons/icon-192.png">
|
||||
|
||||
<!-- Fonts -->
|
||||
<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=Inter:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<!-- Icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
||||
|
||||
<!-- Styles -->
|
||||
<link rel="stylesheet" href="/assets/css/style.css">
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" href="/assets/images/logo.png" type="image/png">
|
||||
|
||||
<?php if (strpos($_SERVER['REQUEST_URI'], 'payment') !== false || strpos($_SERVER['REQUEST_URI'], 'checkout') !== false): ?>
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($extraHead)) echo $extraHead; ?>
|
||||
</head>
|
||||
<body>
|
||||
<header class="header">
|
||||
<nav class="nav container">
|
||||
<a href="/" class="logo">
|
||||
<img src="/assets/images/logo.png" alt="<?= SITE_NAME ?>" class="logo-img">
|
||||
</a>
|
||||
|
||||
<ul class="nav-links">
|
||||
<li><a href="/" class="<?= $_SERVER['REQUEST_URI'] === '/' ? 'active' : '' ?>">Home</a></li>
|
||||
<li><a href="/shop.php" class="<?= strpos($_SERVER['REQUEST_URI'], 'shop') !== false ? 'active' : '' ?>">Shop</a></li>
|
||||
<li><a href="/#about">About</a></li>
|
||||
<?php if ($isLoggedIn): ?>
|
||||
<li><a href="/account/" class="<?= strpos($_SERVER['REQUEST_URI'], 'account') !== false ? 'active' : '' ?>">Account</a></li>
|
||||
<?php else: ?>
|
||||
<li><a href="/login.php">Account</a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<div class="nav-actions">
|
||||
<a href="/cart.php" class="cart-btn" title="Shopping Cart">
|
||||
<i class="fas fa-shopping-bag"></i>
|
||||
<?php if ($cartCount > 0): ?>
|
||||
<span class="cart-count"><?= $cartCount ?></span>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
Reference in New Issue
Block a user