Right Navigation Panel (right_nav2.php) 🚀
This panel renders the right sidebar on key pages, showing either account management links for authenticated users or a login form for guests. It can also display an optional “Our Services” section based on the current template.
Overview
right_nav2.php is included in page templates such as index2.php, integrating smoothly into the layout to provide contextual navigation and user interaction .
Dependencies & Context
- Session Data: Checks
$_SESSION['Customer_ID']to determine login state. - Flash Messages: Uses a
$messagevariable (set in controllers likeindex2.php) to display login errors. - Template Controls: Relies on
$currnt_templateand$include_full_right_bar(arrays defined ininc/config.php) to conditionally show the “Our Services” list.
1. Manage Your Account 👤
Displayed when a user is logged in (Customer_ID is set and non-empty).
<?php if (isset($_SESSION['Customer_ID']) && !empty($_SESSION['Customer_ID'])) { ?>
<h3>Manage Your Account</h3><br />
<ul>
<li><a href="my_account.php">My Account</a></li>
<li><a href="start_quote.php">Quote & Ship</a></li>
<li><a href="my_shipments.php">My Shipments</a></li>
<li><a href="address_book.php">Address Book</a></li>
<li><a href="product_catalog.php">Product Catalog</a></li>
<li><a href="create_bol.php">Create BOL</a></li>
<li><a href="locations.php">Locations</a></li>
<li><a href="apply_for_credit.php">Apply For Credit</a></li>
<li><a href="track_shipment.php">Track Shipment</a></li>
</ul>
<br clear="all" />
<?php } ?>
Key Links & Actions:
- My Account: View or update profile
- Quote & Ship: Initiate shipment quotes
- My Shipments: Track and manage shipments
(…and more)
2. Customer Login 🔒
Rendered when no Customer_ID exists. Presents a login form with validation and error display.
<?php } else { ?>
<h3>Customer Login</h3><br />
<form name="lgnfrm" id="lgnfrm" action="index2.php" method="post">
<input type="hidden" name="action" value="login" />
<table width="190" cellspacing="0" cellpadding="2" border="0">
<tr><td>Username / Email</td></tr>
<tr><td><input type="text" name="usr_email" class="login_input" /></td></tr>
<tr><td>Password</td></tr>
<tr><td><input type="password" name="pwd" class="login_input" /></td></tr>
<tr>
<td>
<input type="image" src="images/login.gif" alt="Login" name="submit" />
<div style="color:#F00;"><?=$message?></div>
</td>
</tr>
<tr>
<td>
<ul>
<li><a href="forgot_password.php">Forgot your password?</a></li>
<li><a href="signup.php">Create an account</a></li>
</ul>
</td>
</tr>
</table>
</form>
<?php } ?>
Form Fields
- usr_email: Text input (max 150 chars)
- pwd: Password input (max 50 chars)
- action: Hidden field set to
"login" - Error Display: Inline
$messagefor failed logins
3. Our Services Include ⚙️
An optional section rendered when the current template is listed in $include_full_right_bar.
<?php if (in_array($currnt_template, $include_full_right_bar)) { ?>
<img src="images/line.gif" alt="" style="margin:5px 0px;" />
<h3>Our Services Include:</h3>
<ul>
<li>Transportation Management</li>
<li>Carrier Contract Negotiations</li>
<li>Uniform LTL Base Rates</li>
<li>Online Rating Engine</li>
<li>Automatic Pre-Pay & Add Calculator</li>
<li>Freight Bill Auditing including Small Package</li>
<li>Freight Payment Processing</li>
<li>Bill of Lading Matching</li>
<li>Loss & Damage Claims</li>
<li>Shipment Tracking & Visibility</li>
<li>Comprehensive Cost & Service Reporting</li>
<li>Account Code Reporting</li>
<li>Carrier Evaluations</li>
<li>Routing Guidance for General and Special Shipments</li>
<li>Vendor Routing Compliance Systems</li>
<li>Shipment Planning & Execution</li>
<li>Electronic Data Interchange (EDI)</li>
</ul><br clear="all" />
<?php } ?>
This feature allows marketing or informational content to be highlighted on selected pages.
Variables & Configuration
| Variable | Purpose |
|---|---|
$_SESSION['Customer_ID'] |
Determines if the Manage Your Account or Login view is shown. |
$message |
Carries flash/error messages into the login form (set in index2.php). |
$currnt_template |
Identifies the active page template (defined in inc/config.php). |
$include_full_right_bar |
Array of templates where Our Services should appear (defined in inc/config.php).) |
Integration & Usage
- Include in Template
<?php include_once("inc/panels/right_nav2.php"); ?> - Ensure Session
session_start()must be called in a parent file (e.g.,inc/config.php).
- Define Template Array
- Configure
$currnt_templateand$include_full_right_barininc/config.php.
- Configure
Note:
- The
<br clear="all" />tags ensure proper float clearing in legacy layouts.- An earlier version (
right_nav.php) exists with more granular billing-country logic;right_nav2.phpstreamlines this behavior.
This design promotes a consistent user experience, consolidating authentication, account links, and marketing blurbs into a single, easily maintainable panel.