new_header-home.php
A PHP/HTML partial that renders the primary header for the Tech Logistics homepage. It includes branding, contact info, navigation, shipment tracking, and user login—all styled with Bootstrap and Google Fonts.
🎯 Purpose
Renders a sticky, responsive header panel used on the homepage.
- Displays company logo and key phone numbers.
- Provides main navigation with dynamic “active” highlighting.
- Embeds a shipment tracking form.
- Includes a collapsible login form.
🔗 Dependencies
| Dependency | Role |
|---|---|
| Bootstrap CSS & JS | Grid system, navbar, collapse components |
| Google Fonts | Material Symbols (icons) & Rubik (typography) |
PHP $_SERVER & basename() |
Determine current page for active links |
| Images (SVG/WebP) | Logo (Tech-Logistic-logo.webp), icons (.svg) |
📐 File Structure
- Font Imports
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined…" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css2?family=Rubik…&display=swap" rel="stylesheet"> - Header Wrapper
<header class="main-header sticky-top bg-white shadow" id="hideOnScroll"> … </header> - Company Logo
<div class="company-logo"> <a href="index.php" class="ltl-logo"> <img src="images/Tech-Logistic-logo.webp" alt="Tech Logistics" …> </a> </div> - Contact Items
- Toll-free support
- Quote hotline
- Navigation Menu
- Home
- Freight Spend Management (with dropdown submenu)
- Freight Tools (external)
- Carrier Login (external)
- Mobile collapse toggle
- Shipment Tracking Form
- Shown on all pages except
contact_us.php
- Shown on all pages except
- Login Button & Collapse
- Triggers a collapsible
<form>for user sign-in
- Triggers a collapsible
💻 Key Code Snippets
Active Link Highlighting
<?php
$page_name = basename($_SERVER['PHP_SELF']);
?>
<a href="index.php"
class="nav-link <?php if($page_name == 'index.php') echo 'active'; ?>">
Home
</a>
Sets the “active” class based on current file name.
Freight Spend Management Dropdown
<li class="nav-item">
<a class="mobile-view nav-arrow dropdown-toggle material-symbols-outlined"
data-bs-toggle="dropdown"></a>
<a href="freight_spend_management.php" class="nav-link">
Freight Spend Management
</a>
<ul class="dropdown-menu sub fadeIn">
<li><a class="sub-nav-link" href="our_technology_advantage.php">Our Technology Advantage</a></li>
<!-- …more submenu items… -->
</ul>
</li>
Conditional Tracking Form
<?php if($page_name != 'contact_us.php') : ?>
<form id="track_shipmentnew" action="track_shipment.php" method="POST">
<div class="input-group">
<input type="text" name="ship_no" … placeholder="Enter Tracking Number" required>
<button class="btn btn-primary" name="action" value="track_this">TRACK</button>
</div>
</form>
<?php endif; ?>
Login Collapse Form
<button type="button" data-bs-toggle="collapse" data-bs-target="#loginBox" …>
<img src="images/login.svg" alt="Login" /> LOGIN
</button>
<form id="lgnfrm" action="/index.php" method="post" class="needs-validation" novalidate>
<input type="hidden" name="action" value="login"/>
<div class="collapse login-box fadeIn" id="loginBox">
<!-- email, password fields, error display, submit button -->
</div>
</form>
🛠️ Integration & Usage
- Location:
linuxfront-v2-logistics/inc/panels/new_header-home.php - Included by: Homepage templates via PHP
include_once. - Template Meta: Relies on global CSS/JS loaded in
inc/template_meta.php. - Related Panels:
header-menu.php(alternative header for inner pages)meta.php(pop-up scripts)
📊 Structure Diagram
flowchart LR
A[Header Container]
A --> B[Company Logo]
A --> C[Contact Info]
A --> D[Navbar]
D --> D1[Home Link]
D --> D2[Freight Spend Mgmt ▶]
D2 --> D2a[Submenu Items]
D --> D3[Freight Tools]
D --> D4[Carrier Login]
A --> E[Tracking Form]
A --> F[Login Toggle & Form]
Design Highlights:
- Responsive: Utilizes Bootstrap grid and collapse for mobile.
- Dynamic: PHP logic for active states and conditional forms.
- Accessible: Proper
aria-label, placeholders, and collapse controls.