</main>
<?php
global $ref_link;
$ref_link = get_field('referral_link', 'option');
$icon_flag = get_field('icon_flag', "option");
$footer = get_field('footer', 'option');
$footer_partners = $footer['footer_partners'];
$footer_logo = $footer['footer_logo'];
$footer_lisence = $footer['footer_lisence'];
$logos = $footer['logos'];
$copyright = $footer['copyright'];
?>
<footer class="footer">
    <div class="footer__container">
        <div class="footer__info">
            <img src="<?php echo esc_url($icon_flag['url']); ?>" alt="<?php echo esc_attr($icon_flag['alt']); ?>" title="<?php echo esc_attr($icon_flag['title']); ?>" width="40" />
            <?php
            $link_responsible   = get_permalink(pll_get_post(833, pll_current_language()));
            $title_responsible  = get_the_title(pll_get_post(833, pll_current_language()));
            $link_bonus   = get_permalink(pll_get_post(1460, pll_current_language()));
            $title_bonus  = get_the_title(pll_get_post(1460, pll_current_language()));
            $link_free   = get_permalink(pll_get_post(1390, pll_current_language()));
            $title_free  = get_the_title(pll_get_post(1390, pll_current_language()));
            $link_app   = get_permalink(pll_get_post(1440, pll_current_language()));
            $title_app  = get_the_title(pll_get_post(1440, pll_current_language()));
            $link_games   = get_permalink(pll_get_post(717, pll_current_language()));
            $title_games  = get_the_title(pll_get_post(717, pll_current_language()));
            $link_login   = get_permalink(pll_get_post(1533, pll_current_language()));
            $title_login  = get_the_title(pll_get_post(1533, pll_current_language()));
            $link_deposit   = get_permalink(pll_get_post(1560, pll_current_language()));
            $title_deposit  = get_the_title(pll_get_post(1560, pll_current_language()));
            $link_codes   = get_permalink(pll_get_post(1475, pll_current_language()));
            $title_codes  = get_the_title(pll_get_post(1475, pll_current_language()));
            ?>
            <ul class="list footer__menu">
                <li>
                    <a href="<?= $link_bonus ?>">
                        <?= $title_bonus ?>
                    </a>
                </li>
                <li>
                    <a href="<?= $link_app ?>">
                        <?= $title_app ?>
                    </a>
                </li>
                <li>
                    <a href="<?= $link_deposit ?>">
                        <span><?= $title_deposit ?></span>
                    </a>
                </li>
                <li>
                    <a href="<?= $link_free ?>">
                        <span><?= $title_free ?></span>
                    </a>
                </li>
                <li>
                    <a href="<?= $link_codes ?>">
                        <span><?= $title_codes ?></span>
                    </a>
                </li>
                <li>
                    <a href="<?= $link_responsible ?>">
                        <?= $title_responsible ?>
                    </a>
                </li>
                <li>
                    <a href="<?= $link_login ?>">
                        <?= $title_login ?>
                    </a>
                </li>
            </ul>
        </div>
        <div class="footer__lisence">
            <img src="<?php echo esc_url($footer_lisence['url']); ?>" alt="<?php echo esc_attr($footer_lisence['alt']); ?>" title="<?php echo esc_attr($footer_lisence['title']); ?>" width="161">
            <?php echo $copyright; ?>
        </div>
        <ul class="list footer__payment">
            <?php foreach ($footer_partners as $row):
                $image = $row['image'];
            ?>
                <li>
                    <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" title="<?php echo esc_attr($image['title']); ?>">
                </li>
            <?php endforeach; ?>
        </ul>
        <div class="footer__data">
            <a class="logo footer__logo" href="<?php echo get_home_url() ?>">
                <img src="<?php echo esc_url($footer_logo['url']); ?>" alt="<?php echo esc_attr($footer_logo['alt']); ?>" title="<?php echo esc_attr($footer_logo['title']); ?>" width="112">
            </a>
            <ul class="list footer__partners">
                <?php foreach ($logos as $row):
                    $image = $row['image'];
                ?>
                    <li>
                        <img src="<?php echo esc_url($image['url']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" title="<?php echo esc_attr($image['title']); ?>">
                    </li>
                <?php endforeach; ?>
            </ul>
        </div>
    </div>
</footer>
<script src="<?php echo get_template_directory_uri(); ?>/assets/js/script.js"></script>
<?php wp_footer(); ?>
</body>

</html>