2026-03-26 16:40:49 +09:00
|
|
|
<?= view('components/print_header', ['printTitle' => '업체 관리']) ?>
|
2026-03-25 17:41:15 +09:00
|
|
|
<section class="border-b border-gray-300 p-2 shrink-0 bg-control-panel">
|
|
|
|
|
<div class="flex flex-wrap items-center justify-between gap-y-2">
|
|
|
|
|
<span class="text-sm font-bold text-gray-700">업체 관리</span>
|
2026-03-26 16:40:49 +09:00
|
|
|
<div class="flex items-center gap-2">
|
|
|
|
|
<button onclick="window.print()" class="no-print border border-btn-print-border text-gray-600 px-3 py-1 rounded-sm text-sm hover:bg-gray-50 transition">인쇄</button>
|
2026-04-08 00:19:00 +09:00
|
|
|
<a href="<?= mgmt_url('companies/create') ?>" class="bg-btn-search text-white px-4 py-1.5 rounded-sm flex items-center gap-1 text-sm shadow hover:opacity-90 transition border border-transparent">업체 등록</a>
|
2026-03-26 16:40:49 +09:00
|
|
|
</div>
|
2026-03-25 17:41:15 +09:00
|
|
|
</div>
|
|
|
|
|
</section>
|
2026-04-22 15:35:28 +09:00
|
|
|
<section class="p-2 bg-white border-b border-gray-200 no-print">
|
|
|
|
|
<form method="GET" action="<?= mgmt_url('companies') ?>" class="flex flex-wrap items-center gap-2">
|
|
|
|
|
<label class="text-sm text-gray-600">업체유형</label>
|
|
|
|
|
<select name="cp_type" class="border border-gray-300 rounded px-2 py-1 text-sm w-44">
|
|
|
|
|
<option value="">전 체</option>
|
|
|
|
|
<?php foreach (($typeOptions ?? []) as $type): ?>
|
|
|
|
|
<option value="<?= esc($type) ?>" <?= (string) ($cpType ?? '') === (string) $type ? 'selected' : '' ?>><?= esc($type) ?></option>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</select>
|
|
|
|
|
<button type="submit" class="bg-btn-search text-white px-4 py-1 rounded-sm text-sm">조회</button>
|
|
|
|
|
<a href="<?= mgmt_url('companies') ?>" class="text-sm text-gray-500 hover:underline">초기화</a>
|
|
|
|
|
</form>
|
|
|
|
|
</section>
|
2026-03-25 17:41:15 +09:00
|
|
|
<div class="border border-gray-300 overflow-auto mt-2">
|
|
|
|
|
<table class="w-full data-table">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th class="w-16">번호</th>
|
|
|
|
|
<th>업체유형</th>
|
|
|
|
|
<th>업체명</th>
|
|
|
|
|
<th>사업자번호</th>
|
|
|
|
|
<th>대표자</th>
|
|
|
|
|
<th>전화</th>
|
|
|
|
|
<th>주소</th>
|
|
|
|
|
<th class="w-20">상태</th>
|
|
|
|
|
<th class="w-36">작업</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
2026-04-22 15:35:28 +09:00
|
|
|
<?php
|
|
|
|
|
$startNo = 1;
|
|
|
|
|
if (isset($pager) && method_exists($pager, 'getCurrentPage') && method_exists($pager, 'getPerPage')) {
|
|
|
|
|
$currentPage = (int) $pager->getCurrentPage();
|
|
|
|
|
$perPage = (int) $pager->getPerPage();
|
|
|
|
|
$startNo = (($currentPage > 0 ? $currentPage : 1) - 1) * ($perPage > 0 ? $perPage : 20) + 1;
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<?php foreach (($list ?? []) as $idx => $row): ?>
|
2026-03-25 17:41:15 +09:00
|
|
|
<tr>
|
2026-04-22 15:35:28 +09:00
|
|
|
<td class="text-center"><?= (int) $startNo + (int) $idx ?></td>
|
2026-03-25 17:41:15 +09:00
|
|
|
<td class="text-center"><?= esc($row->cp_type) ?></td>
|
|
|
|
|
<td class="text-left pl-2"><?= esc($row->cp_name) ?></td>
|
|
|
|
|
<td class="text-center"><?= esc($row->cp_biz_no) ?></td>
|
|
|
|
|
<td class="text-center"><?= esc($row->cp_rep_name) ?></td>
|
|
|
|
|
<td class="text-center"><?= esc($row->cp_tel) ?></td>
|
|
|
|
|
<td class="text-left pl-2"><?= esc($row->cp_addr) ?></td>
|
|
|
|
|
<td class="text-center"><?= (int) $row->cp_state === 1 ? '사용' : '미사용' ?></td>
|
|
|
|
|
<td class="text-center">
|
2026-04-08 00:19:00 +09:00
|
|
|
<a href="<?= mgmt_url('companies/edit/' . (int) $row->cp_idx) ?>" class="text-blue-600 hover:underline text-sm mr-1">수정</a>
|
|
|
|
|
<form action="<?= mgmt_url('companies/delete/' . (int) $row->cp_idx) ?>" method="POST" class="inline" onsubmit="return confirm('삭제하시겠습니까?');">
|
2026-03-25 17:41:15 +09:00
|
|
|
<?= csrf_field() ?>
|
|
|
|
|
<button type="submit" class="text-red-600 hover:underline text-sm">삭제</button>
|
|
|
|
|
</form>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
<?php if (empty($list)): ?>
|
|
|
|
|
<tr><td colspan="9" class="text-center text-gray-400 py-4">등록된 데이터가 없습니다.</td></tr>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
2026-03-26 16:40:49 +09:00
|
|
|
<?php if (isset($pager)): ?><div class="mt-3"><?= $pager->links() ?></div><?php endif; ?>
|