<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="dateUtil" uri="http://egovframework.go.kr/functions/date-util" %>

<div class="popup_wrap">
    <div class="popup_inner">
        <div class="popup_tit">
            <h2 class="tit">자동차 등록원부 정보</h2>
            <a href="#" class="pop-x-btn modalclose"></a>
        </div>
        <div class="popup_con">
            <div class="forms_table_non">
                <table>
                    <colgroup>
                        <col style="width: 20%;" />
                        <col style="width: 30%;" />
                        <col style="width: 20%;" />
                        <col style="width: 30%;" />
                    </colgroup>
                    <tr>
                        <th class="th">연계결과코드</th>
                        <td id="cntcResultCode">${data.cntcResultCode}</td>
                        <th class="th">연계결과상세</th>
                        <td id="cntcResultDtls">${data.cntcResultDtls}</td>
                    </tr>
                    <tr>
                        <th class="th">원부그룹번호</th>
                        <td id="ledgerGroupNo">${data.ledgerGroupNo}</td>
                        <th class="th">원부개별화번호</th>
                        <td id="ledgerIndvdlzNo">${data.ledgerIndvdlzNo}</td>
                    </tr>
                    <tr>
                        <th class="th">차량관리번호</th>
                        <td id="vhmno">${data.vhmno}</td>
                        <th class="th">차량번호</th>
                        <td id="vhrno">${data.vhrno}</td>
                    </tr>
                    <tr>
                        <th class="th">차대번호</th>
                        <td id="vin">${data.vin}</td>
                        <th class="th">차종분류코드</th>
                        <td id="vhctyAsortCode">${data.vhctyAsortCode}</td>
                    </tr>
                    <tr>
                        <th class="th">차종분류명</th>
                        <td id="vhctyAsortNm">${data.vhctyAsortNm}</td>
                        <th class="th">차명</th>
                        <td id="cnm">${data.cnm}</td>
                    </tr>
                    <tr>
                        <th class="th">색상코드</th>
                        <td id="colorCode">${data.colorCode}</td>
                        <th class="th">색상명</th>
                        <td id="colorNm">${data.colorNm}</td>
                    </tr>
                    <tr>
                        <th class="th">번호판규격코드</th>
                        <td id="nmplStndrdCode">${data.nmplStndrdCode}</td>
                        <th class="th">번호판규격명</th>
                        <td id="nmplStndrdNm">${data.nmplStndrdNm}</td>
                    </tr>
                    <tr>
                        <th class="th">용도구분코드</th>
                        <td id="prposSeCode">${data.prposSeCode}</td>
                        <th class="th">용도구분명</th>
                        <td id="prposSeNm">${data.prposSeNm}</td>
                    </tr>
                    <tr>
                        <th class="th">제작사명</th>
                        <td id="mtrsFomNm">${data.mtrsFomNm}</td>
                        <th class="th">형식명</th>
                        <td id="fomNm">${data.fomNm}</td>
                    </tr>
                    <tr>
                        <th class="th">취득금액</th>
                        <td id="acqsAmount">${data.acqsAmount}</td>
                        <th class="th">등록상세코드</th>
                        <td id="registDetailCode">${data.registDetailCode}</td>
                    </tr>
                    <tr>
                        <th class="th">등록상세명</th>
                        <td id="registDetailNm">${data.registDetailNm}</td>
                        <th class="th">최초등록일자</th>
                        <td id="frstRegistDe">${data.frstRegistDe}</td>
                    </tr>
                    <tr>
                        <th class="th">자동차보험종료일자</th>
                        <td id="caagEndde">${data.caagEndde}</td>
                        <th class="th">생산년도</th>
                        <td id="prye">${data.prye}</td>
                    </tr>
                    <tr>
                        <th class="th">사양번호1</th>
                        <td id="spmnno1">${data.spmnno1}</td>
                        <th class="th">사양번호2</th>
                        <td id="spmnno2">${data.spmnno2}</td>
                    </tr>
                    <tr>
                        <th class="th">연식월</th>
                        <td id="yblMd">${data.yblMd}</td>
                        <th class="th">주행거리</th>
                        <td id="trvlDstnc">${data.trvlDstnc}</td>
                    </tr>
                    <tr>
                        <th class="th">검사유효기간시작일자</th>
                        <td id="insptValidPdBgnde">${data.insptValidPdBgnde}</td>
                        <th class="th">검사유효기간종료일자</th>
                        <td id="insptValidPdEndde">${data.insptValidPdEndde}</td>
                    </tr>
                    <tr>
                        <th class="th">점검유효기간시작일자</th>
                        <td id="chckValidPdBgnde">${data.chckValidPdBgnde}</td>
                        <th class="th">점검유효기간종료일자</th>
                        <td id="chckValidPdEndde">${data.chckValidPdEndde}</td>
                    </tr>
                    <tr>
                        <th class="th">등록신청구분명</th>
                        <td id="registReqstSeNm">${data.registReqstSeNm}</td>
                        <th class="th">최초등록신청번호</th>
                        <td id="frstRegistRqrcno">${data.frstRegistRqrcno}</td>
                    </tr>
                    <tr>
                        <th class="th">번호판보관반납일자</th>
                        <td id="nmplCsdyRemnrDe">${data.nmplCsdyRemnrDe}</td>
                        <th class="th">번호판보관여부</th>
                        <td id="nmplCsdyAt">${data.nmplCsdyAt}</td>
                    </tr>
                    <tr>
                        <th class="th">영업용사용기간</th>
                        <td id="bssUsePd">${data.bssUsePd}</td>
                        <th class="th">직권말소예방공지일자</th>
                        <td id="octhtErsrPrvntcNticeDe">${data.octhtErsrPrvntcNticeDe}</td>
                    </tr>
                    <tr>
                        <th class="th">말소등록일자</th>
                        <td id="ersrRegistDe">${data.ersrRegistDe}</td>
                        <th class="th">말소등록구분코드</th>
                        <td id="ersrRegistSeCode">${data.ersrRegistSeCode}</td>
                    </tr>
                    <tr>
                        <th class="th">말소등록구분명</th>
                        <td id="ersrRegistSeNm">${data.ersrRegistSeNm}</td>
                        <th class="th">저당건수</th>
                        <td id="mrtgcnt">${data.mrtgcnt}</td>
                    </tr>
                    <tr>
                        <th class="th">차량건수</th>
                        <td id="vhclecnt">${data.vhclecnt}</td>
                        <th class="th">압인건수</th>
                        <td id="stmdcnt">${data.stmdcnt}</td>
                    </tr>
                    <tr>
                        <th class="th">주소1</th>
                        <td id="adres1">${data.adres1}</td>
                        <th class="th">주소명1</th>
                        <td id="adresNm1">${data.adresNm1}</td>
                    </tr>
                    <tr>
                        <th class="th">주소</th>
                        <td id="adres">${data.adres}</td>
                        <th class="th">주소명</th>
                        <td id="adresNm">${data.adresNm}</td>
                    </tr>
                    <tr>
                        <th class="th">개인법인여부</th>
                        <td id="indvdlBsnmAt">${data.indvdlBsnmAt}</td>
                        <th class="th">전화번호</th>
                        <td id="telno">${data.telno}</td>
                    </tr>
                    <tr>
                        <th class="th">소유자명</th>
                        <td id="mberNm">${data.mberNm}</td>
                        <th class="th">소유자구분코드</th>
                        <td id="mberSeCode">${data.mberSeCode}</td>
                    </tr>
                    <tr>
                        <th class="th">소유자구분번호</th>
                        <td id="mberSeNo">${data.mberSeNo}</td>
                        <th class="th">면세대상자구분코드</th>
                        <td id="taxxmptTrgterSeCode">${data.taxxmptTrgterSeCode}</td>
                    </tr>
                    <tr>
                        <th class="th">면세대상자구분코드명</th>
                        <td id="taxxmptTrgterSeCodeNm">${data.taxxmptTrgterSeCodeNm}</td>
                        <th class="th">건수사항</th>
                        <td id="cntMatter">${data.cntMatter}</td>
                    </tr>
                    <tr>
                        <th class="th">읍면동명</th>
                        <td id="emdNm">${data.emdNm}</td>
                        <th class="th">예방건수</th>
                        <td id="prvntccnt">${data.prvntccnt}</td>
                    </tr>
                    <tr>
                        <th class="th">수출이행여부확인일자</th>
                        <td id="xportFlflAtSttemntDe">${data.xportFlflAtSttemntDe}</td>
                        <th class="th">협력사신청번호</th>
                        <td id="partnRqrcno">${data.partnRqrcno}</td>
                    </tr>
                </table>

                <!-- 등록원부 변경 이력 -->
                <c:if test="${not empty data.record}">
                    <h3 class="sub_tit" style="margin-top: 30px;">등록원부 변경 이력 (${fn:length(data.record)}건)</h3>
                    <table>
                        <colgroup>
                            <col style="width: 5%;" />
                            <col style="width: 7%;" />
                            <col style="width: 8%;" />
                            <col style="width: 6%;" />
                            <col style="width: 6%;" />
                            <col style="width: 8%;" />
                            <col style="width: 10%;" />
                            <col style="width: 8%;" />
                            <col style="width: 8%;" />
                            <col style="width: 8%;" />
                            <col style="width: 8%;" />
                            <col style="width: auto;" />
                            <col style="width: 7%;" />
                            <col style="width: 6%;" />
                        </colgroup>
                        <thead>
                            <tr>
                                <th class="th">번호</th>
                                <th class="th">메인체크</th>
                                <th class="th">변경작업구분코드</th>
                                <th class="th">주번호</th>
                                <th class="th">부번호</th>
                                <th class="th">구분명</th>
                                <th class="th">변경일자</th>
                                <th class="th">원부그룹번호</th>
                                <th class="th">원부개별번호</th>
                                <th class="th">신청번호</th>
                                <th class="th">차량관리번호</th>
                                <th class="th">상세내역</th>
                                <th class="th">상세일련번호</th>
                                <th class="th">플래그</th>
                            </tr>
                        </thead>
                        <tbody>
                            <c:forEach var="rec" items="${data.record}" varStatus="status">
                                <tr>
                                    <td class="text-center">${status.count}</td>
                                    <td class="text-center">${rec.mainchk}</td>
                                    <td class="text-center">${rec.changeJobSeCode}</td>
                                    <td class="text-center">${rec.mainno}</td>
                                    <td class="text-center">${rec.subno}</td>
                                    <td class="text-center">${rec.gubunNm}</td>
                                    <td class="text-center">${rec.changeDe}</td>
                                    <td class="text-center">${rec.ledgerGroupNo}</td>
                                    <td class="text-center">${rec.ledgerIndvdlzNo}</td>
                                    <td class="text-center">${rec.rqrcno}</td>
                                    <td class="text-center">${rec.vhmno}</td>
                                    <td class="text-left">${rec.dtls}</td>
                                    <td class="text-center">${rec.detailSn}</td>
                                    <td class="text-center">${rec.flag}</td>
                                </tr>
                            </c:forEach>
                        </tbody>
                    </table>
                </c:if>
            </div>
        </div>

        <!-- 팝업 버튼 -->
        <div class="popup_foot">
            <a href="#" class="newbtns bg2 modalclose">닫기</a>
        </div>
    </div>
</div>

<script type="text/javascript">
    (function(window, $) {
        'use strict';

        var LedgerInfoPopup = {
            /**
             * 이벤트 바인딩
             */
            bindEvents: function() {
                // 팝업 닫기
                $(".modalclose").on('click', function(e) {
                    e.preventDefault();
                    window.close();
                });
            },

            /**
             * 초기화
             */
            init: function() {
                this.bindEvents();
            }
        };

        // DOM 준비 완료 시 초기화
        $(document).ready(function() {
            LedgerInfoPopup.init();
        });

    })(window, jQuery);
</script>
