style: Laravel Pint 코드 포맷팅 적용

- PSR-12 스타일 가이드 준수
- 302개 파일 스타일 이슈 자동 수정
- 코드 로직 변경 없음 (포맷팅만)
This commit is contained in:
2025-11-06 17:45:49 +09:00
parent 48e76432ee
commit cc206fdbed
294 changed files with 4476 additions and 2561 deletions

View File

@@ -24,10 +24,10 @@
<a class="navbar-brand" href="?page=processes">생산관리</a>
</div>
<ul class="nav navbar-nav">
<li class="<?=($page=='processes')?'active':''?>"><a href="?page=processes">공정</a></li>
<li class="<?=($page=='tasks')?'active':''?>"><a href="?page=tasks">작업</a></li>
<li class="<?=($page=='process_settings')?'active':''?>"><a href="?page=process_settings">작업지시 설정</a></li>
<li class="<?=($page=='job_order_form')?'active':''?>"><a href="?page=job_order_form">작업지시 생성</a></li>
<li class="<?= ($page == 'processes') ? 'active' : ''?>"><a href="?page=processes">공정</a></li>
<li class="<?= ($page == 'tasks') ? 'active' : ''?>"><a href="?page=tasks">작업</a></li>
<li class="<?= ($page == 'process_settings') ? 'active' : ''?>"><a href="?page=process_settings">작업지시 설정</a></li>
<li class="<?= ($page == 'job_order_form') ? 'active' : ''?>"><a href="?page=job_order_form">작업지시 생성</a></li>
</ul>
</div>
</nav>

View File

@@ -1,4 +1,5 @@
<?php
session_start();
header('Content-Type: application/json');
@@ -8,7 +9,7 @@
$password = isset($_POST['password']) ? $_POST['password'] : '';
// 데모이므로 비밀번호 검증은 생략
if (!$userid) {
if (! $userid) {
echo json_encode(['success' => false, 'message' => '아이디를 입력하세요.']);
exit;
}
@@ -21,4 +22,3 @@
echo json_encode(['success' => true]);
exit;
?>

View File

@@ -1,4 +1,5 @@
<?php
session_start();
// POST 데이터 받기
@@ -8,7 +9,7 @@
$password2 = isset($_POST['password2']) ? $_POST['password2'] : '';
// 기본 밸리데이션
if (!$userid || !$username || !$password || !$password2) {
if (! $userid || ! $username || ! $password || ! $password2) {
echo "<script>alert('모든 항목을 입력하세요.'); history.back();</script>";
exit;
}
@@ -23,5 +24,5 @@
$_SESSION['user_id'] = 'user';
// 가입 성공 → 대시보드 이동
header("Location: /tenant/member/dashboard.php");
header('Location: /tenant/member/dashboard.php');
exit;

View File

@@ -1,4 +1,5 @@
<?php $CURRENT_SECTION='approval'; include '../inc/header.php'; ?>
<?php $CURRENT_SECTION = 'approval';
include '../inc/header.php'; ?>
<div class="container" style="max-width:1280px; margin-top:24px;">
<div class="card shadow-sm">
<div class="card-header d-flex gap-2 align-items-center">

View File

@@ -1,4 +1,5 @@
<?php $CURRENT_SECTION='approval'; include '../inc/header.php'; ?>
<?php $CURRENT_SECTION = 'approval';
include '../inc/header.php'; ?>
<div class="container" style="max-width:1280px; margin-top:24px;">
<div class="card shadow-sm">
<div class="card-header d-flex justify-content-between align-items-center">

View File

@@ -1,4 +1,5 @@
<?php $CURRENT_SECTION='approval'; include '../inc/header.php';
<?php $CURRENT_SECTION = 'approval';
include '../inc/header.php';
$object = $_GET['object'] ?? 'LEAVE';
?>
<div class="container" style="max-width:1280px; margin-top:24px;">
@@ -6,7 +7,7 @@
<div class="col-md-4">
<div class="card shadow-sm">
<div class="card-header d-flex justify-content-between align-items-center">
<strong>결재 규칙 (<?=$object?>)</strong>
<strong>결재 규칙 (<?= $object?>)</strong>
<button class="btn btn-sm btn-primary" id="btnAddRule">추가</button>
</div>
<div class="card-body">
@@ -130,7 +131,7 @@
});
$('#btnAddRule').on('click', function(){
alert('규칙 추가(샘플) /api/approval/rule_add.php?object=<?=$object?>');
alert('규칙 추가(샘플) /api/approval/rule_add.php?object=<?= $object?>');
});
// 규칙 선택

View File

@@ -1,3 +1,3 @@
<?php
@session_start();
?>

View File

