<?php Block::put('breadcrumb') ?>
    <ul>
        <li><a href="<?php echo Backend::url('martin/forms/records') ?>"><?php echo e(trans('martin.forms::lang.menu.records.label')) ?></a></li>
        <li>Record #<?php echo $record->id ?></li>
    </ul>
<?php Block::endPut() ?>

<?= $this->makePartial('partials/view_toolbar') ?>

<h2 class="text-center">Record #<?php echo $record->id ?></h2>

<table class="record-table m-t-md">
<?php foreach($record->form_data_arr as $label => $value): ?>
    <tr>
        <td class="record-label"><?php echo ucwords($label) ?>:</td>
        <td class="record-value">
        <?php if(is_array($value) || is_object($value)): ?>
            <ul>
                <?php echo \Martin\Forms\Classes\BackendHelpers::array2ul($value) ?>
            </ul>
        <?php else: ?>
            <?php echo nl2br(htmlspecialchars($value, ENT_QUOTES)); ?>
        <?php endif ?>
        </td>
    </tr>
<?php endforeach ?>
<?php if(count($record->files) > 0): ?>
    <tr>
        <td class="record-label">Attached Files:</td>
        <td class="record-value files-container">
            <ul>
            <?php foreach($record->files as $file): ?>
                <li>
                    <a href="<?php echo Backend::url('martin/forms/records/download', [$record->id, $file->id]) ?>">
                        <?php echo $file->file_name ?>
                        (<?php echo $file->sizeToString() ?>)
                    </a>
                </li>
            <?php endforeach ?>
            </ul>
        </td>
    </tr>
<?php endif ?>
</table>

<div class="record-metadata m-t-md m-r-md text-right">
    <p class="m-a-0"><?php echo e(trans('martin.forms::lang.controllers.records.columns.group')) ?>: <?php echo $record->group ?></p>
    <p class="m-a-0"><?php echo e(trans('martin.forms::lang.controllers.records.columns.ip')) ?>: <?php echo $record->ip ?></p>
    <p class="m-a-0"><?php echo e(trans('martin.forms::lang.controllers.records.columns.created_at')) ?>: <?php echo $record->created_at ?></p>
</div>