139 lines
4.2 KiB
PHP
139 lines
4.2 KiB
PHP
<?php
|
|
// phpcs:ignoreFile
|
|
|
|
if (session_status() === PHP_SESSION_NONE) {
|
|
session_start();
|
|
}
|
|
|
|
$pageTitle = isset($pageTitle) && trim($pageTitle) !== ''
|
|
? $pageTitle
|
|
: 'Louisiana Sugar Cane Cooperative';
|
|
$metaDescription = isset($metaDescription) && trim($metaDescription) !== ''
|
|
? $metaDescription
|
|
: 'Louisiana Sugar Cane Cooperative produces raw cane sugar and molasses while supporting member growers across Louisiana.';
|
|
$bodyClassAttr = 'lasuca-theme';
|
|
if (isset($bodyClass) && trim($bodyClass) !== '') {
|
|
$bodyClassAttr .= ' ' . trim($bodyClass);
|
|
}
|
|
if (strpos($bodyClassAttr, 'theme-dark') === false && strpos($bodyClassAttr, 'theme-light') === false) {
|
|
$bodyClassAttr .= ' theme-dark';
|
|
}
|
|
$extraStyles = isset($extraStyles) ? (array) $extraStyles : array();
|
|
$activeNav = isset($activeNav) ? $activeNav : '';
|
|
|
|
$growerLoggedIn = !empty($_SESSION['myusername']);
|
|
$navItems = array(
|
|
array(
|
|
'key' => 'home',
|
|
'label' => 'Home',
|
|
'href' => '/home.php',
|
|
),
|
|
array(
|
|
'key' => 'factory',
|
|
'label' => 'Factory',
|
|
'href' => '/factory-information.php',
|
|
),
|
|
array(
|
|
'key' => 'production',
|
|
'label' => 'Production',
|
|
'href' => '/production.php',
|
|
),
|
|
array(
|
|
'key' => 'personnel',
|
|
'label' => 'Personnel',
|
|
'href' => '/personnel.php',
|
|
),
|
|
array(
|
|
'key' => 'contact',
|
|
'label' => 'Contact',
|
|
'href' => '/contact-us.php',
|
|
),
|
|
);
|
|
|
|
$loginItem = array(
|
|
'key' => 'login',
|
|
'label' => 'Login',
|
|
'href' => '/grower-login.php',
|
|
);
|
|
if ($growerLoggedIn) {
|
|
array_splice($navItems, 3, 0, array(
|
|
array(
|
|
'key' => 'grower',
|
|
'label' => 'Grower Portal',
|
|
'href' => '/grower-dashboard.php',
|
|
)
|
|
));
|
|
} else {
|
|
array_splice($navItems, 3, 0, array($loginItem));
|
|
}
|
|
|
|
if ($growerLoggedIn) {
|
|
$navItems[] = array(
|
|
'key' => 'logout',
|
|
'label' => 'Log Out',
|
|
'href' => '/grower-logout.php',
|
|
);
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en" dir="ltr">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title><?php echo htmlspecialchars($pageTitle, ENT_QUOTES, 'UTF-8'); ?></title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<meta
|
|
name="description"
|
|
content="<?php echo htmlspecialchars($metaDescription, ENT_QUOTES, 'UTF-8'); ?>"
|
|
/>
|
|
<link rel="icon" type="image/x-icon" href="/images/favicon.ico" />
|
|
<link
|
|
rel="stylesheet"
|
|
href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css"
|
|
/>
|
|
<link rel="stylesheet" href="/new/css/styles.css" />
|
|
<link rel="stylesheet" href="/new/css/lasuca-theme.css" />
|
|
<link rel="stylesheet" href="/new/css/pages.css" />
|
|
<?php foreach ($extraStyles as $styleHref) { ?>
|
|
<link rel="stylesheet" href="<?php echo htmlspecialchars($styleHref, ENT_QUOTES, 'UTF-8'); ?>" />
|
|
<?php } ?>
|
|
</head>
|
|
<body class="<?php echo htmlspecialchars($bodyClassAttr, ENT_QUOTES, 'UTF-8'); ?>">
|
|
<nav class="navbar navbar-expand-lg navbar-dark">
|
|
<div class="container">
|
|
<a class="navbar-brand" href="/">
|
|
<img src="/images/logo2.png" alt="LASUCA logo" />
|
|
<span class="brand-text">Producers of Raw Cane Sugar and Black Strap Molasses</span>
|
|
</a>
|
|
<button
|
|
class="navbar-toggler"
|
|
type="button"
|
|
data-bs-toggle="collapse"
|
|
data-bs-target="#mainNav"
|
|
aria-controls="mainNav"
|
|
aria-expanded="false"
|
|
aria-label="Toggle navigation"
|
|
>
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="mainNav">
|
|
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
|
|
<?php foreach ($navItems as $item) {
|
|
$isActive = $item['key'] === $activeNav;
|
|
?>
|
|
<li class="nav-item">
|
|
<a
|
|
class="nav-link<?php echo $isActive ? ' active' : ''; ?>"
|
|
href="<?php echo htmlspecialchars($item['href'], ENT_QUOTES, 'UTF-8'); ?>"
|
|
<?php if ($isActive) { ?> aria-current="page"
|
|
<?php } ?>
|
|
>
|
|
<?php echo htmlspecialchars($item['label'], ENT_QUOTES, 'UTF-8'); ?>
|
|
</a>
|
|
</li>
|
|
<?php } ?>
|
|
<?php include __DIR__ . '/theme-toggle.php'; ?>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|