<?php
    $footer_logo = get_field( 'footer_logo', 'options' );
    $linkedin = get_field( 'linkedin', 'options' );
    $youtube = get_field( 'youtube', 'options' );
    $address = get_field( 'address', 'options' );
    $address_link = get_field( 'address_link', 'options' );
    $mail = get_field( 'mail', 'options' );
    $contact = get_field( 'contact', 'options' );
    $copyright = get_field( 'copyright', 'options' );
    $column_1_title = get_field( 'column_1_title', 'options' );
    $column_2_title = get_field( 'column_2_title', 'options' );
    $column_3_title = get_field( 'column_3_title', 'options' );
?>

<footer class="footer">
    <div class='row'>
        <?php if($footer_logo || $linkedin || $youtube): ?>
            <div class='col-xs-12 col-md-2'>
                <div class="footer__column">
                    <?php if($footer_logo): ?>
                        <div class="footer__logo">
                            <?php echo $__env->make('elements.image', ['image_id' => $footer_logo], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                        </div>
                    <?php endif; ?>
                    <?php if($linkedin || $youtube): ?>
                        <div class="footer__social">
                            <?php if($linkedin): ?>
                                <a href="<?php echo e($linkedin); ?>" target="_blank" class="footer__social__icon footer__social__icon--linkedin">
                                    <?php echo $__env->make('elements.svg.linkedin-icon', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                </a>
                            <?php endif; ?>
                            <?php if($youtube): ?>
                                <a href="<?php echo e($youtube); ?>" target="_blank" class="footer__social__icon footer__social__icon--youtube">
                                    <?php echo $__env->make('elements.svg.youtube-icon', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                </a>
                            <?php endif; ?>
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        <?php endif; ?>
        <?php if(have_rows('column_1_links', 'options') || have_rows('column_2_links', 'options') || have_rows('column_3_links', 'options')): ?>
            <div class="col-xs-12 col-md-7">
                <div class="footer__columns">
                    <?php if(have_rows('column_1_links', 'options')): ?>
                        <div class="footer__column">
                            <?php if($column_1_title): ?>
                                <p class="footer__column__title"><?php echo $column_1_title; ?></p>
                            <?php endif; ?>
                            <div class="footer__column__links">
                                <?php while(have_rows('column_1_links', 'options')): ?>
                                    <?php
                                        the_row();
                                        $link = get_sub_field( 'link' );
                                        if ($link) {
                                            $target = $link['target'] ? $link['target'] : '_self';
                                        }
                                    ?>
                                    <?php if($link): ?>
                                        <a href="<?php echo e($link['url']); ?>" target="<?php echo e($target); ?>" class="footer__column__link"><?php echo $link['title']; ?></a>
                                    <?php endif; ?>
                                <?php endwhile; ?>
                            </div>                        
                        </div>
                    <?php endif; ?>
                    <?php if(have_rows('column_2_links', 'options')): ?>
                        <div class="footer__column">
                            <?php if($column_2_title): ?>
                                <p class="footer__column__title"><?php echo $column_2_title; ?></p>
                            <?php endif; ?>
                            <div class="footer__column__links">
                                <?php while(have_rows('column_2_links', 'options')): ?>
                                    <?php
                                        the_row();
                                        $link = get_sub_field( 'link' );
                                        if ($link) {
                                            $target = $link['target'] ? $link['target'] : '_self';
                                        }
                                    ?>
                                    <?php if($link): ?>
                                        <a href="<?php echo e($link['url']); ?>" target="<?php echo e($target); ?>" class="footer__column__link"><?php echo $link['title']; ?></a>
                                    <?php endif; ?>
                                <?php endwhile; ?>
                            </div>                        
                        </div>
                    <?php endif; ?>
                    <?php if(have_rows('column_3_links', 'options')): ?>
                        <div class="footer__column">
                            <?php if($column_3_title): ?>
                                <p class="footer__column__title"><?php echo $column_3_title; ?></p>
                            <?php endif; ?>
                            <div class="footer__column__links">
                                <?php while(have_rows('column_3_links', 'options')): ?>
                                    <?php
                                        the_row();
                                        $link = get_sub_field( 'link' );
                                        if ($link) {
                                            $target = $link['target'] ? $link['target'] : '_self';
                                        }
                                    ?>
                                    <?php if($link): ?>
                                        <a href="<?php echo e($link['url']); ?>" target="<?php echo e($target); ?>" class="footer__column__link"><?php echo $link['title']; ?></a>
                                    <?php endif; ?>
                                <?php endwhile; ?>
                            </div>                        
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        <?php endif; ?>
        <?php if($address || $mail || $contact): ?>
            <div class='col-xs-12 col-md-3'>
                <div class="footer__column">
                    <?php if($address): ?>
                        <div class="footer__info footer__info--address">
                            <?php echo $__env->make('elements.svg.location-icon', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                            <?php if($address_link): ?>
                                <a href="<?php echo e($address_link); ?>" target="_blank"><?php echo $address; ?></a>
                            <?php else: ?>
                                <p><?php echo $address; ?></p>
                            <?php endif; ?>
                        </div>
                    <?php endif; ?>
                    <?php if($mail): ?>
                        <div class="footer__info footer__info--mail">
                            <?php echo $__env->make('elements.svg.mail-icon', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                            <a href="mailto:<?php echo e($mail); ?>" target="_blank"><?php echo $mail; ?></a>
                        </div>
                    <?php endif; ?>
                    <?php if($contact): ?>
                        <div class="footer__info footer__info--contact">
                            <?php echo $__env->make('elements.svg.contact-icon', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                            <a href="tel:<?php echo e($contact); ?>" target="_blank"><?php echo $contact; ?></a>
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        <?php endif; ?>
    </div>
    <?php if($copyright): ?>
        <div class='row'>
            <div class='col-xs-12'>
                <div class="footer__copyright"><?php echo $copyright; ?></div>
            </div>
        </div>
    <?php endif; ?>
</footer>

<?php echo $__env->make('elements.footer.analytics', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php (wp_footer()); ?>
<?php /**PATH /home/aphea/new/public/app/themes/aphea/resources/views/blocks/footer.blade.php ENDPATH**/ ?>