<!DOCTYPE html>
<html lang="ko"
	xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="common/layout/login">
<!--
 *******************************************************************************
 * @source  : signin.html
 * @desc    : Signin Page
 *============================================================================
 * STYLE24
 * Copyright(C) 2020 TSIT, All rights reserved.
 *============================================================================
 * VER  DATE         AUTHOR      DESCRIPTION
 * ===  ===========  ==========  =============================================
 * 1.0  2020.10.05   gagamel     최초 작성
 *******************************************************************************
 -->
<head>
	<title>Signin</title>
</head>

<body>

<th:block layout:fragment="content">
	<form name="loginForm" id="loginForm" th:action="@{/login}" method="post">
		<div class="loginCont">
			<div class="logo"><img src="/image/login_logo.png" alt="logo"/></div>
			<ul>
				<li>
					<ul class="loginBox">
						<li th:style="${error == null ? 'display: none;' : ''}">
							<div class="alertBox alert-danger" id="loginFailAlert">
								<strong th:text="${error}">사용자ID 또는 비밀번호가 일치하지 않습니다.</strong>
								<button type="button" class="alertClose" onclick="uifnAlertClose('loginFailAlert');">닫기</button>
							</div>
						</li>
						<li>
							<input type="text" autofocus="autofocus" name="userId" placeholder="아이디" maxlength="20" required="required" data-valid-name="아이디"/>
						</li>
						<li>
							<input type="password" name="passwd" placeholder="비밀번호" maxlength="20" required="required" data-valid-name="비밀번호"/>
						</li>
						<li>
							<label class="chkBox"><input type="checkbox" id="chkSaveId"/>아이디 저장</label>
							<!-- <input type="submit" class="btn btn-black btn-lg" value="Login"/> -->
							<button type="submit" class="btn btn-black btn-lg">Login</button>
						</li>
						<!--li>
							<a href="#" th:href="@{javascript:void(0);}" id="findId" class="forget-password">아이디 찾기</a>
							<i class="dot">&bull;</i>
							<a href="#" th:href="@{javascript:void(0);}" id="findPassword">비밀번호 찾기</a>
							<i class="dot">&bull;</i>
							<a>회원가입</a>
						</li-->
					</ul>
				</li>
				<li>
					<div class="loginInfo">
						<p><em><i class="fa fa-info-circle" aria-hidden="true"></i>안내문</em></p>
						<p>이 시스템은 <strong>STYLE24 Admin</strong> 전용 시스템입니다.<br/>
						인증되지 않은 사용자의 다른 접근은 허용하지 않습니다.<br/>
						본 시스템으로 접근을 시도한 것은 기록에 남게 되며, 반복되는 접근은 불법적인 침입을 하려는 시도로 간주하겠습니다.<br/><br/>
						본 시스템의 사용과 관련된 문의는<br/>
						<strong>스타일24(주) 고객센터 (1544-5336)</strong>으로 연락 주시기 바랍니다.</p>
					</div>
				</li>
			</ul>
		</div>
	</form>

<script th:inline="javascript">
/*<![CDATA[*/
	//주석 추가
	var ckAdminId = "CK_ADMIN_ID";
	var ckDefaultExpireDays = 90;

	// Save ID
	$('#chkSaveId').on('click', function() {
		if ($('#chkSaveId').is(":checked")) {
			if (!gagajf.isNull($('#loginForm input[name=userId]').val())) {
				gagajf.setCookie(ckAdminId, $('#loginForm input[name=userId]').val(), ckDefaultExpireDays);
			}
		} else {
			if (!gagajf.isNull(getCookie(ckAdminId)) && (getCookie(ckAdminId) === $('#loginForm input[name=userId]').val())) {
				gagajf.setCookie(ckAdminId, $('#loginForm input[name=userId]').val(), -1);
			}
		}
	});

	$(document).ready(function() {
		$('#loginForm input[name=userId]').val(gagajf.getCookie(ckAdminId));
		if (gagajf.isNull($('#loginForm input[name=userId]').val())) {
			$('#loginForm input[name=userId]').focus();
			$('#chkSaveId').prop('checked', false);
			$('#chkSaveId').parent().addClass('checked');
		} else {
			$('#loginForm input[name=passwd]').focus();
			$('#chkSaveId').prop('checked', true);
			$('#chkSaveId').parent().removeClass('checked');
		}
	});
/*]]>*/
</script>

</th:block>

</body>
</html>
