<?php
    $home = get_page_by_title('Cisamusep');
?>

<section class="avisos slide">
    <div class="background-avisos active">
    </div>
    <div class="popup" data-group="section-info">        
        <div class="fechar-popup"></div>
        <div class="conteudo-popup">

        <?php
            if(have_rows('popup1', $home)) : while(have_rows('popup1', $home)) : the_row();
            $situacao = get_sub_field('situacao_popup', $home);
            if($situacao == 'ativo'){
        ?>
            
            <div data-target="popup1">
                <h2><?php the_sub_field('titulo_popup'); ?></h2>
                <?php the_sub_field('informacoes_popup'); ?>
            </div>
            
        <?php } ?>
        <?php endwhile ; else : endif; ?>



        <?php
            if(have_rows('popup2', $home)) : while(have_rows('popup2', $home)) : the_row();
            $situacao = get_sub_field('situacao_popup', $home);
            if($situacao == 'ativo'){
        ?>
            
            <div data-target="popup2">
                <h2><?php the_sub_field('titulo_popup'); ?></h2>
                <?php the_sub_field('informacoes_popup'); ?>
            </div>
        
        <?php } ?>
        <?php endwhile ; else : endif; ?>


        <?php
            if(have_rows('popup3', $home)) : while(have_rows('popup3', $home)) : the_row();
            $situacao = get_sub_field('situacao_popup', $home);
            if($situacao == 'ativo'){
        ?>
            
            <div data-target="popup3">
                <h2><?php the_sub_field('titulo_popup'); ?></h2>
                <?php the_sub_field('informacoes_popup'); ?>
            </div>
        
        <?php } ?>
        <?php endwhile ; else : endif; ?>

        </div>

    </div>
    
</section>