155 lines
9.8 KiB
PHP
155 lines
9.8 KiB
PHP
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
|
<?= $this->section('content') ?>
|
|
<?php if ($error = session('error')): echo $viewDatas['service']->getHelper()->alert($error) ?><?php endif ?>
|
|
<div class="layout_top"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?></div>
|
|
<!-- Layout Middle Start -->
|
|
<table class="layout_middle">
|
|
<tr>
|
|
<td class="layout_left">
|
|
<!-- Layout Left Start -->
|
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?>
|
|
<!-- Layout Left End -->
|
|
</td>
|
|
<td class="layout_right">
|
|
<!-- Layout Right Start -->
|
|
<div class="layout_header"><?= $this->include("templates/{$viewDatas['layout']}/index_header"); ?></div>
|
|
<div id="container" class="layout_content">
|
|
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
|
|
<div class="index_body">
|
|
<?= form_open(current_url(), ["method" => "get"]) ?>
|
|
<nav class="index_top navbar navbar-expand-lg">
|
|
<div class="container-fluid">
|
|
<nav class="condition nav">
|
|
조건:
|
|
<?php foreach ($viewDatas['control']['actionFilters'] as $field): ?>
|
|
<?= $viewDatas['service']->getHelper()->getListFilter($field, $viewDatas['control']['index_filters'][$field] ?? old($field), $viewDatas) ?>
|
|
<?php endforeach ?>
|
|
</nav>
|
|
<?= $this->include("templates/{$viewDatas['layout']}/index_content_top"); ?>
|
|
</div>
|
|
</nav>
|
|
<?= form_close() ?>
|
|
<?= 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>
|
|
<th class="index_head_short_column">
|
|
<?= $viewDatas['service']->getHelper()->getListLabel('site', lang("{$viewDatas['class_path']}.label.site"), $viewDatas) ?>
|
|
</th>
|
|
<th class="index_head_short_column">
|
|
<?= $viewDatas['service']->getHelper()->getListLabel('location', lang("{$viewDatas['class_path']}.label.location"), $viewDatas) ?>
|
|
</th>
|
|
<th class="index_head_short_column">
|
|
<?= $viewDatas['service']->getHelper()->getListLabel('type', lang("{$viewDatas['class_path']}.label.type"), $viewDatas) ?>
|
|
</th>
|
|
<th class="index_head_short_column">
|
|
<?= $viewDatas['service']->getHelper()->getListLabel('clientinfo_uid', lang("{$viewDatas['class_path']}.label.clientinfo_uid"), $viewDatas) ?>
|
|
</th>
|
|
<th class="index_head_short_column">
|
|
서버정보<div class="float-end rounded border border-primary" style="cursor:pointer;" onclick="copyServerPartsToClipboard()">All COPY</div>
|
|
</th>
|
|
<th class="index_head_short_column">
|
|
<?= $viewDatas['service']->getHelper()->getListLabel('billing_at', lang("{$viewDatas['class_path']}.label.billing_at"), $viewDatas) ?>
|
|
</th>
|
|
<th class="index_head_short_column">
|
|
<?= $viewDatas['service']->getHelper()->getListLabel('amount', lang("{$viewDatas['class_path']}.label.amount"), $viewDatas) ?>
|
|
</th>
|
|
<th class="index_head_short_column">
|
|
<?= $viewDatas['service']->getHelper()->getListLabel('status', lang("{$viewDatas['class_path']}.label.status"), $viewDatas) ?>
|
|
</th>
|
|
<th class="index_head_short_column">
|
|
<?= $viewDatas['service']->getHelper()->getListLabel('start_at', lang("{$viewDatas['class_path']}.label.start_at"), $viewDatas) ?>
|
|
</th>
|
|
<th class="index_head_short_column">작업</th>
|
|
</thead>
|
|
<tbody>
|
|
<?php $cnt = 0 ?>
|
|
<?php foreach ($viewDatas['entities'] as $entity): ?>
|
|
<?php $viewDatas['entity'] = $entity; ?>
|
|
<tr <?= $entity->getStatus() === $entity::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
|
|
<?php $num = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
|
<td nowrap><?= $viewDatas['service']->getHelper()->getListButton('modify', $num, $viewDatas) ?></td>
|
|
<td nowrap>
|
|
<?= $viewDatas['service']->getHelper()->getFieldView('site', $entity->site, $viewDatas) ?>
|
|
</td>
|
|
<td nowrap>
|
|
<?= $viewDatas['service']->getHelper()->getFieldView('location', $entity->location, $viewDatas) ?>
|
|
</td>
|
|
<td nowrap>
|
|
<?= $viewDatas['service']->getHelper()->getFieldView('type', $entity->type, $viewDatas) ?>
|
|
</td>
|
|
<td nowrap>
|
|
<?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->clientinfo_uid, $viewDatas) ?>
|
|
</td>
|
|
<td nowrap>
|
|
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
|
'serverinfo_uid' => $entity->getServerEntity()->getPK(),
|
|
'types' => SERVERPART['SERVICE_PARTTYPES'],
|
|
'template' => 'part_service'
|
|
]) ?>
|
|
</td>
|
|
<td nowrap>
|
|
<?= $viewDatas['service']->getHelper()->getFieldView('billing_at', $entity->billing_at, $viewDatas) ?>
|
|
</td>
|
|
<td nowrap>
|
|
<?= $viewDatas['service']->getHelper()->getFieldView('amount', $entity->amount, $viewDatas) ?>
|
|
</td>
|
|
<td nowrap>
|
|
<?= $viewDatas['service']->getHelper()->getFieldView('status', $entity->status, $viewDatas) ?>
|
|
</td>
|
|
<td><?= $viewDatas['service']->getHelper()->getFieldView('start_at', $entity->start_at, $viewDatas) ?></td>
|
|
<td nowrap>
|
|
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>
|
|
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
|
|
</td>
|
|
</tr>
|
|
<?php $cnt++ ?>
|
|
<?php endforeach ?>
|
|
</tbody>
|
|
</table>
|
|
<?= $this->include("templates/{$viewDatas['layout']}/index_content_bottom"); ?>
|
|
<?= form_close() ?>
|
|
</div>
|
|
</div>
|
|
<div class=" layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?>
|
|
</div>
|
|
<!-- Layout Right End -->
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<!-- Layout Middle End -->
|
|
<div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?></div>
|
|
<script>
|
|
function copyServerPartToClipboard(text) {
|
|
try {
|
|
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
// HTTPS 환경
|
|
navigator.clipboard.writeText(text)
|
|
.then(() => alert(text + "\n 복사되었습니다."))
|
|
.catch(err => alert("실패: " + err));
|
|
} else {
|
|
// HTTP 환경 fallback
|
|
const temp = document.createElement("textarea");
|
|
temp.value = text;
|
|
document.body.appendChild(temp);
|
|
temp.select();
|
|
document.execCommand("copy");
|
|
document.body.removeChild(temp);
|
|
alert(text + "\n 복사되었습니다.");
|
|
}
|
|
} catch (err) {
|
|
alert("복사 실패: " + err);
|
|
}
|
|
}
|
|
|
|
function copyServerPartsToClipboard() {
|
|
// 모든 .serverparts div에서 text-data 속성값 수집
|
|
const elements = document.querySelectorAll(".serverparts");
|
|
const texts = Array.from(elements).map(el => el.getAttribute("text-data") || "");
|
|
// console.log(texts);
|
|
const combined = texts.join("\n");
|
|
copyServerPartToClipboard(combined);
|
|
}
|
|
</script>
|
|
<?= $this->endSection() ?>
|