<?php 
	global $passport_theme_setting; 
    global $passport_footer_column;

	$header_image			= get_header_image();
	$hide_extra_menu_bar	= get_theme_mod( 'passport_hide_extra_menu_section', 'false' );
    $passport_footer_column	= get_theme_mod( 'passport_footer_column', '3' );

?>
    <footer id="footer" class="site-footer">
        <div class="container">
    	    <div class="footer-widgets <?php if( 'full_width_container' == $passport_theme_setting && is_front_page() && ! is_home()  ) { echo 'full-width'; } else { echo 'fix-width'; } ?> clearfix">
			    <div class="footer-widget-area column layout">
	                <?php 
                    $i	= $passport_footer_column;
 				    for ( $i=1; $i <= $passport_footer_column; $i++ ) :
					    if ( is_active_sidebar( PASSPORT_THEME_SLUG . '-footer-'. $i.'' ) ) : 
					        if( '1' == $passport_footer_column ) : ?>
						        <div class="col-xxs col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <?php elseif( '2' == $passport_footer_column && 'full_width_container' == $passport_theme_setting ) : ?>
							    <div class="col-xxs col-xs-12 col-sm-6 col-md-6 col-lg-6">
						    <?php elseif( '2' == $passport_footer_column ) : ?>
							    <div class="col-xxs col-xs-12 col-sm-6 col-md-6 col-lg-6">
                            <?php elseif( '3' == $passport_footer_column && 'full_width_container' == $passport_theme_setting ) : ?>
							    <div class="col-xxs col-xs-12 col-sm-6 col-md-4 col-lg-4">
                            <?php elseif( '3' == $passport_footer_column ) : ?>
							    <div class="col-xxs col-xs-12 col-sm-6 col-md-4 col-lg-4">
                            <?php elseif( '4' == $passport_footer_column && 'full_width_container' == $passport_theme_setting ) : ?>
							    <div class="col-xxs col-xs-12 col-sm-6 col-md-3 col-lg-3">
						    <?php elseif( '4' == $passport_footer_column ) : ?>
							    <div class="col-xxs col-xs-12 col-sm-6 col-md-3 col-lg-3">
						    <?php endif; ?>
								    <div class="row">
								        <div class="footer-widget-item">
								            <?php dynamic_sidebar( PASSPORT_THEME_SLUG . '-footer-'. $i.'' ); ?>
								        </div>
								    </div>
						    <?php if( '1' == $passport_footer_column ) : ?>
							    </div>
                            <?php elseif( '2' == $passport_footer_column && 'full_width_container' == $passport_theme_setting ) : ?>
                                </div>
						    <?php elseif( '2' == $passport_footer_column ) : ?>
							    </div>
                            <?php elseif( '3' == $passport_footer_column && 'full_width_container' == $passport_theme_setting ) : ?>
                                </div>
					        <?php elseif( '3' == $passport_footer_column ) : ?>
							    </div>
                            <?php elseif( '4' == $passport_footer_column && 'full_width_container' == $passport_theme_setting ) : ?>
                                </div>
							    <?php elseif( '4' == $passport_footer_column ) : ?>
							    </div>
						    <?php endif; ?>
					    <?php endif; ?>
				    <?php endfor; ?>
			    </div>
            </div>
        </div>
        <div class="small footer">
            <div class="container">
                <div class="row">
	                <?php 
		                $copyright_year = date('Y'); 
                        $blogname		= get_bloginfo( 'name' );
	                ?>
                    <div class="alignleft">
                        <nav id="footer-menu-bar" class="footer-navbar">
       	                    <?php echo passport_footer_menu() ?>
                        </nav>
                    </div>
                    <?php if( ! empty( $copyright_year ) && ! empty( $blogname ) ) : ?>
                    <div class="right-indent alignright">
		                <?php echo 'Copyright &#169; '. $copyright_year .' '. $blogname .' All Rights Reserved.' ?>
                    </div>
                    <?php endif; ?>
                </div>
            </div>
        </div><!-- .footer -->
	    <a href="#" class="back-to-top"><i class="fa fa-chevron-up"></i></a>
    </footer><!-- #footer -->
	<?php wp_footer(); ?>
	</body>
</html>
