<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layout/layout}"
>

<th:block layout:fragment="css">
  <link rel="stylesheet" th:href="@{/css/login/login.css}">
</th:block>
<th:block layout:fragment="script">
  <script type="text/javascript" th:src="@{/js/login/login.js}"></script>
</th:block>

<div layout:fragment="content">
  <!--  <img id="img02" th:src="@{/img/main_bg.png}" class="w-100 h-100" alt="배경2">-->
<!--  <div id="form-signin" class="form-signin text-center bg-white">-->
    <!-- Security config의 loginPage("url")와 action url과 동일하게 작성-->

<!--    <div class="row">-->
<!--      <h2>반갑습니다</h2>-->
<!--      <p>이곳은 보안정보관리시스템입니다</p>-->
<!--    </div>-->

    <form action="/login" method="post">
      <!-- Spring Security가 적용되면 POST 방식으로 보내는 모든 데이터는 csrf 토큰 값이 필요 -->
      <input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
      <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
      <p th:if="${loginError}" class="error text-danger">로그인에 실패하였습니다.</p>
      <!-- 로그인 시 아이디의 name 애트리뷰트 값은 username -->
      <!-- 파라미터명을 변경하고 싶을 경우 config class formlogin()에서 .usernameParameter("") 명시 -->

      <div class="index_warp ">
        <ul class="login_warp">
          <li>
            <img src="img/logo_white.png" alt=""/>
            <h1>보안정보관리시스템</h1>
            <h2>NATIONAL SECRET INTELLIGENCE MANAGEMENT SYSTEM</h2>
          </li>
          <li>
            <div>
              <h1>Login</h1>
              <input th:src="@{/img/login_icon02.png}" type="text" name="username" id="username" placeholder="아이디" onfocus="this.placeholder=''" onblur="this.placeholder='아이디'" class="form_01 form_log">
              <input th:src="@{/img/login_icon02.png}" type="password" name="password" id="password" placeholder="비밀번호" onfocus="this.placeholder=''" onblur="this.placeholder='비밀번호'" class="form_01 form_pw">
              <input name="idchk" type="checkbox" id="idchk" class="form_02"> 아이디저장

              <input type="submit" name="login" id="login" value="로그인" class="btn_login">

              <dl>
                <dd><a href="#" data-bs-toggle="modal" data-bs-target="#userInsertModal"><span>dot</span>회원가입</a></dd>
                <dd><a href="#"><span>dot</span>아이디/비밀번호찾기</a></dd>
              </dl>
            </div>
          </li>
        </ul>
      </div>




