<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/**
 * Footer Template
 *
 * Here we setup all logic and XHTML that is required for the footer section of all screens.
 *
 * @package ttFramework
 * @subpackage Template
 */
	$total = tt_temptt_get_option('footer_sidebars', '3');
?>
	<footer id="footer" class="sec-padding">

<?php
	if ( ( is_active_sidebar( 'footer-1' ) ||
		   is_active_sidebar( 'footer-2' ) ||
		   is_active_sidebar( 'footer-3' ) ||
		   is_active_sidebar( 'footer-4' ) ) && $total > 0 ) {
		   $BTcols = 4;
		   if ( $total == 4) $BTcols = 3; if ( $total == 3) $BTcols = 4; if ( $total == 2) $BTcols = 6; if ( $total == 1) $BTcols = 12;

?>
			<section id="footer-widget-area">
        		<div class="thm-container">
            		<div class="row">

					<?php $i = 0; while ( $i < $total ) { $i++; ?>
						<?php if ( is_active_sidebar( 'footer-' . $i ) ) { ?>

						<div class="clearfix col-md-<?php print esc_attr($BTcols); ?> col-sm-6 footer-widget-<?php print esc_attr($i); ?>">
				            <?php dynamic_sidebar( 'footer-' . $i ); ?>
						</div>

				        <?php } ?>
					<?php } // End WHILE Loop ?>

					</div>
			    </div>
			</section>
	<?php } // End IF Statement ?>
	</footer><!--/.footer-wrap-->

<section class="bottom-bar">
    <div class="thm-container clearfix">
        <div class="pull-left">
            <p>
				<?php if ( tt_temptt_get_option('footer_left', 1) ) {
					print do_shortcode(  tt_temptt_get_option('footer_left_text') );
				} else {
				    bloginfo(); ?> &copy; <?php print date( 'Y' ) . esc_html_e( 'All Rights Reserved.', 'logiscargo' );
				} ?>
            </p>
        </div>
        <div class="pull-right">
            <p>
				<?php if( tt_temptt_get_option('footer_right', 1) ) {
						print do_shortcode(  tt_temptt_get_option('footer_right_text') );
					} else {
						esc_html_e( 'Powered by', 'logiscargo' ); ?> <a href="http://templatation.com">Templatation</a>
				<?php } ?>
            </p>
        </div>
    </div>
</section>
<a href="#" class="scrollup"></a>
<?php wp_footer(); ?>

</body>
</html>
