HeaderInner Panel (header-inner.php) 🚀

The header-inner.php file defines the main header section for authenticated users in the Tech Logistics application. It dynamically renders:

  • Customer-specific features and access controls
  • Company branding and contact information
  • A responsive navigation menu
  • A personalized “My Account” dropdown with context-aware links
  • Breadcrumb navigation reflecting the current page

This component is included in page templates after user authentication to ensure a cohesive, feature-driven UI for logged-in customers.


Session & Feature Initialization 🔑

At the top, the script loads user location features and BOL (Bill of Lading) permissions:

<?php
// Load features available to the customer's location
$ret = get_customer_location_features(
    $_SESSION['Master_Customer_ID'],
    $_SESSION['Customer_ID']
); 

// Ensure access flags are initialized
if (isset($_SESSION['access_loaded']) && $_SESSION['access_loaded']!='Y') {
    $_SESSION['access_loaded'] = 'N';
}

// Determine if the user can create a BOL
if (isset($_SESSION['Customer_Detail_ID'])) {
    $isbol = isCreateBOL($_SESSION['Customer_Detail_ID']);
} else {
    $isbol = 'N';
}
?>
  • get_customer_location_features returns flags like carrier_perform, create_bol, small_package, etc.
  • isCreateBOL checks if the user’s detail record permits BOL creation.

Company Logo & Contact Info 📞

This section displays the company logo and two toll-free contact items:

<header class="main-header sticky-top bg-white shadow" id="hideOnScroll">
  <div class="container-fluid content-header">
    <div class="row">

      <!-- Company Logo -->
      <div class="col-lg-6 company-logo ps-lg-5">
        <a href="index.php" class="ltl-logo">
          <img src="images/Tech-Logistic-logo.webp"
               alt="Tech Logistics"
               class="img-fluid"
               width="323">
        </a>
      </div>

      <!-- Contact Items -->
      <div class="col-lg-6 d-flex justify-content-end align-items-center pe-lg-5">
        <div class="contact-item me-3">
          <img src="images/phone_in_talk.svg" alt="Call Us Toll-Free">
          <div class="phone-number">
            <a href="tel:800-641-5300" class="contact-info">800-641-5300</a><br>
            <small class="text-muted">Call Us Toll-Free</small>
          </div>
        </div>
        <div class="contact-item">
          <img src="images/request_quote.svg" alt="For Quotes Call">
          <div class="phone-number">
            <a href="tel:1-888-882-3174" class="contact-info">1-888-882-3174</a><br>
            <small class="text-muted">For Quotes Call</small>
          </div>
        </div>
      </div>

    </div>
  </div>

The responsive Bootstrap navbar adapts to the current page and session features:

<nav class="navbar navbar-expand-lg">
  <?php $page_name = basename($_SERVER['PHP_SELF']); ?>

  <div class="collapse navbar-collapse" id="main_nav">
    <ul class="navbar-nav">

      <li class="nav-item">
        <a href="index.php"
           class="nav-link <?php if ($page_name=='index.php') echo 'active'; ?>">
          🏠 Home
        </a>
      </li>

      <li class="nav-item dropdown">
        <a class="nav-link" href="freight_spend_management.php">
          Our Services
        </a>
        <ul class="dropdown-menu sub fadeIn">
          <li><a href="carrier_negotiations.php">Carrier Negotiations</a></li>
          <!-- …other service links… -->
          <li>
            <a href="request_consultation.php">
              <button class="btn-dark btn py-1">Request Consultation</button>
            </a>
          </li>
        </ul>
      </li>

      <li class="nav-item">
        <a href="https://tools.nvisionglobal.com/#/login?ownerId=4"
           target="_blank"
           class="nav-link">
           📦 Freight Tools
        </a>
      </li>

      <li class="nav-item">
        <a href="https://tools.nvisionglobal.com/#/login?ownerId=4"
           target="_blank"
           class="nav-link">
           🔑 Carrier Login
        </a>
      </li>

    </ul>
  </div>
</nav>
  • Active Link Highlighting is managed via PHP basename($_SERVER['PHP_SELF'])
  • Dropdown Submenus reveal nested services on mobile and desktop.

“My Account” Dropdown & Actions 👤

A toggle button shows the customer’s email and expands an account menu:

<button type="button"
        class="btn btn-primary d-flex px-4"
        data-bs-toggle="collapse"
        data-bs-target="#loginBox">
  <img src="images/manage_accounts.svg" alt="Manage Account" class="me-2">
  <span class="customer-email">
    <?php if (!empty($_SESSION['Customer_ID'])) echo $_SESSION['Customer_email']; ?>
  </span>
  <svg class="ms-2" …>…chevron…</svg>
