<?php
/*
	osConcert Seat Booking Sofware
	Copyright (c) 2007-2025 https://www.osconcert.com

Released under the GNU General Public License
*/

// Check to ensure this file is included in osConcert!
defined('_FEXEC') or die();

// Hide footer.php if not to show in maintenance mode
if (DOWN_FOR_MAINTENANCE_FOOTER_OFF =='false') 
{
?>
<?php
if(HEADER_BANNER=='yes'){ 
require(DIR_FS_CATALOG.DIR_WS_TEMPLATES.TEMPLATE_NAME. '/content/sponsors.php'); 
}
?>
<?php
	if (!empty(FOOTER_BG)) {
		$fbgUrl = FOOTER_BG;
		// Always cast to int ONCE
		$overlayPercent = defined('FOOTER_BG_OVERLAY') ? (int)FOOTER_BG_OVERLAY : 50;
		// Keep safe range
		if ($overlayPercent < 0) $overlayPercent = 0;
		if ($overlayPercent > 90) $overlayPercent = 90;
		$opacity = $overlayPercent / 100;
		// Accent or black overlay
		if (defined('FOOTER_BG_OVERLAY_ACCENT') && (int)FOOTER_BG_OVERLAY_ACCENT === 1) {
			$overlay = "rgba(var(--we-accent-rgb), $opacity)";
		} else {
			$overlay = "rgba(0,0,0, $opacity)";
		}
		$fbgStyle = "background-image: linear-gradient($overlay, $overlay), url('" . htmlspecialchars($fbgUrl, ENT_QUOTES, 'UTF-8') . "');"
				  . "background-size:cover;"
				  . "background-repeat:no-repeat;"
				  . "background-position:center;";
	}
?>
<!-- ======= Fancy Footer ======= -->
<footer id="footer" class="footer">

  <div class="footer-content" style="<?= $fbgStyle ?>">
    <div class="container">
      <div class="row gy-4">

        <div class="col-lg-3 col-md-6">
          <div class="footer-info">
            <h3><?php echo STORE_NAME; ?></h3>

            <img class="rounded" src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME; ?>/images/footer-image.png" alt="<?php echo HEADER_TEXT_HOME; ?>"><br><br>

            <ul class="footer-contact">
              <li>
                <strong><?php echo FOOTER_TEXT_EMAIL; ?>:&nbsp;</strong>
                <a href="mailto:<?php echo STORE_OWNER_EMAIL_ADDRESS; ?>">
                  <?php echo STORE_OWNER_EMAIL_ADDRESS; ?>
                </a>
              </li>

              <?php if (STORE_OWNER_TELEPHONE != '') { ?>
                <li>
                  <i class="bi bi-phone"></i>
                  <?php echo STORE_OWNER_TELEPHONE; ?>
                </li>
              <?php } ?>
            </ul>
          </div>
        </div>

        <div class="col-lg-3 col-md-6 footer-links">
          <h4><?php echo TEXT_FOOTER_LINKS; ?></h4>
          <ul>
            <li>
              <i class="bi bi-chevron-right"></i>
              <a href="/"><?php echo FOOTER_TEXT_HOME; ?></a>
            </li>
          </ul>
        </div>

        <div class="col-lg-2 col-md-6 footer-links">
          <h4><?php echo TEXT_FOOTER_INFORMATION; ?></h4>
          <ul>
            <?php
              require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/boxes/footer_information.php');

              if (BOX_INFORMATION_CONTACT_LINK != '') {
                echo '<li><i class="bi bi-chevron-right"></i> <a href="' . BOX_INFORMATION_CONTACT_LINK . '">' . BOX_INFORMATION_CONTACT . '</a></li>';
              }

              if (PURCHASE_NO_ACCOUNT === 'no') {
                echo '<li><i class="bi bi-chevron-right"></i> <a href="' . tep_href_link(FILENAME_ACCOUNT) . '">' . HEADER_ACCOUNT . '</a></li>';
              }
            ?>
          </ul>
        </div>

        <div class="col-lg-4 col-md-6 footer-newsletter text-center">
          <?php
            if (SHOW_NEWSLETTER_BUTTON == 'Enable') {
              echo '<h3>' . TEXT_FOOTER_NEWSLETTER . '</h3>';
              echo '<a class="btn btn-newsletter" href="' . NEWSLETTER_LANDING_PAGE . '">Subscribe</a>';
              echo '<p><a target="_blank" rel="noopener" href="https://www.mailer-pro.com">by Mailer-PRO</a></p>';
            } else {
              echo OTHER_FOOTER_TEXT;
            }
          ?>
        </div>

      </div>
    </div>
  </div>

  <div class="footer-legal">
  <div class="container d-flex flex-column flex-lg-row justify-content-center justify-content-lg-between align-items-center gap-3">

    <div class="copyright text-center text-lg-start small">
      <?php echo "Copyright &copy; 2007-" . date('Y'); ?>
      <a href="/"><?php echo STORE_NAME; ?></a>.
      <?php echo FOOTER_MESSAGE; ?><br>

      <a href="https://www.osconcert.com" target="_blank" rel="noopener">
        <img
          src="<?php echo DIR_WS_TEMPLATES . TEMPLATE_NAME; ?>/images/osc1.png"
          alt="<?php echo STORE_NAME; ?>"
          title="<?php echo STORE_NAME; ?>"
          width="24"
          height="24"
          loading="lazy">
      </a>

      Powered by
      <a href="https://www.osconcert.com" target="_blank" rel="noopener">osConcert</a>. Template by <a href="https://www.cybergord.com">CyberGord Web Engine</a>.
    </div>

    <div class="social-links d-flex justify-content-center gap-2">

      <?php if (TWITTER_ID != '') { ?>
        <a target="_blank" rel="noopener" href="https://twitter.com/<?php echo TWITTER_ID; ?>" class="twitter" aria-label="Twitter">
          <i class="bi bi-twitter"></i>
        </a>
      <?php } ?>

      <?php if (FACEBOOK_ID != '') { ?>
        <a target="_blank" rel="noopener" href="https://facebook.com/<?php echo FACEBOOK_ID; ?>" class="facebook" aria-label="Facebook">
          <i class="bi bi-facebook"></i>
        </a>
      <?php } ?>

      <?php if (INSTAGRAM_ID != '') { ?>
        <a target="_blank" rel="noopener" href="https://www.instagram.com/<?php echo INSTAGRAM_ID; ?>" class="instagram" aria-label="Instagram">
          <i class="bi bi-instagram"></i>
        </a>
      <?php } ?>

      <?php if (LINKEDIN_ID != '') { ?>
        <a target="_blank" rel="noopener" href="https://www.linkedin.com/in/<?php echo LINKEDIN_ID; ?>" class="linkedin" aria-label="LinkedIn">
          <i class="bi bi-linkedin"></i>
        </a>
      <?php } ?>

    </div>

  </div>
</div>

</footer>
  
<?php 
} 
?>