<?php
/**
 * @package WordPress
 * @subpackage Campoal
 */

$fields = get_field_objects();
if( $fields ): ?>
<div class="petition-advanced-infomaitons">
	<table class="ui very basic striped table">
		<thead>
		    <tr><th colspan="3">
		    <h3><?php esc_html_e('Advanced infomations', 'campoal') ?></h3>
		    </th>
		</tr></thead>
		<tbody>
        <?php foreach( $fields as $field ) :
        	if (!empty($field['value'])) : ?>
            <tr>
      			<td class="collapsing">
            	<strong><?php echo esc_html($field['label']); ?>: </strong>
            	</td>
            	<td>
            	<?php if (is_array($field['value'])) :
            		foreach ($field['value'] as $field_key => $value) { ?>
            			<?php echo esc_html($value) . ((count($field['value']) - 1) == $field_key ? '' : ', ') ?>
            		<?php }
            	else : ?>
            		<?php echo esc_html($field['value']) ?>
            	<?php endif; ?>
            	</td>
            </tr>
            <?php endif;
        endforeach; ?>
        </tbody>
    </table>
</div>
<?php endif; ?>