<?php 
$billingAttributes = $block->getGeodemographicFields('billing');
$shippingAttributes = $block->getGeodemographicFields('shipping');
$hasData = !empty($billingAttributes) || !empty($shippingAttributes);
?>
<?php if ($hasData): ?>
<section class="admin__page-section">
    <div class="admin__page-section-title">
        <span class="title">AFD Censation Geodemographics</span>
    </div>
    <?php if (!empty($billingAttributes)): ?>
    <div class="admin__page-section-item">
        <div class="admin__page-section-item-title">
            <div class="admin__page-section-item order-billing-address">
                <div class="admin__page-section-item-title">
                    <span class="title">Billing Address</span>
                    <table class="admin__table-secondary">
                        <tbody>
                        <?php foreach ($billingAttributes as $attribute): ?>
                            <tr>
                                <th>
                                    <span><?php echo $block->convertAttributeCode($attribute->getAttributeCode()) ?></span>
                                </th>
                                <td><span><?php echo $attribute->getValue() ?></span></td>
                            </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <?php endif; ?>
    <?php if (!empty($shippingAttributes)): ?>
    <div class="admin__page-section-item">
        <div class="admin__page-section-item-title">
            <div class="admin__page-section-item order-billing-address">
                <div class="admin__page-section-item-title">
                    <span class="title">Shipping Address</span>
                    <table class="admin__table-secondary">
                        <tbody>
                        <?php foreach ($shippingAttributes as $attribute): ?>
                            <tr>
                                <th>
                                    <span><?php echo $block->convertAttributeCode($attribute->getAttributeCode()) ?></span>
                                </th>
                                <td><span><?php echo $attribute->getValue() ?></span></td>
                            </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>

                </div>
            </div>
        </div>

    </div>
    <?php endif; ?>
</section>
<div style="clear:both"></div>
<?php endif; ?>