Old Welcome Page (old-welcome.php)

Overview

This file renders the legacy “Welcome” landing page for the logistics portal.
It clears stale quote data, enforces security, sets up the user’s default location, and displays quick-action buttons for quoting, shipping, and account management.

Dependencies

  • inc/config.php – Global constants, paths, and environment setup
  • inc/user_secure.inc.php – Session security and referrer-based session handling
  • inc/panels/meta.php & TEMPLATE_DIR/inc/template_meta.php – Meta tags, CSS/JS includes
  • inc/panels/header-inner.php – Inner header for logged-in users
  • inc/panels/footer-home.php – Footer for home pages

Session Management

Clearing Old Data

unset($_SESSION["QUOTE_INFO"]);
unset($_SESSION["banyan"]["easy_rate_array"]);

The code resets any in-progress quote or rate lookups to avoid data leakage on page load.

Default Location Setup

On first login, the script fetches the user’s default shipping location:

if ($_SESSION['first_login_default'] != 'Y') {
    $query = "
      SELECT access_customer_id
      FROM customers_users_locations_access
      WHERE user_id = '{$_SESSION['user_id']}'
        AND default_location = 'Y'
      LIMIT 1
    ";
    $result        = Query($query);
    $obj           = GetObj($result);
    $default_login = $obj->access_customer_id;
}

It stores the access_customer_id for redirect in a JavaScript snippet later.

HTML Structure

Head Section

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <? include_once(TEMPLATE_DIR . "inc/template_meta.php"); ?>
  <? include_once("inc/panels/meta.php"); ?>
</head>

It pulls in DOCTYPE, meta tags, CSS, and JS dependencies.

Body & Wrapper

<body>
  <div id="wrapper">
    <? include_once("inc/panels/header-inner.php"); ?>
    <div class="container">
      <div class="fa-main-content">
        <!-- Welcome Panel -->
      </div>
    </div>
    <? include_once("inc/panels/footer-home.php"); ?>
  </div>
  <!-- First-login JS -->
</body>
</html>

The layout uses a central wrapper, a header, main container, and footer.

Welcome Panel

Quote & Ship Section

  • Title: “Quote & Ship”
  • Description: Instant carrier comparisons or reuse past shipments.

Dynamic “Start a Quote” Button

The code evaluates several session flags to determine availability and style of the Start a Quote button:

Session Flag Required Value Action
canadian_cwt_tab & Customer_ID != 7 Y LTL-focused quote (rel="ltl")
rating_check & detail_product Y & Y Standard quote
banyan_enabled Y Banyan-branded quote
Default fallback — Standard quote
<? if (isset($_SESSION['canadian_cwt_tab'])
     && $_SESSION['canadian_cwt_tab']=='Y'
     && $_SESSION['Customer_ID']!='7'): ?>
  <a href="javascript:{}" rel="ltl">
    <button class="btn btn-primary py-3 btn-effect mb-2">
      Start a Quote
    </button>
  </a>
<? else: ?>
  <a href="start_quote.php">
    <button class="btn btn-primary py-3 btn-effect mb-2">
      Start a Quote
    </button>
  </a>
<? endif; ?>

Additional Actions

  • Create a Shipment
    <? if ($_SESSION['create_shipment_check']=='Y'): ?>
      <span>OR</span>
      <a href="create_shipment.php">
        <button class="btn btn-primary py-3 btn-effect mb-2">
          Create a Shipment
        </button>
      </a>
    <? endif; ?>
    
  • Small Parcel
    <? if ($_SESSION['small_package']=='Y'): ?>
      <span>OR</span>
      <a href="small_parcel.php">
        <button class="btn btn-primary py-3 btn-effect mb-2">
          Small Parcel
        </button>
      </a>
    <? endif; ?>
    

Shipments & Payments Box

Below the quote panel, a two-column box highlights key account features:

📦 Your Shipments 💳 Make payments
Review shipment dates and documents. Review invoices and pay electronically.
Access proof of delivery and past shipping. Apply for credit and manage billing options.

First-Login Redirect Logic

On first login, the page injects a script to auto-select the default location and submit the top-header form:

<? if ($default_login!='' && $_SESSION['first_login_default']!='Y'): ?>
<script>
  var tmpDefault  = '<?=$default_login?>';
  var location_id = $("#location_id").val();
  if (location_id !== tmpDefault) {
    $("#location_id").val(tmpDefault).change();
    $("#top_header_companies_frm").submit();
  }
</script>
<? endif; ?>

This ensures the user lands at their primary location before any further navigation.


Emojis Legend

  • 📦 Shipment features
  • 💳 Payment features

This documentation covers the purpose, how session flags drive dynamic UI elements, and the key include dependencies of old-welcome.php.