<?php
/**
 * The template for displaying the footer
 */
if (!defined('ABSPATH')) {
    exit();
}
?>
</div><!-- CONTENT -->

<!-- FOOTER -->
<footer>  
    <?php
    global $milo_theme_options;

// Footer layout options
    $milo_footer_top_switch = $milo_footer_layout_top = $milo_footer_mid_switch = $milo_footer_layout_mid = $milo_footer_bottom_switch = $milo_footer_layout_bottom = '';
    $milo_footer_layout_top[0] = $milo_footer_layout_mid[0] = $milo_footer_layout_bottom[0] = 3;
    $milo_footer_layout_top[1] = $milo_footer_layout_mid[1] = $milo_footer_layout_bottom[1] = 6;
    $milo_footer_layout_top[2] = $milo_footer_layout_mid[2] = $milo_footer_layout_bottom[2] = 9;
    if (isset($milo_theme_options['milo-footer-top-switch'])) {
        $milo_footer_top_switch = $milo_theme_options['milo-footer-top-switch'];
    }
    if (isset($milo_theme_options['milo-footer-layout-top'])) {
        $milo_footer_layout_top = $milo_theme_options['milo-footer-layout-top'];
    }

    if (isset($milo_theme_options['milo-footer-mid-switch'])) {
        $milo_footer_mid_switch = $milo_theme_options['milo-footer-mid-switch'];
    }
    if (isset($milo_theme_options['milo-footer-layout-mid'])) {
        $milo_footer_layout_mid = $milo_theme_options['milo-footer-layout-mid'];
    }

    if (isset($milo_theme_options['milo-footer-bottom-switch'])) {
        $milo_footer_bottom_switch = $milo_theme_options['milo-footer-bottom-switch'];
    }
    if (isset($milo_theme_options['milo-footer-layout-bottom'])) {
        $milo_footer_layout_bottom = $milo_theme_options['milo-footer-layout-bottom'];
    }

    if ($milo_footer_top_switch == 1 && $milo_footer_layout_top != ''):
        ?>
        <div id="footer-top"<?php
        if (isset($milo_theme_options['milo-footer-top-parallax'])) {
            if ($milo_theme_options['milo-footer-top-parallax'] == 1) {
                echo ' class="parallax" data-stellar-background-ratio="0.1"';
            }
        }
        ?>>
                <?php if (isset($milo_theme_options['milo-footer-top-shadow'])) {
                if ($milo_theme_options['milo-footer-top-shadow'] == 1) { ?>
                <div class="full-section-shadow-top"></div>
                <?php } } ?>
                
            <div class="container">
                <div class="row">

                    <?php
                    $top_layouts = array_unique($milo_footer_layout_top);

                    asort($top_layouts);
                    $initial = 0;
                    $count = 1;
                    foreach ($top_layouts as $top_layout) {


                        $top_layout - $initial;
                        ?>
                        <div class="col-sm-<?php echo esc_attr($top_layout - $initial); ?>" id="footer-top-widget-area-<?php echo esc_attr($count); ?>">

                            <?php
                            if (function_exists('dynamic_sidebar')) {

                                if (is_active_sidebar('milo-footer-top-sidebar-' . $count)) {
                                    dynamic_sidebar('milo-footer-top-sidebar-' . $count);
                                }
                            }
                            ?>

                        </div>
                        <?php
                        $initial = $top_layout;
                        $count++;
                    }
                    if ($initial != 12) {
                        ?>
                        <div class="col-sm-<?php echo esc_attr(12 - $initial); ?>" id="footer-top-widget-area-<?php echo esc_attr($count); ?>">

                            <?php
                            if (function_exists('dynamic_sidebar')) {

                                if (is_active_sidebar('milo-footer-top-sidebar-' . $count)) {
                                    dynamic_sidebar('milo-footer-top-sidebar-' . $count);
                                }
                            }
                            ?>

                        </div>
                        <?php
                    }
                    ?>

                </div>
            </div>
        </div>
        <?php
    endif;
    if ($milo_footer_mid_switch == 1 && $milo_footer_layout_mid != ''):
        ?>
        <div id="footer"<?php
        if (isset($milo_theme_options['milo-footer-mid-parallax'])) {
            if ($milo_theme_options['milo-footer-mid-parallax'] == 1) {
                echo ' class="parallax" data-stellar-background-ratio="0.1"';
            }
        }
        ?>>
            
            <?php if (isset($milo_theme_options['milo-footer-mid-shadow'])) {
                if ($milo_theme_options['milo-footer-mid-shadow'] == 1) { ?>
                <div class="full-section-shadow-top"></div>
                <?php } } ?>
            
            <div class="container">
                <div class="row">

                    <?php
                    $mid_layouts = array_unique($milo_footer_layout_mid);

                    asort($mid_layouts);
                    $initial = 0;
                    $count = 1;
                    foreach ($mid_layouts as $mid_layout) {


                        $mid_layout - $initial;
                        ?>
                        <div class="col-sm-<?php echo esc_attr($mid_layout - $initial); ?>" id="footer-mid-widget-area-<?php echo esc_attr($count); ?>">

                            <?php
                            if (function_exists('dynamic_sidebar')) {

                                if (is_active_sidebar('milo-footer-mid-sidebar-' . $count)) {
                                    dynamic_sidebar('milo-footer-mid-sidebar-' . $count);
                                }
                            }
                            ?>

                        </div>
                        <?php
                        $initial = $mid_layout;
                        $count++;
                    }
                    if ($initial != 12) {
                        ?>
                        <div class="col-sm-<?php echo esc_attr(12 - $initial); ?>" id="footer-mid-widget-area-<?php echo esc_attr($count); ?>">

                            <?php
                            if (function_exists('dynamic_sidebar')) {

                                if (is_active_sidebar('milo-footer-mid-sidebar-' . $count)) {
                                    dynamic_sidebar('milo-footer-mid-sidebar-' . $count);
                                }
                            }
                            ?>

                        </div>
                        <?php
                    }
                    ?>

                </div>
            </div>
        </div>
        <?php
    endif;
    if ($milo_footer_bottom_switch == 1 && $milo_footer_layout_bottom != ''):
        ?>
    <div id="footer-bottom"<?php
        if (isset($milo_theme_options['milo-footer-bottom-parallax'])) {
            if ($milo_theme_options['milo-footer-bottom-parallax'] == 1) {
                echo ' class="parallax" data-stellar-background-ratio="0.1"';
            }
        }
        ?>>
        
        <?php if (isset($milo_theme_options['milo-footer-bottom-shadow'])) {
                if ($milo_theme_options['milo-footer-bottom-shadow'] == 1) { ?>
                <div class="full-section-shadow-top"></div>
                <?php } } ?>
                
            <div class="container">
                <div class="row">

                    <?php
                    $bottom_layouts = array_unique($milo_footer_layout_bottom);

                    asort($bottom_layouts);
                    $initial = 0;
                    $count = 1;
                    foreach ($bottom_layouts as $bottom_layout) {


                        $bottom_layout - $initial;
                        ?>
                        <div class="col-sm-<?php echo esc_attr($bottom_layout - $initial); ?>" id="footer-bottom-widget-area-<?php echo esc_attr($count); ?>">

                            <?php
                            if (function_exists('dynamic_sidebar')) {

                                if (is_active_sidebar('milo-footer-bottom-sidebar-' . $count)) {
                                    dynamic_sidebar('milo-footer-bottom-sidebar-' . $count);
                                }
                            }
                            ?>

                        </div>
                        <?php
                        $initial = $bottom_layout;
                        $count++;
                    }
                    if ($initial != 12) {
                        ?>
                        <div class="col-sm-<?php echo esc_attr(12 - $initial); ?>" id="footer-bottom-widget-area-<?php echo esc_attr($count); ?>">

                            <?php
                            if (function_exists('dynamic_sidebar')) {

                                if (is_active_sidebar('milo-footer-bottom-sidebar-' . $count)) {
                                    dynamic_sidebar('milo-footer-bottom-sidebar-' . $count);
                                }
                            }
                            ?>

                        </div>
                        <?php
                    }
                    ?>

                </div>
            </div>
        </div>
    <?php endif; ?>
    <!-- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->

</footer><!-- FOOTER -->

</div><!-- PAGE-WRAPPER -->

<?php
if (isset($milo_theme_options['milo-backtotop-toggle'])) {
    if ($milo_theme_options['milo-backtotop-toggle'] == 1) {
        ?>
        <!-- GO TOP -->
        <a id="go-top"><i class="mt-icon-arrow-up2"></i></a>
            <?php
        }
    }

    wp_footer();
    ?>
</body>
</html>