<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header">
  <h5 class="modal-title" th:text="${userInfo.userStatus eq 'USC003' ? '現 외사경찰 상세' : userInfo.userStatus eq 'USC006' ? '前 외사경찰 상세' : userInfo.userStatus eq 'USC007' ? '非 외사경찰 상세' : null}"></h5>
  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>

<ul class="nav nav-tabs" id="userTab" role="tablist">
  <li class="nav-item" role="presentation">
    <button class="nav-link active" id="editTab" th:data-userseq="${userInfo.userSeq}" data-bs-toggle="tab" type="button" role="tab">현황 상세</button>
  </li>
  <li class="nav-item" role="presentation">
    <button class="nav-link" id="historyTab" th:data-userseq="${userInfo.userSeq}" data-bs-toggle="tab" type="button" role="tab">수정이력</button>
  </li>
</ul>
<div class="modal-body">
  <form id="userInfoUpdate" action="#" method="post">
    <input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
    <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
    <input type="hidden" name="userSeq" id="userSeq" class="userSeq" th:value="${userInfo.userSeq}">
    <input type="hidden" name="userStatus" th:value="${userInfo.userStatus}">
    <div class="mb-3 mt-3 row">
      <label for="dicCode" class="col-sm-2 col-form-label col-form-label-sm text-center ">공무원식별번호</label>
      <div class="col-sm-4">
        <input type="text" class="form-control form-control-sm" id="dicCode" name="dicCode" autocomplete="off" th:value="${userInfo.dicCode}">
      </div>
    </div>
    <div class="mb-3 row">
      <label for="userId" class="col-sm-2 col-form-label col-form-label-sm text-center ">아이디</label>
      <div class="col-sm-4">
        <input type="text" class="form-control form-control-sm" id="userId" name="userId" autocomplete="off" th:value="${userInfo.userId}" readonly>
        <label for="userId" style="font-size: 12px">아이디는 수정할 수 없습니다.</label>
      </div>
      <label for="userNm" class="col-sm-2 col-form-label col-form-label-sm text-center">이름</label>
      <div class="col-sm-4">
        <input type="text" class=" form-control form-control-sm" id="userNm" name="userNm" autocomplete="off" th:value="${userInfo.userNm}">
      </div>
    </div>
    <div class="mb-3 row">
      <label for="phoneNo" class="col-sm-2 col-form-label col-form-label-sm text-center">휴대전화</label>
      <div class="col-sm-4">
        <input type="tel" class="form-control form-control-sm" id="phoneNo" name="phoneNo" th:value="${userInfo.phoneNo}">
      </div>
      <label for="email" class="col-sm-2 col-form-label col-form-label-sm text-center">이메일</label>
      <div class="col-sm-4">
        <input type="email" class="form-control form-control-sm" id="email" name="email" th:value="${userInfo.email}">
      </div>
    </div>
    <div class="mb-3 row">
      <label for="sex" class="col-sm-2 col-form-label col-form-label-sm text-center">성별</label>
      <div class="col-sm-4">
        <select class="form-select form-select-sm" id="sex" name="sex">
          <option value="SEX002" th:selected="${userInfo.sex eq 'SEX002'}">남</option>
          <option value="SEX001" th:selected="${userInfo.sex eq 'SEX001'}">여</option>
        </select>
      </div>
    </div>
    <div class="mb-3 row">
      <label for="birthDate" class="col-sm-2 col-form-label col-form-label-sm text-center">생년월일</label>
      <div class="col-sm-4">
        <input type="text" class="form-control form-control-sm dateSelector" id="birthDate" name="birthDate" th:value="${userInfo.birthDate}" readonly>
      </div>
      <label for="policeInDate" class="col-sm-2 col-form-label col-form-label-sm text-center">해양경찰배명일</label>
      <div class="col-sm-4">
        <input type="text" class="form-control form-control-sm dateSelector" id="policeInDate" name="policeInDate" th:value="${userInfo.policeInDate}" readonly>
      </div>
    </div>
    <div class="mb-3 row">
      <label for="ogCd" class="col-sm-2 col-form-label col-form-label-sm text-center">관서</label>
      <div class="col-sm-4">
        <select class="form-select form-select-sm" id="ogCd" name="ogCd">
          <option value="">--선택--</option>
          <th:block th:each="code:${ogList}">
            <option th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq userInfo.ogCd}"></option>
          </th:block>
        </select>
      </div>
      <label for="organInDate" class="col-sm-2 col-form-label col-form-label-sm text-center">현관서전입일</label>
      <div class="col-sm-4">
        <input type="text" class="form-control form-control-sm dateSelector" id="organInDate" name="organInDate" th:value="${userInfo.organInDate}" readonly>
      </div>
    </div>
    <div class="mb-3 row">
      <label for="ofcCd" class="col-sm-2 col-form-label col-form-label-sm text-center">부서</label>
      <div class="col-sm-4">
        <select class="form-select form-select-sm" id="ofcCd" name="ofcCd">
          <option value="">--선택--</option>
          <th:block th:each="code:${ofcList}">
            <option th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq userInfo.ofcCd}"></option>
          </th:block>
        </select>
      </div>
      <label for="ofcInDate" class="col-sm-2 col-form-label col-form-label-sm text-center">현부서임용일</label>
      <div class="col-sm-4">
        <input type="text" class="form-control form-control-sm dateSelector" id="ofcInDate" name="ofcInDate" th:value="${userInfo.ofcInDate}" readonly>
      </div>
    </div>
    <div class="mb-3 row">
      <label for="titleCd" class="col-sm-2 col-form-label col-form-label-sm text-center">계급</label>
      <div class="col-sm-4">
        <select class="form-select form-select-sm" id="titleCd" name="titleCd">
          <option value="">--선택--</option>
          <th:block th:each="code:${titleList}">
            <option th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq userInfo.titleCd}"></option>
          </th:block>
        </select>
      </div>
      <label for="titleInDate" class="col-sm-2 col-form-label col-form-label-sm text-center">현계급임용일</label>
      <div class="col-sm-4">
        <input type="text" class="form-control form-control-sm dateSelector" id="titleInDate" name="titleInDate" th:value="${userInfo.titleInDate}" readonly>
      </div>
    </div>
    <div class="mb-3 row">
      <label for="outturnCd" class="col-sm-2 col-form-label col-form-label-sm text-center">경과</label>
      <div class="col-sm-4">
        <select class="form-select form-select-sm" id="outturnCd" name="outturnCd">
          <option value="">--선택--</option>
          <th:block th:each="code:${outturnList}">
            <option th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq userInfo.outturnCd}"></option>
          </th:block>
        </select>
      </div>
      <label for="seriesCd" class="col-sm-2 col-form-label col-form-label-sm text-center">직별</label>
      <div class="col-sm-4">
        <select class="form-select form-select-sm" id="seriesCd" name="seriesCd">
          <option value="">--선택--</option>
          <th:block th:each="code:${seriesList}">
            <option th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq userInfo.seriesCd}"></option>
          </th:block>
        </select>
      </div>
    </div>
    <div class="mb-3 row">
      <label for="languageCd" class="col-sm-2 col-form-label col-form-label-sm text-center">외국어특채</label>
      <div class="col-sm-4">
        <select class="form-select form-select-sm" id="languageCd" name="languageCd">
          <option value="">--선택--</option>
          <th:block th:each="code:${languageList}">
            <option th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq userInfo.languageCd}"></option>
          </th:block>
        </select>
      </div>
    </div>
  </form>
</div>
<div class="modal-footer row justify-content-between">
  <div class="col-auto">
    <th:block th:if="${accessAuth eq 'ACC003'}">
      <button type="button" class="btn btn-info" id="syncToKwmsBtn" th:disabled="${#strings.isEmpty(userInfo.dicCode)}">인사시스템 정보 불러오기</button>
      <th:block th:if="${#strings.isEmpty(userInfo.dicCode)}">
        <label for="syncToKwmsBtn" style="font-size: 12px">공무원식별번호가 필요합니다.</label>
      </th:block>
    </th:block>
  </div>
  <div class="col-auto">
    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
    <button type="button" class="btn btn-warning" id="updateBtn" th:if="${accessAuth eq 'ACC003'}">수정</button>
  </div>
</div>
</html>