servermgrv2/app/Views/front/board/index.php
최준흠git config git config --helpgit config --global user.name 최준흠 b225b22628 servermgrv2 init...
2023-08-05 09:22:00 +09:00

56 lines
3.0 KiB
PHP

<?= $this->extend('layouts/front') ?>
<?= $this->section('content') ?>
<div class="content">
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
<div class="top">
<?= form_open(current_url(), array("method" => "get")) ?>
<ul class="nav">
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_BoardHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
<?= $this->include('templates/front/index_head') ?>
</ul>
<?= form_close() ?>
</div>
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="table table-bordered table-hover table-striped">
<tr>
<th>번호</th>
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_BoardHelper($field, $viewDatas) ?></th><?php endforeach ?>
<th>작업</th>
</tr>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
<td>
<!-- 사용자가 자신의 작성한것인지 확인되면 update 가능-->
<?php if ($viewDatas[SESSION_NAMES['ISLOGIN']] && $entity->getUser_Uid() == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?>
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
<?php else : ?>
<?= $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt) ?>
<?php endif ?>
</td>
<?php foreach ($viewDatas['fields'] as $field) : ?>
<td nowrap><?= getFieldIndex_Row_BoardHelper_Admin($field, $entity, $viewDatas) ?></td>
<?php endforeach ?>
<td>
<!-- 사용자가 자신의 작성한것인지 확인되면 delete 가능-->
<?php if ($viewDatas[SESSION_NAMES['ISLOGIN']] && $entity->getUser_Uid() == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?>
<?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
<?php endif ?>
</td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</table>
<div class="bottom">
<ul class="nav justify-content-center">
<!-- 사용자가 쓰기권한이 있는지 확인-->
<?php if (isRole_CommonHelper($viewDatas['currentRoles'], $viewDatas['category'], CATEGORY_ROLE_FIELDS['WRITE'])) : ?>
<li class="nav-item"><?= anchor(current_url() . '/insert', '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?></li>
<?php endif ?>
</ul>
<?= $viewDatas['pagination'] ?>
</div>
<?= form_close() ?>
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
</div>
<?= $this->endSection() ?>