Footer-Home Panel (footer-home.php)
This panel renders the site’s footer on public-facing pages. It includes navigation links, social icons, scroll controls, conditional chatbot integration, and attribution.
Purpose
- Provide a consistent footer across the Linuxfront-v2-Logistics site.
- Highlight the current page in the footer navigation.
- Render social media links and a “scroll-to-top” button.
- Optionally display an interactive chatbot for specific users.
- Show the “Powered by” notice with a dynamic year.
File Location
linuxfront-v2-logistics/inc/panels/footer-home.php
Key Features
- Dynamic Link Highlighting
- Social Media Icons
- Scroll-to-Top Button
- Conditional Chatbot Overlay 💬
- Powered By Notice
Structure & Markup
The footer uses Bootstrap’s grid classes and custom CSS classes to lay out content. It begins by detecting the current page:
<?php
$page_name = basename($_SERVER['PHP_SELF']);
?>
<footer class="footer">
<div class="container position-relative">
<!-- Scroll-to-Top -->
<a href="#top" class="scroll-to-top">
<img src="images/keyboard_arrow_up.svg" alt="Scroll Arrow" width="40" />
</a>
<!-- ... -->
</div>
</footer>
Dynamic Page Highlighting
This section compares the current filename to each link’s target. If they match, it adds the active class.
<a href="index.php"
class="nav-link <?php if($page_name == 'index.php') { echo 'active'; } ?>">
Home
</a>
Social Media Icons
A row of icons links to the company’s social pages. Each opens in a new tab:
- Facebook:
https://www.facebook.com/techtransport/ - Twitter-X:
https://twitter.com/tech_transport - LinkedIn:
https://www.linkedin.com/company/615045/
Scroll-to-Top Button
An anchored button uses an SVG arrow. Clicking it smoothly scrolls the user to the top of the page.
Chatbot Integration 💬
For Customer ID “7”, if the external chatbot URL responds with HTTP 200, the chat icon appears. Clicking it toggles an overlay <iframe> loading /xai-chatbotv2.php.
function toggleChat() {
const chatOverlay = document.getElementById('chatOverlay');
const chatIcon = document.querySelector('.chat-icon');
const isHidden = window.getComputedStyle(chatOverlay).display === 'none';
if (isHidden) {
chatOverlay.style.display = 'block';
chatIcon.classList.add('open');
} else {
chatOverlay.style.display = 'none';
chatIcon.classList.remove('open');
}
}
Powered By Notice
A bottom strip displays the site attribution using PHP’s date() to keep the year current.
<p class="text-white mb-0">
Powered by: Freightanywhere.com |
Copyright © 2008 - <?php echo date('Y'); ?> Tech Logistics.
All Rights Reserved.
</p>
Dependencies & Context
- PHP Session
Relies on$_SESSION['Customer_ID']for chatbot logic. - Helper Function
UsescheckUrlStatus($url)to verify chatbot server availability. - CSS Framework
Leverages Bootstrap grid and utility classes. - Template Inclusion
This panel is included via the site template, e.g.:<?php include_once("inc/panels/footer-home.php"); ?>
Similar Implementations
A near-identical footer appears in Linuxfront-v2 (non-Logistics) codebase:
linuxfront-v2/inc/panels/footer-home.php
This parallel structure ensures branding consistency across portals.
Integration Example
To render this footer at the bottom of a page:
<?php
// ... page content ...
include_once("inc/panels/footer-home.php");
?>
This inclusion typically sits just before </body> in the master template.
✨ Footer-Home Panel ensures a unified, responsive footer with dynamic navigation, social connectivity, user-specific chat, and up-to-date attribution across the Linuxfront-v2-Logistics site.