<?php
define('IS_NOT_LOGIN', true); // 로그인 하지 않은 상태에서 접근하는 파일인 경우

$adminsubmitmsg = $_REQUEST['m'];
$para_s = $_REQUEST['s'];
$para_k = $_REQUEST['k'];
$submitstoreid = addslashes(trim($_REQUEST["adminstoreid"]));
$submitid = addslashes(trim($_REQUEST["adminid"]));
$submitpwd = addslashes(trim($_REQUEST["adminpwd"]));
$submitname = addslashes(trim($_REQUEST["adminname"]));
$submitemail = addslashes(trim($_REQUEST["adminemail"]));

if ($submitid == "" || $submitpwd == "" || $submitemail == "") {
	exit;
}

if ($adminsubmitmsg == "error") {
	die("오류 발생 : 서버관리자에게 자동 통보 되었습니다.<br><br>지금 바로 신고하여 주시면 더 빠른 복구가 가능합니다.");
}
?>

<!DOCTYPE html>
<html>

<head>
	<?php include "_MyAdminConfig.php" ?>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title><?=$HOME_ADMIN_TITLE_NAME?> 회원ID 등록 성공</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">

	<link rel="stylesheet" type="text/css" href="css/main_admin.css?v=<?php echo $MY_CSS_VER?>">

	<script src="vendor/js/jquery-3.3.1.min.js?v=<?php echo $MY_JS_VER?>"></script>
	<script src="js/joinup_admin.js?v=<?php echo $MY_JS_VER?>"></script>
	<script src="vendor/js/jquery.dataTables.js?v=<?php echo $MY_JS_VER?>"></script>
	<script src="vendor/js/buttons.html5.min.js?v=<?php echo $MY_JS_VER?>"></script>
	<style>
		input:focus {outline: none;}
	</style>
</head>

