382 lines
28 KiB
PHP
382 lines
28 KiB
PHP
<?php
|
|
require_once __DIR__ . '/app.php';
|
|
|
|
function render_header(string $title, string $active = '', bool $isFluid = false, bool $showNav = true): void
|
|
{
|
|
global $lang, $dir;
|
|
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
|
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
|
$toggleLang = $lang === 'ar' ? 'en' : 'ar';
|
|
$toggleLabel = $lang === 'ar' ? 'EN' : 'AR';
|
|
|
|
$appName = get_setting('company_name', t('app_name'));
|
|
$logoPath = get_setting('logo_path');
|
|
$faviconPath = get_setting('favicon_path');
|
|
|
|
$navUserPic = '';
|
|
$navUserName = 'Account';
|
|
if (isset($_SESSION['user_id'])) {
|
|
try {
|
|
$stmt = db()->prepare("SELECT full_name, profile_picture FROM users WHERE id = ?");
|
|
$stmt->execute([$_SESSION['user_id']]);
|
|
$u = $stmt->fetch();
|
|
if ($u) {
|
|
$navUserName = $u['full_name'];
|
|
$navUserPic = $u['profile_picture'];
|
|
}
|
|
} catch (Throwable $e) {}
|
|
}
|
|
?>
|
|
<!doctype html>
|
|
<html lang="<?= e($lang) ?>" dir="<?= e($dir) ?>">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title><?= e($title) ?> | <?= e($appName) ?></title>
|
|
<script>
|
|
(function() {
|
|
const savedTheme = localStorage.getItem('theme') || 'light';
|
|
document.documentElement.setAttribute('data-theme', savedTheme);
|
|
})();
|
|
</script>
|
|
<?php if ($faviconPath): ?>
|
|
<link rel="icon" href="<?= e($faviconPath) ?>">
|
|
<?php endif; ?>
|
|
<?php if ($projectDescription): ?>
|
|
<meta name="description" content="<?= e($projectDescription) ?>" />
|
|
<meta property="og:description" content="<?= e($projectDescription) ?>" />
|
|
<meta property="twitter:description" content="<?= e($projectDescription) ?>" />
|
|
<?php endif; ?>
|
|
<?php if ($projectImageUrl): ?>
|
|
<meta property="og:image" content="<?= e($projectImageUrl) ?>" />
|
|
<meta property="twitter:image" content="<?= e($projectImageUrl) ?>" />
|
|
<?php endif; ?>
|
|
<?php if ($dir === "rtl"): ?>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.rtl.min.css">
|
|
<?php else: ?>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<?php endif; ?>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
|
<link rel="stylesheet" href="/assets/css/custom.css?v=<?= time() ?>">
|
|
</head>
|
|
<body class="app-body">
|
|
<?php if ($showNav): ?>
|
|
<nav class="navbar navbar-expand-lg navbar-light bg-white border-bottom sticky-top shadow-sm py-3 z-3">
|
|
<div class="<?= $isFluid ? 'container-fluid px-4' : 'container' ?>">
|
|
<a class="navbar-brand fs-4 d-flex align-items-center" href="<?= e(url_with_lang('index.php')) ?>">
|
|
<?php if ($logoPath): ?>
|
|
<img src="<?= e($logoPath) ?>" alt="<?= e($appName) ?> Logo" height="32" class="me-2 rounded">
|
|
<?php else: ?>
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="currentColor" class="bi bi-box-seam me-1 text-primary" viewBox="0 0 16 16">
|
|
<path d="M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5l2.404.961L10.404 2zm3.564 1.426L5.596 5 8 5.961 14.154 3.5zm3.25 1.7-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.84L1 4.239v7.923zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464z"/>
|
|
</svg>
|
|
<?php endif; ?>
|
|
<?= e($appName) ?>
|
|
</a>
|
|
<button class="navbar-toggler border-0" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="mainNav">
|
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0 fw-semibold">
|
|
<li class="nav-item">
|
|
<a class="nav-link <?= $active === 'home' ? 'active text-primary' : '' ?>" href="<?= e(url_with_lang('index.php')) ?>">
|
|
<?= e(t('nav_home')) ?>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link <?= $active === 'faq' ? 'active text-primary' : '' ?>" href="<?= e(url_with_lang('faq.php')) ?>">
|
|
FAQ
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
<div class="d-flex align-items-center gap-3">
|
|
|
|
<!-- Theme Switcher -->
|
|
<div class="dropdown">
|
|
<button class="btn btn-sm btn-outline-dark rounded-pill px-3 fw-bold dropdown-toggle" type="button" id="themeDropdown" data-bs-toggle="dropdown" aria-expanded="false">
|
|
<i class="bi bi-palette-fill me-1"></i> <?= e(t('nav_theme')) ?>
|
|
</button>
|
|
<ul class="dropdown-menu dropdown-menu-end shadow-sm border-0 mt-3" aria-labelledby="themeDropdown" style="border-radius: 12px;">
|
|
<li><button class="dropdown-item py-2" onclick="setTheme('light')"><span class="d-inline-block rounded-circle me-2" style="width:12px;height:12px;background:#f4f7f6;border:1px solid #ccc;"></span>Default</button></li>
|
|
<li><button class="dropdown-item py-2" onclick="setTheme('dark')"><span class="d-inline-block rounded-circle me-2" style="width:12px;height:12px;background:#0f172a;"></span>Dark</button></li>
|
|
<li><button class="dropdown-item py-2" onclick="setTheme('blue')"><span class="d-inline-block rounded-circle me-2" style="width:12px;height:12px;background:#2563eb;"></span>Blue</button></li>
|
|
<li><button class="dropdown-item py-2" onclick="setTheme('green')"><span class="d-inline-block rounded-circle me-2" style="width:12px;height:12px;background:#10b981;"></span>Green</button></li>
|
|
<li><button class="dropdown-item py-2" onclick="setTheme('purple')"><span class="d-inline-block rounded-circle me-2" style="width:12px;height:12px;background:#8b5cf6;"></span>Purple</button></li>
|
|
<li><button class="dropdown-item py-2" onclick="setTheme('red')"><span class="d-inline-block rounded-circle me-2" style="width:12px;height:12px;background:#ef4444;"></span>Red</button></li>
|
|
<li><button class="dropdown-item py-2" onclick="setTheme('orange')"><span class="d-inline-block rounded-circle me-2" style="width:12px;height:12px;background:#f97316;"></span>Orange</button></li>
|
|
<li><button class="dropdown-item py-2" onclick="setTheme('teal')"><span class="d-inline-block rounded-circle me-2" style="width:12px;height:12px;background:#14b8a6;"></span>Teal</button></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="dropdown">
|
|
<?php if (isset($_SESSION['user_id'])): ?>
|
|
<a class="text-decoration-none text-muted fw-semibold dropdown-toggle d-flex align-items-center gap-2" href="#" id="loginDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
<?php if ($navUserPic): ?>
|
|
<img src="<?= e($navUserPic) ?>" alt="User" class="rounded-circle object-fit-cover shadow-sm" style="width:32px; height:32px;">
|
|
<?php else: ?>
|
|
<div class="rounded-circle bg-light d-flex align-items-center justify-content-center shadow-sm text-secondary" style="width:32px; height:32px;">
|
|
<i class="bi bi-person-fill"></i>
|
|
</div>
|
|
<?php endif; ?>
|
|
<span class="d-none d-sm-inline"><?= e($navUserName) ?></span>
|
|
</a>
|
|
<ul class="dropdown-menu dropdown-menu-end shadow-sm border-0 mt-3" aria-labelledby="loginDropdown" style="border-radius: 12px;">
|
|
<li>
|
|
<a class="dropdown-item py-2 <?= $active === 'profile' ? 'active' : '' ?>" href="<?= e(url_with_lang('profile.php')) ?>">
|
|
<i class="bi bi-person-circle text-primary me-2"></i><?= e(t('my_profile')) ?>
|
|
</a>
|
|
</li>
|
|
<?php if (($_SESSION['user_role'] ?? '') === 'shipper'): ?>
|
|
<li>
|
|
<a class="dropdown-item py-2 <?= $active === 'shipper' ? 'active' : '' ?>" href="<?= e(url_with_lang('shipper_dashboard.php')) ?>">
|
|
<i class="bi bi-box-seam text-primary me-2"></i><?= e(t('nav_shipper')) ?>
|
|
</a>
|
|
</li>
|
|
<?php elseif (($_SESSION['user_role'] ?? '') === 'truck_owner'): ?>
|
|
<li>
|
|
<a class="dropdown-item py-2 <?= $active === 'owner' ? 'active' : '' ?>" href="<?= e(url_with_lang('truck_owner_dashboard.php')) ?>">
|
|
<i class="bi bi-truck text-primary me-2"></i><?= e(t('nav_owner')) ?>
|
|
</a>
|
|
</li>
|
|
<?php elseif (($_SESSION['user_role'] ?? '') === 'admin'): ?>
|
|
<li>
|
|
<a class="dropdown-item py-2 <?= $active === 'admin' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_dashboard.php')) ?>">
|
|
<i class="bi bi-speedometer2 text-primary me-2"></i><?= e(t('nav_admin')) ?>
|
|
</a>
|
|
</li>
|
|
<?php endif; ?>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li>
|
|
<a class="dropdown-item py-2 text-danger" href="<?= e(url_with_lang('logout.php')) ?>">
|
|
<i class="bi bi-box-arrow-right me-2"></i>Logout
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
<?php else: ?>
|
|
<a class="text-decoration-none text-muted fw-semibold" href="<?= e(url_with_lang('login.php')) ?>">
|
|
<?= e(t('nav_login')) ?>
|
|
</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<a class="btn btn-sm btn-outline-dark rounded-pill px-3 fw-bold" href="<?= e(current_url_with_lang($toggleLang)) ?>">
|
|
<?= e($toggleLabel) ?>
|
|
</a>
|
|
|
|
<?php if (!isset($_SESSION['user_id'])): ?>
|
|
<a class="btn btn-primary btn-sm rounded-pill px-4 fw-bold shadow-sm d-none d-lg-block" href="<?= e(url_with_lang('register.php', ['role' => 'shipper'])) ?>">
|
|
<?= e(t('nav_get_started')) ?>
|
|
</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
<?php endif; ?>
|
|
<main class="<?= $isFluid ? 'container-fluid p-0' : 'container py-5' ?>">
|
|
<?php
|
|
}
|
|
|
|
function render_footer(bool $showFooter = true): void
|
|
{
|
|
global $lang;
|
|
$appName = get_setting('company_name', t('app_name'));
|
|
$logoPath = get_setting('logo_path');
|
|
$companyEmail = get_setting('company_email', '');
|
|
$companyPhone = get_setting('company_phone', '');
|
|
$companyAddress = get_setting('company_address', '');
|
|
?>
|
|
</main>
|
|
<?php if ($showFooter): ?>
|
|
<footer class="bg-white border-top py-5 mt-auto">
|
|
<div class="container">
|
|
<div class="row g-4 mb-4">
|
|
<div class="col-md-4">
|
|
<div class="d-flex align-items-center mb-3">
|
|
<?php if ($logoPath): ?>
|
|
<img src="<?= e($logoPath) ?>" alt="<?= e($appName) ?> Logo" height="28" class="me-2 rounded">
|
|
<?php else: ?>
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-box-seam me-2 text-primary" viewBox="0 0 16 16">
|
|
<path d="M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5l2.404.961L10.404 2zm3.564 1.426L5.596 5 8 5.961 14.154 3.5zm3.25 1.7-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.84L1 4.239v7.923zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464z"/>
|
|
</svg>
|
|
<?php endif; ?>
|
|
<h5 class="fw-bold mb-0 text-dark"><?= e($appName) ?></h5>
|
|
</div>
|
|
<p class="text-muted small pe-md-4">
|
|
<?= e(t('motivation_phrase')) ?>
|
|
</p>
|
|
<?php if ($companyEmail || $companyPhone || $companyAddress): ?>
|
|
<div class="small text-muted mt-3">
|
|
<?php if ($companyAddress): ?>
|
|
<div class="mb-1"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" class="bi bi-geo-alt me-1" viewBox="0 0 16 16"><path d="M12.166 8.94c-.524 1.062-1.234 2.12-1.96 3.07A32 32 0 0 1 8 14.58a32 32 0 0 1-2.206-2.57c-.726-.95-1.436-2.008-1.96-3.07C3.304 7.867 3 6.862 3 6a5 5 0 0 1 10 0c0 .862-.305 1.867-.834 2.94M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10"/><path d="M8 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0 1a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/></svg><?= e($companyAddress) ?></div>
|
|
<?php endif; ?>
|
|
<?php if ($companyPhone): ?>
|
|
<div class="mb-1"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" class="bi bi-telephone me-1" viewBox="0 0 16 16"><path d="M3.654 1.328a.678.678 0 0 0-1.015-.063L1.605 2.3c-.483.484-.661 1.169-.45 1.77a17.6 17.6 0 0 0 4.168 6.608 17.6 17.6 0 0 0 6.608 4.168c.601.211 1.286.033 1.77-.45l1.034-1.034a.678.678 0 0 0-.063-1.015l-2.307-1.794a.68.68 0 0 0-.58-.122l-2.19.547a1.75 1.75 0 0 1-1.657-.459L5.482 8.062a1.75 1.75 0 0 1-.46-1.657l.548-2.19a.68.68 0 0 0-.122-.58z"/></svg><a href="tel:<?= e($companyPhone) ?>" class="text-muted text-decoration-none"><?= e($companyPhone) ?></a></div>
|
|
<?php endif; ?>
|
|
<?php if ($companyEmail): ?>
|
|
<div class="mb-1"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" class="bi bi-envelope me-1" viewBox="0 0 16 16"><path d="M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1zm13 2.383-4.708 2.825L15 11.105zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741M1 11.105l4.708-2.897L1 5.383z"/></svg><a href="mailto:<?= e($companyEmail) ?>" class="text-muted text-decoration-none"><?= e($companyEmail) ?></a></div>
|
|
<?php endif; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
<div class="col-md-2 offset-md-2">
|
|
<h6 class="fw-bold mb-3"><?= e(t('company')) ?></h6>
|
|
<ul class="list-unstyled text-muted small">
|
|
<li class="mb-2"><a href="#" class="text-decoration-none text-muted"><?= e(t('about_us')) ?></a></li>
|
|
<li class="mb-2"><a href="#" class="text-decoration-none text-muted"><?= e(t('careers')) ?></a></li>
|
|
<li class="mb-2"><a href="#" class="text-decoration-none text-muted"><?= e(t('contact')) ?></a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<h6 class="fw-bold mb-3"><?= e(t('resources')) ?></h6>
|
|
<ul class="list-unstyled text-muted small">
|
|
<li class="mb-2"><a href="<?= e(url_with_lang('faq.php')) ?>" class="text-decoration-none text-muted"><?= e(t('help_center')) ?></a></li>
|
|
<li class="mb-2"><a href="<?= e(url_with_lang('terms.php')) ?>" class="text-decoration-none text-muted"><?= e(t('terms_of_service')) ?></a></li>
|
|
<li class="mb-2"><a href="<?= e(url_with_lang('privacy.php')) ?>" class="text-decoration-none text-muted"><?= e(t('privacy_policy')) ?></a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="col-md-2">
|
|
<h6 class="fw-bold mb-3"><?= e(t('language')) ?></h6>
|
|
<div class="d-flex gap-2">
|
|
<a href="<?= e(current_url_with_lang('en')) ?>" class="text-decoration-none <?= $lang === 'en' ? 'text-primary fw-bold' : 'text-muted' ?>">EN</a>
|
|
<span class="text-muted">|</span>
|
|
<a href="<?= e(current_url_with_lang('ar')) ?>" class="text-decoration-none <?= $lang === 'ar' ? 'text-primary fw-bold' : 'text-muted' ?>">AR</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-flex flex-column flex-md-row justify-content-between align-items-center pt-4 border-top small text-muted">
|
|
<span>© <?= date('Y') ?> <?= e($appName) ?>. <?= e(t('all_rights_reserved')) ?></span>
|
|
<span class="mt-2 mt-md-0"><?= e(t('footer_note')) ?></span>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
<?php endif; ?>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script>
|
|
function setTheme(theme) {
|
|
document.documentElement.setAttribute('data-theme', theme);
|
|
localStorage.setItem('theme', theme);
|
|
}
|
|
</script>
|
|
<script src="/assets/js/main.js?v=<?= time() ?>"></script>
|
|
</body>
|
|
</html>
|
|
<?php
|
|
}
|
|
|
|
function render_admin_sidebar(string $active = 'dashboard'): void
|
|
{
|
|
$settingsActive = in_array($active, ['company_profile', 'integrations', 'notification_templates']);
|
|
$locationsActive = in_array($active, ['countries', 'cities']);
|
|
$usersActive = in_array($active, ['shippers', 'truck_owners', 'register', 'platform_users']);
|
|
$pagesActive = in_array($active, ['faqs', 'landing_pages']);
|
|
$reportsActive = in_array($active, ['reports_shippers', 'reports_truck_owners', 'reports_summary']);
|
|
?>
|
|
<aside class="admin-sidebar d-flex flex-column h-100 py-4 px-3">
|
|
<h2 class="h5 fw-bold mb-4 px-2"><i class="bi bi-shield-lock me-2 text-primary"></i><?= e(t('nav_admin')) ?></h2>
|
|
<nav class="nav flex-column gap-1 flex-grow-1">
|
|
<a class="admin-nav-link <?= $active === 'dashboard' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_dashboard.php')) ?>">
|
|
<i class="bi bi-speedometer2 me-2"></i><?= e(t('dashboard')) ?>
|
|
</a>
|
|
<a class="admin-nav-link <?= $active === 'shipments' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_shipments.php')) ?>">
|
|
<i class="bi bi-box2-fill me-2"></i><?= e(t('shipments')) ?>
|
|
</a>
|
|
|
|
<a class="nav-link fw-bold text-muted text-uppercase mt-2 d-flex justify-content-between align-items-center p-2 rounded" style="cursor: pointer; font-size: 0.85rem;" data-bs-toggle="collapse" data-bs-target="#collapseLocations" aria-expanded="<?= $locationsActive ? 'true' : 'false' ?>">
|
|
<span><i class="bi bi-geo-alt-fill me-2"></i><?= e(t('locations')) ?></span>
|
|
<i class="bi bi-chevron-down small"></i>
|
|
</a>
|
|
<div class="collapse <?= $locationsActive ? 'show' : '' ?>" id="collapseLocations">
|
|
<div class="nav flex-column gap-1 ms-3 border-start ps-2 border-2">
|
|
<a class="admin-nav-link <?= $active === 'countries' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_countries.php')) ?>">
|
|
<i class="bi bi-globe-americas me-2"></i><?= e(t('countries')) ?>
|
|
</a>
|
|
<a class="admin-nav-link <?= $active === 'cities' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_cities.php')) ?>">
|
|
<i class="bi bi-pin-map me-2"></i><?= e(t('cities')) ?>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<a class="nav-link fw-bold text-muted text-uppercase mt-2 d-flex justify-content-between align-items-center p-2 rounded" style="cursor: pointer; font-size: 0.85rem;" data-bs-toggle="collapse" data-bs-target="#collapseUsers" aria-expanded="<?= $usersActive ? 'true' : 'false' ?>">
|
|
<span><i class="bi bi-people-fill me-2"></i><?= e(t('users')) ?></span>
|
|
<i class="bi bi-chevron-down small"></i>
|
|
</a>
|
|
<div class="collapse <?= $usersActive ? 'show' : '' ?>" id="collapseUsers">
|
|
<div class="nav flex-column gap-1 ms-3 border-start ps-2 border-2">
|
|
<a class="admin-nav-link <?= $active === 'shippers' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_shippers.php')) ?>">
|
|
<i class="bi bi-box-seam me-2"></i><?= e(t('shippers')) ?>
|
|
</a>
|
|
<a class="admin-nav-link <?= $active === 'truck_owners' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_truck_owners.php')) ?>">
|
|
<i class="bi bi-truck me-2"></i><?= e(t('truck_owners')) ?>
|
|
</a>
|
|
<a class="admin-nav-link <?= $active === 'platform_users' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_platform_users.php')) ?>">
|
|
<i class="bi bi-person-badge me-2"></i><?= e(t('nav_platform_users')) ?>
|
|
</a>
|
|
<a class="admin-nav-link <?= $active === 'register' ? 'active' : '' ?>" href="<?= e(url_with_lang('register.php')) ?>">
|
|
<i class="bi bi-person-plus me-2"></i><?= e(t('user_registration')) ?>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<a class="nav-link fw-bold text-muted text-uppercase mt-2 d-flex justify-content-between align-items-center p-2 rounded" style="cursor: pointer; font-size: 0.85rem;" data-bs-toggle="collapse" data-bs-target="#collapsePages" aria-expanded="<?= $pagesActive ? 'true' : 'false' ?>">
|
|
<span><i class="bi bi-file-earmark-text-fill me-2"></i><?= e(t('pages')) ?></span>
|
|
<i class="bi bi-chevron-down small"></i>
|
|
</a>
|
|
<div class="collapse <?= $pagesActive ? 'show' : '' ?>" id="collapsePages">
|
|
<div class="nav flex-column gap-1 ms-3 border-start ps-2 border-2">
|
|
<a class="admin-nav-link <?= $active === 'faqs' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_faqs.php')) ?>">
|
|
<i class="bi bi-question-square me-2"></i><?= e(t('faqs')) ?>
|
|
</a>
|
|
<a class="admin-nav-link <?= $active === 'landing_pages' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_landing_pages.php')) ?>">
|
|
<i class="bi bi-layout-text-window me-2"></i><?= e(t('landing_pages')) ?>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<a class="nav-link fw-bold text-muted text-uppercase mt-2 d-flex justify-content-between align-items-center p-2 rounded" style="cursor: pointer; font-size: 0.85rem;" data-bs-toggle="collapse" data-bs-target="#collapseReports" aria-expanded="<?= $reportsActive ? 'true' : 'false' ?>">
|
|
<span><i class="bi bi-file-earmark-bar-graph-fill me-2"></i><?= e(t('reports')) ?></span>
|
|
<i class="bi bi-chevron-down small"></i>
|
|
</a>
|
|
<div class="collapse <?= $reportsActive ? 'show' : '' ?>" id="collapseReports">
|
|
<div class="nav flex-column gap-1 ms-3 border-start ps-2 border-2">
|
|
<a class="admin-nav-link <?= $active === 'reports_summary' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_reports_summary.php')) ?>">
|
|
<i class="bi bi-pie-chart-fill me-2"></i><?= e(t('analytics')) ?>
|
|
</a>
|
|
<a class="admin-nav-link <?= $active === 'reports_shippers' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_reports_shippers.php')) ?>">
|
|
<i class="bi bi-people me-2"></i><?= e(t('shipper_shipments')) ?>
|
|
</a>
|
|
<a class="admin-nav-link <?= $active === 'reports_truck_owners' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_reports_truck_owners.php')) ?>">
|
|
<i class="bi bi-truck me-2"></i><?= e(t('truck_owners_statements')) ?>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<a class="nav-link fw-bold text-muted text-uppercase mt-2 d-flex justify-content-between align-items-center p-2 rounded" style="cursor: pointer; font-size: 0.85rem;" data-bs-toggle="collapse" data-bs-target="#collapseSettings" aria-expanded="<?= $settingsActive ? 'true' : 'false' ?>">
|
|
<span><i class="bi bi-gear-fill me-2"></i><?= e(t('settings')) ?></span>
|
|
<i class="bi bi-chevron-down small"></i>
|
|
</a>
|
|
<div class="collapse <?= $settingsActive ? 'show' : '' ?>" id="collapseSettings">
|
|
<div class="nav flex-column gap-1 ms-3 border-start ps-2 border-2">
|
|
<a class="admin-nav-link <?= $active === 'company_profile' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_company_profile.php')) ?>">
|
|
<i class="bi bi-building me-2"></i><?= e(t('company_setting')) ?>
|
|
</a>
|
|
<a class="admin-nav-link <?= $active === 'integrations' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_integrations.php')) ?>">
|
|
<i class="bi bi-plug me-2"></i><?= e(t('integrations')) ?>
|
|
</a>
|
|
<a class="admin-nav-link <?= $active === 'notification_templates' ? 'active' : '' ?>" href="<?= e(url_with_lang('admin_notification_templates.php')) ?>">
|
|
<i class="bi bi-bell-fill me-2"></i><?= e(t('notification_templates')) ?>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
</nav>
|
|
|
|
<div class="mt-4 pt-4 border-top text-center">
|
|
<a href="<?= e(url_with_lang('logout.php')) ?>" class="btn btn-outline-danger w-100 btn-sm">
|
|
<i class="bi bi-box-arrow-right me-2"></i>Logout
|
|
</a>
|
|
</div>
|
|
</aside>
|
|
<?php
|
|
}
|