<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header">
  <h5 class="modal-title" id="crackdownStatusEditModalLabel" th:text="${crackdownStatus.cdsKey eq null ? '불법조업 외국어선 단속등록' : '불법조업 외국어선 단속수정'}">></h5>
  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="cdsEditBody">
  <form action="#" method="post" id="cdsEditForm">
    <input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
    <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="cdsKey" th:value="${crackdownStatus.cdsKey}">
    <th:block th:if="${crackdownStatus.fishingBoat ne null}">
      <input type="hidden" name="fbKey" th:value="${crackdownStatus.fishingBoat.fbKey}">
    </th:block>
    <th:block th:if="${crackdownStatus.processResult ne null}">
      <input type="hidden" name="prKey" th:value="${crackdownStatus.processResult.prKey}">
    </th:block>
    <input type="hidden" name="wrtOrgan" th:value="${crackdownStatus.wrtOrgan}">
    <input type="hidden" name="wrtNm" th:value="${crackdownStatus.wrtNm}">
    <input type="hidden" name="wrtDt" th:value="${#temporals.format(crackdownStatus.wrtDt, 'yyyy-MM-dd HH:mm')}">
    <input type="hidden" id="saveYn" name="saveYn">
    <div class="mb-3 row">
      나포정보
    </div>
    <div class="mb-3 row">
      <div class="col-sm-1">
        <label class="col-auto col-form-label text-center">나포일시</label>
        <label class="col-auto col-form-label text-center">NLL</label>
      </div>
      <div class="col-sm-2">
        <input class="form-control" name="napoDt" id="napoDt">
        <select class="form-select form-select-sm" name="nll">
          <option value="Y">O</option>
          <option value="N">X</option>
        </select>
      </div>
      <label class="col-sm-1 col-form-label text-center">위반장소</label>
      <div class="col-sm-2">
        <input class="form-control" placeholder="위도" name="napoSeaPointLat">
        <input class="form-control" placeholder="경도" name="napoSeaPointLon">
        <input class="form-control" placeholder="상세내용" name="napoSeaPointDetail">
      </div>
      <div class="col-sm-1">
        <label class="col-form-label text-center">위반내용</label>
        <button type="button" class="btn btn-primary col-auto" id="violationAddBtn">+</button>
      </div>
      <div class="col-sm-2" id="violationDiv">
        <th:block th:if="${#lists.isEmpty(crackdownStatus.violationList)}">
          <select class="form-select form-select-sm violation" name="violation">
            <option value="">선택</option>
            <th:block th:each="commonCode:${session.commonCode.get('VT')}">
              <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
            </th:block>
            <option value="etc">직접입력</option>
          </select>
        </th:block>
        <th:block th:if="${!#lists.isEmpty(crackdownStatus.violationList)}">
          <th:block th:each="violation : ${crackdownStatus.violationList}">
            <th:block th:each="commonCode:${session.commonCode.get('VT')}">
              <input type="hidden" name="violationKey" th:value="${violation.violationKey}">
              <select class="form-select form-select-sm violation" name="violation">
                <option value="">선택</option>
                <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                        th:selected="${crackdownStatus.violationList != null and commonCode.itemCd eq crackdownStatus.violationList.violation}"></option>
                <option value="etc">직접입력</option>
              </select>
            </th:block>
          </th:block>
        </th:block>
      </div>
      <label class="col-sm-1 col-form-label text-center">침범유형</label>
      <div class="col-sm-2">
        <select class="form-select form-select-sm" name="invasionType">
          <option value="">선택</option>
          <th:block th:each="commonCode:${session.commonCode.get('IST')}">
            <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                    th:selected="${commonCode.itemCd eq crackdownStatus.invasionType}"></option>
          </th:block>
        </select>
      </div>
    </div>
    <div class="mb-3 row">
      특수공무집행방해
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">발생건수</label>
      <div class="col-sm-2">
        <input type="number" min="0" class="form-control" name="obstrExspdCnt">
      </div>
      <label class="col-sm-1 col-form-label text-center">피해인원</label>
      <div class="col-sm-2">
        <input type="number" min="0" class="form-control" name="personDamageCnt">
      </div>
      <label class="col-sm-1 col-form-label text-center">피해액</label>
      <div class="col-sm-2">
        <input type="number" min="0" class="form-control" name="personDamageAmount">
      </div>
      <label class="col-sm-1 col-form-label text-center">상세내용</label>
      <div class="col-sm-2">
        <input class="form-control" name="personDamageDetail">
      </div>
      <label class="col-sm-1 col-form-label text-center">발생건수</label>
      <div class="col-sm-2">
        <input type="number" min="0" class="form-control" name="materialDamageCnt">
      </div>
      <label class="col-sm-1 col-form-label text-center">피해액</label>
      <div class="col-sm-2">
        <input type="number" min="0" class="form-control" name="materialDamageAmount">
      </div>
      <label class="col-sm-1 col-form-label text-center">상세내용</label>
      <div class="col-sm-2">
        <input class="form-control" name="materialDamageDetail">
      </div>
    </div>
    <div class="mb-3 row">
      검거기관
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">사건담당 기관</label>
      <div class="col-sm-2">
        <select class="form-select form-select-sm" name="caseAgency">
          <option value="">선택</option>
          <th:block th:each="commonCode:${session.commonCode.get('ATA')}">
            <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                    th:selected="${commonCode.itemCd eq crackdownStatus.caseAgency}"></option>
          </th:block>
        </select>
      </div>
      <label class="col-sm-1 col-form-label text-center">단속<br>경찰서</label>
      <div class="col-sm-2">
        <select class="form-select form-select-sm" name="crackdownPolice" id="crackdownPolice">
          <option value="">선택</option>
          <th:block th:each="commonCode:${session.commonCode.get('CPO')}">
            <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                    th:selected="${commonCode.itemCd eq crackdownStatus.crackdownPolice}"></option>
          </th:block>
          <option value="etc">직접입력</option>
        </select>
      </div>
      <label class="col-sm-1 col-form-label text-center">단속함정</label>
      <div class="col-sm-2">
        <select class="form-select form-select-sm" name="crackdownBoat" id="crackdownBoat">
          <option value="">선택</option>
          <th:block th:each="commonCode:${session.commonCode.get('CDB')}">
            <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                    th:selected="${commonCode.itemCd eq crackdownStatus.crackdownPolice}"></option>
          </th:block>
          <option value="etc">직접입력</option>
        </select>
      </div>
      <label class="col-sm-1 col-form-label text-center">MMSI.NO</label>
      <div class="col-sm-2">
        <input class="form-control" name="mmsi">
      </div>
    </div>
    <div class="mb-3 row">
      선박제원
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">선명</label>
      <div class="col-sm-2">
        <input class="form-control" name="boatNameKr">
      </div>
      <label class="col-sm-1 col-form-label text-center">톤수</label>
      <div class="col-sm-2">
        <input type="number" min="0" class="form-control" name="tonCnt">
      </div>
      <label class="col-sm-1 col-form-label text-center">선질</label>
      <div class="col-sm-2">
        <select class="form-select form-select-sm" name="boatMaterial" id="boatMaterial">
          <option value="">선택</option>
          <th:block th:each="commonCode:${session.commonCode.get('BM')}">
            <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                    th:selected="${crackdownStatus.fishingBoat ne null && commonCode.itemCd eq crackdownStatus.fishingBoat.boatMaterial}"></option>
          </th:block>
          <option value="etc">직접입력</option>
        </select>
      </div>
      <label class="col-sm-1 col-form-label text-center">선적 성</label>
      <div class="col-sm-2">
        <input class="form-control" name="boatNnySung">
      </div>
      <label class="col-sm-1 col-form-label text-center">선적 시</label>
      <div class="col-sm-2">
        <input class="form-control" name="boatNnyAi">
      </div>
      <label class="col-sm-1 col-form-label text-center">선장명</label>
      <div class="col-sm-2">
        <input class="form-control" name="sailorNameKr">
      </div>
      <label class="col-sm-1 col-form-label text-center">출생년도</label>
      <div class="col-sm-2">
        <input class="form-control" name="birthdate" id="birthdate">
      </div>
      <label class="col-sm-1 col-form-label text-center">선종</label>
      <div class="col-sm-2">
        <input class="form-control" name="fisheryType">
      </div>
    </div>
    <div class="mb-3 row">
      어획물 축소기재
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">어종</label>
      <div class="col-sm-2">
        <input class="form-control" name="catchFishSpecies">
      </div>
      <label class="col-sm-1 col-form-label text-center">수량</label>
      <div class="col-sm-2">
        <input type="number" min="0" class="form-control" name="catchCnt">
      </div>
    </div>
    <div class="mb-3 row">
      범칙물
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">어종</label>
      <div class="col-sm-2">
        <input class="form-control" name="offenseFishSpecies">
      </div>
      <label class="col-sm-1 col-form-label text-center">어획량</label>
      <div class="col-sm-2">
        <input type="number" min="0" class="form-control" name="offenseCatchCnt">
      </div>
      <label class="col-sm-1 col-form-label text-center">폐기량</label>
      <div class="col-sm-2">
        <input type="number" min="0" class="form-control" name="offenseIllegalWasteQuantity">
      </div>
      <label class="col-sm-1 col-form-label text-center">위판량</label>
      <div class="col-sm-2">
        <input type="number" min="0" class="form-control" name="offenseQuantity">
      </div>
      <label class="col-sm-1 col-form-label text-center">위판금액</label>
      <div class="col-sm-2">
        <input type="number" min="0" class="form-control" name="offenseAmount">
      </div>
    </div>
    <div class="mb-3 row">
      처리결과
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">처리현황</label>
      <div class="col-sm-2">
        <select class="form-select form-select-sm" name="processStatus" id="processStatus">
          <option value="">선택</option>
          <th:block th:each="commonCode:${session.commonCode.get('PR')}">
            <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                    th:selected="${crackdownStatus.processResult ne null && commonCode.itemCd eq crackdownStatus.processResult.processStatus}"></option>
          </th:block>
          <option value="etc">직접입력</option>
        </select>
      </div>
    </div>
    <div class="mb-3 row">
      담보금 납부
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">납부액</label>
      <div class="col-sm-2">
        <input type="number" min="0" class="form-control" name="damboPayment">
      </div>
      <label class="col-sm-1 col-form-label text-center">납부일시</label>
      <div class="col-sm-2">
        <input class="form-control" name="paymentPaymentDt" id="paymentPaymentDt">
      </div>
    </div>
    <div class="mb-3 row">
      담보금 미납
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">미납액</label>
      <div class="col-sm-2">
        <input type="number" min="0" class="form-control" name="damboUnpaidAmount">
      </div>
    </div>
    <div class="mb-3 row">
      선박처리
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">위탁시작일</label>
      <div class="col-sm-2">
        <input class="form-control" name="consignmentStartDt" id="consignmentStartDt">
      </div>
      <label class="col-sm-1 col-form-label text-center">위탁종료일</label>
      <div class="col-sm-2">
        <input class="form-control" name="consignmentEndDt" id="consignmentEndDt">
      </div>
      <label class="col-sm-1 col-form-label text-center">퇴거일</label>
      <div class="col-sm-2">
        <input class="form-control" name="evictionDt" id="evictionDt">
      </div>
      <label class="col-sm-1 col-form-label text-center">환부일</label>
      <div class="col-sm-2">
        <input class="form-control" name="returnDt" id="returnDt">
      </div>
      <label class="col-sm-1 col-form-label text-center">몰수확정일</label>
      <div class="col-sm-2">
        <input class="form-control" name="confiscationDt" id="confiscationDt">
      </div>
      <label class="col-sm-1 col-form-label text-center">폐선일</label>
      <div class="col-sm-2">
        <input class="form-control" name="boatDisposalDt" id="boatDisposalDt">
      </div>
      <label class="col-sm-1 col-form-label text-center">폐선종류</label>
      <div class="col-sm-2">
        <select class="form-select form-select-sm" name="boatDisposalType">
          <option value="">선택</option>
          <th:block th:each="commonCode:${session.commonCode.get('BDT')}">
            <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
                    th:selected="${crackdownStatus.processResult ne null && commonCode.itemCd eq crackdownStatus.processResult.boatDisposalType}"></option>
          </th:block>
        </select>
      </div>
    </div>
    <div class="mb-3 row">
      직접인계
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">직접인계일</label>
      <div class="col-sm-2">
        <input class="form-control" name="directHandoverDt" id="directHandoverDt">
      </div>
      <label class="col-sm-1 col-form-label text-center">해점</label>
      <div class="col-sm-2">
        <input class="form-control" placeholder="경도" name="handoverSeaPointLon">
        <input class="form-control" placeholder="위도" name="handoverSeaPointLat">
        <input class="form-control" placeholder="상세내용" name="handoverSeaPointDetail">
      </div>
      <label class="col-sm-1 col-form-label text-center">인계함정</label>
      <div class="col-sm-2">
        <input class="form-control" name="handoverBoat">
      </div>
      <label class="col-sm-1 col-form-label text-center">중측</br>인수함정</label>
      <div class="col-sm-2">
        <input class="form-control" name="middleTakeoverBoat">
      </div>
    </div>
    <div class="mb-3 row">
      구속/ 불구속
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">선장</label>
      <div class="col-sm-2">
        <select class="form-select form-select-sm" name="captin">
          <option value="">선택</option>
          <option value="Y">구속</option>
          <option value="N">불구속</option>
        </select>
      </div>
      <label class="col-sm-1 col-form-label text-center">향해장</label>
      <div class="col-sm-2">
        <select class="form-select form-select-sm" name="mate">
          <option value="">선택</option>
          <option value="Y">구속</option>
          <option value="N">불구속</option>
        </select>
      </div>
      <label class="col-sm-1 col-form-label text-center">기관장</label>
      <div class="col-sm-2">
        <select class="form-select form-select-sm" name="warden">
          <option value="">선택</option>
          <option value="Y">구속</option>
          <option value="N">불구속</option>
        </select>
      </div>
      <button type="button" class="btn btn-primary col-auto" id="sailorAddBtn">선원 추가</button>
    </div>
    <div class="mb-3 row" id="sailorDiv">
      <!--
      <div class="row">
        <label class="col-sm-1 col-form-label text-center">선원 이름</label>
        <div class="col-sm-2">
          <input class="form-control" name="sailorNameKr">
        </div>
        <div class="col-sm-2">
          <select class="form-select form-select-sm sailor-list" name="sailor">
            <option value="">선택</option>
            <option value="Y">구속</option>
            <option value="N">불구속</option>
          </select>
        </div>
        <button type="button" class="btn btn-primary col-auto" id="sailorRemoveBtn">-</button>
      </div>
      -->
    </div>
    <div class="mb-3 row">
      현장조사
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">나포일시</label>
      <div class="col-sm-2">
        <input class="form-control" name="fieldIvsgtNapoDt" id="fieldIvsgtNapoDt">
      </div>
      <label class="col-sm-1 col-form-label text-center">석방일시</label>
      <div class="col-sm-2">
        <input class="form-control" name="fieldIvsgtReleaseDt" id="fieldIvsgtReleaseDt">
      </div>
      <label class="col-sm-1 col-form-label text-center">소요시간</label>
      <div class="col-sm-2">
        <input class="form-control" name="fieldIvsgtTimeTaken">
      </div>
    </div>
    <div class="mb-3 row">
      압송
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">압송시작</label>
      <div class="col-sm-2">
        <input class="form-control" name="pressurizedStartDt" id="pressurizedStartDt">
      </div>
      <label class="col-sm-1 col-form-label text-center">압송종료</label>
      <div class="col-sm-2">
        <input class="form-control" name="pressurizedEndDt" id="pressurizedEndDt">
      </div>
      <label class="col-sm-1 col-form-label text-center">영장청구<br>소요시간</label>
      <div class="col-sm-2">
        <input class="form-control" name="warrantReqTakeTime" readonly>
      </div>
      <label class="col-sm-1 col-form-label text-center">거리</label>
      <div class="col-sm-2">
        <input class="form-control" name="distance">
      </div>
    </div>
    <div class="mb-3 row">
      압수어구
    </div>
    <div class="mb-3 row">
      <label class="col-sm-1 col-form-label text-center">틀</label>
      <div class="col-sm-2">
        <input class="form-control" name="confiscationFrame">
      </div>
      <label class="col-sm-1 col-form-label text-center">폭</label>
      <div class="col-sm-2">
        <input class="form-control" name="confiscationWidth">
      </div>
      <label class="col-sm-1 col-form-label text-center">조</label>
      <div class="col-sm-2">
        <input class="form-control" name="confiscationJo">
      </div>
      <label class="col-sm-1 col-form-label text-center">개</label>
      <div class="col-sm-2">
        <input class="form-control" name="confiscationGae">
      </div>
      <label class="col-sm-1 col-form-label text-center">기타</label>
      <div class="col-sm-2">
        <input class="form-control" name="confiscationEtc">
      </div>
    </div>
  </form>
</div>
<div class="modal-footer">
  <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
  <button type="button" class="btn btn-warning" id="saveTempBtn">임시저장</button>
  <button type="button" class="btn btn-primary" id="saveCrackdownStatusBtn">저장</button>
</div>
</html>