<?php
do_action("inoby_before_footer");
$footer_layout = rwmb_meta("mb-footer-layout", ["object_type" => "setting"], "options");
$copyright_layout = rwmb_meta("mb-copyright-layout", ["object_type" => "setting"], "options");
if ($footer_layout !== "footer-none") { 
?>

<div id="footer" class="<?= $footer_layout ?>">
  <div class="container">
    <div class="row">
      <?php if ($footer_layout == "footer-one"):
        if (is_active_sidebar("footer-1")): ?>
      <div id="footer-column-1" class="widget-area">
        <?php dynamic_sidebar("footer-1"); ?>
      </div>
      <?php endif; ?>

      <?php
      endif; ?>

      <?php if ($footer_layout == "footer-two"):
        if (is_active_sidebar("footer-1")): ?>
      <div id="footer-column-1" class="widget-area">
        <?php dynamic_sidebar("footer-1"); ?>
      </div>
      <?php endif; ?>

      <?php if (is_active_sidebar("footer-2")): ?>
      <div id="footer-column-2" class="widget-area">
        <?php dynamic_sidebar("footer-2"); ?>
      </div>
      <?php endif; ?>

      <?php
      endif; ?>

      <?php if ($footer_layout == "footer-three"):
        if (is_active_sidebar("footer-1")): ?>
      <div id="footer-column-1" class="widget-area">
        <?php dynamic_sidebar("footer-1"); ?>
      </div>
      <?php endif; ?>

      <?php if (is_active_sidebar("footer-2")): ?>
      <div id="footer-column-2" class="widget-area">
        <?php dynamic_sidebar("footer-2"); ?>
      </div>
      <?php endif; ?>

      <?php if (is_active_sidebar("footer-3")): ?>
      <div id="footer-column-3" class="widget-area">
        <?php dynamic_sidebar("footer-3"); ?>
      </div>
      <?php endif; ?>

      <?php
      endif; ?>

      <?php if ($footer_layout == "footer-four"):
        if (is_active_sidebar("footer-1")): ?>
      <div id="footer-column-1" class="widget-area">
        <?php dynamic_sidebar("footer-1"); ?>
      </div>
      <?php endif; ?>

      <?php if (is_active_sidebar("footer-2")): ?>
      <div id="footer-column-2" class="widget-area">
        <?php dynamic_sidebar("footer-2"); ?>
      </div>
      <?php endif; ?>

      <?php if (is_active_sidebar("footer-3")): ?>
      <div id="footer-column-3" class="widget-area">
        <?php dynamic_sidebar("footer-3"); ?>
      </div>
      <?php endif; ?>

      <?php if (is_active_sidebar("footer-4")): ?>
      <div id="footer-column-4" class="widget-area">
        <?php dynamic_sidebar("footer-4"); ?>
      </div>
      <?php endif; ?>

      <?php
      endif; ?>

      <?php if ($footer_layout == "footer-five"):
        if (is_active_sidebar("footer-1")): ?>
      <div id="footer-column-1" class="widget-area">
        <?php dynamic_sidebar("footer-1"); ?>
      </div>
      <?php endif; ?>

      <?php if (is_active_sidebar("footer-2")): ?>
      <div id="footer-column-2" class="widget-area">
        <?php dynamic_sidebar("footer-2"); ?>
      </div>
      <?php endif; ?>

      <?php if (is_active_sidebar("footer-3")): ?>
      <div id="footer-column-3" class="widget-area">
        <?php dynamic_sidebar("footer-3"); ?>
      </div>
      <?php endif; ?>

      <?php if (is_active_sidebar("footer-4")): ?>
      <div id="footer-column-4" class="widget-area">
        <?php dynamic_sidebar("footer-4"); ?>
      </div>
      <?php endif; ?>

      <?php if (is_active_sidebar("footer-5")): ?>
      <div id="footer-column-5" class="widget-area">
        <?php dynamic_sidebar("footer-5"); ?>
      </div>
      <?php endif;
      endif; ?>
    </div>
  </div>

</div>

<?php 
}

do_action("inoby_before_copyright");

if ($copyright_layout !== "copyright-none") { 
?>

<div id="copyright" class="<?= $copyright_layout ?>">
  <div class="container">
    <div class="row">
      <?php if ($copyright_layout == "copyright-center"):
            if (is_active_sidebar("copyright-center")): ?>
      <div id="copyright-center" class="widget-area">
        <?php dynamic_sidebar("copyright-center"); ?>
      </div>
      <?php endif; ?>

      <?php endif; ?>

      <?php if ($copyright_layout == "copyright-left-and-right"):
                      if (is_active_sidebar("copyright-left")): ?>
      <div id="copyright-left" class="widget-area">
        <?php dynamic_sidebar("copyright-left"); ?>
      </div>
      <?php endif; ?>

      <?php if (is_active_sidebar("copyright-right")): ?>
      <div id="copyright-right" class="widget-area">
        <?php dynamic_sidebar("copyright-right"); ?>
      </div>
      <?php endif; ?>

      <?php endif; ?>

      <?php if ($copyright_layout == "copyright-left-right-center"):
                    if (is_active_sidebar("copyright-left")): ?>
      <div id="copyright-left" class="widget-area">
        <?php dynamic_sidebar("copyright-left"); ?>
      </div>
      <?php endif; ?>

      <?php if (is_active_sidebar("copyright-center")): ?>
      <div id="copyright-center" class="widget-area">
        <?php dynamic_sidebar("copyright-center"); ?>
      </div>
      <?php endif; ?>

      <?php if (is_active_sidebar("copyright-right")): ?>
      <div id="copyright-right" class="widget-area">
        <?php dynamic_sidebar("copyright-right"); ?>
      </div>
      <?php 
                  endif;
                endif; 
                ?>


    </div>
  </div>

</div>

<?php 
  }
?>