<?php
$header_file = "includes/template-part/footer/".$advancenews['Footer_Design'].".php";
if (file_exists($header_file)) {
   include $header_file;
}
?>

<?php
if ($advancenews['Footer_BgImage'] !='') {
  ?>
  <style media="screen">
    .mahamudfutureit_footer{
      background-image: url(<?php echo $advancenews['Footer_BgImage']  ?>) !important;
      background-repeat: no-repeat !important;
      background-position: center center !important;
      background-size: cover !important;
    }
  </style>
  <?php
}
if ($advancenews['Footer_Middle_BgImage'] !='') {
  ?>
  <style media="screen">
    .mahamudfutureit_footer .footer_middle{
      background-image: url(<?php echo $advancenews['Footer_Middle_BgImage']  ?>) !important;
      background-repeat: no-repeat !important;
      background-position: center center !important;
      background-size: cover !important;
    }
  </style>
  <?php
}
if ($advancenews['PopupAdsCtl'] == 'on') {
  ?>
  <div class="modal fade" id="popUpAds" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-hidden="true">
   <div class="modal-dialog modal-dialog-centered">
     <div class="modal-content border-0">
       <div class="modal-body p-0 position-relative">
         <span data-bs-dismiss="modal" class="position-absolute" style="cursor:pointer; background: rgb(165 162 162 / 71%); height: 35px; position: absolute !important; display: block; width: 35px; font-size: 22px; line-height: 38px; text-align: center; top: 10px; right: 10px; color: white; border-radius: 50%;">
           <i class="bi bi-x-lg"></i>
         </span>
         <?php echo showAds($advancenews['PopupAds'], 'off') ?>
       </div>
     </div>
   </div>
  </div>
  <script>
    document.addEventListener("DOMContentLoaded", function () {
      const modalId = 'popUpAds';
      const showAfter = <?php echo $advancenews['PopupAdsLoadTime'] ?? 0 ?> * 1000;
      const delayBetweenViews = <?php echo $advancenews['PopupAdsLoadAdd'] ?? 0 ?> * 60 * 1000;
      const storageKey = 'MahamudFutureITPopUpAds';
      const lastShown = localStorage.getItem(storageKey);
      const now = Date.now();
      if (!lastShown || now - parseInt(lastShown) > delayBetweenViews) {
        setTimeout(function () {
          var myModal = new bootstrap.Modal(document.getElementById(modalId));
          myModal.show();
          localStorage.setItem(storageKey, now.toString());
        }, showAfter);
      }
    });
  </script>
  <?php
}

$footer_popup_ads = showAds($advancenews['bottomPopupAds'], 'off');
if ($footer_popup_ads != '') {
  ?>
  <div class="mahamudfutureit_footer_slidad">
    <div class="mahamudfutureit_footer_slidad_inner">
      <span class="mahamudfutureit_footer_slidad_close" onclick="this.closest('.mahamudfutureit_footer_slidad').style.display='none'">
        <i class="bi bi-x-lg"></i>
      </span>
      <div class="container">
        <?php echo $footer_popup_ads ?>
      </div>
    </div>
  </div>
  <?php
}

?>