@@ -2,110 +2,110 @@
// 섹션-서브메뉴 정의 (링크는 네가 쓰는 경로에 맞춰두었어)
$NAV = [
'item' => [
'title'=>'품목',
'items'=>[
['라벨'=>'품목관리','href'=>'/tenant/material/list.php'],
['라벨'=>'BOM 단품(기초 바람시)','href'=>'/tenant/product//bending.php'],
['라벨'=>'BOM 결합 상품','href'=>'/tenant/product/bom_combined.php'],
['라벨'=>'제품 단가','href'=>'/tenant/product/product_price.php'],
['라벨'=>'코드 및 로트 관리','href'=>'/tenant/product/code_lot.php'],
'title' => '품목',
'items' => [
['라벨' => '품목관리', 'href' => '/tenant/material/list.php'],
['라벨' => 'BOM 단품(기초 바람시)', 'href' => '/tenant/product//bending.php'],
['라벨' => 'BOM 결합 상품', 'href' => '/tenant/product/bom_combined.php'],
['라벨' => '제품 단가', 'href' => '/tenant/product/product_price.php'],
['라벨' => '코드 및 로트 관리', 'href' => '/tenant/product/code_lot.php'],
],
],
'order' => [
'title'=>'수주',
'items'=>[
['라벨'=>'견적 관리','href'=>'/tenant/order/estimate.php'],
['라벨'=>'수주 관리','href'=>'/tenant/order/manage.php'],
['라벨'=>'수주 등록/수정','href'=>'/tenant/order/edit.php'],
['라벨'=>'상태 관리','href'=>'/tenant/order/status.php'],
'title' => '수주',
'items' => [
['라벨' => '견적 관리', 'href' => '/tenant/order/estimate.php'],
['라벨' => '수주 관리', 'href' => '/tenant/order/manage.php'],
['라벨' => '수주 등록/수정', 'href' => '/tenant/order/edit.php'],
['라벨' => '상태 관리', 'href' => '/tenant/order/status.php'],
],
],
'process' => [
'title'=>'생산',
'items'=>[
['라벨'=>'공정관리','href'=>'/tenant/process/processes.php'],
['라벨'=>'작업관리','href'=>'/tenant/process/tasks.php'],
['라벨'=>'작업지시 설정','href'=>'/tenant/process/process_settings.php'],
['라벨'=>'스크린 작업','href'=>'/tenant/production/screen_work.php'],
['라벨'=>'슬랫 작업','href'=>'/tenant/production/screen_work.php'],
['라벨'=>'절곡 작업','href'=>'/tenant/production/screen_work.php'],
'title' => '생산',
'items' => [
['라벨' => '공정관리', 'href' => '/tenant/process/processes.php'],
['라벨' => '작업관리', 'href' => '/tenant/process/tasks.php'],
['라벨' => '작업지시 설정', 'href' => '/tenant/process/process_settings.php'],
['라벨' => '스크린 작업', 'href' => '/tenant/production/screen_work.php'],
['라벨' => '슬랫 작업', 'href' => '/tenant/production/screen_work.php'],
['라벨' => '절곡 작업', 'href' => '/tenant/production/screen_work.php'],
],
],
'shipment' => [
'title'=>'출고',
'items'=>[
['라벨'=>'출고 현황 조회','href'=>'/tenant/shipment/status.php'],
['라벨'=>'월간 출고 일정','href'=>'/tenant/shipment/monthly_schedule.php'],
'title' => '출고',
'items' => [
['라벨' => '출고 현황 조회', 'href' => '/tenant/shipment/status.php'],
['라벨' => '월간 출고 일정', 'href' => '/tenant/shipment/monthly_schedule.php'],
],
],
'quality' => [
'title'=>'품질',
'items'=>[
['라벨'=>'제품 검사 요청','href'=>'/tenant/quality/request.php'],
['라벨'=>'제품 검사 일정','href'=>'/tenant/quality/schedule.php'],
['라벨'=>'품질 인정 실적 대장','href'=>'/tenant/quality/record.php'],
['라벨'=>'인정서류 자료실','href'=>'/tenant/quality/docs.php'],
'title' => '품질',
'items' => [
['라벨' => '제품 검사 요청', 'href' => '/tenant/quality/request.php'],
['라벨' => '제품 검사 일정', 'href' => '/tenant/quality/schedule.php'],
['라벨' => '품질 인정 실적 대장', 'href' => '/tenant/quality/record.php'],
['라벨' => '인정서류 자료실', 'href' => '/tenant/quality/docs.php'],
],
],
'inventory' => [
'title'=>'재고',
'items'=>[
['라벨'=>'재고 조회','href'=>'/tenant/inventory/stock.php'],
['라벨'=>'수입 검사 대장','href'=>'/tenant/material/inspection_list.php'],
['라벨'=>'입고 현황','href'=>'/tenant/material/inventory_status.php'],
['라벨'=>'부적합품 관리','href'=>'/tenant/inventory/defective.php'],
'title' => '재고',
'items' => [
['라벨' => '재고 조회', 'href' => '/tenant/inventory/stock.php'],
['라벨' => '수입 검사 대장', 'href' => '/tenant/material/inspection_list.php'],
['라벨' => '입고 현황', 'href' => '/tenant/material/inventory_status.php'],
['라벨' => '부적합품 관리', 'href' => '/tenant/inventory/defective.php'],
],
],
'subscription' => [
'title'=>'구독',
'items'=>[
['라벨'=>'구독 하기','href'=>'/tenant/tenant/subscribe.php'],
['라벨'=>'구독 관리','href'=>'/tenant/subscription/list.php'],
['라벨'=>'회사 조회','href'=>'/tenant/subscription/tenant_list.php'],
['라벨'=>'상품별 회사 리스트','href'=>'/tenant/subscription/tenant_product_list.php'],
'title' => '구독',
'items' => [
['라벨' => '구독 하기', 'href' => '/tenant/tenant/subscribe.php'],
['라벨' => '구독 관리', 'href' => '/tenant/subscription/list.php'],
['라벨' => '회사 조회', 'href' => '/tenant/subscription/tenant_list.php'],
['라벨' => '상품별 회사 리스트', 'href' => '/tenant/subscription/tenant_product_list.php'],
],
],
'member' => [
'title' => '회원',
'items' => [
['라벨'=>'가입','href'=>'/tenant/member/register.php'],
['라벨'=>'회사 선택','href'=>'/tenant/member/tenant_select.php'],
['라벨'=>'내정보 수정','href'=>'/tenant/member/profile_edit.php'],
['라벨'=>'탈퇴','href'=>'/tenant/member/withdraw.php'],
['라벨'=>'회원가입 컬럼설정','href'=>'/tenant/settings/member_fields.php'],
['라벨' => '가입', 'href' => '/tenant/member/register.php'],
['라벨' => '회사 선택', 'href' => '/tenant/member/tenant_select.php'],
['라벨' => '내정보 수정', 'href' => '/tenant/member/profile_edit.php'],
['라벨' => '탈퇴', 'href' => '/tenant/member/withdraw.php'],
['라벨' => '회원가입 컬럼설정', 'href' => '/tenant/settings/member_fields.php'],
],
],
'permission' => [
'title'=>'메뉴/권한',
'items'=>[
['라벨'=>'메뉴 관리','href'=>'/tenant/permission/tenant_menu.php'],
['라벨'=>'부서 권한 설정','href'=>'/tenant/permission/department.php'],
['라벨'=>'역할 권한 설정','href'=>'/tenant/permission/role.php'],
['라벨'=>'유저 권한 설정','href'=>'/tenant/permission/user.php'],
['라벨'=>'권한 분석','href'=>'/tenant/permission/analyze.php'],
'title' => '메뉴/권한',
'items' => [
['라벨' => '메뉴 관리', 'href' => '/tenant/permission/tenant_menu.php'],
['라벨' => '부서 권한 설정', 'href' => '/tenant/permission/department.php'],
['라벨' => '역할 권한 설정', 'href' => '/tenant/permission/role.php'],
['라벨' => '유저 권한 설정', 'href' => '/tenant/permission/user.php'],
['라벨' => '권한 분석', 'href' => '/tenant/permission/analyze.php'],
],
],
'approval' => [
'title'=>'결재(승인)',
'items'=>[
['라벨'=>'결재 대상 관리','href'=>'/tenant/approval/objects.php'],
['라벨'=>'결재 규칙/결재선 관리','href'=>'/tenant/approval/rules.php'],
['라벨'=>'결재권자 관리','href'=>'/tenant/approval/pool.php'],
['라벨'=>'결재 현황 조회','href'=>'/tenant/approval/instances.php'],
'title' => '결재(승인)',
'items' => [
['라벨' => '결재 대상 관리', 'href' => '/tenant/approval/objects.php'],
['라벨' => '결재 규칙/결재선 관리', 'href' => '/tenant/approval/rules.php'],
['라벨' => '결재권자 관리', 'href' => '/tenant/approval/pool.php'],
['라벨' => '결재 현황 조회', 'href' => '/tenant/approval/instances.php'],
],
],
'tenant' => [
'title'=>'회사',
'items'=>[
['라벨'=>'회사 가입','href'=>'/tenant/tenant/join.php'],
['라벨'=>'수정','href'=>'/tenant/tenant/edit.php'],
['라벨'=>'탈퇴','href'=>'/tenant/tenant/withdraw.php'],
['라벨'=>'카테고리 관리','href'=>'/tenant/category/category_list.php'],
['라벨'=>'분류 관리','href'=>'/tenant/category/subcategory_list.php'],
['라벨'=>'부서 관리','href'=>'/tenant/tenant/department_list.php'],
['라벨'=>'역할 관리','href'=>'/tenant/tenant/role_list.php'],
['라벨'=>'유저 관리','href'=>'/tenant/tenant/user_list.php'],
['라벨'=>'옵션 관리','href'=>'/tenant/tenant/option.php'],
'title' => '회사',
'items' => [
['라벨' => '회사 가입', 'href' => '/tenant/tenant/join.php'],
['라벨' => '수정', 'href' => '/tenant/tenant/edit.php'],
['라벨' => '탈퇴', 'href' => '/tenant/tenant/withdraw.php'],
['라벨' => '카테고리 관리', 'href' => '/tenant/category/category_list.php'],
['라벨' => '분류 관리', 'href' => '/tenant/category/subcategory_list.php'],
['라벨' => '부서 관리', 'href' => '/tenant/tenant/department_list.php'],
['라벨' => '역할 관리', 'href' => '/tenant/tenant/role_list.php'],
['라벨' => '유저 관리', 'href' => '/tenant/tenant/user_list.php'],
['라벨' => '옵션 관리', 'href' => '/tenant/tenant/option.php'],
],
],
];
@@ -114,14 +114,14 @@
$NAV_ROOT = [
'title' => '기본',
'items' => [
['라벨'=>'인트로','href'=>'/tenant/member/intro.php'],
['라벨'=>'대시보드','href'=>'/tenant/member/dashboard.php'],
['라벨' => '인트로', 'href' => '/tenant/member/intro.php'],
['라벨' => '대시보드', 'href' => '/tenant/member/dashboard.php'],
],
];
// ③ 현재 경로/섹션 파악
$currentPath = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$hasSection = isset($CURRENT_SECTION, $NAV[$CURRENT_SECTION]);
$currentPath = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$hasSection = isset($CURRENT_SECTION, $NAV[$CURRENT_SECTION]);
// ④ JS/초기 렌더에 사용할 "초기 섹션" (없으면 root 사용)
$INITIAL_SECTION = $hasSection ? $CURRENT_SECTION : 'root';
@@ -144,7 +144,7 @@
<div class="collapse navbar-collapse" id="mainNav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<?php foreach ($NAV as $key => $conf): // root는 1뎁스에 출력하지 않음 ?>
<?php foreach ($NAV as $key => $conf) { // root는 1뎁스에 출력하지 않음?>
<li class="nav-item">
<a href="#"
class="nav-link top-link <?= ($hasSection && $CURRENT_SECTION === $key) ? 'active' : '' ?>"
@@ -152,7 +152,7 @@ class="nav-link top-link <?= ($hasSection && $CURRENT_SECTION === $key) ? 'activ
<?= htmlspecialchars($conf['title']) ?>
</a>
</li>
<?php endforeach; ?>
<?php } ?>
</ul>
<!-- 우측 로그인/로그아웃 영역은 그대로 -->
</div>
@@ -165,11 +165,11 @@ class="nav-link top-link <?= ($hasSection && $CURRENT_SECTION === $key) ? 'activ
<ul id="subnav" class="subnav list-unstyled d-flex flex-wrap gap-3 m-0 py-2">
<?php
$INIT_ITEMS = ($INITIAL_SECTION === 'root') ? $NAV_ROOT['items'] : $NAV[$INITIAL_SECTION]['items'];
foreach ($INIT_ITEMS as $item):
$activeClass = ($currentPath === $item['href']) ? 'active' : '';
?>
foreach ($INIT_ITEMS as $item) {
$activeClass = ($currentPath === $item['href']) ? 'active' : '';
?>
<li><a class="subnav-link <?= $activeClass ?>" href="<?= $item['href'] ?>"><?= htmlspecialchars($item['라벨']) ?></a></li>
<?php endforeach; ?>
<?php } ?>
</ul>
</div>
</div>
@@ -187,7 +187,7 @@ class="nav-link top-link <?= ($hasSection && $CURRENT_SECTION === $key) ? 'activ
<script>
$(function(){
const NAV = <?= json_encode($NAV_JS, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES) ?>;
const NAV = <?= json_encode($NAV_JS, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?>;
const INITIAL_SECTION = '<?= $INITIAL_SECTION ?>'; // 'root' 또는 실제 섹션 키
const $subnav = $('#subnav');

View File

@@ -1,13 +1,13 @@
<?php
session_start();
if (!isset($_SESSION['user_id'])) {
if (! isset($_SESSION['user_id'])) {
// 로그인 안 한 경우 로그인 페이지로
header("Location: ./member/intro.php");
header('Location: ./member/intro.php');
exit;
} else {
// 로그인 한 경우 대시보드로
header("Location: ./member/dashboard.php");
header('Location: ./member/dashboard.php');
exit;
}
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='inventory';
$CURRENT_SECTION = 'inventory';
include '../inc/header.php';
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='inventory';
$CURRENT_SECTION = 'inventory';
include '../inc/header.php';
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='inventory';
$CURRENT_SECTION = 'inventory';
include '../inc/header.php';
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='inventory';
$CURRENT_SECTION = 'inventory';
include '../inc/header.php';
?>

View File

@@ -1,6 +1,6 @@
<?php
// 자재관리 > 리스트
$CURRENT_SECTION='item';;
$CURRENT_SECTION = 'item';
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:24px;">

View File

@@ -1,9 +1,9 @@
<?php
session_start();
session_unset(); // 모든 세션 변수 해제
session_destroy(); // 세션 파기
// 로그인 페이지로 이동 (필요시 경로 수정)
header("Location: /tenant/member/intro.php");
header('Location: /tenant/member/intro.php');
exit;
?>

View File

@@ -14,11 +14,11 @@
<div class="mb-3">
<label class="form-label">아이디</label>
<input type="text" class="form-control" name="userid" value="<?=htmlspecialchars($userid)?>" readonly>
<input type="text" class="form-control" name="userid" value="<?= htmlspecialchars($userid)?>" readonly>
</div>
<div class="mb-3">
<label for="username" class="form-label">이름</label>
<input type="text" class="form-control" id="username" name="username" value="<?=htmlspecialchars($username)?>" required>
<input type="text" class="form-control" id="username" name="username" value="<?= htmlspecialchars($username)?>" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">새 비밀번호</label>

View File

@@ -1,10 +1,11 @@
<?php
include '../inc/config.php';
// 새 테넌트(회사명) 입력값 확인
$new_tenant_name = isset($_POST['new_tenant_name']) ? trim($_POST['new_tenant_name']) : '';
if (!$new_tenant_name) {
if (! $new_tenant_name) {
echo "<script>alert('회사명을 입력하세요.'); history.back();</script>";
exit;
}
@@ -17,6 +18,5 @@
$_SESSION['tenant_name'] = $new_tenant_name;
// 대시보드로 이동
header("Location: /tenant/member/dashboard.php");
header('Location: /tenant/member/dashboard.php');
exit;
?>

View File

@@ -9,7 +9,6 @@
['id' => 103, 'name' => '네이버'],
];
?>
<div class="container" style="max-width:500px; margin-top:40px;">
@@ -20,9 +19,9 @@
<label for="tenant_id" class="form-label">기존 테넌트 선택</label>
<select class="form-select" id="tenant_id" name="tenant_id" required>
<option value="">테넌트 선택...</option>
<?php foreach($sample_tenants as $tenant): ?>
<option value="<?=$tenant['id']?>"><?=$tenant['name']?></option>
<?php endforeach; ?>
<?php foreach ($sample_tenants as $tenant) { ?>
<option value="<?= $tenant['id']?>"><?= $tenant['name']?></option>
<?php } ?>
</select>
</div>
<button type="submit" class="btn btn-primary w-100 mb-3">선택</button>

View File

@@ -1,10 +1,11 @@
<?php
include '../inc/config.php';
// POST로 받은 테넌트 ID 확인
$tenant_id = isset($_POST['tenant_id']) ? intval($_POST['tenant_id']) : 0;
if (!$tenant_id) {
if (! $tenant_id) {
echo "<script>alert('테넌트를 선택하세요.'); history.back();</script>";
exit;
}
@@ -13,6 +14,5 @@
$_SESSION['tenant_id'] = $tenant_id;
// 대시보드로 이동
header("Location: /tenant/member/dashboard.php");
header('Location: /tenant/member/dashboard.php');
exit;
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='order';
$CURRENT_SECTION = 'order';
include '../inc/header.php';
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='order';
$CURRENT_SECTION = 'order';
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:18px;">

View File

@@ -1,6 +1,6 @@
<!-- SAM RULES: include=../inc/header.php; base=/tenant; width=1280; js=jQuery+BS5 -->
<?php
$CURRENT_SECTION='order';
$CURRENT_SECTION = 'order';
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:18px;">

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='order';
$CURRENT_SECTION = 'order';
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:18px;">

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='order';
$CURRENT_SECTION = 'order';
include '../inc/header.php';
?>

View File

@@ -1,6 +1,6 @@
<?php
// 권한 분석 — 선택한 메뉴/액션 기준으로 효과권한(EFFECTIVE) 분석
$CURRENT_SECTION='permission';
$CURRENT_SECTION = 'permission';
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:24px;">

View File

@@ -1,4 +1,5 @@
<?php $CURRENT_SECTION='permission'; include '../inc/header.php'; ?>
<?php $CURRENT_SECTION = 'permission';
include '../inc/header.php'; ?>
<div class="container" style="max-width:1100px; margin-top:24px;">
<div class="card shadow-sm">

View File

@@ -1,4 +1,5 @@
<?php $CURRENT_SECTION='permission'; include '../inc/header.php'; ?>
<?php $CURRENT_SECTION = 'permission';
include '../inc/header.php'; ?>
<div class="container" style="max-width:1100px; margin-top:24px;">
<div class="card shadow-sm">

View File

@@ -1,6 +1,6 @@
<?php
// 부서 권한 설정 (트리형) — 메뉴관리에서 활성화된 메뉴만 대상
$CURRENT_SECTION='permission';
$CURRENT_SECTION = 'permission';
include '../inc/header.php';
?>

View File

@@ -1,6 +1,6 @@
<?php
// 역할 권한 설정 (트리형)
$CURRENT_SECTION='permission';
$CURRENT_SECTION = 'permission';
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:24px;">

View File

@@ -1,4 +1,5 @@
<?php $CURRENT_SECTION='permission'; include '../inc/header.php'; ?>
<?php $CURRENT_SECTION = 'permission';
include '../inc/header.php'; ?>
<div class="container" style="max-width:1280px; margin-top:24px;">
<div class="row g-3">

View File

@@ -1,4 +1,5 @@
<?php $CURRENT_SECTION='permission'; include '../inc/header.php'; ?>
<?php $CURRENT_SECTION = 'permission';
include '../inc/header.php'; ?>
<div class="container" style="max-width:1280px; margin-top:24px;">

View File

@@ -1,6 +1,6 @@
<?php
// 유저 권한 설정 (트리형 + 개인 예외 모드)
$CURRENT_SECTION='permission';
$CURRENT_SECTION = 'permission';
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:24px;">

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='item';
$CURRENT_SECTION = 'item';
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:24px;">

View File

@@ -1,9 +1,9 @@
<!-- SAM RULES: include=../inc/header.php; base=/tenant; width=1280; js=jQuery+BS5 -->
<?php
// BOM 템플릿 편집기
$CURRENT_SECTION='item';
$CURRENT_SECTION = 'item';
include '../inc/header.php';
$modelId = isset($_GET['model_id']) ? (int)$_GET['model_id'] : 0;
$modelId = isset($_GET['model_id']) ? (int) $_GET['model_id'] : 0;
?>
<div class="container" style="max-width:1280px; margin-top:24px;">
<div class="d-flex justify-content-between align-items-center mb-3">

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='item';
$CURRENT_SECTION = 'item';
include '../inc/header.php';
?>

View File

@@ -1,6 +1,6 @@
<?php
$CURRENT_SECTION='item'; // 상단 네비 하이라이트 용도
include '../inc/header.php';
$CURRENT_SECTION = 'item'; // 상단 네비 하이라이트 용도
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:24px;">

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='item';
$CURRENT_SECTION = 'item';
include '../inc/header.php';
?>

View File

@@ -1,6 +1,6 @@
<?php
// 모델관리
$CURRENT_SECTION='item';
$CURRENT_SECTION = 'item';
include '../inc/header.php';
?>
<!--

View File

@@ -1,6 +1,6 @@
<?php
// 모델관리
$CURRENT_SECTION='item';
$CURRENT_SECTION = 'item';
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:24px;">

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='item';
$CURRENT_SECTION = 'item';
include '../inc/header.php';
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='process';
$CURRENT_SECTION = 'process';
include '../inc/header.php';
?>

View File

@@ -50,7 +50,7 @@
</tr>
</thead>
<tbody id="miTbody">
<?php foreach($rows as $i=>$r): ?>
<?php foreach ($rows as $i => $r) { ?>
<tr data-idx="<?= $i ?>">
<td><?= htmlspecialchars($r['id'] ?? '') ?></td>
<td><?= htmlspecialchars($r['rawl ot'] ?? $r['rawlot'] ?? '') ?></td>
@@ -70,7 +70,7 @@
</div>
</td>
</tr>
<?php endforeach; ?>
<?php } ?>
</tbody>
</table>
</div>

View File

@@ -1,8 +1,8 @@
<!-- SAM RULES: include=../inc/header.php; base=/tenant; width=1280; js=jQuery+BS5 -->
<?php
// 모달 내부 Ajax 본문 조각 (header/footer 없음)
$jobId = $_POST['job_id'] ?? ($_GET['job_id'] ?? '');
$cust = $_POST['cust'] ?? ($_GET['cust'] ?? '');
$jobId = $_POST['job_id'] ?? ($_GET['job_id'] ?? '');
$cust = $_POST['cust'] ?? ($_GET['cust'] ?? '');
$orderNo = $_POST['order_no'] ?? ($_GET['order_no'] ?? '');
?>
<div class="p-3">

View File

@@ -1,6 +1,6 @@
<!-- SAM RULES: include=../inc/header.php; base=/tenant; width=1280; js=jQuery+BS5 -->
<?php
$CURRENT_SECTION='process';
$CURRENT_SECTION = 'process';
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:18px;">

View File

@@ -1,6 +1,6 @@
<!-- SAM RULES: include=../inc/header.php; base=/tenant; width=1280; js=jQuery+BS5 -->
<?php
$CURRENT_SECTION='process';
$CURRENT_SECTION = 'process';
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:18px;">

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='process';
$CURRENT_SECTION = 'process';
include '../inc/header.php';
?>

View File

@@ -1,8 +1,8 @@
<?php
// SAM MODAL BODY (NO header/footer)
// Params: job_id, cust, order_no (POST/GET)
$jobId = $_POST['job_id'] ?? ($_GET['job_id'] ?? '');
$cust = $_POST['cust'] ?? ($_GET['cust'] ?? '');
$jobId = $_POST['job_id'] ?? ($_GET['job_id'] ?? '');
$cust = $_POST['cust'] ?? ($_GET['cust'] ?? '');
$orderNo = $_POST['order_no'] ?? ($_GET['order_no'] ?? '');
?>
<div class="p-3">
@@ -56,7 +56,9 @@
<div class="col-5 text-end small text-muted">설정순위</div>
<div class="col-7">
<select class="form-select form-select-sm" id="setPriority">
<?php for($i=1;$i<=10;$i++) echo "<option>$i</option>"; ?>
<?php for ($i = 1; $i <= 10; $i++) {
echo "<option>$i</option>";
} ?>
</select>
</div>
</div>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='quality';
$CURRENT_SECTION = 'quality';
include '../inc/header.php';
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='quality';
$CURRENT_SECTION = 'quality';
include '../inc/header.php';
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='quality';
$CURRENT_SECTION = 'quality';
include '../inc/header.php';
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='quality';
$CURRENT_SECTION = 'quality';
include '../inc/header.php';
?>

View File

@@ -7,67 +7,71 @@
// ====== 샘플 데이터 (실구현은 DB 조인) ======
// setting_field_defs
$FIELD_DEFS = [
['field_key'=>'name','label'=>'이름','data_type'=>'string','input_type'=>'text','option_source'=>null],
['field_key'=>'email','label'=>'이메일','data_type'=>'string','input_type'=>'text','option_source'=>null],
['field_key'=>'phone','label'=>'전화번호','data_type'=>'string','input_type'=>'text','option_source'=>null],
['field_key'=>'department','label'=>'부서','data_type'=>'string','input_type'=>'select','option_source'=>'tenant_list'],
['field_key'=>'position','label'=>'직급','data_type'=>'string','input_type'=>'select','option_source'=>'tenant_list'],
['field_key'=>'job_title','label'=>'직책','data_type'=>'string','input_type'=>'select','option_source'=>'tenant_list'],
['field_key'=>'manager_id','label'=>'직속 상급자','data_type'=>'bigint','input_type'=>'select_user','option_source'=>null],
['field_key'=>'hire_date','label'=>'입사일','data_type'=>'date','input_type'=>'date','option_source'=>null],
['field_key'=>'employment_type','label'=>'고용형태','data_type'=>'string','input_type'=>'select','option_source'=>'tenant_list'],
['field_key'=>'work_location','label'=>'근무지','data_type'=>'string','input_type'=>'select','option_source'=>'tenant_list'],
['field_key'=>'work_type','label'=>'근무형태','data_type'=>'string','input_type'=>'select','option_source'=>'tenant_list'],
['field_key'=>'gender','label'=>'성별','data_type'=>'string','input_type'=>'select','option_source'=>'tenant_list'],
['field_key'=>'bank_name','label'=>'은행','data_type'=>'string','input_type'=>'select','option_source'=>'tenant_list'],
['field_key'=>'bank_account','label'=>'계좌번호','data_type'=>'string','input_type'=>'text','option_source'=>null],
['field_key'=>'employee_no','label'=>'사번','data_type'=>'string','input_type'=>'text','option_source'=>null],
['field_key'=>'profile_photo','label'=>'프로필 사진','data_type'=>'file','input_type'=>'file','option_source'=>null],
['field_key' => 'name', 'label' => '이름', 'data_type' => 'string', 'input_type' => 'text', 'option_source' => null],
['field_key' => 'email', 'label' => '이메일', 'data_type' => 'string', 'input_type' => 'text', 'option_source' => null],
['field_key' => 'phone', 'label' => '전화번호', 'data_type' => 'string', 'input_type' => 'text', 'option_source' => null],
['field_key' => 'department', 'label' => '부서', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'],
['field_key' => 'position', 'label' => '직급', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'],
['field_key' => 'job_title', 'label' => '직책', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'],
['field_key' => 'manager_id', 'label' => '직속 상급자', 'data_type' => 'bigint', 'input_type' => 'select_user', 'option_source' => null],
['field_key' => 'hire_date', 'label' => '입사일', 'data_type' => 'date', 'input_type' => 'date', 'option_source' => null],
['field_key' => 'employment_type', 'label' => '고용형태', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'],
['field_key' => 'work_location', 'label' => '근무지', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'],
['field_key' => 'work_type', 'label' => '근무형태', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'],
['field_key' => 'gender', 'label' => '성별', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'],
['field_key' => 'bank_name', 'label' => '은행', 'data_type' => 'string', 'input_type' => 'select', 'option_source' => 'tenant_list'],
['field_key' => 'bank_account', 'label' => '계좌번호', 'data_type' => 'string', 'input_type' => 'text', 'option_source' => null],
['field_key' => 'employee_no', 'label' => '사번', 'data_type' => 'string', 'input_type' => 'text', 'option_source' => null],
['field_key' => 'profile_photo', 'label' => '프로필 사진', 'data_type' => 'file', 'input_type' => 'file', 'option_source' => null],
];
// tenant_option_groups (id, name) — select 항목에서 선택할 그룹
$OPTION_GROUPS = [
['id'=>101,'group_key'=>'department','name'=>'부서 그룹'],
['id'=>102,'group_key'=>'position','name'=>'직급 그룹'],
['id'=>103,'group_key'=>'job_title','name'=>'직책 그룹'],
['id'=>104,'group_key'=>'employment_type','name'=>'고용형태 그룹'],
['id'=>105,'group_key'=>'work_location','name'=>'근무지 그룹'],
['id'=>106,'group_key'=>'work_type','name'=>'근무형태 그룹'],
['id'=>107,'group_key'=>'gender','name'=>'성별 그룹'],
['id'=>108,'group_key'=>'bank_name','name'=>'은행 그룹'],
['id' => 101, 'group_key' => 'department', 'name' => '부서 그룹'],
['id' => 102, 'group_key' => 'position', 'name' => '직급 그룹'],
['id' => 103, 'group_key' => 'job_title', 'name' => '직책 그룹'],
['id' => 104, 'group_key' => 'employment_type', 'name' => '고용형태 그룹'],
['id' => 105, 'group_key' => 'work_location', 'name' => '근무지 그룹'],
['id' => 106, 'group_key' => 'work_type', 'name' => '근무형태 그룹'],
['id' => 107, 'group_key' => 'gender', 'name' => '성별 그룹'],
['id' => 108, 'group_key' => 'bank_name', 'name' => '은행 그룹'],
];
// tenant_field_settings (샘플: enabled/required/sort/order/group)
// key = field_key
$SETTINGS = [
'name' => ['enabled'=>1,'required'=>1,'sort_order'=>10,'option_group_id'=>null],
'email' => ['enabled'=>1,'required'=>1,'sort_order'=>20,'option_group_id'=>null],
'phone' => ['enabled'=>1,'required'=>0,'sort_order'=>30,'option_group_id'=>null],
'department' => ['enabled'=>1,'required'=>1,'sort_order'=>40,'option_group_id'=>101],
'position' => ['enabled'=>1,'required'=>0,'sort_order'=>50,'option_group_id'=>102],
'job_title' => ['enabled'=>0,'required'=>0,'sort_order'=>60,'option_group_id'=>103],
'manager_id' => ['enabled'=>0,'required'=>0,'sort_order'=>70,'option_group_id'=>null],
'hire_date' => ['enabled'=>1,'required'=>0,'sort_order'=>80,'option_group_id'=>null],
'employment_type' => ['enabled'=>1,'required'=>0,'sort_order'=>90,'option_group_id'=>104],
'work_location' => ['enabled'=>1,'required'=>0,'sort_order'=>100,'option_group_id'=>105],
'work_type' => ['enabled'=>0,'required'=>0,'sort_order'=>110,'option_group_id'=>106],
'gender' => ['enabled'=>0,'required'=>0,'sort_order'=>120,'option_group_id'=>107],
'bank_name' => ['enabled'=>0,'required'=>0,'sort_order'=>130,'option_group_id'=>108],
'bank_account' => ['enabled'=>0,'required'=>0,'sort_order'=>140,'option_group_id'=>null],
'employee_no' => ['enabled'=>1,'required'=>0,'sort_order'=>150,'option_group_id'=>null],
'profile_photo' => ['enabled'=>0,'required'=>0,'sort_order'=>160,'option_group_id'=>null],
'name' => ['enabled' => 1, 'required' => 1, 'sort_order' => 10, 'option_group_id' => null],
'email' => ['enabled' => 1, 'required' => 1, 'sort_order' => 20, 'option_group_id' => null],
'phone' => ['enabled' => 1, 'required' => 0, 'sort_order' => 30, 'option_group_id' => null],
'department' => ['enabled' => 1, 'required' => 1, 'sort_order' => 40, 'option_group_id' => 101],
'position' => ['enabled' => 1, 'required' => 0, 'sort_order' => 50, 'option_group_id' => 102],
'job_title' => ['enabled' => 0, 'required' => 0, 'sort_order' => 60, 'option_group_id' => 103],
'manager_id' => ['enabled' => 0, 'required' => 0, 'sort_order' => 70, 'option_group_id' => null],
'hire_date' => ['enabled' => 1, 'required' => 0, 'sort_order' => 80, 'option_group_id' => null],
'employment_type' => ['enabled' => 1, 'required' => 0, 'sort_order' => 90, 'option_group_id' => 104],
'work_location' => ['enabled' => 1, 'required' => 0, 'sort_order' => 100, 'option_group_id' => 105],
'work_type' => ['enabled' => 0, 'required' => 0, 'sort_order' => 110, 'option_group_id' => 106],
'gender' => ['enabled' => 0, 'required' => 0, 'sort_order' => 120, 'option_group_id' => 107],
'bank_name' => ['enabled' => 0, 'required' => 0, 'sort_order' => 130, 'option_group_id' => 108],
'bank_account' => ['enabled' => 0, 'required' => 0, 'sort_order' => 140, 'option_group_id' => null],
'employee_no' => ['enabled' => 1, 'required' => 0, 'sort_order' => 150, 'option_group_id' => null],
'profile_photo' => ['enabled' => 0, 'required' => 0, 'sort_order' => 160, 'option_group_id' => null],
];
// helper: 옵션그룹 셀렉트 HTML
function render_group_select($field_key,$sel,$groups,$def){
if (!($def['input_type']==='select' && $def['option_source']==='tenant_list')) return '<span class="text-muted">—</span>';
function render_group_select($field_key, $sel, $groups, $def)
{
if (! ($def['input_type'] === 'select' && $def['option_source'] === 'tenant_list')) {
return '<span class="text-muted">—</span>';
}
$html = '<select class="form-select form-select-sm opt-group" data-field="'.$field_key.'" style="min-width:160px;">';
$html .= '<option value="">(그룹 선택)</option>';
foreach($groups as $g){
$s = ($sel==$g['id'])?'selected':'';
foreach ($groups as $g) {
$s = ($sel == $g['id']) ? 'selected' : '';
$html .= '<option value="'.$g['id'].'" '.$s.'>'.htmlspecialchars($g['name']).'</option>';
}
$html .= '</select>';
return $html;
}
@@ -75,22 +79,28 @@ function render_group_select($field_key,$sel,$groups,$def){
function group_name_by_id($id, $groups)
{
foreach ($groups as $g) {
if ((string)$g['id'] === (string)$id) return $g['name'];
if ((string) $g['id'] === (string) $id) {
return $g['name'];
}
}
return null;
}
function render_group_label($field_key, $sel_id, $groups, $def)
{
// select + tenant_list 타입만 노출, 그 외는 대시
if (!($def['input_type'] === 'select' && $def['option_source'] === 'tenant_list')) {
if (! ($def['input_type'] === 'select' && $def['option_source'] === 'tenant_list')) {
return '<span class="text-muted">—</span>';
}
if (!$sel_id) return '<span class="badge bg-light text-muted">미지정</span>';
if (! $sel_id) {
return '<span class="badge bg-light text-muted">미지정</span>';
}
$name = htmlspecialchars(group_name_by_id($sel_id, $groups) ?: '알 수 없음');
// 필요하면 관리 링크 표시
return '<span class="badge bg-secondary-subtle text-dark">' . $name . '</span>'
. ' <a href="/tenant/settings/option_groups.php?selected=' . $sel_id . '" class="btn btn-sm btn-outline-secondary ms-1">관리</a>';
return '<span class="badge bg-secondary-subtle text-dark">'.$name.'</span>'
.' <a href="/tenant/settings/option_groups.php?selected='.$sel_id.'" class="btn btn-sm btn-outline-secondary ms-1">관리</a>';
}
?>
@@ -130,20 +140,21 @@ function render_group_label($field_key, $sel_id, $groups, $def)
<tbody>
<?php
// sort_order 순으로 정렬된 것처럼 표시
usort($FIELD_DEFS, function($a,$b) use($SETTINGS){
usort($FIELD_DEFS, function ($a, $b) use ($SETTINGS) {
$sa = $SETTINGS[$a['field_key']]['sort_order'] ?? 9999;
$sb = $SETTINGS[$b['field_key']]['sort_order'] ?? 9999;
return $sa <=> $sb;
});
foreach($FIELD_DEFS as $def):
$key = $def['field_key'];
$set = $SETTINGS[$key] ?? ['enabled'=>0,'required'=>0,'sort_order'=>9999,'option_group_id'=>null];
$enabled = (int)$set['enabled'];
$required = (int)$set['required'];
$order = (int)$set['sort_order'];
$groupId = $set['option_group_id'];
?>
foreach ($FIELD_DEFS as $def) {
$key = $def['field_key'];
$set = $SETTINGS[$key] ?? ['enabled' => 0, 'required' => 0, 'sort_order' => 9999, 'option_group_id' => null];
$enabled = (int) $set['enabled'];
$required = (int) $set['required'];
$order = (int) $set['sort_order'];
$groupId = $set['option_group_id'];
?>
<tr data-field="<?= htmlspecialchars($key) ?>">
<td>
<div class="input-group input-group-sm">
@@ -157,15 +168,15 @@ function render_group_label($field_key, $sel_id, $groups, $def)
<div class="text-muted small"><?= htmlspecialchars($key) ?> · <?= htmlspecialchars($def['data_type']) ?></div>
</td>
<td><span class="badge rounded-pill bg-light text-dark"><?= htmlspecialchars($def['input_type']) ?></span></td>
<td><?= render_group_label($key,$groupId,$OPTION_GROUPS,$def) ?></td>
<td><?= render_group_label($key, $groupId, $OPTION_GROUPS, $def) ?></td>
<td>
<div class="form-check form-switch d-flex justify-content-center m-0">
<input class="form-check-input toggle-req" type="checkbox" <?= $required?'checked':'' ?> <?= $enabled? '' : 'disabled' ?>>
<input class="form-check-input toggle-req" type="checkbox" <?= $required ? 'checked' : '' ?> <?= $enabled ? '' : 'disabled' ?>>
</div>
</td>
<td>
<div class="form-check form-switch d-flex justify-content-center m-0">
<input class="form-check-input toggle-on" type="checkbox" <?= $enabled?'checked':'' ?>>
<input class="form-check-input toggle-on" type="checkbox" <?= $enabled ? 'checked' : '' ?>>
</div>
</td>
<td>
@@ -173,7 +184,7 @@ function render_group_label($field_key, $sel_id, $groups, $def)
<button class="btn btn-sm btn-outline-secondary btn-reset" type="button">되돌리기</button>
</td>
</tr>
<?php endforeach; ?>
<?php } ?>
</tbody>
</table>
</div>
@@ -194,8 +205,8 @@ function render_group_label($field_key, $sel_id, $groups, $def)
<script>
$(function(){
// —— 메모리 상태(실제 구현은 서버 조인 결과로 초기화)
const defs = <?= json_encode($FIELD_DEFS, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES) ?>;
const initSettings = <?= json_encode($SETTINGS, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES) ?>;
const defs = <?= json_encode($FIELD_DEFS, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?>;
const initSettings = <?= json_encode($SETTINGS, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?>;
let state = JSON.parse(JSON.stringify(initSettings)); // deep copy

View File

@@ -1,6 +1,6 @@
<!-- SAM RULES: include=../inc/header.php; base=/tenant; width=1280; js=jQuery+BS5 -->
<?php
$CURRENT_SECTION='member'; // 상단 1뎁스 "회사" 섹션에 노출
$CURRENT_SECTION = 'member'; // 상단 1뎁스 "회사" 섹션에 노출
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:24px;">

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='shipment';
$CURRENT_SECTION = 'shipment';
include '../inc/header.php';
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='shipment';
$CURRENT_SECTION = 'shipment';
include '../inc/header.php';
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='subscription';
$CURRENT_SECTION = 'subscription';
include '../inc/header.php';
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='subscription';
$CURRENT_SECTION = 'subscription';
include '../inc/header.php';
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='subscription';
$CURRENT_SECTION = 'subscription';
include '../inc/header.php';
?>

View File

@@ -5,18 +5,18 @@
// 샘플: 세션 또는 DB에서 기존 데이터 조회 (실제로는 DB에서 가져와야 함)
$tenant = [
'company_name' => isset($_SESSION['company_name']) ? $_SESSION['company_name'] : '샘플주식회사',
'code' => isset($_SESSION['tenant_code']) ? $_SESSION['tenant_code'] : 'samplecorp',
'email' => isset($_SESSION['tenant_email']) ? $_SESSION['tenant_email'] : 'admin@sample.com',
'phone' => isset($_SESSION['tenant_phone']) ? $_SESSION['tenant_phone'] : '02-1234-5678',
'address' => isset($_SESSION['tenant_address']) ? $_SESSION['tenant_address'] : '서울시 강남구',
'code' => isset($_SESSION['tenant_code']) ? $_SESSION['tenant_code'] : 'samplecorp',
'email' => isset($_SESSION['tenant_email']) ? $_SESSION['tenant_email'] : 'admin@sample.com',
'phone' => isset($_SESSION['tenant_phone']) ? $_SESSION['tenant_phone'] : '02-1234-5678',
'address' => isset($_SESSION['tenant_address']) ? $_SESSION['tenant_address'] : '서울시 강남구',
'business_num' => isset($_SESSION['tenant_business_num']) ? $_SESSION['tenant_business_num'] : '1234567890',
'corp_reg_no' => isset($_SESSION['tenant_corp_reg_no']) ? $_SESSION['tenant_corp_reg_no'] : '',
'ceo_name' => isset($_SESSION['tenant_ceo_name']) ? $_SESSION['tenant_ceo_name'] : '홍길동',
'homepage' => isset($_SESSION['tenant_homepage']) ? $_SESSION['tenant_homepage'] : '',
'fax' => isset($_SESSION['tenant_fax']) ? $_SESSION['tenant_fax'] : '',
'admin_memo' => isset($_SESSION['tenant_admin_memo']) ? $_SESSION['tenant_admin_memo'] : '',
'max_users' => isset($_SESSION['tenant_max_users']) ? $_SESSION['tenant_max_users'] : 10,
'logo' => isset($_SESSION['tenant_logo']) ? $_SESSION['tenant_logo'] : '',
'corp_reg_no' => isset($_SESSION['tenant_corp_reg_no']) ? $_SESSION['tenant_corp_reg_no'] : '',
'ceo_name' => isset($_SESSION['tenant_ceo_name']) ? $_SESSION['tenant_ceo_name'] : '홍길동',
'homepage' => isset($_SESSION['tenant_homepage']) ? $_SESSION['tenant_homepage'] : '',
'fax' => isset($_SESSION['tenant_fax']) ? $_SESSION['tenant_fax'] : '',
'admin_memo' => isset($_SESSION['tenant_admin_memo']) ? $_SESSION['tenant_admin_memo'] : '',
'max_users' => isset($_SESSION['tenant_max_users']) ? $_SESSION['tenant_max_users'] : 10,
'logo' => isset($_SESSION['tenant_logo']) ? $_SESSION['tenant_logo'] : '',
];
?>
@@ -27,58 +27,58 @@
<div class="mb-3">
<label class="form-label">회사/조직명 <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="company_name" maxlength="100" value="<?=htmlspecialchars($tenant['company_name'])?>" required>
<input type="text" class="form-control" name="company_name" maxlength="100" value="<?= htmlspecialchars($tenant['company_name'])?>" required>
</div>
<div class="mb-3">
<label class="form-label">회사 코드 <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="code" maxlength="50" value="<?=htmlspecialchars($tenant['code'])?>" readonly>
<input type="text" class="form-control" name="code" maxlength="50" value="<?= htmlspecialchars($tenant['code'])?>" readonly>
</div>
<div class="mb-3">
<label class="form-label">대표 이메일</label>
<input type="email" class="form-control" name="email" maxlength="80" value="<?=htmlspecialchars($tenant['email'])?>">
<input type="email" class="form-control" name="email" maxlength="80" value="<?= htmlspecialchars($tenant['email'])?>">
</div>
<div class="mb-3">
<label class="form-label">대표 전화번호</label>
<input type="text" class="form-control" name="phone" maxlength="20" value="<?=htmlspecialchars($tenant['phone'])?>">
<input type="text" class="form-control" name="phone" maxlength="20" value="<?= htmlspecialchars($tenant['phone'])?>">
</div>
<div class="mb-3">
<label class="form-label">주소</label>
<input type="text" class="form-control" name="address" maxlength="255" value="<?=htmlspecialchars($tenant['address'])?>">
<input type="text" class="form-control" name="address" maxlength="255" value="<?= htmlspecialchars($tenant['address'])?>">
</div>
<div class="mb-3">
<label class="form-label">사업자등록번호</label>
<input type="text" class="form-control" name="business_num" maxlength="12" value="<?=htmlspecialchars($tenant['business_num'])?>">
<input type="text" class="form-control" name="business_num" maxlength="12" value="<?= htmlspecialchars($tenant['business_num'])?>">
</div>
<div class="mb-3">
<label class="form-label">법인등록번호</label>
<input type="text" class="form-control" name="corp_reg_no" maxlength="13" value="<?=htmlspecialchars($tenant['corp_reg_no'])?>">
<input type="text" class="form-control" name="corp_reg_no" maxlength="13" value="<?= htmlspecialchars($tenant['corp_reg_no'])?>">
</div>
<div class="mb-3">
<label class="form-label">대표자명</label>
<input type="text" class="form-control" name="ceo_name" maxlength="50" value="<?=htmlspecialchars($tenant['ceo_name'])?>">
<input type="text" class="form-control" name="ceo_name" maxlength="50" value="<?= htmlspecialchars($tenant['ceo_name'])?>">
</div>
<div class="mb-3">
<label class="form-label">홈페이지 주소</label>
<input type="url" class="form-control" name="homepage" maxlength="255" value="<?=htmlspecialchars($tenant['homepage'])?>">
<input type="url" class="form-control" name="homepage" maxlength="255" value="<?= htmlspecialchars($tenant['homepage'])?>">
</div>
<div class="mb-3">
<label class="form-label">팩스번호</label>
<input type="text" class="form-control" name="fax" maxlength="30" value="<?=htmlspecialchars($tenant['fax'])?>">
<input type="text" class="form-control" name="fax" maxlength="30" value="<?= htmlspecialchars($tenant['fax'])?>">
</div>
<div class="mb-3">
<label class="form-label">회사 로고</label>
<?php if ($tenant['logo']): ?>
<div class="mb-2"><img src="<?=htmlspecialchars($tenant['logo'])?>" alt="로고" style="height:40px;"></div>
<?php endif; ?>
<?php if ($tenant['logo']) { ?>
<div class="mb-2"><img src="<?= htmlspecialchars($tenant['logo'])?>" alt="로고" style="height:40px;"></div>
<?php } ?>
<input type="file" class="form-control" name="logo" accept="image/*">
</div>
<div class="mb-3">
<label class="form-label">관리자 메모</label>
<textarea class="form-control" name="admin_memo" maxlength="500" rows="2"><?=htmlspecialchars($tenant['admin_memo'])?></textarea>
<textarea class="form-control" name="admin_memo" maxlength="500" rows="2"><?= htmlspecialchars($tenant['admin_memo'])?></textarea>
</div>
<div class="mb-3">
<label class="form-label">최대 사용자 수</label>
<input type="number" class="form-control" name="max_users" min="1" max="999" value="<?=htmlspecialchars($tenant['max_users'])?>">
<input type="number" class="form-control" name="max_users" min="1" max="999" value="<?= htmlspecialchars($tenant['max_users'])?>">
</div>
<button type="submit" class="btn btn-primary w-100 mt-2">수정하기</button>
</form>

View File

@@ -1,7 +1,7 @@
<!-- SAM RULES: include=../inc/header.php; base=/tenant; width=1280; js=jQuery+BS5 -->
<?php
// 네비게이션은 '회사' 섹션에 묶어둘게요(관리 성격)
$CURRENT_SECTION='tenant';
$CURRENT_SECTION = 'tenant';
include '../inc/header.php';
?>
<div class="container" style="max-width:1280px; margin-top:24px;">

View File

@@ -1,4 +1,5 @@
<?php
include '../inc/config.php';
// 실제로는 ?id=...로 전달받아 삭제 처리
@@ -8,7 +9,7 @@
// 예: DELETE FROM roles WHERE id = $role_id
// 삭제 완료 메시지 후 역할 리스트로 이동
echo <<<HTML
echo <<<'HTML'
<script>
alert('역할이 삭제되었습니다.');
window.location.href = '/tenant/tenant/role_list.php';
@@ -16,4 +17,3 @@
HTML;
exit;
?>

View File

@@ -1,5 +1,5 @@
<?php
$CURRENT_SECTION='tenant';
$CURRENT_SECTION = 'tenant';
include '../inc/header.php';
?>

View File

@@ -8,21 +8,21 @@
$users = [
1 => [
'id'=>1,
'user_id'=>'kevin',
'name'=>'권혁성',
'email'=>'kevin@sample.com',
'phone'=>'010-1111-2222',
'options'=>json_encode(['사번'=>'A001','계좌번호'=>'111-2222-3333']),
'id' => 1,
'user_id' => 'kevin',
'name' => '권혁성',
'email' => 'kevin@sample.com',
'phone' => '010-1111-2222',
'options' => json_encode(['사번' => 'A001', '계좌번호' => '111-2222-3333']),
'profile_photo_path' => '',
],
2 => [
'id'=>2,
'user_id'=>'sally',
'name'=>'김슬기',
'email'=>'sally@sample.com',
'phone'=>'010-3333-4444',
'options'=>json_encode(['사번'=>'A002','계좌번호'=>'222-3333-4444']),
'id' => 2,
'user_id' => 'sally',
'name' => '김슬기',
'email' => 'sally@sample.com',
'phone' => '010-3333-4444',
'options' => json_encode(['사번' => 'A002', '계좌번호' => '222-3333-4444']),
'profile_photo_path' => '',
],
];
@@ -30,7 +30,7 @@
$user_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
$user = isset($users[$user_id]) ? $users[$user_id] : null;
if (!$user) {
if (! $user) {
echo '<div class="alert alert-danger mt-4 text-center">해당 회원을 찾을 수 없습니다.</div>';
include '../inc/footer.php';
exit;
@@ -61,9 +61,9 @@
</div>
<div class="mb-3">
<label class="form-label">프로필 사진</label>
<?php if ($user['profile_photo_path']): ?>
<?php if ($user['profile_photo_path']) { ?>
<div class="mb-2"><img src="<?= htmlspecialchars($user['profile_photo_path']) ?>" alt="프로필" style="height:40px;"></div>
<?php endif; ?>
<?php } ?>
<input type="file" class="form-control" name="profile_photo" accept="image/*">
</div>
<div class="mb-3">
@@ -74,12 +74,12 @@
<label class="form-label">비밀번호 확인</label>
<input type="password" class="form-control" name="password2" maxlength="30" placeholder="변경 시 입력">
</div>
<?php foreach($allowed_options as $opt): ?>
<?php foreach ($allowed_options as $opt) { ?>
<div class="mb-3">
<label class="form-label"><?= htmlspecialchars($opt) ?></label>
<input type="text" class="form-control" name="option_<?= urlencode($opt) ?>" value="<?= isset($user_options[$opt]) ? htmlspecialchars($user_options[$opt]) : '' ?>">
</div>
<?php endforeach; ?>
<?php } ?>
<div class="d-flex gap-2">
<button type="submit" class="btn btn-primary w-50">수정</button>
<a href="/tenant/tenant/user_list.php" class="btn btn-secondary w-50">취소</a>

View File

@@ -1,4 +1,5 @@
<?php
include '../inc/config.php';
// 실제로는 ?id=...로 받아서 매핑 해제 처리
@@ -9,7 +10,7 @@
// 또는 users 테이블에서 deleted_at 세팅 등
// 샘플: 삭제 완료 메시지 후 유저 리스트로 이동
echo <<<HTML
echo <<<'HTML'
<script>
alert('회사의 회원 연결이 해제되었습니다.');
window.location.href = '/tenant/tenant/user_list.php';
@@ -17,4 +18,3 @@
HTML;
exit;
?>

View File

@@ -4,7 +4,7 @@
// 최고관리자 권한 체크(예시)
// 실제 환경에서는 $_SESSION['user_role'] 또는 tenant 관리자 여부 등으로 확인
if (!isset($_SESSION['user_role']) || $_SESSION['user_role'] !== 'tenant_admin') {
if (! isset($_SESSION['user_role']) || $_SESSION['user_role'] !== 'tenant_admin') {
echo '<div class="alert alert-danger mt-4 text-center">회사 관리자만 회사 탈퇴가 가능합니다.</div>';
include '../inc/footer.php';
exit;