Files
sam-api/public/tenant/member/tenant_add_process.php

23 lines
670 B
PHP
Raw Normal View History

2025-08-10 02:36:50 +09:00
<?php
2025-08-10 02:36:50 +09:00
include '../inc/config.php';
// 새 테넌트(회사명) 입력값 확인
$new_tenant_name = isset($_POST['new_tenant_name']) ? trim($_POST['new_tenant_name']) : '';
if (! $new_tenant_name) {
2025-08-10 02:36:50 +09:00
echo "<script>alert('회사명을 입력하세요.'); history.back();</script>";
exit;
}
// 실제로는 DB에 등록하고 ID를 받아야 함 (샘플로 랜덤값 부여)
$new_tenant_id = rand(1000, 9999); // 실제는 DB의 AUTO_INCREMENT 등 사용
// 세션에 테넌트 정보 저장
$_SESSION['tenant_id'] = $new_tenant_id;
$_SESSION['tenant_name'] = $new_tenant_name;
// 대시보드로 이동
header('Location: /tenant/member/dashboard.php');
2025-08-10 02:36:50 +09:00
exit;