<?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the #content div and all content after
 *
 * @package ares
 */
?>
<?php 
	// Variables - Contact Details
	$email = get_field('email', 'options');
	$location = get_field('location', 'options');
	$phone = get_field('phone', 'options');
	$phone_nice = str_replace(' ', '', $phone);
?>
<footer>
	<div class="footer-container">
		<div class="row">
			<div class="col-md-4 icon">
				<i class="fa fa-angle-right" aria-hidden="true"></i>
			</div>
			<div class="col-md-4">
				<div class="contact-wrapper">
					<h2>Get in touch</h2>
					<p><a href="mailto:<?php echo $email; ?>"><?php echo $email; ?></a></p>
					<p><?php echo $location; ?></p>
					<p class="has-border"><a href="tel:<?php echo $phone_nice; ?>"><?php echo $phone; ?></a></p>
				</div>
			</div>
			<div class="col-md-2">
				<div class="sitemap-wrapper">
					<h2>Sitemap</h2>
					<?php wp_nav_menu(array('theme_location' => 'primary')); ?>
				</div>
			</div>
			<div class="col-md-2">
				<?php if( have_rows( 'social_media', 'options' ) ):
					echo '<div class="social-wrapper">';
					echo '<h2>Connect with us</h2>';
					while ( have_rows( 'social_media', 'options' ) ) : the_row();
						if( get_row_layout() == 'facebook' ):
							$link = get_sub_field( 'link' );
							echo '<a href=" '. $link .'" class="social-link facebook"><i class="fa fa-facebook" aria-hidden="true"></i></a>';
						elseif( get_row_layout() == 'instagram' ): 
							$link = get_sub_field( 'link' );
							echo '<a href=" '. $link .'" class="social-link instagram"><i class="fa fa-instagram" aria-hidden="true"></i></a>';
						elseif( get_row_layout() == 'linkedin' ): 
							$link = get_sub_field( 'link' );
							echo '<a href=" '. $link .'" class="social-link linkedin"><i class="fa fa-linkedin" aria-hidden="true"></i></a>';
						elseif( get_row_layout() == 'twitter' ): 
							$link = get_sub_field( 'link' );
							echo '<a href=" '. $link .'" class="social-link twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a>';
						elseif( get_row_layout() == 'youtube' ): 
							$link = get_sub_field( 'link' );
							echo '<a href=" '. $link .'" class="social-link youtube"><i class="fa fa-youtube" aria-hidden="true"></i></a>';
						elseif( get_row_layout() == 'vimeo' ): 
							$link = get_sub_field( 'link' );
							echo '<a href=" '. $link .'" class="social-link vimeo"><i class="fa fa-vimeo" aria-hidden="true"></i></a>';
						endif;

					endwhile;
					echo '</div>';
				else :
					// no layouts found
				endif; ?>
			</div>
		</div>
		<div class="row copyright-wrapper">
			<p>&copy; <?php echo bloginfo('name'); ?> <?php echo date('Y'); ?>. All Rights Reserved.</p>
			<p>A site by <a href="https://seenagency.com.au/" target="_blank">Seen</a></p>
		</div>
	</div>
</footer>
<!-- FontAwesome -->
<script src="https://use.fontawesome.com/8e1efb638f.js"></script>
<?php if (is_page('thank-you')): ?>
	<!-- Global site tag (gtag.js) - Google Ads: 757123592 --> <script async src="https://www.googletagmanager.com/gtag/js?id=AW-757123592"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-757123592'); </script>
<?php endif ?>
<?php wp_footer(); ?>
</body>
</html>