<?php

use yii\helpers\Html;

$this->title = Yii::t('app', 'Records must be verified');

?>

<div class="forms-index">

    <h1><?= Html::encode($this->title) ?></h1>

    <?php if(count($data)): ?>
        <table class="table table-striped table-bordered">
            <thead>
                <th style="width: 60%"><?= Yii::t('app', 'Form') ?></th>
                <th style="width: 30%"><?= Yii::t('app', 'Records Count') ?></th>
                <th style="width: 10%"></th>
            </thead>

            <?php foreach($data as $item): ?>
                <tr>
                    <td>
                        <?= $item['form_name'] . ($forms_versions[$item['form_id']] == 1 ? '' : ' <i class="not-set">(different version)</i>') ?>
                    </td>
                    <td><?= $item['records_count'] ?></td>
                    <td>
                        <?= Html::a('<span class="glyphicon glyphicon-eye-open"></span>', [
                            'verify-form-records',
                            'form_id' => $item['form_id'],
                            'version' => $item['form_version']
                        ]) ?>
                    </td>
                </tr>
            <?php endforeach; ?>
        </table>
    <?php else: ?>
        <div class="alert alert-info">
            <?= Yii::t('app', 'You don\'t have any record to verify') ?>
        </div>
    <?php endif; ?>
</div>