<footer class="<?php echo $mahamudfutureit_footer['footer_class'] ?> mahamudfutureit_footer">
  <?php
  // Topbar
  if (isset($mahamudfutureit_footer['footer_top'])) {
    ?>
    <div class="<?php echo $mahamudfutureit_footer['footer_top']['footer_class'] ?>" id="<?php echo $mahamudfutureit_footer['footer_top']['footer_id'] ?>">
      <div class="<?php echo $advancenews['Footer_Container'] ?>">
        <div class="row align-items-center">
          <?php
            foreach ($mahamudfutureit_footer['footer_top']['footer_element'] as $get_topbar_columns) {
              ?>
              <div class="<?php echo $get_topbar_columns['col'] ?>" >
                  <?php
                  foreach ($get_topbar_columns['item'] as $topbar_elements) {
                     if (file_exists($topbar_elements)) {
                        include $topbar_elements;
                    }
                  }
                  ?>
              </div>
              <?php
            }
          ?>
        </div>
      </div>
    </div>

    <?php
    if ($advancenews['FooterTop_BorderColor'] !='') {
      ?>
      <div class="<?php echo $advancenews['Footer_Container'] ?>">
        <div class="row">
          <div class="col-12">
            <div style="background-color: <?php echo $advancenews['FooterTop_BorderColor'] ?>; height: 0.5px;">
            </div>
          </div>
        </div>
      </div>
      <?php
    }
  }
  // Midddle Bar
  if (isset($mahamudfutureit_footer['footer_middle'])) {
    ?>
    <div class="<?php echo $mahamudfutureit_footer['footer_middle']['footer_class'] ?>" id="<?php echo $mahamudfutureit_footer['footer_middle']['footer_id'] ?>">
      <div class="<?php echo $advancenews['Footer_Container'] ?> ">
        <div class="row align-items-center  ">
          <?php
            foreach ($mahamudfutureit_footer['footer_middle']['footer_element'] as $get_middlebar_columns) {
              ?>
              <div class="<?php echo $get_middlebar_columns['col'] ?>  " >
                  <?php
                  foreach ($get_middlebar_columns['item'] as $middlebar_elements) {
                    if (file_exists($middlebar_elements)) {
                        include $middlebar_elements;
                    }
                  }
                  ?>
              </div>
              <?php
            }
          ?>
        </div>
      </div>
    </div>
    <?php
  }
  // Bottom Bar
  if (isset($mahamudfutureit_footer['footer_bottom'])) {
    if ($advancenews['FooterBottom_BorderColor'] !='') {
      ?>
      <div class="<?php echo $advancenews['Footer_Container'] ?>">
        <div class="row">
          <div class="col-12">
            <div style="background-color: <?php echo $advancenews['FooterBottom_BorderColor'] ?>; height: 0.5px;">
            </div>
          </div>
        </div>
      </div>
      <?php
    }
    ?>
    <div class="<?php echo $mahamudfutureit_footer['footer_bottom']['footer_class'] ?>" id="<?php echo $mahamudfutureit_footer['footer_bottom']['footer_id'] ?>">
      <div class="<?php echo $advancenews['Footer_Container'] ?>">
        <div class="row align-items-center">
          <?php
            foreach ($mahamudfutureit_footer['footer_bottom']['footer_element'] as $get_bottombar_columns) {
              ?>
              <div class="<?php echo $get_bottombar_columns['col'] ?>" >
                  <div class="tt_element_inner">
                    <?php
                    foreach ($get_bottombar_columns['item'] as $bottombar_elements) {
                      if (file_exists($bottombar_elements)) {
                          include $bottombar_elements;
                      }
                    }
                    ?>
                  </div>
              </div>
              <?php
            }
          ?>
        </div>
      </div>
    </div>
    <?php
  }
  ?>
</footer>
<button id="mahamudfutureit_backToTop"><i class="bi bi-chevron-up"></i></button>

<!-- ========== Font Awesome for TTS Player (mahamudfutureit) ========== -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">

<script type="text/javascript">
  function MahamudFutureITTicker(e,t){var r=document.getElementById(e),n={speed:20},a=Object.assign(n,t),i=r.querySelector("ul");i.innerHTML+=i.innerHTML;var l=0,o=null;function s(){l--,Math.abs(l)>=i.scrollWidth/2&&(l=0),i.style.transform="translateX("+l+"px)"}function c(){o||(o=setInterval(s,a.speed))}function u(){clearInterval(o),o=null}c(),r.addEventListener("mouseenter",u),r.addEventListener("mouseleave",c)}MahamudFutureITTicker("mahamudfutureit-ticker-box",{speed:10});
</script>
<script>
  $(document).ready(function(){$(".popup-gallery").magnificPopup({delegate:"a",type:"image",tLoading:"লোড হচ্ছে...",mainClass:"mfp-img-mobile",gallery:{enabled:!1,navigateByImgClick:!1,preload:[0,1]},image:{tError:"ছবিটি পাওয়া যাচ্ছে না !",titleSrc:function(i){return i.el.attr("title")}}})});
</script>
<script type="text/javascript">
  const defaultTheme = '<?php echo $advancenews['WebsiteTheme'] ?>';
</script>
<script src="<?php echo $site_domain;?>assets/js/mahamudfutureit.js"></script>
<script src="<?php echo $site_domain;?>lib/bootstrap-5.3.3/js/bootstrap.min.js"></script>
<?php echo $advancenews['Custome_Footer_Code'] ?>
<?php echo $advancenews['Custome_Footer_JS'] ?>
</body>
</html>