feat: 기본코드 bag 목록과 관리자 CRUD 분리

- /bag/code-kinds, /bag/code-details/{ck_idx} 조회 (LoginAuthFilter, Roles::canManageCodeMaster)
- admin에서는 종류·세부 목록 제거, 등록·수정·삭제만 유지 후 bag으로 리다이렉트
- 사이트 메뉴·기본코드 링크 SQL, CSV 동기화 스크립트·README 보강
- 관리자 대시보드: 발주·판매 테이블 미존재 시 통계 비활성화
- 회원 로그인 잠금(mb_login_fail_count, mb_locked_until) 및 관리자 잠금 해제

Made-with: Cursor
This commit is contained in:
taekyoungc
2026-03-30 15:07:09 +09:00
parent de8f631ca8
commit ab40a90f69
32 changed files with 1026 additions and 704 deletions

View File

@@ -26,6 +26,7 @@ class Filters extends BaseFilters
*/
public array $aliases = [
'adminAuth' => \App\Filters\AdminAuthFilter::class,
'loginAuth' => \App\Filters\LoginAuthFilter::class,
'csrf' => CSRF::class,
'toolbar' => DebugToolbar::class,
'honeypot' => Honeypot::class,

View File

@@ -42,6 +42,14 @@ class Roles extends BaseConfig
return $level === self::LEVEL_SUPER_ADMIN || $level === self::LEVEL_HEADQUARTERS_ADMIN;
}
/**
* 기본코드(종류·세부) 등록·수정·삭제 가능 (지자체·super·본부 관리자)
*/
public static function canManageCodeMaster(int $level): bool
{
return $level === self::LEVEL_LOCAL_ADMIN || self::isSuperAdminEquivalent($level);
}
/**
* TOTP 2차 인증 적용 대상 (지자체·super·본부 관리자)
*/

View File

