Files
jongryangje/app/Views/admin/packaging_unit/create.php
javamon1174 acc9e4741e P2-05/06 포장 단위 관리 CRUD + 이력 + 기간별 조회
- packaging_unit, packaging_unit_history 테이블 생성
- PackagingUnitModel, PackagingUnitHistoryModel
- PackagingUnit 컨트롤러 (목록/등록/수정/삭제/이력)
- 박스당팩수 x 팩당낱장수 = 총낱장수 자동 계산
- 변경 시 자동 이력 기록
- E2E 테스트 3개 전체 통과

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 16:32:55 +09:00

49 lines
2.9 KiB
PHP

<section class="border-b border-gray-300 p-2 shrink-0 bg-control-panel">
<span class="text-sm font-bold text-gray-700">포장 단위 등록</span>
</section>
<div class="border border-gray-300 p-4 mt-2 bg-white max-w-3xl">
<form action="<?= base_url('admin/packaging-units/store') ?>" method="POST" class="space-y-4">
<?= csrf_field() ?>
<div class="flex flex-wrap items-center gap-2">
<label class="block text-sm font-bold text-gray-700 w-32">봉투 <span class="text-red-500">*</span></label>
<select class="border border-gray-300 rounded px-3 py-1.5 text-sm w-60" name="pu_bag_code" required>
<option value="">선택</option>
<?php foreach ($bagCodes as $cd): ?>
<option value="<?= esc($cd->cd_code) ?>" <?= old('pu_bag_code') === $cd->cd_code ? 'selected' : '' ?>>
<?= esc($cd->cd_code) ?> — <?= esc($cd->cd_name) ?>
</option>
<?php endforeach; ?>
</select>
</div>
<div class="flex flex-wrap items-center gap-2">
<label class="block text-sm font-bold text-gray-700 w-32">박스당 팩 수 <span class="text-red-500">*</span></label>
<input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-32 text-right" name="pu_box_per_pack" type="number" min="1" value="<?= esc(old('pu_box_per_pack', '1')) ?>" required/>
<span class="text-sm text-gray-500">팩</span>
</div>
<div class="flex flex-wrap items-center gap-2">
<label class="block text-sm font-bold text-gray-700 w-32">팩당 낱장 수 <span class="text-red-500">*</span></label>
<input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-32 text-right" name="pu_pack_per_sheet" type="number" min="1" value="<?= esc(old('pu_pack_per_sheet', '1')) ?>" required/>
<span class="text-sm text-gray-500">장</span>
</div>
<div class="flex flex-wrap items-center gap-2">
<label class="block text-sm font-bold text-gray-700 w-32">적용시작일 <span class="text-red-500">*</span></label>
<input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-44" name="pu_start_date" type="date" value="<?= esc(old('pu_start_date', date('Y-m-d'))) ?>" required/>
</div>
<div class="flex flex-wrap items-center gap-2">
<label class="block text-sm font-bold text-gray-700 w-32">적용종료일</label>
<input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-44" name="pu_end_date" type="date" value="<?= esc(old('pu_end_date')) ?>"/>
<span class="text-sm text-gray-400">비워두면 현재 적용중</span>
</div>
<div class="flex gap-2 pt-2">
<button type="submit" class="bg-btn-search text-white px-6 py-1.5 rounded-sm text-sm shadow hover:opacity-90 transition">등록</button>
<a href="<?= base_url('admin/packaging-units') ?>" class="bg-gray-200 text-gray-700 px-6 py-1.5 rounded-sm text-sm hover:bg-gray-300 transition">취소</a>
</div>
</form>
</div>