trafficmonitor/app/Views/admin/user/index.php

61 lines
3.0 KiB
PHP

<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php
$control = $viewDatas['control'];
$layout = $control['layout'];
$layoutPath = LAYOUTS[$layout]['path'];
$helper = $control['helper'];
$layoutDir = "templates/{$layout}";
$classPath = $viewDatas['class_path'];
?>
<?php if ($message = session('message')): ?><?php endif ?>
<div class="layout_top"><?= $this->include("{$layoutPath}/top"); ?></div>
<table class="layout_middle">
<tr>
<td class="layout_left"><?= $this->include("{$layoutPath}/left_menu"); ?></td>
<td class="layout_right">
<div class="layout_header"><?= $this->include("{$layoutDir}/index_header"); ?></div>
<div id="container" class="layout_content">
<link href="/css/<?= $layout ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
<div class="index_body">
<?= $this->include("{$layoutDir}/index_content_filter"); ?>
<?= form_open(current_url(), ['id' => 'batchjob_form', 'method' => "post"]) ?>
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="reisze_table">
<thead>
<tr>
<th class="index_head_short_column">번호</th>
<?php foreach ($control['formFields'] as $field): ?><th data-rtc-resizable="<?= $field ?>"><?= $helper->getListLabel($field, lang("{$classPath}.label.{$field}"), $viewDatas) ?></th><?php endforeach ?>
<th class="index_head_short_column">작업</th>
</tr>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php
$viewDatas['entity'] = $entity;
$isDefaultStatus = $entity->getStatus() === $entity::DEFAULT_STATUS;
$rowClass = $isDefaultStatus ? "" : 'class="table-danger"';
$num = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt);
?>
<tr <?= $rowClass ?>>
<td nowrap><?= $helper->getListButton('modify', $num, $viewDatas) ?></td>
<?php foreach ($control['formFields'] as $field): ?><td><?= $helper->getFieldView($field, $entity->$field, $viewDatas) ?></td><?php endforeach ?>
<td nowrap>
<?= $helper->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $helper->getListButton('delete', '', $viewDatas) ?>
</td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>
<?= $this->include("{$layoutDir}/index_content_bottom"); ?>
<?= form_close() ?>
</div>
</div>
<div class="layout_footer"><?= $this->include("{$layoutDir}/index_footer"); ?></div>
</td>
</tr>
</table>
<div class="layout_bottom"><?= $this->include("{$layoutPath}/bottom"); ?></div>
<?= $this->endSection() ?>