<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">

<div class="modal-header">
<h5 class="modal-title" th:text="${shipInfo.siType eq 'KRCN' ? '한-중 국제여객선 상세' : shipInfo.siType eq 'KRJPRU' ? '한-일,러 국제여객선 상세' : null}"></h5>
  <button type="button" id="btn-close" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
	<ul class="nav nav-tabs" id="userTab" role="tablist">
        <li class="nav-item" role="presentation">
          <button class="nav-link active" id="viewTab" th:data-siseq="${shipInfo.siSeq}" th:data-sitype="${shipInfo.siType}" data-bs-toggle="tab" data-bs-target="#accessTabPanel" type="button" role="tab" aria-controls="accessTabPanel" aria-selected="true">현황상세</button>
        </li>
        <li class="nav-item" role="presentation">
          <button class="nav-link" id="historyTab" th:data-siseq="${shipInfo.siSeq}" th:data-sitype="${shipInfo.siType}" data-bs-toggle="tab" data-bs-target="#approvalTabPanel" type="button" role="tab" aria-controls="approvalTabPanel" aria-selected="false">수정이력</button>
        </li>
   </ul>
  <form id="shipInfoUpdate" 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" id="vSiSeq" name="siSeq" th:value="${shipInfo.siSeq}">
   		<input type="hidden" id="vSiType" name="siType" th:value="${shipInfo.siType}">
   		<input type="hidden" name="versionNo" th:value="${shipInfo.versionNo}">
          <h5 class="text-center">항로</h5>
          <div class="mb-2 row">
            <label for="startPointM" class="col-sm-2 col-form-label text-center">출발</label>        
            <div class="col-sm-3">
               <input type="text" class="form-control" id="startPointM" name="startPoint" th:value="${shipInfo.startPoint}">
            </div>
           <label for="endPointM" class="col-sm-2 col-form-label text-center">도착</label>
            <div class="col-sm-3">
              <input type="text" class="form-control" id="endPointM" name="endPoint" th:value="${shipInfo.endPoint}">
            </div> 
          </div>
          <div class="mb-2 row">
            <label for="distanceNmM" class="col-sm-2 col-form-label text-center">거리(해리)</label>        
            <div class="col-sm-3">
               <input type="text" class="form-control" id="distanceNmM" name="distanceNm" th:value="${shipInfo.distanceNm}" placeholder="ex:OOO해리">
            </div>
            <label for="distanceKmM" class="col-sm-2 col-form-label text-center">거리(KM)</label>        
            <div class="col-sm-3">
               <input type="text" class="form-control" id="distanceKmM" name="distanceKm" th:value="${shipInfo.distanceKm}" placeholder="ex:OOOKm">
            </div>
          </div>
          <br><br>
          <div class="mb-3 row">
            <label for="shipWeightM" class="col-sm-2 col-form-label text-center">국제총톤 수</label>
            <div class="col-sm-3">
                  <input type="number" class="form-control" id="shipWeightM" name="shipWeight" th:value="${shipInfo.shipWeight}">
            </div>
            <label for="passengerCntM" class="col-sm-2 col-form-label text-center">여객</label>
            <div class="col-sm-3">
                  <input type="number" class="form-control" id="passengerCntM" name="passengerCnt" th:value="${shipInfo.passengerCnt}" placeholder="단위:명">
            </div> 
          </div>
          <div class="mb-1 row">
          <label for="freightCntM" class="col-sm-2 col-form-label text-center">화물</label>
            <div class="col-sm-3">
                  <input type="number" class="form-control" id="freightCntM" name="freightCnt" th:value="${shipInfo.freightCnt}" placeholder="단위:TEU">
            </div>
          </div>
          <br><br>
          <div class="mb-4 row">
            <label for="ownerNmM" class="col-sm-2 col-form-label text-center">사업자</label>
            <div class="col-sm-3">
                  <input type="text" class="form-control" id="ownerNmM" name="ownerNm" th:value="${shipInfo.ownerNm}">
            </div>
            <label for="shipNmM" class="col-sm-2 col-form-label text-center">선명</label>
            <div class="col-sm-3">
                  <input type="text" class="form-control" id="shipNmM" name="shipNm" th:value="${shipInfo.shipNm}">
            </div>
          </div>
          <div class="mb-1 row">
          <label for="operationCntM" class="col-sm-2 col-form-label text-center">운항횟수</label>
            <div class="col-sm-3">
                  <input type="text" class="form-control" id="operationCntM" name="operationCnt" th:value="${shipInfo.operationCnt}" placeholder="ex:주0회(00H)">
            </div>
          </div>
          <div class="mb-1 row">
            <label for="closeYnM" class="col-sm-2 col-form-label text-center">휴항</label>
            <div class="col-sm-2">
            <select class="form-select form-select-sm" id="closeYnM" name="closeYn">
                  <option value="">선택</option>
                  <option value="O" th:selected="${shipInfo.closeYn eq 'O'}">O</option>
                  <option value="X" th:selected="${shipInfo.closeYn eq 'X'}">X</option>
           </select>
           </div>
          </div>
          <div class="mb-1 row">
            <label for="descriptionM" class="col-sm-2 col-form-label text-center">비고</label>
            <div class="col-sm-4">
                  <textarea id="descriptionM" name="description" rows="4" cols="50" th:utext="${shipInfo.description}"></textarea>
            </div>
          </div>
      </form>
</div>
<div class="modal-footer justify-content-between">
<div class="col-auto">
    <button type="button" class="btn btn-secondary" id="btn-close" data-bs-dismiss="modal">닫기</button>
    <button type="button" class="btn btn-danger" id="deleteShipInfo" th:if="${accessAuth eq 'ACC003'} or ${wrtUserSeq eq userSeq}">삭제</button>
</div>
<div class="col-auto">
</div>
  <div class="col-auto">
    <button type="button" class="btn btn-warning" id="updateShipInfo" th:if="${accessAuth eq 'ACC003'} or ${wrtUserSeq eq userSeq}">수정</button>
  </div>
</div>
</html>