표 디자인 - 모든 표를 가벼운 스타일로 통일(.data-table 경량화: 작은 회색 헤더·연한 구분선·hover) - 표/패널 바깥 테두리 둥글게(rounded-lg) 일괄 적용, 표 래퍼에 패딩 카드(p-4) 통일 - 표 헤더·데이터 정렬을 전 화면 좌측 기준으로 통일 - .data-table th/td text-align:left (전역), 흩어진 center/right 정렬 정리 - 재디자인 Tailwind 표(포장단위·단가·기본코드·담당자·업체·판매대행소·무료대상자·지정판매소)도 셀 좌측화 - 기본정보관리 등 나머지 소메뉴 표를 기본 코드 관리 스타일(가벼운 표·상태 pill)로 재디자인 워크스페이스/공통 - "이 화면 설명" → 새 탭 대신 우측 드로어 팝업(현재 화면과 동시에 보기, Esc·드래그 폭조절) - 상단바 글씨 크기 조절(A−/A+), 작업 내용에 zoom 적용 - 탭 최대치 도달 시 자동 삭제 대신 안내 토스트, "모두 닫기"(업무 현황 탭은 보존) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
84 lines
3.9 KiB
PHP
84 lines
3.9 KiB
PHP
<?php
|
|
/** @var object $kind */
|
|
/** @var list<object> $list */
|
|
/** @var bool $canManage */
|
|
/** @var array<int,bool> $rowCanEdit */
|
|
$canManage = ! empty($canManage);
|
|
$rowCanEdit = $rowCanEdit ?? [];
|
|
$showActionsCol = $canManage;
|
|
$rowStartNo = 1;
|
|
if (isset($pager) && $pager !== null) {
|
|
$rowStartNo = (int) ($pager->getCurrentPage() - 1) * (int) $pager->getPerPage() + 1;
|
|
}
|
|
?>
|
|
<div class="space-y-3">
|
|
<?= view('components/print_header', ['printTitle' => '세부코드 - ' . esc($kind->ck_name)]) ?>
|
|
<section class="border border-gray-300 rounded bg-control-panel p-2">
|
|
<div class="flex flex-wrap items-center justify-between gap-y-2">
|
|
<div class="flex flex-wrap items-center gap-2 text-sm">
|
|
<a href="<?= base_url('bag/code-kinds') ?>" class="text-blue-600 hover:underline">← 기본코드 종류</a>
|
|
<span class="text-gray-400">|</span>
|
|
<span class="font-bold text-gray-700"><?= $canManage ? '세부코드 관리' : '세부코드 조회' ?> — <?= esc($kind->ck_name) ?> (<?= esc($kind->ck_code) ?>)</span>
|
|
</div>
|
|
<div class="flex items-center gap-2">
|
|
<button type="button" onclick="window.print()" class="no-print rounded border border-gray-300 px-3 py-1 text-sm text-gray-600 hover:bg-gray-50">인쇄</button>
|
|
<?php if ($canManage): ?>
|
|
<a href="<?= base_url('admin/code-details/' . (int) $kind->ck_idx . '/create') ?>" class="rounded border border-transparent bg-[#243a5e] px-3 py-1.5 text-sm text-white shadow hover:opacity-90">세부코드 등록</a>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<div class="border border-gray-300 rounded-lg p-4 overflow-auto">
|
|
<table class="data-table w-full">
|
|
<thead>
|
|
<tr>
|
|
<th class="w-16 text-center">번호</th>
|
|
<th class="w-24 text-center">코드</th>
|
|
<th>코드명</th>
|
|
<th class="w-24 text-center">범위</th>
|
|
<th class="w-20 text-center">정렬순서</th>
|
|
<th class="w-20 text-center">상태</th>
|
|
<th>등록일</th>
|
|
<?php if ($showActionsCol): ?>
|
|
<th class="w-28 text-center">작업</th>
|
|
<?php endif; ?>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php $rowNo = $rowStartNo; foreach ($list as $row): ?>
|
|
<?php
|
|
$isPlatform = (($row->cd_source ?? 'platform') === 'platform' && (int) ($row->cd_lg_idx ?? 0) === 0);
|
|
$scopeLabel = $isPlatform ? '공통' : '지자체';
|
|
?>
|
|
<tr>
|
|
<td class="text-center"><?= (string) $rowNo ?></td>
|
|
<td class="text-center font-mono"><?= esc($row->cd_code) ?></td>
|
|
<td><?= esc($row->cd_name) ?></td>
|
|
<td class="text-center text-xs"><?= esc($scopeLabel) ?></td>
|
|
<td class="text-center"><?= (int) $row->cd_sort ?></td>
|
|
<td class="text-center"><?= (int) $row->cd_state === 1 ? '사용' : '미사용' ?></td>
|
|
<td class="text-left"><?= esc($row->cd_regdate ?? '') ?></td>
|
|
<?php if ($showActionsCol): ?>
|
|
<td class="text-center text-sm">
|
|
<?php if (! empty($rowCanEdit[$row->cd_idx])): ?>
|
|
<a href="<?= base_url('admin/code-details/edit/' . (int) $row->cd_idx) ?>" class="text-blue-600 hover:underline">수정</a>
|
|
<form action="<?= base_url('admin/code-details/delete/' . (int) $row->cd_idx) ?>" method="POST" class="ml-1 inline" onsubmit="return confirm('이 세부코드를 삭제하시겠습니까?');">
|
|
<?= csrf_field() ?>
|
|
<button type="submit" class="text-red-600 hover:underline">삭제</button>
|
|
</form>
|
|
<?php else: ?>
|
|
<span class="text-gray-400">—</span>
|
|
<?php endif; ?>
|
|
</td>
|
|
<?php endif; ?>
|
|
</tr>
|
|
<?php $rowNo++; ?>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<?php if (isset($pager) && $pager !== null): ?>
|
|
<div class="mt-3"><?= $pager->links() ?></div>
|
|
<?php endif; ?>
|
|
</div>
|