includes/modals/global_modal.php

<dialog class="modal" id="global-modal">
    <div>
        <h2><?= h(t('section.global.total')) ?></h2>

        <?php if ($showCountries): ?>
        <section>
            <h3><?= h(t('section.countries')) ?></h3>
            <table>
                <tbody>
                <?php foreach ($globalCountries as $row): ?>
                    <?php $cc = strtolower((string)$row['country']); ?>
                    <tr>
                        <td>
                            <?= countryFlag($cc) ?> <span data-country="<?= h(strtoupper($cc)) ?>"><?= h(countryName($cc)) ?></span>
                        </td>
                        <td><?= h($row['views']) ?></td>
                    </tr>
                <?php endforeach; ?>
                </tbody>
            </table>
        </section>
        <?php endif; ?>

        <section>
            <h3><?= h(t('section.search.engines')) ?></h3>
            <table>
                <tbody>
                <?php foreach ($globalSearchEngines as $row): ?>
                    <tr>
                        <td>
                            <?= referrerIconHtml((string)$row['referrer']) ?>
                            <?= h((string)$row['label']) ?>
                        </td>
                        <td><?= h($row['views']) ?></td>
                    </tr>
                <?php endforeach; ?>
                </tbody>
            </table>
        </section>

        <section>
            <h3><?= h(t('section.referrers')) ?></h3>
            <table>
                <tbody>
                <?php foreach ($globalReferrers as $row): ?>
                    <tr>
                        <td>
                            <?= referrerIconHtml((string)$row['referrer']) ?>
                            <?= h((string)$row['label']) ?>
                        </td>
                        <td><?= h($row['views']) ?></td>
                    </tr>
                <?php endforeach; ?>
                </tbody>
            </table>
        </section>
    </div>
</dialog>