<?php
/**
 * The template for displaying the footer
 *
 * Contains the closing of the #content div and all content after.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package WordPress
 * @subpackage Twenty_Seventeen
 * @since 1.0
 * @version 1.2
 */
$map = get_field('map', 'option');
$map_2 = get_field('map_2', 'option');
$column_1_image = get_field('column_1_image', 'option');
$column_1_title = get_field('column_1_title', 'option');
$column_1_content = get_field('column_1_content', 'option');
$column_2_image = get_field('column_2_image', 'option');
$column_2_title = get_field('column_2_title', 'option');
$column_2_content = get_field('column_2_content', 'option');
$column_3_image = get_field('column_3_image', 'option');
$column_3_title = get_field('column_3_title', 'option');
$column_3_content = get_field('column_3_content', 'option');
if($map != '') :
?>


<?php
	$frontpage_id = get_option( 'page_on_front' ); 
	$cs_title = get_field('cs_title', $frontpage_id);
	$cs_subtitle = get_field('cs_subtitle', $frontpage_id);
	$cs_form = get_field('cs_form', $frontpage_id);
?>
<?php if($cs_form != '') : ?>
    <!-- Section 3 Start -->
    <div id="section4" class="section4">
        <div class="container">
        	
            <div class="contact-form-inner center">
        	
			<?php echo ($cs_title != '') ? '<h2>'.$cs_title.'</h2>' : ''; ?>
			<?php echo ($cs_subtitle != '') ? '<p>'.$cs_subtitle.'</p>' : ''; ?>
            
        	<div class="section4-inner clearfix">
            	<div class="contact-form-main pull-right center wow fadeInRight" data-wow-delay="0.5s">
                	<div class="form-inner clearfix">
                        <?php echo do_shortcode($cs_form); ?>
                    </div>
                </div>
                <div class="map-section pull-left wow fadeInLeft" data-wow-delay="0.5s">
                	<div class="map-box"><?php echo $map; ?></div>
					<div class="map-box"><?php echo $map_2; ?></div>
                    <!--<div class="map-box">                    
                	<div id="map-canvas" class="the-google-map extra-color-1"></div>
                    </div>-->

                </div>
            </div>
            
            </div>
            
            </div>
        </div>
    </div>
    <!-- Section 3 End -->
<?php endif; ?>
    
	
	<!-- Section 4 End -->
<?php endif; ?>
</div>
<!-- Footer -->
<footer id="Footer" class="footer">
	<div class="container">
    	<div class="add-box-container clearfix">
        	<div class="add-box footerinfo1 wow fadeInLeft" data-wow-delay="0.5s">
                <?php if($column_1_image != '') : ?>
					<img src="<?php echo $column_1_image; ?>" alt="Map">
				<?php endif; ?>
				<?php echo ($column_1_title != '') ? '<span class="title">'.$column_1_title.'</span>' : ''; ?>
				<?php echo ($column_1_content != '') ? $column_1_content : ''; ?>
            </div>
            <div class="add-box footerinfo2 wow fadeInUp" data-wow-delay="0.5s">
            	<?php if($column_2_image != '') : ?>
					<img src="<?php echo $column_2_image; ?>" alt="Phone">
				<?php endif; ?>
				<?php echo ($column_2_title != '') ? '<span class="title">'.$column_2_title.'</span>' : ''; ?>
				<?php echo ($column_2_content != '') ? $column_2_content : ''; ?>
            </div>
            <div class="add-box footerinfo3 wow fadeInRight" data-wow-delay="0.5s">
            	<?php if($column_3_image != '') : ?>
					<img src="<?php echo $column_3_image; ?>" alt="Visit Us">
				<?php endif; ?>
				<?php echo ($column_3_title != '') ? '<span class="title">'.$column_3_title.'</span>' : ''; ?>
				<?php echo ($column_3_content != '') ? $column_3_content : ''; ?>
            </div>
        </div>
    </div>
    <div class="copy-right-area center">
    	<div class="container">
    		<div class="copy-right-inner">
    			<p>Copyright &copy; <?php echo date('Y'); ?> <?php bloginfo('title', 'display'); ?>. All Right Reserved.</p>
    			<?php if(have_rows('social_media', 'option')) : ?>
	    			<ul class="f-social">
	    				<?php while(have_rows('social_media', 'option')) : the_row(); 
							$link = get_sub_field('sm_link');
							$icon = get_sub_field('sm_icon');
							if($link == '' || $icon == '') continue;
						?>
	    					<li><a href="<?php echo $link; ?>" target="_blank"><i class="ei ei-<?php echo $icon; ?>"></i></a></li>
	    				<?php endwhile; ?>
	    			</ul>
	    		<?php endif; ?>
    			<div class="powered-by-text"><p>Powered by: <a href="http://www.assorteddesign.com/" target="_blank">Assorted Design <img src="<?php echo get_template_directory_uri(); ?>/assets/images/assorted-design.png" alt="Assorted Design" /></a></p>
    			</div>
    		</div>
    	</div>
    </div>
</footer>
<a id="toTop" class="scrollup"><i class="fa fa-caret-up" aria-hidden="true"></i></a>
<script src="<?php echo get_template_directory_uri(); ?>/assets/js/jquery-min.js"></script>
<script src="<?php echo get_template_directory_uri(); ?>/assets/js/commonscript.js"></script>
<script src="<?php echo get_template_directory_uri(); ?>/assets/js/main.js"></script>
<!-- WP Footer Start -->
<?php wp_footer(); ?>
<!-- WP Footer End -->
</body>
</html>