<!--
<h1 class="spark2dzoho-page-title">
    <?php _e( "List of opportunities", "spark2dzoho" ); ?>
</h1>
-->


<?php
$onGoingOpportunities = array_filter(
    $opportunities,
    function ($var) {
        return ($var['Job Opening Status'] == 'Em andamento');
    }
);
?>

<?php if ( count( $onGoingOpportunities ) > 0 ): ?>    

        <?php foreach ( $onGoingOpportunities as $opportunity ): ?>

            <?php if ( $opportunity['JOBOPENINGID'] <> '449101000000591118' ) : ?>

            <article class="opportunity">
                <div class="elementor-container elementor-column-gap-default container">
                    <div class="elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-0069437" data-id="0069437" data-element_type="column">
                        <div class="elementor-widget-wrap elementor-element-populated">
                            <div class="elementor-element elementor-element-8eafa9e elementor-widget elementor-widget-heading" data-id="8eafa9e" data-element_type="widget" data-widget_type="heading.default">
                                <div class="elementor-widget-container">
                                    <a href="/job/?opportunity_id=<?php echo $opportunity['JOBOPENINGID']; ?>&opportunity=<?php  echo rawurlencode($opportunity['Posting Title (em inglês)']);  ?>"><h2 class="elementor-heading-title elementor-size-default titulo_post"><?php  echo $opportunity['Posting Title (em inglês)']; ?></h2></a>
                                </div>
                            </div>
                            <div class="elementor-element elementor-element-e5a1729 elementor-widget elementor-widget-heading" data-id="e5a1729" data-element_type="widget" data-widget_type="heading.default">
                                <div class="elementor-widget-container">
                                    <h3 class="elementor-heading-title elementor-size-default cidade_post"><?php echo $opportunity['City']; ?></h3>
                                </div>
                            </div>
                            <div class="elementor-element elementor-element-f4f5353 elementor-widget elementor-widget-heading" data-id="f4f5353" data-element_type="widget" data-widget_type="heading.default">
                                <div class="elementor-widget-container">
                                    <p class="elementor-heading-title elementor-size-default descricao_post"><?php echo strip_tags( $opportunity['Descrição (em inglês)'] ); ?></p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-21d2f55" data-id="21d2f55" data-element_type="column">
                        <div class="elementor-widget-wrap elementor-element-populated">
                            <div class="elementor-element elementor-element-4f3aab0 elementor-align-center elementor-widget elementor-widget-button" data-id="4f3aab0" data-element_type="widget" data-widget_type="button.default">
                                <div class="elementor-widget-container">
                                    <div class="elementor-button-wrapper">
                                        <a href="/job/?opportunity_id=<?php echo $opportunity['JOBOPENINGID']; ?>&opportunity=<?php  echo rawurlencode($opportunity['Posting Title (em inglês)']);  ?>" class="elementor-button-link elementor-button elementor-size-md" role="button">
                                            <span class="elementor-button-content-wrapper">
                                                <span class="elementor-button-text">View opportunity</span>
                                            </span>
                                        </a>
                                    </div>
                                </div>
                            </div>
                           <!-- <div class="elementor-element elementor-element-395dda8 elementor-widget elementor-widget-heading" data-id="395dda8" data-element_type="widget" data-widget_type="heading.default">
                                <div class="elementor-widget-container">
                                    <p class="elementor-heading-title elementor-size-default">
                                        <a href="/job/?opportunity_id=<?php echo $opportunity['JOBOPENINGID']; ?>&opportunity=<?php  echo rawurlencode($opportunity['Posting Title']);  ?>"> 
                                            Read full description
                                        </a>
                                    </p>
                                </div>
                            </div>-->
                        </div>
                    </div>
                </div>
            </article>
        <?php endif; ?>
        
        <?php endforeach; ?>
        
<?php else: ?>
<p><?php _e( 'There are no opening jobs at this moment.', 'spark2dzoho' ); ?></p>
<?php endif; ?>