<?php $status = new OpCacheGUI\OpCache\Status($this->byteFormatter, $this->translator, opcache_get_status()); ?>
<section id="status-tabs" class="tabs">
    <div class="data-block clear">
        <h2><?= $this->translator->translate('status.title'); ?></h2>
        <table>
            <?php foreach ($status->getStatusInfo() as $key => $statusItem) { ?>
                <tr>
                    <td><?= $this->translator->translate('status.' . $key); ?></td>
                    <?php if ($key === 'opcache_enabled') { ?>
                        <td><span class="<?= $statusItem ? 'g' : 'r'; ?>s"></span></td>
                    <?php } else { ?>
                        <td><span class="<?= $statusItem ? 'r' : 'g'; ?>s"></span></td>
                    <?php } ?>
                </tr>
            <?php } ?>
        </table>
        <form action="<?= $this->url->get('reset'); ?>" method="post" id="reset" data-confirmation="<?= $this->translator->translate('confirmation.reset'); ?>" data-yes="<?= $this->translator->translate('confirmation.yes'); ?>" data-no="<?= $this->translator->translate('confirmation.no'); ?>">
            <input type="hidden" name="csrfToken" value="<?= $this->csrfToken->get(); ?>">
            <button type="submit" name="submit" value="Reset" class="cnfbtn cnfbtn--fn js-confirm reset-btn"><?= $this->translator->translate('reset.submit'); ?></button>
        </form>
    </div>

    <div class="data-block">
        <h2><?= $this->translator->translate('memory.title'); ?></h2>
        <table>
            <?php foreach ($status->getMemoryInfo() as $key => $memoryItem) { ?>
                <tr>
                    <td><?= $this->translator->translate('memory.' . $key); ?></td>
                    <td><?= $memoryItem; ?></td>
                </tr>
            <?php } ?>
        </table>
    </div>

    <div class="data-block">
        <h2><?= $this->translator->translate('stats.title'); ?></h2>
        <?php foreach ($status->getStatsInfo() as $statisticList) { ?>
            <div>
                <table>
                    <?php foreach ($statisticList as $key => $statisticItem) { ?>
                        <tr>
                            <td><?= $this->translator->translate('stats.' . $key); ?></td>
                            <td><?= $statisticItem; ?></td>
                        </tr>
                    <?php } ?>
                </table>
            </div>
        <?php } ?>
    </div>
</section>