<body style="margin:0; padding:0; overflow:hidden;">
	<div style="display:flex; justify-content:center; align-items:center; flex-direction:column; width:100vw; height:80vh; background:#131313; font-size:1.2em;">
		<div style="display:flex; justify-content:center; align-items:center; width:100%; min-width:300px; height:auto; margin:0px auto 0px; color:#ffffff; font-size:1.2em; text-align:center;">
			"<?php echo $submitname?>" 님 축하합니다.<br><br>신청하신 관리자 아이디는 정상적으로 접수 되었습니다.<br><br>아래에 표시된 로그인 정보를 메모해 두시면 편리합니다.
		</div>
		<div style="display:flex; justify-content:center; align-items:center; width:90%; min-width:500px; max-width:900px; height:auto; margin:0px auto 10px;">
			<div id="adminsubmitmsg" style="display:flex; justify-content:center; align-items:center; width:320px; height:30px; color:OrangeRed; padding:10px; text-align:center;"><?php echo $adminsubmitmsg?></div>
		</div>
		<div style="display:flex; justify-content:center; align-items:flex-start; flex-direction:row; width:90%; min-width:500px; max-width:900px; height:auto; margin:0px auto 10px;">
			<div style="display:flex; justify-content:center; align-items:center; width:130px; height:30px; border:1px solid #7a7a7a; background:#7a7a7a; color:#ffffff; padding:10px; text-align:center;">로그인주소</div>
			<div style="width:100%; border:1px solid #7a7a7a; background:transparent; padding:0px;">
				<input type="text" name="adminurl" id="adminurl" style="width:100%; min-width:500px; max-width:800px; height:30px; padding:10px 10px 10px; border:0; background:transparent; color:#ffffff; font-size:0.9em;" value="<?php echo $HOME_ADMIN_URL?>/login_admin.php" readonly>
			</div>
		</div>
		<div style="display:flex; justify-content:center; align-items:flex-start; flex-direction:row; width:90%; min-width:500px; max-width:900px; height:auto; margin:0px auto 10px;">
			<div style="display:flex; justify-content:center; align-items:center; width:130px; height:30px; border:1px solid #7a7a7a; background:#7a7a7a; color:#ffffff; padding:10px; text-align:center;">상점ID</div>
			<div style="width:100%; border:1px solid #7a7a7a; background:transparent; padding:0px;">
				<input type="text" name="adminstoreid" id="adminstoreid" style="width:100%; min-width:500px; max-width:800px; height:30px; padding:10px 10px 10px; border:0; background:transparent; color:#ffffff; font-size:1.2em;" value="<?php echo $submitstoreid?>" readonly>
			</div>
		</div>
		<div style="display:flex; justify-content:center; align-items:flex-start; flex-direction:row; width:90%; min-width:500px; max-width:900px; height:auto; margin:0px auto 10px;">
			<div style="display:flex; justify-content:center; align-items:center; width:130px; height:30px; border:1px solid #7a7a7a; background:#7a7a7a; color:#ffffff; padding:10px; text-align:center;">회원ID</div>
			<div style="width:100%; border:1px solid #7a7a7a; background:transparent; padding:0px;">
				<input type="text" name="adminid" id="adminid" style="width:100%; min-width:500px; max-width:800px; height:30px; padding:10px 10px 10px; border:0; background:transparent; color:#ffffff; font-size:1.2em;" value="<?php echo $submitid?>" readonly>
			</div>
		</div>
		<div style="display:flex; justify-content:center; align-items:flex-start; flex-direction:row; width:90%; min-width:500px; max-width:900px; height:auto; margin:0px auto 10px;">
			<div style="display:flex; justify-content:center; align-items:center; width:130px; height:30px; border:1px solid #7a7a7a; background:#7a7a7a; color:#ffffff; padding:10px; text-align:center;">비밀번호</div>
			<div style="width:100%; border:1px solid #7a7a7a; background:transparent; padding:0px;">
				<?php
				// 비밀번호 일부만 보이도록 마스킹 처리 (예: 첫글자, 마지막글자만 노출, 나머지는 *)
				$maskedPwd = $submitpwd;
				if (strlen($submitpwd) > 2) {
					$maskedPwd = substr($submitpwd, 0, 1) . str_repeat('*', strlen($submitpwd) - 2) . substr($submitpwd, -1);
				} elseif (strlen($submitpwd) == 2) {
					$maskedPwd = substr($submitpwd, 0, 1) . '*';
				} // 1글자는 그대로 노출
				?>
				<input type="text" name="adminpwd" id="adminpwd" style="width:100%; min-width:500px; max-width:800px; height:30px; padding:10px 10px 10px; border:0; background:transparent; color:#ffffff; font-size:1.2em;" value="<?php echo $maskedPwd?>" readonly>
			</div>
		</div>
		<div style="display:flex; justify-content:center; align-items:flex-start; flex-direction:row; width:90%; min-width:500px; max-width:900px; height:auto; margin:0px auto 0px;">
			<div style="display:flex; justify-content:center; align-items:center; width:130px; height:30px; border:1px solid #7a7a7a; background:#7a7a7a; color:#ffffff; padding:10px; text-align:center;">이메일</div>
			<div style="width:100%; border:1px solid #7a7a7a; background:transparent; padding:0px;">
				<input type="text" name="adminemail" id="adminemail" style="width:100%; min-width:500px; max-width:800px; height:30px; padding:10px 10px 10px; border:0; background:transparent; color:#ffffff; font-size:1.2em;" value="<?php echo $submitemail?>" readonly>
			</div>
		</div>
	</div>

	<div style="display:flex; justify-content:center; align-items:center; flex-direction:column; width:100vw; height:20vh; background:#131313; font-size:1.2em;">
		<div style="width:100%; min-width:250px; max-width:350px; padding:0px;">
			<div id="joinup_link" style="display:flex; justify-content:center; align-items:center; width:100%; height:30px; padding:10px; text-align:center; cursor:pointer; border:1px solid #ffffff; color:#ffffff;" onclick="location.href='<?php echo $HOME_ADMIN_URL?>/login_admin.php'">로그인 페이지 바로가기</div>
		</div>
	</div>
</body>

</html>