</button>

<div class="collapse myaccount-box" id="loginBox">
  <ul class="myaccount">
    <li>
      <a href="my_account.php">
        👤 My Profile
      </a>
    </li>

    <li>
      <!-- Quote & Ship varies by billing country -->
      <a href="<?php echo ($_SESSION['Customer_Billing_COUNTRY']=='18')
                     ? 'javascript:{}" rel="ltl'
                     : 'start_quote.php'; ?>">
        📝 Quote & Ship
      </a>
    </li>

    <li>
      <!-- Parcel submenu -->
      📦 <a data-bs-toggle="collapse" data-bs-target="#smallParcelSub">Parcel</a>
    </li>
    <ul class="collapse sub-link-container" id="smallParcelSub">
      <?php if ($_SESSION['small_package']=='Y'): ?>
        <li><a href="small_parcel.php">Small Parcel</a></li>
      <?php endif; ?>
      <li><a href="transaction.php">View Transactions</a></li>
      <li><a href="reports.php">Reports</a></li>
      <?php if ($_SESSION['small_package']=='Y'): ?>
        <li><a href="small_package.php">Small Package</a></li>
      <?php endif; ?>
    </ul>

    <!-- Conditional links based on session flags -->
    <?php if ($_SESSION['my_shipments_check']=='Y'): ?>
      <li><a href="<?php echo ($_SESSION['banyan_enabled']=='Y')
                           ? 'my_shipments_v2.php'
                           : 'my_shipments.php'; ?>">
            🚚 My Shipments
          </a>
      </li>
    <?php endif; ?>

    <?php if ($_SESSION['enable_claims']=='Y'): ?>
      <li><a href="claim_system.php">⚠️ Claims</a></li>
    <?php endif; ?>

    <!-- …more conditionally rendered items… -->

    <li>
      <a href="logout.php" class="text-danger logout">
        🔴 Logout
      </a>
    </li>
  </ul>
</div>
  • Dynamic Visibility: Many <li> items render only if session flags (e.g. $_SESSION['create_shipment_check'], $_SESSION['create_bol']) are set.
  • Nested Collapses enable multi-level menus on mobile.

Feature Flags Table 📊

Session Key Feature
carrier_perform Carrier Performance Reports
small_package Small Parcel access
create_bol Create Bill of Lading
enable_claims Claims System
dashboard Auditing Dashboard link
itools External Itools link
shipment_coupon Vendor Codes (Coupons)
product_catalog_check Product Catalog
address_book Address Book

At the end of the file, a dynamic breadcrumb trail is generated:

<?php
$page_name       = basename($_SERVER['PHP_SELF'], ".php");
$breadcrumb_label = ucwords(str_replace('_',' ',$page_name));

if (!in_array($page_name, ['contact_us','track_shipment','case_study','404'])
    && !$cms_breadcrumb && !$no_breadcrumb):
?>
<section class="breadcrumb-container">
  <nav aria-label="breadcrumb">
    <ol class="breadcrumb">
      <li class="breadcrumb-item">
        <a href="index.php"<?php if ($page_name=='index') echo ' class="active"'; ?>>
          Home
        </a>
      </li>
      <?php if ($page_name!='index'): ?>
        <li class="breadcrumb-item active" aria-current="page">
          <?php echo $breadcrumb_label; ?>
        </li>
      <?php endif; ?>
    </ol>
  </nav>
</section>
<?php endif; ?>
  • Exclusions: Certain pages (e.g. 404.php) skip breadcrumbs.
  • Label Formatting: Underscores become spaces and words are capitalized.

Dependencies & Context 🔗

  • Functions:
    • get_customer_location_features($masterId, $custId) retrieves location-based permissions
    • isCreateBOL($detailId) checks BOL creation rights
  • Includes: This panel is typically loaded via the site template:
    include_once("inc/panels/header-inner.php");
    
  • Session Variables: Relies on keys like Master_Customer_ID, Customer_ID, user_id, and Customer_email.

Style & Responsiveness 🎨

  • Uses Bootstrap 5 classes (navbar-expand-lg, collapse, container-fluid) for mobile-first layout.
  • Applies sticky-top to keep the header visible on scroll.
  • Utilizes SVG icons and Google Fonts (commented-out imports) for crisp visuals.

This header component orchestrates core navigation and account workflows, reflecting each customer’s entitlements and streamlining access to features tailored to their location and permissions.