<!--      <div class="row">-->
<!--        <label for="username" class="col-sm-4 col-form-label mb-2">아이디</label>-->
<!--        <div class="col-sm-8 mb-2">-->
<!--          <input type="text" class="form-control" id="username" name="username">-->
<!--        </div>-->
<!--        <label for="password" class="col-sm-4 col-form-label mb-2">비밀번호</label>-->
<!--        <div class="col-sm-8 mb-2">-->
<!--          <input type="password" class="form-control" id="password" name="password">-->
<!--        </div>-->
<!--      </div>-->
<!--      &lt;!&ndash;<div class="checkbox mb-3">-->
<!--        <label>-->
<!--          <input type="checkbox" class="disabled" value="remember-me"> 계정저장(비활성화)-->
<!--        </label>-->
<!--      </div>&ndash;&gt;-->
<!--      <button class="w-100 my-2 btn btn-lg btn-primary" type="submit">로그인</button>-->
<!--      <div class="row my-2 justify-content-between">-->
<!--        <div class="col-auto">-->
<!--          <a href="#" data-bs-toggle="modal" data-bs-target="#userInsertModal">회원가입</a>-->
<!--        </div>-->
<!--        <div class="col-auto">-->
<!--          <a href="#">아이디/비밀번호 찾기</a>-->
<!--        </div>-->
<!--      </div>-->
<!--    </form>-->
<!--  </div>-->



  <div class="modal fade" id="userInsertModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="userInsertModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content ">
        <div class="modal-header">
          <h5 class="modal-title" id="userInsertModalLabel">사용자 신청</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <form id="userInfoInsert" action="#" th:action="@{/admin/insertUserInfo}" method="post">
          <div class="mb-3 row">
          <div class="mb-3 mt-3 row">
            <label for="userId" class="col-sm-2 col-form-label text-center ">아이디</label>
            <div class="col-sm-4">
              <input type="text" class="form-control" id="userId" name="userId" autocomplete="off">
              <label for="userId" style="font-size: 12px">6~20자 사이의 알파벳, 숫자를 입력하세요</label>
            </div>
            <label for="userNm" class="col-sm-2 col-form-label text-center">이름</label>
            <div class="col-sm-4">
              <input type="text" class=" form-control" id="userNm" name="userNm" autocomplete="off">
            </div>
          </div>
          <div class="mb-3 row">
            <label for="modalPassword" class="col-sm-2 col-form-label text-center">비밀번호</label>
            <div class="col-sm-4">
              <input type="password" class="form-control" id="modalPassword" name="password" >
              <label for="userId" style="font-size: 12px">8~16자 사이의 알파벳, 숫자, 특수문자 조합</label>
            </div>
            <label for="passwordConfirm" class="col-sm-2 col-form-label text-center">비밀번호 확인</label>
            <div class="col-sm-4">
              <input type="password" class="form-control" id="passwordConfirm">
            </div>
          </div>
          <div class="mb-3 row">
            <label for="tel" class="col-sm-2 col-form-label text-center">전화번호</label>
            <div class="col-sm-4">
              <input type="tel" class="form-control" id="tel">
            </div>
            <label for="email" class="col-sm-2 col-form-label text-center">이메일</label>
            <div class="col-sm-4">
              <input type="email" class="form-control" id="email">
            </div>
          </div>
          <div class="mb-3 row">
            <label for="telP" class="col-sm-2 col-form-label text-center">휴대전화</label>
            <div class="col-sm-4">
              <input type="tel" class="form-control" id="telP">
            </div>
          </div>
          <div class="mb-3 row">
            <label for="ogCd" class="col-sm-2 col-form-label text-center">관서</label>
            <div class="col-sm-4">
              <select class="form-control" id="ogCd" name="ogCd">
              	<option value="">--선택--</option>
              	<option th:each="val : ${OgList}" th:value="${val?.itemCd}" th:utext="${val?.itemValue}">
              	</option>
              </select> 
            </div>
            <label for="ofcCd" class="col-sm-2 col-form-label text-center">부서</label>
            <div class="col-sm-4">
              <select class="form-control" id="ofcCd" name="ofcCd">
              	<option value="">--선택--</option>
              	<option th:each="val : ${OfcList}" th:value="${val?.itemCd}" th:utext="${val?.itemValue}">
              	</option>
              </select>
            </div>
          </div>
          <div class="mb-3 row" >
            <label for="address" class="col-sm-2 col-form-label text-center">주소</label>
            <div class="col-sm-8">
              <input type="adress" class="form-control" id="address">
            </div>
            <div class="col-sm-2">
              <button type="button" class="btn btn-secondary" id="search">주소검색</button>
            </div>
          </div>
          <div class="mb-3 row">
              <label for="addresses" class="col-sm-2 col-form-label text-center">상세주소</label>
              <div class="col-sm-10">
                <input type="address" class="form-control" id="addresses">
              </div>
            </div>
            <div class="mb-3 row">
              <label for="photo" class="col-sm-2 col-form-label text-center">사진</label>
              <div class="col-sm-4">
                <input type="file" style="font-size: 12px" class="form-control" id="photo">
              </div>
              <label for="sign" class="col-sm-2 col-form-label text-center">서명</label>
              <div class="col-sm-4">
                <input type="file" style="font-size: 12px" class="form-control" id="sign">
              </div>
            </div>
            <div class="mb-3 row">
              <label for="tel" class="col-sm-2 col-form-label text-center">요청사항</label>
              <div class="col-sm-4">
                <input type="text" class="form-control" id="need">
              </div>
              <label for="precautions" class="col-sm-2 col-form-label text-center">주의사항</label>
              <div class="col-sm-4">
                <input type="text" class="form-control" id="precautions">
              </div>
            </div>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data-bs-dismiss="modal" id="closeModalBtn">닫기</button>
            <button type="button" class="btn btn-primary" id="saveBtn">신청</button>
          </div>
         </form>

        </div>

      </div>
    </div>
  </div>
</div>
</html>