@@ -17,6 +17,11 @@ $routes->get('bag/waste-suibal-enterprise', 'Home::wasteSuibalEnterprise');
// 사이트 메뉴 (/bag/*)
$routes->get('bag/basic-info', 'Bag::basicInfo');
$routes->get('bag/code-kinds', 'Bag::codeKinds');
$routes->get('bag/code-details/(:num)', 'Bag::codeDetails/$1');
// 옛 주소 호환: 세부 목록만 사이트로 이동
$routes->get('admin/code-details/(:num)', 'Admin\CodeDetail::index/$1');
$routes->get('bag/purchase-inbound', 'Bag::purchaseInbound');
$routes->get('bag/issue', 'Bag::issue');
$routes->get('bag/inventory', 'Bag::inventory');
@@ -63,6 +68,7 @@ $routes->group('admin', ['filter' => 'adminAuth'], static function ($routes): vo
$routes->post('users/store', 'Admin\User::store');
$routes->get('users/edit/(:num)', 'Admin\User::edit/$1');
$routes->post('users/update/(:num)', 'Admin\User::update/$1');
$routes->post('users/unlock-login/(:num)', 'Admin\User::unlockLogin/$1');
$routes->post('users/delete/(:num)', 'Admin\User::delete/$1');
$routes->get('access/login-history', 'Admin\Access::loginHistory');
$routes->get('access/approvals', 'Admin\Access::approvals');
@@ -88,8 +94,7 @@ $routes->group('admin', ['filter' => 'adminAuth'], static function ($routes): vo
$routes->get('password-change', 'Admin\PasswordChange::index');
$routes->post('password-change', 'Admin\PasswordChange::update');
// 기본코드 종류 관리 (P2-01)
$routes->get('code-kinds', 'Admin\CodeKind::index');
// 기본코드 종류 관리 (P2-01) — 등록·수정·삭제는 관리자 전용
$routes->get('code-kinds/create', 'Admin\CodeKind::create');
$routes->post('code-kinds/store', 'Admin\CodeKind::store');
$routes->get('code-kinds/edit/(:num)', 'Admin\CodeKind::edit/$1');
@@ -97,7 +102,6 @@ $routes->group('admin', ['filter' => 'adminAuth'], static function ($routes): vo
$routes->post('code-kinds/delete/(:num)', 'Admin\CodeKind::delete/$1');
// 세부코드 관리 (P2-02)
$routes->get('code-details/(:num)', 'Admin\CodeDetail::index/$1');
$routes->get('code-details/(:num)/create', 'Admin\CodeDetail::create/$1');
$routes->post('code-details/store', 'Admin\CodeDetail::store');
$routes->get('code-details/edit/(:num)', 'Admin\CodeDetail::edit/$1');

View File

@@ -1,10 +1,14 @@
<?php
declare(strict_types=1);
namespace App\Controllers\Admin;
use App\Controllers\BaseController;
use App\Models\CodeKindModel;
use App\Models\CodeDetailModel;
use CodeIgniter\HTTP\RedirectResponse;
use Config\Roles;
class CodeDetail extends BaseController
{
@@ -17,31 +21,30 @@ class CodeDetail extends BaseController
$this->detailModel = model(CodeDetailModel::class);
}
public function index(int $ckIdx)
private function redirectIfCannotManageCodeMaster(): ?RedirectResponse
{
$kind = $this->kindModel->find($ckIdx);
if ($kind === null) {
return redirect()->to(site_url('admin/code-kinds'))->with('error', '코드 종류를 찾을 수 없습니다.');
if (! Roles::canManageCodeMaster((int) session()->get('mb_level'))) {
return redirect()->to(site_url('bag/code-kinds'))->with('error', '코드 관리 권한이 없습니다.');
}
$list = $this->detailModel->where('cd_ck_idx', $ckIdx)->orderBy('cd_sort', 'ASC')->paginate(20);
$pager = $this->detailModel->pager;
return null;
}
return view('admin/layout', [
'title' => '세부코드 관리 — ' . $kind->ck_name . ' (' . $kind->ck_code . ')',
'content' => view('admin/code_detail/index', [
'kind' => $kind,
'list' => $list,
'pager' => $pager,
]),
]);
/** @deprecated 사이트 URL 유지용 — 세부 목록은 /bag/code-details/{ck_idx} */
public function index(int $ckIdx): RedirectResponse
{
return redirect()->to(site_url('bag/code-details/' . $ckIdx));
}
public function create(int $ckIdx)
{
if ($r = $this->redirectIfCannotManageCodeMaster()) {
return $r;
}
$kind = $this->kindModel->find($ckIdx);
if ($kind === null) {
return redirect()->to(site_url('admin/code-kinds'))->with('error', '코드 종류를 찾을 수 없습니다.');
return redirect()->to(site_url('bag/code-kinds'))->with('error', '코드 종류를 찾을 수 없습니다.');
}
return view('admin/layout', [
@@ -52,6 +55,10 @@ class CodeDetail extends BaseController
public function store()
{
if ($r = $this->redirectIfCannotManageCodeMaster()) {
return $r;
}
$rules = [
'cd_ck_idx' => 'required|is_natural_no_zero',
'cd_code' => 'required|max_length[50]',
@@ -74,14 +81,18 @@ class CodeDetail extends BaseController
'cd_regdate' => date('Y-m-d H:i:s'),
]);
return redirect()->to(site_url('admin/code-details/' . $ckIdx))->with('success', '세부코드가 등록되었습니다.');
return redirect()->to(site_url('bag/code-details/' . $ckIdx))->with('success', '세부코드가 등록되었습니다.');
}
public function edit(int $id)
{
if ($r = $this->redirectIfCannotManageCodeMaster()) {
return $r;
}
$item = $this->detailModel->find($id);
if ($item === null) {
return redirect()->to(site_url('admin/code-kinds'))->with('error', '세부코드를 찾을 수 없습니다.');
return redirect()->to(site_url('bag/code-kinds'))->with('error', '세부코드를 찾을 수 없습니다.');
}
$kind = $this->kindModel->find($item->cd_ck_idx);
@@ -97,9 +108,13 @@ class CodeDetail extends BaseController
public function update(int $id)
{
if ($r = $this->redirectIfCannotManageCodeMaster()) {
return $r;
}
$item = $this->detailModel->find($id);
if ($item === null) {
return redirect()->to(site_url('admin/code-kinds'))->with('error', '세부코드를 찾을 수 없습니다.');
return redirect()->to(site_url('bag/code-kinds'))->with('error', '세부코드를 찾을 수 없습니다.');
}
$rules = [
@@ -118,19 +133,23 @@ class CodeDetail extends BaseController
'cd_state' => (int) $this->request->getPost('cd_state'),
]);
return redirect()->to(site_url('admin/code-details/' . $item->cd_ck_idx))->with('success', '세부코드가 수정되었습니다.');
return redirect()->to(site_url('bag/code-details/' . $item->cd_ck_idx))->with('success', '세부코드가 수정되었습니다.');
}
public function delete(int $id)
{
if ($r = $this->redirectIfCannotManageCodeMaster()) {
return $r;
}
$item = $this->detailModel->find($id);
if ($item === null) {
return redirect()->to(site_url('admin/code-kinds'))->with('error', '세부코드를 찾을 수 없습니다.');
return redirect()->to(site_url('bag/code-kinds'))->with('error', '세부코드를 찾을 수 없습니다.');
}
$ckIdx = $item->cd_ck_idx;
$this->detailModel->delete($id);
return redirect()->to(site_url('admin/code-details/' . $ckIdx))->with('success', '세부코드가 삭제되었습니다.');
return redirect()->to(site_url('bag/code-details/' . $ckIdx))->with('success', '세부코드가 삭제되었습니다.');
}
}

View File

@@ -1,10 +1,13 @@
<?php
declare(strict_types=1);
namespace App\Controllers\Admin;
use App\Controllers\BaseController;
use App\Models\CodeKindModel;
use App\Models\CodeDetailModel;
use CodeIgniter\HTTP\RedirectResponse;
use Config\Roles;
class CodeKind extends BaseController
@@ -16,30 +19,21 @@ class CodeKind extends BaseController
$this->kindModel = model(CodeKindModel::class);
}
public function index()
private function redirectIfCannotManageCodeMaster(): ?RedirectResponse
{
$list = $this->kindModel->orderBy('ck_code', 'ASC')->paginate(20);
$pager = $this->kindModel->pager;
// 세부코드 수 매핑
$detailModel = model(CodeDetailModel::class);
$countMap = [];
foreach ($list as $row) {
$countMap[$row->ck_idx] = $detailModel->where('cd_ck_idx', $row->ck_idx)->countAllResults(false);
if (! Roles::canManageCodeMaster((int) session()->get('mb_level'))) {
return redirect()->to(site_url('bag/code-kinds'))->with('error', '코드 관리 권한이 없습니다.');
}
return view('admin/layout', [
'title' => '기본코드 종류 관리',
'content' => view('admin/code_kind/index', [
'list' => $list,
'countMap' => $countMap,
'pager' => $pager,
]),
]);
return null;
}
public function create()
{
if ($r = $this->redirectIfCannotManageCodeMaster()) {
return $r;
}
return view('admin/layout', [
'title' => '기본코드 종류 등록',
'content' => view('admin/code_kind/create'),
@@ -48,6 +42,10 @@ class CodeKind extends BaseController
public function store()
{
if ($r = $this->redirectIfCannotManageCodeMaster()) {
return $r;
}
$rules = [
'ck_code' => 'required|max_length[20]|is_unique[code_kind.ck_code]',
'ck_name' => 'required|max_length[100]',
@@ -64,14 +62,18 @@ class CodeKind extends BaseController
'ck_regdate' => date('Y-m-d H:i:s'),
]);
return redirect()->to(site_url('admin/code-kinds'))->with('success', '코드 종류가 등록되었습니다.');
return redirect()->to(site_url('bag/code-kinds'))->with('success', '코드 종류가 등록되었습니다.');
}
public function edit(int $id)
{
if ($r = $this->redirectIfCannotManageCodeMaster()) {
return $r;
}
$item = $this->kindModel->find($id);
if ($item === null) {
return redirect()->to(site_url('admin/code-kinds'))->with('error', '코드 종류를 찾을 수 없습니다.');
return redirect()->to(site_url('bag/code-kinds'))->with('error', '코드 종류를 찾을 수 없습니다.');
}
return view('admin/layout', [
@@ -82,9 +84,13 @@ class CodeKind extends BaseController
public function update(int $id)
{
if ($r = $this->redirectIfCannotManageCodeMaster()) {
return $r;
}
$item = $this->kindModel->find($id);
if ($item === null) {
return redirect()->to(site_url('admin/code-kinds'))->with('error', '코드 종류를 찾을 수 없습니다.');
return redirect()->to(site_url('bag/code-kinds'))->with('error', '코드 종류를 찾을 수 없습니다.');
}
$rules = [
@@ -101,24 +107,28 @@ class CodeKind extends BaseController
'ck_state' => (int) $this->request->getPost('ck_state'),
]);
return redirect()->to(site_url('admin/code-kinds'))->with('success', '코드 종류가 수정되었습니다.');
return redirect()->to(site_url('bag/code-kinds'))->with('success', '코드 종류가 수정되었습니다.');
}
public function delete(int $id)
{
$item = $this->kindModel->find($id);
if ($item === null) {
return redirect()->to(site_url('admin/code-kinds'))->with('error', '코드 종류를 찾을 수 없습니다.');
if ($r = $this->redirectIfCannotManageCodeMaster()) {
return $r;
}
$item = $this->kindModel->find($id);
if ($item === null) {
return redirect()->to(site_url('bag/code-kinds'))->with('error', '코드 종류를 찾을 수 없습니다.');
}
// 세부코드가 있으면 삭제 불가
$detailCount = model(CodeDetailModel::class)->where('cd_ck_idx', $id)->countAllResults();
if ($detailCount > 0) {
return redirect()->to(site_url('admin/code-kinds'))
return redirect()->to(site_url('bag/code-kinds'))
->with('error', '세부코드가 ' . $detailCount . '개 존재하여 삭제할 수 없습니다. 먼저 세부코드를 삭제해 주세요.');
}
$this->kindModel->delete($id);
return redirect()->to(site_url('admin/code-kinds'))->with('success', '코드 종류가 삭제되었습니다.');
return redirect()->to(site_url('bag/code-kinds'))->with('success', '코드 종류가 삭제되었습니다.');
}
}

View File

@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace App\Controllers\Admin;
use App\Controllers\BaseController;
use CodeIgniter\Database\Exceptions\DatabaseException;
class Dashboard extends BaseController
{
@@ -22,65 +23,71 @@ class Dashboard extends BaseController
'issue_count_month'=> 0,
'recent_orders' => [],
'recent_sales' => [],
'stats_unavailable'=> false,
];
if ($lgIdx) {
$db = \Config\Database::connect();
// 총 발주 건수/금액
$orderStats = $db->query("
SELECT COUNT(*) as cnt,
COALESCE(SUM(sub.total_amt), 0) as total_amount
FROM bag_order bo
LEFT JOIN (
SELECT boi_bo_idx, SUM(boi_amount) as total_amt
FROM bag_order_item GROUP BY boi_bo_idx
) sub ON sub.boi_bo_idx = bo.bo_idx
WHERE bo.bo_lg_idx = ? AND bo.bo_status = 'normal'
", [$lgIdx])->getRow();
$stats['order_count'] = (int) ($orderStats->cnt ?? 0);
$stats['order_amount'] = (int) ($orderStats->total_amount ?? 0);
try {
// 총 발주 건수/금액
$orderStats = $db->query("
SELECT COUNT(*) as cnt,
COALESCE(SUM(sub.total_amt), 0) as total_amount
FROM bag_order bo
LEFT JOIN (
SELECT boi_bo_idx, SUM(boi_amount) as total_amt
FROM bag_order_item GROUP BY boi_bo_idx
) sub ON sub.boi_bo_idx = bo.bo_idx
WHERE bo.bo_lg_idx = ? AND bo.bo_status = 'normal'
", [$lgIdx])->getRow();
$stats['order_count'] = (int) ($orderStats->cnt ?? 0);
$stats['order_amount'] = (int) ($orderStats->total_amount ?? 0);
// 총 판매 건수/금액
$saleStats = $db->query("
SELECT COUNT(*) as cnt, COALESCE(SUM(bs_amount), 0) as total_amount
FROM bag_sale
WHERE bs_lg_idx = ? AND bs_type = 'sale'
", [$lgIdx])->getRow();
$stats['sale_count'] = (int) ($saleStats->cnt ?? 0);
$stats['sale_amount'] = (int) ($saleStats->total_amount ?? 0);
// 총 판매 건수/금액
$saleStats = $db->query("
SELECT COUNT(*) as cnt, COALESCE(SUM(bs_amount), 0) as total_amount
FROM bag_sale
WHERE bs_lg_idx = ? AND bs_type = 'sale'
", [$lgIdx])->getRow();
$stats['sale_count'] = (int) ($saleStats->cnt ?? 0);
$stats['sale_amount'] = (int) ($saleStats->total_amount ?? 0);
// 현재 재고 품목 수
$invCount = $db->query("
SELECT COUNT(*) as cnt FROM bag_inventory WHERE bi_lg_idx = ? AND bi_qty > 0
", [$lgIdx])->getRow();
$stats['inventory_count'] = (int) ($invCount->cnt ?? 0);
// 현재 재고 품목 수
$invCount = $db->query("
SELECT COUNT(*) as cnt FROM bag_inventory WHERE bi_lg_idx = ? AND bi_qty > 0
", [$lgIdx])->getRow();
$stats['inventory_count'] = (int) ($invCount->cnt ?? 0);
// 이번 달 불출 건수
$monthStart = date('Y-m-01');
$issueCount = $db->query("
SELECT COUNT(*) as cnt FROM bag_issue
WHERE bi2_lg_idx = ? AND bi2_status = 'normal' AND bi2_issue_date >= ?
", [$lgIdx, $monthStart])->getRow();
$stats['issue_count_month'] = (int) ($issueCount->cnt ?? 0);
// 이번 달 불출 건수
$monthStart = date('Y-m-01');
$issueCount = $db->query("
SELECT COUNT(*) as cnt FROM bag_issue
WHERE bi2_lg_idx = ? AND bi2_status = 'normal' AND bi2_issue_date >= ?
", [$lgIdx, $monthStart])->getRow();
$stats['issue_count_month'] = (int) ($issueCount->cnt ?? 0);
// 최근 발주 5건
$stats['recent_orders'] = $db->query("
SELECT bo_idx, bo_lot_no, bo_order_date, bo_status
FROM bag_order
WHERE bo_lg_idx = ?
ORDER BY bo_order_date DESC, bo_idx DESC
LIMIT 5
", [$lgIdx])->getResult();
// 최근 발주 5건
$stats['recent_orders'] = $db->query("
SELECT bo_idx, bo_lot_no, bo_order_date, bo_status
FROM bag_order
WHERE bo_lg_idx = ?
ORDER BY bo_order_date DESC, bo_idx DESC
LIMIT 5
", [$lgIdx])->getResult();
// 최근 판매 5건
$stats['recent_sales'] = $db->query("
SELECT bs_idx, bs_ds_name, bs_bag_name, bs_qty, bs_amount, bs_sale_date, bs_type
FROM bag_sale
WHERE bs_lg_idx = ?
ORDER BY bs_sale_date DESC, bs_idx DESC
LIMIT 5
", [$lgIdx])->getResult();
// 최근 판매 5건
$stats['recent_sales'] = $db->query("
SELECT bs_idx, bs_ds_name, bs_bag_name, bs_qty, bs_amount, bs_sale_date, bs_type
FROM bag_sale
WHERE bs_lg_idx = ?
ORDER BY bs_sale_date DESC, bs_idx DESC
LIMIT 5
", [$lgIdx])->getResult();
} catch (DatabaseException $e) {
$stats['stats_unavailable'] = true;
log_message('error', '[Dashboard] 통계 조회 실패(테이블 미생성 등): ' . $e->getMessage());
}
}
return view('admin/layout', [

View File

@@ -177,6 +177,23 @@ class User extends BaseController
return redirect()->to(site_url('admin/users'))->with('success', '회원 정보가 수정되었습니다.');
}
/**
* 로그인 실패 누적 잠금(mb_locked_until) 해제 — 비밀번호는 그대로 두고 재시도만 가능하게 함
*/
public function unlockLogin(int $id)
{
$member = $this->memberModel->find($id);
if (! $member) {
return redirect()->to(site_url('admin/users'))->with('error', '회원을 찾을 수 없습니다.');
}
$this->memberModel->update($id, [
'mb_login_fail_count' => 0,
'mb_locked_until' => null,
]);
return redirect()->back()->with('success', '로그인 잠금이 해제되었습니다.');
}
/**
* 현재 로그인한 관리자가 부여 가능한 역할 목록.
* super/본부만 4·5 부여 가능, 지자체 관리자는 1~3만.

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Controllers;
use CodeIgniter\Database\Exceptions\DatabaseException;
use App\Models\BagInventoryModel;
use App\Models\BagIssueModel;
use App\Models\BagOrderModel;
@@ -18,6 +19,7 @@ use App\Models\PackagingUnitModel;
use App\Models\SalesAgencyModel;
use App\Models\ShopOrderModel;
use App\Models\DesignatedShopModel;
use Config\Roles;
class Bag extends BaseController
{
@@ -44,17 +46,74 @@ class Bag extends BaseController
public function basicInfo(): string
{
$lgIdx = $this->lgIdx();
$data = [];
$data = [
'bagPrices' => [],
'packagingUnits' => [],
];
if ($lgIdx) {
$data['codeKinds'] = model(CodeKindModel::class)->orderBy('ck_code', 'ASC')->findAll();
$data['bagPrices'] = model(BagPriceModel::class)->where('bp_lg_idx', $lgIdx)->orderBy('bp_bag_code', 'ASC')->findAll();
$data['packagingUnits'] = model(PackagingUnitModel::class)->where('pu_lg_idx', $lgIdx)->orderBy('pu_bag_code', 'ASC')->findAll();
try {
$data['bagPrices'] = model(BagPriceModel::class)->where('bp_lg_idx', $lgIdx)->orderBy('bp_bag_code', 'ASC')->findAll();
} catch (DatabaseException $e) {
log_message('error', '[basicInfo] bag_price 조회 실패(테이블 미생성 등): ' . $e->getMessage());
}
try {
$data['packagingUnits'] = model(PackagingUnitModel::class)->where('pu_lg_idx', $lgIdx)->orderBy('pu_bag_code', 'ASC')->findAll();
} catch (DatabaseException $e) {
log_message('error', '[basicInfo] packaging_unit 조회 실패: ' . $e->getMessage());
}
}
return $this->render('기본정보관리', 'bag/basic_info', $data);
}
/**
* 기본코드 종류·세부코드 조회 전용 (사이트 메뉴 기본코드관리)
*/
public function codeKinds(): string
{
$kindModel = model(CodeKindModel::class);
$detailModel = model(CodeDetailModel::class);
$kinds = $kindModel->orderBy('ck_code', 'ASC')->findAll();
$countMap = [];
foreach ($kinds as $row) {
// countAllResults() 기본값(true)으로 매번 빌더 초기화 — false 시 where 누적되어 2번째부터 0건으로 보임
$countMap[$row->ck_idx] = (int) $detailModel->where('cd_ck_idx', $row->ck_idx)->countAllResults();
}
return $this->render('기본코드관리', 'bag/code_kinds', [
'codeKinds' => $kinds,
'countMap' => $countMap,
'canManage' => Roles::canManageCodeMaster((int) session()->get('mb_level')),
]);
}
/**
* 기본코드 세부 목록 (사이트 레이아웃). 등록·수정·삭제 폼은 /admin/code-details/* 유지.
*/
public function codeDetails(int $ckIdx)
{
$kindModel = model(CodeKindModel::class);
$detailModel = model(CodeDetailModel::class);
$kind = $kindModel->find($ckIdx);
if ($kind === null) {
return redirect()->to(site_url('bag/code-kinds'))->with('error', '코드 종류를 찾을 수 없습니다.');
}
$list = $detailModel->where('cd_ck_idx', $ckIdx)->orderBy('cd_sort', 'ASC')->orderBy('cd_idx', 'ASC')->paginate(20);
$pager = $detailModel->pager;
$canManage = Roles::canManageCodeMaster((int) session()->get('mb_level'));
$title = ($canManage ? '세부코드 관리' : '세부코드 조회') . ' — ' . $kind->ck_name . ' (' . $kind->ck_code . ')';
return $this->render($title, 'bag/code_details', [
'kind' => $kind,
'list' => $list,
'pager' => $pager,
'canManage' => $canManage,
]);
}
// ──────────────────────────────────────────────
// 발주 입고 관리
// ──────────────────────────────────────────────

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace App\Filters;
use CodeIgniter\Filters\FilterInterface;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
/**
* 로그인만 필요 (mb_level 무관). 기본코드 조회 등 시민·판매소도 접근 가능한 /admin/* 하위용.
*/
class LoginAuthFilter implements FilterInterface
{
public function before(RequestInterface $request, $arguments = null)
{
if (! session()->get('logged_in')) {
return redirect()->to(site_url('login'))->with('error', '로그인이 필요합니다.');
}
return null;
}
public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
{
return $response;
}
}

View File

@@ -1,6 +1,6 @@
<section class="border-b border-gray-300 p-2 shrink-0 bg-control-panel">
<div class="flex items-center gap-2">
<a href="<?= base_url('admin/code-details/' . (int) $kind->ck_idx) ?>" class="text-blue-600 hover:underline text-sm">&larr; <?= esc($kind->ck_name) ?></a>
<a href="<?= base_url('bag/code-details/' . (int) $kind->ck_idx) ?>" class="text-blue-600 hover:underline text-sm">&larr; <?= esc($kind->ck_name) ?></a>
<span class="text-gray-400">|</span>
<span class="text-sm font-bold text-gray-700">세부코드 등록</span>
</div>
@@ -32,7 +32,7 @@
<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/code-details/' . (int) $kind->ck_idx) ?>" class="bg-gray-200 text-gray-700 px-6 py-1.5 rounded-sm text-sm hover:bg-gray-300 transition">취소</a>
<a href="<?= base_url('bag/code-details/' . (int) $kind->ck_idx) ?>" 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>

View File

@@ -1,6 +1,6 @@
<section class="border-b border-gray-300 p-2 shrink-0 bg-control-panel">
<div class="flex items-center gap-2">
<a href="<?= base_url('admin/code-details/' . (int) $kind->ck_idx) ?>" class="text-blue-600 hover:underline text-sm">&larr; <?= esc($kind->ck_name) ?></a>
<a href="<?= base_url('bag/code-details/' . (int) $kind->ck_idx) ?>" class="text-blue-600 hover:underline text-sm">&larr; <?= esc($kind->ck_name) ?></a>
<span class="text-gray-400">|</span>
<span class="text-sm font-bold text-gray-700">세부코드 수정</span>
</div>
@@ -39,7 +39,7 @@
<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/code-details/' . (int) $kind->ck_idx) ?>" class="bg-gray-200 text-gray-700 px-6 py-1.5 rounded-sm text-sm hover:bg-gray-300 transition">취소</a>
<a href="<?= base_url('bag/code-details/' . (int) $kind->ck_idx) ?>" 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>

View File

@@ -1,49 +0,0 @@
<?= view('components/print_header', ['printTitle' => '세부코드 관리 - ' . esc($kind->ck_name)]) ?>
<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">
<div class="flex items-center gap-2">
<a href="<?= base_url('admin/code-kinds') ?>" class="text-blue-600 hover:underline text-sm">&larr; 코드 종류</a>
<span class="text-gray-400">|</span>
<span class="text-sm font-bold text-gray-700">세부코드 — <?= esc($kind->ck_name) ?> (<?= esc($kind->ck_code) ?>)</span>
</div>
<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>
<a href="<?= base_url('admin/code-details/' . (int) $kind->ck_idx . '/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>
</div>
</div>
</section>
<div class="border border-gray-300 overflow-auto mt-2">
<table class="w-full data-table">
<thead>
<tr>
<th class="w-16">번호</th>
<th class="w-24">코드</th>
<th>코드명</th>
<th class="w-20">정렬순서</th>
<th class="w-20">상태</th>
<th>등록일</th>
<th class="w-28">작업</th>
</tr>
</thead>
<tbody class="text-right">
<?php foreach ($list as $row): ?>
<tr>
<td class="text-center"><?= esc($row->cd_idx) ?></td>
<td class="text-center font-mono"><?= esc($row->cd_code) ?></td>
<td class="text-left pl-2"><?= esc($row->cd_name) ?></td>
<td class="text-center"><?= (int) $row->cd_sort ?></td>
<td class="text-center"><?= (int) $row->cd_state === 1 ? '사용' : '미사용' ?></td>
<td class="text-left pl-2"><?= esc($row->cd_regdate ?? '') ?></td>
<td class="text-center">
<a href="<?= base_url('admin/code-details/edit/' . (int) $row->cd_idx) ?>" class="text-blue-600 hover:underline text-sm">수정</a>
<form action="<?= base_url('admin/code-details/delete/' . (int) $row->cd_idx) ?>" method="POST" class="inline ml-1" onsubmit="return confirm('이 세부코드를 삭제하시겠습니까?');">
<?= csrf_field() ?>
<button type="submit" class="text-red-600 hover:underline text-sm">삭제</button>
</form>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php if (isset($pager)): ?><div class="mt-3"><?= $pager->links() ?></div><?php endif; ?>

View File

@@ -17,7 +17,7 @@
<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/code-kinds') ?>" class="bg-gray-200 text-gray-700 px-6 py-1.5 rounded-sm text-sm hover:bg-gray-300 transition">취소</a>
<a href="<?= base_url('bag/code-kinds') ?>" 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>

View File

@@ -25,7 +25,7 @@
<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/code-kinds') ?>" class="bg-gray-200 text-gray-700 px-6 py-1.5 rounded-sm text-sm hover:bg-gray-300 transition">취소</a>
<a href="<?= base_url('bag/code-kinds') ?>" 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>

View File

@@ -1,48 +0,0 @@
<?= view('components/print_header', ['printTitle' => '기본코드 종류 관리']) ?>
<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>
<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>
<a href="<?= base_url('admin/code-kinds/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>
</div>
</div>
</section>
<div class="border border-gray-300 overflow-auto mt-2">
<table class="w-full data-table">
<thead>
<tr>
<th class="w-16">번호</th>
<th class="w-20">코드</th>
<th>코드명</th>
<th class="w-24">세부코드 수</th>
<th class="w-20">상태</th>
<th>등록일</th>
<th class="w-40">작업</th>
</tr>
</thead>
<tbody class="text-right">
<?php foreach ($list as $row): ?>
<tr>
<td class="text-center"><?= esc($row->ck_idx) ?></td>
<td class="text-center font-mono font-bold"><?= esc($row->ck_code) ?></td>
<td class="text-left pl-2"><?= esc($row->ck_name) ?></td>
<td class="text-center">
<a href="<?= base_url('admin/code-details/' . (int) $row->ck_idx) ?>" class="text-blue-600 hover:underline"><?= (int) ($countMap[$row->ck_idx] ?? 0) ?>개</a>
</td>
<td class="text-center"><?= (int) $row->ck_state === 1 ? '사용' : '미사용' ?></td>
<td class="text-left pl-2"><?= esc($row->ck_regdate ?? '') ?></td>
<td class="text-center">
<a href="<?= base_url('admin/code-details/' . (int) $row->ck_idx) ?>" class="text-green-600 hover:underline text-sm mr-1">세부코드</a>
<a href="<?= base_url('admin/code-kinds/edit/' . (int) $row->ck_idx) ?>" class="text-blue-600 hover:underline text-sm mr-1">수정</a>
<form action="<?= base_url('admin/code-kinds/delete/' . (int) $row->ck_idx) ?>" method="POST" class="inline" onsubmit="return confirm('이 코드 종류를 삭제하시겠습니까?');">
<?= csrf_field() ?>
<button type="submit" class="text-red-600 hover:underline text-sm">삭제</button>
</form>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php if (isset($pager)): ?><div class="mt-3"><?= $pager->links() ?></div><?php endif; ?>

View File

@@ -6,6 +6,15 @@
</div>
<?php else: ?>
<?php if (! empty($s['stats_unavailable'])): ?>
<div class="border border-amber-300 bg-amber-50 p-4 text-sm text-amber-900 mb-4">
발주·판매·재고·불출 통계 테이블이 아직 없거나 조회에 실패했습니다. MySQL에서
<code class="text-xs bg-white px-1 rounded">writable/database/order_tables.sql</code>과
<code class="text-xs bg-white px-1 rounded">writable/database/sales_tables.sql</code>을
<code class="text-xs bg-white px-1 rounded">jongryangje_dev</code> DB에 실행해 주세요.
</div>
<?php endif; ?>
<!-- 통계 카드 -->
<div class="grid grid-cols-2 md:grid-cols-4 gap-3 mb-4">
<div class="border border-gray-300 p-4 bg-white">

View File

@@ -1,6 +1,19 @@
<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>
<?php
$editLockUntil = $member->mb_locked_until ?? null;
$editLoginLocked = $editLockUntil !== null && $editLockUntil !== '' && strtotime((string) $editLockUntil) > time();
?>
<?php if ($editLoginLocked): ?>
<div class="mt-2 p-3 bg-amber-50 border border-amber-200 text-sm text-amber-900 flex flex-wrap items-center gap-3">
<span>비밀번호 오류로 로그인이 잠겨 있습니다. (~ <?= esc(date('Y-m-d H:i', strtotime((string) $editLockUntil))) ?>)</span>
<form action="<?= base_url('admin/users/unlock-login/' . $member->mb_idx) ?>" method="POST" class="inline" onsubmit="return confirm('로그인 잠금을 해제할까요?');">
<?= csrf_field() ?>
<button type="submit" class="bg-amber-700 text-white px-3 py-1 rounded-sm text-sm hover:opacity-90">잠금 해제</button>
</form>
</div>
<?php endif; ?>
<div class="border border-gray-300 p-4 mt-2 bg-white max-w-xl">
<form action="<?= base_url('admin/users/update/' . $member->mb_idx) ?>" method="POST" class="space-y-4">
<?= csrf_field() ?>

View File

@@ -18,6 +18,7 @@
<th>이메일</th>
<th>역할</th>
<th>상태</th>
<th>로그인 잠금</th>
<th>가입일</th>
<th>관리</th>
</tr>
@@ -42,9 +43,27 @@
}
?>
</td>
<td class="text-left pl-2 text-sm">
<?php
$until = $row->mb_locked_until ?? null;
$loginLocked = $until !== null && $until !== '' && strtotime((string) $until) > time();
if ($loginLocked) {
echo '잠금~' . esc(date('Y-m-d H:i', strtotime((string) $until)));
} else {
$fail = (int) ($row->mb_login_fail_count ?? 0);
echo $fail > 0 ? '실패 ' . $fail . '회' : '—';
}
?>
</td>
<td class="text-left pl-2"><?= esc($row->mb_regdate ?? '') ?></td>
<td class="text-center">
<?php if ((int) $row->mb_state !== 0): ?>
<?php if ($loginLocked): ?>
<form action="<?= base_url('admin/users/unlock-login/' . $row->mb_idx) ?>" method="POST" class="inline mr-1" onsubmit="return confirm('로그인 잠금을 해제할까요?');">
<?= csrf_field() ?>
<button type="submit" class="text-amber-700 hover:underline">잠금해제</button>
</form>
<?php endif; ?>
<a href="<?= base_url('admin/users/edit/' . $row->mb_idx) ?>" class="text-blue-600 hover:underline">수정</a>
<form action="<?= base_url('admin/users/delete/' . $row->mb_idx) ?>" method="POST" class="inline ml-1" onsubmit="return confirm('탈퇴 처리하시겠습니까?');">
<?= csrf_field() ?>

View File

@@ -1,30 +1,8 @@
<div class="space-y-6">
<!-- 기본코드 종류 -->
<section>
<div class="flex items-center justify-between mb-2 border-b pb-1">
<h3 class="text-base font-bold text-gray-700">기본코드 종류</h3>
<a href="<?= base_url('admin/code-kinds') ?>" class="text-blue-600 hover:underline text-sm">관리 &rarr;</a>
</div>
<table class="data-table">
<thead><tr>
<th class="w-16">번호</th><th>코드</th><th>코드명</th><th>상태</th>
</tr></thead>
<tbody>
<?php if (! empty($codeKinds)): ?>
<?php foreach ($codeKinds as $i => $row): ?>
<tr>
<td class="text-center"><?= $i + 1 ?></td>
<td class="text-center"><?= esc($row->ck_code) ?></td>
<td><?= esc($row->ck_name) ?></td>
<td class="text-center"><?= ($row->ck_status ?? 'active') === 'active' ? '사용' : '미사용' ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr><td colspan="4" class="text-center text-gray-400 py-4">등록된 코드 종류가 없습니다.</td></tr>
<?php endif; ?>
</tbody>
</table>
</section>
<p class="text-sm text-gray-600">
기본코드 종류·세부코드는 상단 메뉴 <strong class="font-medium text-gray-800">기본정보관리</strong>
<a href="<?= base_url('bag/code-kinds') ?>" class="text-blue-600 hover:underline">기본코드관리</a>에서 확인할 있습니다.
</p>
<!-- 봉투 단가 -->
<section>

View File

@@ -0,0 +1,65 @@
<?php
/** @var object $kind */
/** @var list<object> $list */
/** @var bool $canManage */
$canManage = ! empty($canManage);
?>
<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">&larr; 기본코드 종류</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-[#1c4e80] 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 overflow-auto">
<table class="data-table w-full">
<thead>
<tr>
<th class="w-16">번호</th>
<th class="w-24">코드</th>
<th>코드명</th>
<th class="w-20">정렬순서</th>
<th class="w-20">상태</th>
<th>등록일</th>
<?php if ($canManage): ?>
<th class="w-28">작업</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php foreach ($list as $row): ?>
<tr>
<td class="text-center"><?= esc((string) $row->cd_idx) ?></td>
<td class="text-center font-mono"><?= esc($row->cd_code) ?></td>
<td><?= esc($row->cd_name) ?></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 ($canManage): ?>
<td class="text-center text-sm">
<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>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php if (isset($pager) && $pager !== null): ?>
<div class="mt-3"><?= $pager->links() ?></div>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,62 @@
<?php
/** @var list<object> $codeKinds */
/** @var array<int,int> $countMap */
/** @var bool $canManage */
$canManage = ! empty($canManage);
$colCount = $canManage ? 7 : 6;
?>
<div class="space-y-4">
<section>
<div class="flex flex-wrap items-center justify-between gap-2 mb-2 border-b pb-1">
<h3 class="text-base font-bold text-gray-700">기본코드 종류</h3>
<div class="flex flex-wrap items-center gap-2 text-xs sm:text-sm">
<?php if ($canManage): ?>
<a href="<?= base_url('admin/code-kinds/create') ?>" class="inline-flex items-center rounded bg-[#1c4e80] px-3 py-1.5 text-white shadow hover:opacity-90">코드 종류 등록</a>
<?php else: ?>
<span class="text-gray-500">세부코드는 행의 링크에서 조회할 수 있습니다.</span>
<?php endif; ?>
</div>
</div>
<table class="data-table">
<thead><tr>
<th class="w-14"><?= $canManage ? 'PK' : '번호' ?></th>
<th class="w-24">코드</th>
<th>코드명</th>
<th class="w-28">세부코드</th>
<th class="w-20">상태</th>
<th class="w-40">등록일</th>
<?php if ($canManage): ?>
<th class="w-44">작업</th>
<?php endif; ?>
</tr></thead>
<tbody>
<?php if (! empty($codeKinds)): ?>
<?php $i = 0; foreach ($codeKinds as $row): $i++; ?>
<tr>
<td class="text-center"><?= $canManage ? esc((string) $row->ck_idx) : (string) $i ?></td>
<td class="text-center font-mono"><?= esc($row->ck_code) ?></td>
<td><?= esc($row->ck_name) ?></td>
<td class="text-center">
<a href="<?= base_url('bag/code-details/' . (int) $row->ck_idx) ?>" class="text-blue-600 hover:underline"><?= (int) ($countMap[$row->ck_idx] ?? 0) ?>개 보기</a>
</td>
<td class="text-center"><?= (int) ($row->ck_state ?? 0) === 1 ? '사용' : '미사용' ?></td>
<td class="text-left"><?= esc($row->ck_regdate ?? '') ?></td>
<?php if ($canManage): ?>
<td class="text-center text-sm">
<a href="<?= base_url('bag/code-details/' . (int) $row->ck_idx) ?>" class="text-green-600 hover:underline mr-1">세부코드</a>
<a href="<?= base_url('admin/code-kinds/edit/' . (int) $row->ck_idx) ?>" class="text-blue-600 hover:underline mr-1">수정</a>
<form action="<?= base_url('admin/code-kinds/delete/' . (int) $row->ck_idx) ?>" method="POST" class="inline" onsubmit="return confirm('이 코드 종류를 삭제하시겠습니까?');">
<?= csrf_field() ?>
<button type="submit" class="text-red-600 hover:underline">삭제</button>
</form>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr><td colspan="<?= (string) $colCount ?>" class="text-center text-gray-400 py-4">등록된 코드 종류가 없습니다.</td></tr>
<?php endif; ?>
</tbody>
</table>
</section>
</div>

View File

@@ -64,7 +64,7 @@ body { overflow: hidden; }
</head>
<body class="bg-gray-100 text-gray-800 flex flex-col h-screen font-sans antialiased select-none">
<!-- BEGIN: Top Navigation -->
<header class="bg-white border-b border-gray-300 h-12 flex items-center justify-between px-4 shrink-0 z-20">
<header class="relative bg-white border-b border-gray-300 h-12 flex items-center justify-between px-4 shrink-0 z-50">
<div class="flex items-center gap-4">
<div class="flex items-center gap-2">
<div class="w-6 h-6 flex items-center justify-center shrink-0">
@@ -78,20 +78,49 @@ body { overflow: hidden; }
<nav class="hidden md:flex gap-5 text-sm font-medium text-gray-600">
<?php if (! empty($siteNavTree)): ?>
<?php foreach ($siteNavTree as $navItem): ?>
<?php $isActive = ($currentPath === trim((string) $navItem->mm_link, '/')); ?>
<?php
$navLink = trim((string) $navItem->mm_link, '/');
$isActive = ($currentPath === $navLink);
if (! $isActive && ! empty($navItem->children)) {
foreach ($navItem->children as $ch) {
$childPath = trim((string) $ch->mm_link, '/');
if ($currentPath === $childPath) {
$isActive = true;
break;
}
// 기본코드 세부는 메뉴에 직접 링크 없음 → 기본코드관리(bag/code-kinds)와 동일 메뉴군으로 표시
if ($childPath === 'bag/code-kinds' && str_starts_with($currentPath, 'bag/code-details')) {
$isActive = true;
break;
}
}
}
?>
<div class="relative group">
<a class="<?= $isActive ? 'text-blue-700 font-bold border-b-2 border-blue-700 pb-3 -mb-3' : 'hover:text-blue-600' ?>"
href="<?= base_url($navItem->mm_link) ?>">
<?= esc($navItem->mm_name) ?>
</a>
<?php if (! empty($navItem->children)): ?>
<div class="absolute left-0 top-full hidden group-hover:block bg-white border border-gray-200 rounded shadow-lg min-w-[10rem] z-30">
<?php /* pt-1: 부모와 패널 사이 호버 끊김 방지. z-50: 제목 바보다 위 */ ?>
<div class="absolute left-0 top-full z-50 hidden pt-1 min-w-[12rem] group-hover:block group-focus-within:block">
<div class="bg-white border border-gray-200 rounded shadow-lg py-1">
<?php foreach ($navItem->children as $child): ?>
<a href="<?= base_url($child->mm_link) ?>"
<?php
$childLink = trim((string) ($child->mm_link ?? ''));
?>
<?php if ($childLink !== ''): ?>
<a href="<?= base_url($childLink) ?>"
class="block px-3 py-1.5 text-sm text-gray-700 hover:bg-blue-50 whitespace-nowrap">
<?= esc($child->mm_name) ?>
</a>
<?php else: ?>
<span class="block px-3 py-1.5 text-sm text-gray-400 cursor-default whitespace-nowrap" title="관리자 메뉴 관리에서 링크를 설정해 주세요">
<?= esc($child->mm_name) ?>
</span>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</div>