<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<c:set var="pageKorName" scope="request">면제차량 이력</c:set>

<div class="card" data-doctx="${pageName}">
	<div class="card-datatable text-nowrap">
        <div class="dataTables_wrapper dt-bootstrap5 no-footer">
			<div name="table-responsive"
			class="table-responsive ox-scroll oy-scroll h-px-550">
				<table name="exmptnVhclTable" class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
					<thead class="sticky-thead">
						<tr name="exmptnVhclTheadTr">
							<th style="width: 80px;">No.</th>
							<th style="width: 140px;">차량번호</th>
							<th style="width: 300px;">면제사유</th>
							<th style="width: 200px;">공문번호</th>
							<th style="width: 160px;">소유주명</th>
							<th style="width: 160px;">면제시작일</th>
							<th style="width: 160px;">면제종료일</th>
							<th style="width: 100px;">삭제 여부</th>
							<th style="width: 200px;">삭제사유</th>
							<th style="width: 160px;">등록자</th>
							<th style="width: 200px;">등록일시</th>
							<th style="width: 160px;">수정자</th>
							<th style="width: 200px;">수정일시</th>
							<th style="width: 160px;">삭제자</th>
							<th style="width: 200px;">삭제일시</th>
							<th class="dummy-th"></th>
						</tr>
                    </thead>
                    <tbody name="exmptnVhclTbody"></tbody>
					<template is="curly-brackets" name="exmptnVhclRow">
                   		<tr data-index="DATA-INDEX">
                   			<td onclick ondblclick class="text-end">HSTRY_SN</td>
                   			<td onclick ondblclick class="text-center">VHRNO</td>
                   			<td onclick ondblclick class="text-start">EXMPTN_RSN</td>
                    		<td onclick ondblclick class="text-start">DOC_NO</td>
                    		<td onclick ondblclick class="text-start">OWNR_NM</td>
                    		<td onclick ondblclick class="text-center">EXMPTN_BGNG_YMD</td>
                    		<td onclick ondblclick class="text-center">EXMPTN_END_YMD</td>
                    		<td onclick ondblclick class="text-center">DEL_YN</td>
                    		<td onclick ondblclick class="text-start">DEL_RSN</td>
                    		<td onclick ondblclick class="text-start">RGTR_NM</td>
                    		<td onclick ondblclick class="text-center">REG_DT</td>
                    		<td onclick ondblclick class="text-start">MDFR_NM</td>
                    		<td onclick ondblclick class="text-center">MDFCN_DT</td>
                    		<td onclick ondblclick class="text-start">DLTR_NM</td>
                    		<td onclick ondblclick class="text-center">DEL_DT</td>
                    		<td class="dummy-td"></td>
                    	</tr>
                   	</template>
                   	<template name="exmptnVhclNotFound">
                   		<tr>
                   			<td valign="top" colspan="15" class="dataTables_empty text-center">
                   			면제차량 이력 정보를 찾지 못했습니다.
                   			</td>
                   		</tr>
                   	</template>
				</table>
			</div>
		</div>
    </div>
</div>
<script>
LoadScript("crdn08030Script",wctx.url("/resources/js/fims/crdn/crdn08030.js?ver=${ver}"));

pageObject["${pageName}"] = newDoctxFinder("${pageName}");

var NTR034 = new CommonCodes(${NTR034});

$(document).ready(function(){

	var list = ${list};

	var $P = pageObject["${pageName}"];

	/**************************************************************************
	* DatasetControl, DatasetSupport, FormFields
	**************************************************************************/
	var ctrl = newCrdn08030Control($P);

	ctrl.dataset.onDatasetChange = (obj, option) => {
		var t = $P.getGridTemplate();
		var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
		$P.renderExmptnVhclList(obj["Total"], ctrl.dataset.length, trs);
	}

	/**************************************************************************
	* pageObject.function
	**************************************************************************/

	$P.getGridTemplate = () => {
		var notFound = [$P.findn("exmptnVhclNotFound").innerHTML];
		var found = $P.findn("exmptnVhclRow").innerHTML;
		var replacer = (str, dataItem) => str
			.replace(/{onclick}/gi, "")
        	.replace(/{ondblclick}/gi, "");

		return {
			found : found,
			notFound : notFound,
			replacer : replacer
		};
	}

	$P.renderExmptnVhclList = (total, listLength, trs) => {
		$P.$findn("exmptnVhclTbody").html(trs);

		//보안모드
	    fn_securityModeToggle($("#securityMode--top").is(":checked"));
	}

	ctrl.dataset.setData(list);
});
</script>