<!DOCTYPE html
	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
	layout:decorate="~{admin/layout/layout}" th:with="title='',active='home'">
<th:block layout:fragment="html_head">
	<script language='javascript'>

		function comma_inputgeuminputgeum(id, val) {
			var num = val;
			if (num.length >= 4) {
				re = /^$|,/g;
				num = num.replace(re, "");
				fl = ""
				if (isNaN(num)) {alert("문자는 사용할 수 없습니다."); return 0}
				if (num == 0) return num
				if (num < 0) {
					num = num * (-1)
					fl = "-"
				}
				else {
					num = num * 1 //처음 입력값이 0부터 시작할때 이것을 제거한다.
				}
				num = new String(num)
				temp = ""
				co = 3
				num_len = num.length
				while (num_len > 0) {
					num_len = num_len - co
					if (num_len < 0) {co = num_len + co; num_len = 0}
					temp = "," + num.substr(num_len, co) + temp
				}
				$('#' + id).val(fl + temp.substr(1));
			}
		}


		function num_check() {
			var keyCode = event.keyCode
			if (keyCode < 48 || keyCode > 57) {
				alert("문자는 사용할 수 없습니다." + "[" + keyCode + "]")
				event.returnValue = false
			}
		}


		function parentLoad(url) {
			location.href = url;
		}


		function forDefault() {
			if (confirm("전용 설정 하시겠습니까?")) {
				$.ajax({
					type: "post",
					url: "/agent/forDefault",
					data: {
						siteIdx: '[[${targetSite.siteIdx}]]'			
					},
					async: true,
					dataType: "json",
					success: function (data) {
						if (data.RES == "SUCCESS") {
							alert("변경완료");
							location.reload();
						
						} else {
							alert(data.MSG);

						}
					}
				});
			}
		}
		
		
		function keyUpdate() {
		
			if(confirm("키를 재발급합니다. 기존키는 사용할수 없습니다")) {

			 $.ajax({
		 			type : "post",
		 			url : "/agent/agentUpdate",
		 			data : {
		 				siteKey:"new",
		 				siteId: '[[${targetSite.siteId}]]',
						siteIdx: '[[${targetSite.siteIdx}]]'
		 			},
		 			async : true,
		 			dataType : "json",
		 			success : function(data) {
		 				if(data.RES=="SUCCESS"){
		 					alert("변경완료");		
		 				//	location.href = location.href; 
		 					//$('#ciCreditAmt').val();
		 					//$('#sitekey').val(data.DATA);
		 				}else{
		 					alert(data.MSG);
		 				
		 				}
		 			}
		 		});
			}
		}
	
		function ipUpdate(){
			
			if(confirm("허용 IP를 번경합니다 추가시 , 로 구분해주세요")){
	
				 $.ajax({
		 			type : "post",
		 			url : "/agent/agentUpdate",
		 			data : {
		 				siteIp:$('#siteIp').val(),
		 				siteId: '[[${targetSite.siteId}]]',
						siteIdx: '[[${targetSite.siteIdx}]]'
		 			},
		 			async : true,
		 			dataType : "json",
		 			success : function(data) {
		 				if(data.RES=="SUCCESS"){
		 					alert("변경완료");		
		 				//	location.href = location.href; 
		 					//$('#ciCreditAmt').val();
		 					//$('#siteKey').val(data.DATA);
		 				}else{
		 					alert(data.MSG);
		 				
		 				}
		 			}
			 	});
			}
		}
	
		function cbUpdate(){
		
			if(confirm("기존를 CBURL을 번경합니다")) {

			 $.ajax({
		 			type : "post",
		 			url : "/agent/agentUpdate",
		 			data : {
		 				siteCbUrl:$('#siteCbUrl').val(),
		 				siteId: '[[${targetSite.siteId}]]',
						siteIdx: '[[${targetSite.siteIdx}]]'
		 			},
		 			async : true,
		 			dataType : "json",
		 			success : function(data) {
		 				if(data.RES=="SUCCESS"){
		 					alert("변경완료");		
		 				//	location.href = location.href; 
		 					//$('#ciCreditAmt').val();
		 					//$('#sitekey').val(data.DATA);
		 				}else{
		 					alert(data.MSG);
		 				
		 				}
		 			}
		 		});
			}
		}
	

		function forNexus() {
			if($('#nexusApiId').val() == '') {
				alert("Nexus Agent ID를 입력하세요."); return 0
			}
			
			if($('#nexusApiKey').val() == '') {
				alert("Nexus Agent Key를 입력하세요."); return 0
			}
			
			if (confirm("전용 설정 하시겠습니까?")) {
				$.ajax({
					type: "post",
					url: "/agent/onlyNexus",
					data: {
						siteIdx: '[[${targetSite.siteIdx}]]',
						nexusApiId: $('#nexusApiId').val(),
						nexusApiKey: $('#nexusApiKey').val()
					},
					async: true,
					dataType: "json",
					success: function (data) {
						if (data.RES == "SUCCESS") {
							alert("변경완료");
							location.reload();
						
						} else {
							alert(data.MSG);

						}
					}
				});
			}
		}

		function forXtreem() {
			if (confirm("전용 설정 하시겠습니까?")) {
				$.ajax({
					type: "post",
					url: "/agent/onlyXtreem",
					data: {
						siteIdx: '[[${targetSite.siteIdx}]]',
						xtreemApiId: $('#xtreemApiId').val(),
						xtreemApiKey: $('#xtreemApiKey').val()
					},
					async: true,
					dataType: "json",
					success: function (data) {
						if (data.RES == "SUCCESS") {
							alert("변경완료");
							location.reload();
						
						} else {
							alert(data.MSG);

						}
					}
				});
			}
		}
		
		function memoUpdate() {
			if (confirm("저장하시겠습니까?")) {



				$.ajax({
					type: "post",
					url: "/agent/siteUpdate",
					data: {
						siteId: '[[${targetSite.siteId}]]',
						memo: $('#memo').val()

					},
					async: true,
					dataType: "json",
					success: function (data) {
						if (data.RES == "SUCCESS") {
							alert("변경완료");
							//	location.href = location.href; 
							//$('#ciCreditAmt').val();
							//$('#sitekey').val(data.DATA);
						} else {
							alert(data.MSG);

						}
					}
				});

			}

		}


		function memoUpdate() {
			if (confirm("저장하시겠습니까?")) {



				$.ajax({
					type: "post",
					url: "/agent/siteUpdate",
					data: {
						siteId: '[[${targetSite.siteId}]]',
						memo: $('#memo').val()

					},
					async: true,
					dataType: "json",
					success: function (data) {
						if (data.RES == "SUCCESS") {
							alert("변경완료");
							//	location.href = location.href; 
							//$('#ciCreditAmt').val();
						//	$('#sitekey').val(data.DATA);
						} else {
							alert(data.MSG);

						}
					}
				});

			}

		}

		function creditUpdate() {
			if (confirm("저장하시겠습니까?")) {



				$.ajax({
					type: "post",
					url: "/agent/siteUpdate",
					data: {
						siteId: '[[${targetSite.siteId}]]',
						siteMaxCredit: $('#siteMaxCredit').val(),
						siteCreditRate: $('#siteCreditRate').val()

					},
					async: true,
					dataType: "json",
					success: function (data) {
						if (data.RES == "SUCCESS") {
							alert("변경완료");
							//	location.href = location.href; 
							//$('#ciCreditAmt').val();
							//$('#sitekey').val(data.DATA);
						} else {
							alert(data.MSG);

						}
					}
				});

			}

		}


		function sameRate() {
			if ($('#idleRate').val() == "") {
				alert("수수료를 입력해주세요"); return;

			}
			$('.rate').val($('#idleRate').val());
		}

		function samePointRate() {
			if ($('#idlePointRate').val() == "") {
				alert("수수료를 입력해주세요"); return;

			}
			$('.insurePointRate').val($('#idlePointRate').val());
		}


		function saveRate() {

			if (confirm("저장하시겠습니까?")) {
				var ret = []
				$('#rateList tr').each(function (index, item) {

					var useCheck = $(this).find(".useYn").prop("checked");
					var useYn = "N";
					if (useCheck) {useYn = "Y";}

					var row = {vendorIdx: $(this).find(".vendor").data('vidx'), rate: $(this).find(".rate").val(), insurePointRate: $(this).find(".insurePointRate").val(), useYn: useYn};
					ret.push(row);
				});


				$.ajax({
					type: "post",
					url: "/agent/creditRateSave",
					data: {
						param: {targetSiteIdx: $('#targetSiteIdx').val()},
						paramlist: ret
					},
					async: false,
					dataType: "json",
					success: function (data) {
						if (data.RES == "SUCCESS") {

							alert("처리완료");
						} else { }
					}
				});
			}
		}




		function acharge() {

			if ($('#aiCreditAmt').val() == "" || $('#aiCreditAmt').val() == "0") {
				alert("크레딧을 입력해주세요.");
				return;
			}




			$.ajax({
				type: "post",
				url: "/cash/addProc",
				data: {
					creditType: "AI",
					creditAmt: $('#aiCreditAmt').val().split(",").join(""),
					targetSiteId: '[[${targetSite.siteId}]]',
					targetSiteIdx: '[[${targetSite.siteIdx}]]'
				},
				async: true,
				dataType: "json",
				success: function (data) {
					if (data.RES == "SUCCESS") {
						alert("완료");
						//	location.href = location.href; 
						//$('#ciCreditAmt').val();

					} else {
						alert(data.MSG);

					}
				}
			});

		}

		function aexchange() {

			if ($('#aoCreditAmt').val() == "" || $('#aoCreditAmt').val() == "0") {
				alert("크레딧을 입력해주세요.");
				return;
			}




			$.ajax({
				type: "post",
				url: "/cash/addProc",
				data: {
					creditType: "AO",
					creditAmt: $('#aoCreditAmt').val().split(",").join(""),
					targetSiteId: '[[${targetSite.siteId}]]',
					targetSiteIdx: '[[${targetSite.siteIdx}]]'
				},
				async: true,
				dataType: "json",
				success: function (data) {
					if (data.RES == "SUCCESS") {
						alert("완료");
						//	location.href = location.href; 
						//$('#ciCreditAmt').val();

					} else {
						alert(data.MSG);

					}
				}
			});

		}
		
		
		function saveScvrAll() {
			if(confirm("저장하시겠습니까?")) {
				var ret = []
				var sl = $('.vendorCode');
				//alert(sl.length);
			
			  	$('.vendorCode').each(function(index,item) {
				 	//alert($(this).data('vcode'));
				 	//.find(":selected").attr("data-value");
					var row = {
						vendorIdx:$(this).find(":selected").attr("data-vidx"),
						vendorCode:$(this).val(),
						rate:$(this).find(":selected").attr("data-vrate"),
						useYn:"Y",
						type:0
					};	  		
			  		ret.push(row);
				});
				 
				console.log(ret)
				
		  		$.ajax({
	    			type : "post",
	    			url : "/agent/saveSvcrAll",
	    			data : {
	    				param :{targetSiteIdx: '[[${targetSite.siteIdx}]]'}, 	    				
	   					paramlist:ret
	    			},
	    			async : false,
	    			dataType : "json",
	    			success : function(data) {
	    				if(data.RES=="SUCCESS"){
	    					alert("처리완료");
	    				} else {
	    				}	    				
	    			}
		    	});	 
			}  		
	  	}
		
		function saveScvr(vidx) {
			// alert($('#select_'+vidx).val());
			if(confirm("저장하시겠습니까?")) { 
		    	 $.ajax({
		 			type : "post",
		 			url : "/agent/saveSvcr",
		 			data : {	 	
						  param:{			
			 				targetSiteId:'[[${targetSite.siteId}]]',
			 				targetSiteIdx:'[[${targetSite.siteIdx}]]',
			 				vendorIdx:vidx,
			 				vendorCode:$('#select_'+vidx).val(),
			 				rate:$('#v'+vidx).text(),
			 				type:0 			
		 				}
		 			},
		 			async : true,
		 			dataType : "json",
		 			success : function(data) {
		 				if(data.RES=="SUCCESS"){
		 					alert("완료");		
		 					location.href = location.href; 
		 					//$('#ciCreditAmt').val();
		 				
		 				}else{
		 					alert(data.MSG);
		 				
		 				}
		 			}
		 		});
		 	}
		}
		

		$(document).ready(function () {

			$('ul.tabs').on('click', 'li', function () {
		        var tab_id = $(this).attr('data-tab');
		
		        $('ul.tabs li').removeClass('current');
		        $('.tab-content').removeClass('current');
		
		        $(this).addClass('current');
		        $("#" + tab_id).addClass('current');
		
		        // 상위 탭이 tab-3인 경우, 하위 탭 초기화
		        if (tab_id === 'tab-3') {
		            $('#tab-3 .inner-tabs li.current').click(); // 하위 탭 초기화
		        }
		    });
		
		    // 하위 탭 클릭 처리
		    $('#tab-3 .inner-tabs').on('click', 'li', function () {
		        var inner_tab_id = $(this).attr('data-tab');
		
		        $('#tab-3 .inner-tabs li').removeClass('current');
		        $('#tab-3 .in-tab-content').removeClass('current');
		
		        $(this).addClass('current');
		        $("#" + inner_tab_id).addClass('current');
		    });
		
		    // 초기화: 상위 탭과 하위 탭 활성화
		    $('ul.tabs li.current').click();
			
			$('.modalBtn1').click(function(event){
		      event.stopPropagation();
		      $(".modal-content1").fadeIn(300);
		  	});
		  	$('.modal-content1 .modal-header a').click(function(event){
		      event.stopPropagation();
		      $(".modal-content1").fadeOut(300);
		  	});
		  	
			$('.modalBtn2').click(function(event){
		      event.stopPropagation();
		      $(".modal-content2").fadeIn(300);
		  	});
		  	$('.modal-content2 .modal-header a').click(function(event){
		      event.stopPropagation();
		      $(".modal-content2").fadeOut(300);
		  	});
		  	
		  	$('.modalBtn3').click(function(event){
		      event.stopPropagation();
		      $(".modal-content3").fadeIn(300);
		  	});
		  	$('.modal-content3 .modal-header a').click(function(event){
		      event.stopPropagation();
		      $(".modal-content3").fadeOut(300);
		  	});

			$('.modalBtn4').click(function(event){
		      event.stopPropagation();
		      $(".modal-content4").fadeIn(300);
		  	});
		  	$('.modal-content4 .modal-header a').click(function(event){
		      event.stopPropagation();
		      $(".modal-content4").fadeOut(300);
		  	});
		})
	</script>
	<style>
		ul.tabs {
			margin: 0px;
			padding: 0px;
			list-style: none;
		}

		ul.tabs li {
			background: none;
			color: #222;
			display: inline-block;
			padding: 10px 15px;
			cursor: pointer;
		}

		ul.tabs li.current {
			background: #e6f4f9;
			color: #222;
		}
		
		ul.inner-tabs {
			margin: 0px;
			padding: 0px;
			list-style: none;
		}

		ul.inner-tabs li {
			background: none;
			color: #222;
			display: inline-block;
			padding: 10px 15px;
			cursor: pointer;
		}

		ul.inner-tabs li.current {
			background: #e6f4f9;
			color: #222;
		}
		
		.tab-content {
			display: none;
			background: #e6f4f9;
			padding: 15px;
		}
		
		.tab-content.current {
			display: inherit;
		}
		.table-responsive > table.in-tab-content {
			width: 100%;
		}
		.in-tab-content {
			display: none;
			padding: 15px;
		}
		.in-tab-content.current {
			display: inherit;
		}
		
		.modal-content1 .modal-header{
			justify-content: end;
		}
		
		.modal-content2 .modal-header{
			justify-content: end;
		}
		
		.modal-content3 .modal-header{
			justify-content: end;
		}
		
		.modal-content4 .modal-header{
			justify-content: end;
		}
		.flex-c-c {
			display: flex;
			justify-content: center;
			align-items:center;
		}
		#saveAllBtn {position: absolute; right: 15px; top: 0; color: #fff; padding: 10px 15px; display: inline-block; cursor: pointer; border-radius: 5px; background: #03add2; border: 0; font-size: 14px;}
	</style>
</th:block>

<th:block layout:fragment="content">
	<div class="container-fluid">
		<div class="page-name">
			<h1>에이전시 <em class="bl" th:text="${targetSite.siteName}">1234567</em> 의 정보</h1>
		</div>
		<ul class="tabs">
			<li class="tab-link current" data-tab="tab-1">일반</li>
			<li class="tab-link" data-tab="tab-2">상세설정</li>
			<li class="tab-link" data-tab="tab-3">게임사 연결설정</li>
		</ul>
		<div class="tab-content current" id="tab-1">
			<div class="table">
				<div class="head">
					<h6>에이전시 정보</h6>
					<a class="blBtn" href="javascript:siteInfoUpdate()">저장</a>
				</div>
				<div class="body">
					<div class="table-responsive">
						<table>
							<colgroup>
								<col width="30%">
								<col width="70%">
							</colgroup>
							<tbody>
								<tr>
									<th>아이디</th>
									<td th:text="${targetSite.siteId}">moka</td>
									<input type="hidden" id="targetSiteIdx" class="input"
										th:value="${targetSite.siteIdx}"></input>
								</tr>
								<tr>
									<th>도메인</th>
									<td><input type="text" id="domain" class="input" th:value="${targetSite.domain}" />
									</td>
								</tr>
								<tr>
									<th>비밀번호</th>
									<td><input id="newPass" class="input" type="password" /></td>
								</tr>
								<tr>
									<th>Credit</th>
									<td th:text="${targetSite.credit}">0</td>
								</tr>
								<tr>
									<th>Credit 서브포인트</th>
									<td th:text="${targetSite.point}">0</td>
								</tr>
								<tr>
									<th>보유포인트</th>
									<td>-</td>
								</tr>
								<tr>
									<th>에이전시등급</th>
									<td th:text="${targetSite.siteLevel}">3</td>
								</tr>
								<tr>
									<th>에이전시명</th>
									<td><input type="text" id="siteName" class="input"
											th:value="${targetSite.siteName}" /></td>
								</tr>
								<tr>
									<th>보험금</th>
									<td th:text="${targetSite.insurance}">0</td>
								</tr>
								<tr>
									<th>보험서브포인트</th>
									<td th:text="${targetSite.insurancePoint}">0</td>
								</tr>
								<tr>
									<th>보유머니</th>
									<td>-</td>
								</tr>
								<tr>
									<th>총 회원 수</th>
									<td th:text="${targetSite.downMemCnt}"></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>

			<div class="creditBtnWrap">
				<a th:href="|javascript:parentLoad('/cash/charge?searchSiteId=${targetSite.siteId}')|">크레딧 신청내역</a>
				<a th:href="|javascript:parentLoad('/cash/exchange?searchSiteId=${targetSite.siteId}')|">크레딧 환전내역</a>
				<a th:href="|javascript:parentLoad('/cash/point?searchSiteId=${targetSite.siteId}')|">크레딧 서브포인트 내역</a>
				<a class="creditPop">크레딧 지급</a>
				<div class="creditPopWrap">
					<h4>크레딧 지급<a class="close">닫기</a></h4>
					<input type="text" id="aiCreditAmt" value="0" onkeypress="num_check()"
						onkeyup="comma_inputgeuminputgeum('aiCreditAmt',  this.value)" />
					<a href="javascript:acharge()">지급</a>
				</div>
				<a class="creditPop">크레딧 회수</a>
				<div class="creditPopWrap" style="display:none">
					<h4>크레딧 회수<a class="close">닫기</a></h4>
					<input type="text" id="aoCreditAmt" value="0" onkeypress="num_check()"
						onkeyup="comma_inputgeuminputgeum('aoCreditAmt',  this.value)" />
					<a href="javascript:aexchange()">회수</a>
				</div>
			</div>

			<div class="table">
				<div class="head">
					<h6>에이전시 통계</h6>
					<a class="blBtn" href="javascript:siteInfoUpdate()">저장</a>
				</div>
				<div class="body">
					<div class="table-responsive">
						<table>
							<colgroup>
								<col width="30%">
								<col width="70%">
							</colgroup>
							<tbody>
								<tr>
									<th>총 입금</th>
									<td>0</td>
								</tr>
								<tr>
									<th>총 보험포인트</th>
									<td>0</td>
								</tr>
								<tr>
									<th>총 베팅금</th>
									<td>0</td>
								</tr>
								<tr>
									<th>총 출금</th>
									<td>0</td>
								</tr>
								<tr>
									<th>총 게임머니</th>
									<td>0</td>
								</tr>
								<tr>
									<th>총 윈루즈</th>
									<td>0</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>

			<div class="table">
				<div class="head">
					<h6>메모</h6>
					<a class="blBtn" href="javascript:memoUpdate()">저장</a>
				</div>
				<div class="body">
					<div class="table-responsive">
						<div class="memo">
							<textarea id="memo" th:utext="${targetSite.memo}"></textarea>
						</div>
					</div>
				</div>
			</div>

			<div class="table">
				<div class="head">
					<h6>Credit 설정</h6>
					<a class="blBtn" href="javascript:creditUpdate()">저장</a>
				</div>
				<div class="body">
					<div class="table-responsive">
						<table>
							<colgroup>
								<col width="30%">
								<col width="70%">
							</colgroup>
							<tbody>
								<!-- 
	                            <tr>
				                  <th>최대 Credit한도</th>
				                  <td><input class="input w100" type="text"  id="siteMaxCredit" th:value="${targetSite.siteMaxCredit}" /></td>
				                </tr>
				                -->
								<tr>
									<th>Credit 구매 수수료율</th>
									<td><input class="input w100" type="text" th:value="${targetSite.siteCreditRate}" />
										%</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>

			<div class="table">
				<div class="head">
					<div class="rateSet">
						<h6>게임별 Credit수수료율 설정</h6>
						<input class="input w100" id="idleRate" type="text" />
						<a class="gnBtn" href="javascript:sameRate()">일괄적용</a>
						<a class="grBtn"><i class="fas fa-redo"></i></a>
						<a class="blBtn" href="javascript:saveRate()">저장</a>
					</div>
					<div class="rateSet" style="display:none">
						<h6>롤링요율설정</h6>
						<input class="input w100" id="idlePointRate" type="text" />
						<a class="gnBtn" href="javascript:samePointRate()">일괄적용</a>
						<a class="grBtn"><i class="fas fa-redo"></i></a>

					</div>
				</div>
				<div class="body">
					<div class="table-responsive">
						<table>
							<colgroup>
								<col width="20%">
								<col width="35%">
								<!-- <col width="35%"> -->
								<col width="10%">
							</colgroup>
							<thead>
								<tr>
									<th>Cpny</th>
									<th>Credit수수료</th>
									<th style="display:none">롤링요율</th>
									<th th:if="${loginSite.siteLevel < 1}" ?'':'style="dispaly:none"' >게임이용여부</th>
		                         </tr>
		                      </thead>
		                    <tbody  id="rateList">
			                    <th:block th:each="list,seq : ${vederRateList}">
		                            <tr>
					                  <td th:text="${list.get('vendorName')}" class="vendor" th:data-vidx="${list.get('vendorIdx')}">
										에볼루션</td>
									<td><input class="input w100 rate" type="text" th:value="|${list.get('rate')}|" /> %
									</td>
									<td style="display:none"><input class="input w100 insurePointRate" type="text"
											th:value="|${list.get('insurePointRate')}|" /> %</td>
									<td th:if="${loginSite.siteLevel < 1}" ?'':'style="dispaly:none"'>
						                  	<div class="toggle-wrap">
						                  		<label class="toggle-text on"></label>
						                  		<input type="checkbox" class="set-switch useYn" th:checked="${list.get('siteUseYn')=='Y'}" />
											</div>
										</td>
									</tr>
								</th:block>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
		<div class="tab-content" id="tab-2">
			<div class="table">
                <div class="head between">
                  <h6>기본 정보</h6>
                  <div class="check-wrap">
                    <div class="inputs">
                      <input type="checkbox" id="set" />
                      <label for="set">더 넛츠 전용 세팅</label>
                    </div>
                    <a class="blBtn" href="javascript:siteInfoUpdate()">저장</a>
                  </div>
                </div>
                <div class="body">
                  <div class="table-responsive">
                    <table>
                      <colgroup>
                        <col width="30%">
                        <col width="70%">
                      </colgroup>
                      <tbody>
                            <tr>
                                <th>번호</th>
                                <td>1907</td>
                            </tr>
                            <tr>
                                <th>분류</th>
                                <td>총판</td>
                            </tr>
                            <tr>
                                <th>타입</th>
                                <td>병행</td>
                            </tr>
                            <tr>
                                <th>소속 에이전시</th>
                                <td class="selectFlex">
                                  <div class="tgBox">
                                    <a class="selectBox">토브로<em>@tobro</em></a>
                                    <div class="tgBoxcon">
                                      <ul>
                                        <li>에이전시</li>
                                        <li><a>수정</a></li>
                                        <li><a href="exchange.html">지급 내역</a></li>
                                        <li><a href="charge.html">충전 내역</a></li>
                                        <li><a href="agentqna.html">문의 내역</a></li>
                                      </ul>
                                      <ul>
                                        <li>유저</li>
                                        <li><a href="user.html">유저 목록</a></li>
                                        <li><a href="payments.html">지급 내역</a></li>
                                      </ul>
                                    </div>
                                  </div>
                                  <span class="selectRight">→</span>
                                  <div class="tgBox">
                                    <a class="selectBox bl">no.1<em>@no.1</em></a>
                                    <div class="tgBoxcon">
                                      <ul>
                                        <li>에이전시</li>
                                        <li><a>수정</a></li>
                                        <li><a href="exchange.html">지급 내역</a></li>
                                        <li><a href="charge.html">충전 내역</a></li>
                                        <li><a href="agentqna.html">문의 내역</a></li>
                                      </ul>
                                      <ul>
                                        <li>유저</li>
                                        <li><a href="user.html">유저 목록</a></li>
                                        <li><a href="payments.html">지급 내역</a></li>
                                      </ul>
                                    </div>
                                  </div>
                                </td>
                            </tr>
                            <tr>
                                <th>아이디</th>
                                <td>no.1</td>
                            </tr>
                            <tr>
                                <th>닉네임</th>
                                <td>no.1</td>
                            </tr>
                            <tr>
                                <th>비밀번호</th>
                                <td><a class="btn modalBtn">비밀번호 변경</a></td>
                            </tr>
                            <tr>
                                <th>API KEY</th>
                                <td>
                                  <div><input type="text" id="siteKey" class="input" th:value="${targetSite.siteKey}"><a class="inputbtn" href='javascript:keyUpdate()'>재발급</a></div>
                                  <span class="text">API KEY는 개발에 필요한 정보입니다. 개발자에게 전달해주세요.</span>
                                </td>
                            </tr>
                            <tr>
                                <th>API 호출 허용 IP 설정</th>
                                <td>
                                  <div class="flex-c-c">
                                  	<!--<input type="text" id="siteIp" class="input" th:value="${targetSite.siteIp}">-->
                                  	<textarea type="text" id="siteIp" class="input" style="height:60px;padding-right:20px;resize: none;">[[${targetSite.siteIp}]]</textarea>
                                  	<a class="inputbtn" href='javascript:ipUpdate()'>변경</a>
                                  </div>
                                  <span class="text"></span>
                                </td>
                            </tr>
                            <tr>
                                <th>관리자 접속 허용 아이피</th>
                                <td>
                                  <div class="flex-c-c">
                                  	<!--<input type="text" id="siteIp" class="input" th:value="${targetSite.siteIp}">-->
                                  	<textarea type="text" id="siteIp" class="input" style="height:60px;padding-right:20px;resize: none;"></textarea>
                                  	<a class="inputbtn" href=''>저장</a>
                                  </div>
                                  <span class="text"></span>
                                </td>
                            </tr>
                            <tr>
                                <th>Callback URL</th>
                                <td>
                                  <div><input type="text" id="siteCbUrl" class="input" th:value="${targetSite.siteCbUrl}"><a class="inputbtn"  href='javascript:cbUpdate()'>변경</a></div>
                                  <span class="text">정확한 주소값을 전부 입력해주세요. (http 혹 https 사용인지 정확하게 입력)</span>
                                </td>
                            </tr>
                            <tr>
                                <th>계좌 번호</th>
                                <td>
                                  <div><input type="text" id="siteBankInfo" class="input"><a class="inputbtn" >변경</a></div>
                                </td>
                            </tr>
                            <tr>
                                <th>현재 보유 금액</th>
                                <td>1,000,000</td>
                            </tr>
                            <tr>
                                <th>하부 에이전시 현재 총 보유 금액</th>
                                <td>1,000,000</td>
                            </tr>                            
                            <tr>
                                <th>요율</th>
                                <td>0 %</td>
                            </tr>
                            <tr>
                                <th>총 지급받은 금액</th>
                                <td>1,000,000</td>
                            </tr>
                            <tr>
                                <th>총 충전받은 금액</th>
                                <td>1,000,000</td>
                            </tr>
                            <tr>
                                <th>총 지급해준 금액</th>
                                <td>1,000,000</td>
                            </tr>
                            <tr>
                                <th>총 충전해준 금액</th>
                                <td>1,000,000</td>
                            </tr>
                            <tr>
                                <th>하부 에이전시 수</th>
                                <td>0</td>
                            <tr>
                                <th>하부 유저 수</th>
                                <td>0</td>
                            </tr>
                            <tr>
                                <th>가입 시각</th>
                                <td>22-01-29 02:01</td>
                            </tr>
                            <tr>
                            	<th>기본설정</th>
                            	<td><a class="btn modalBtn1">기본설정</a></td>
                            </tr>
                            <tr>
                            	<th>Nexus 전용설정</th>
                            	<td>
                            		<ul class="nexuswrap">
                            			<li><span>API ID : </span><input type="text" id="nexusApiId" class="input" th:value="${nexusInfo.vendorApiId}" /></li>
                            			<li><span>API KEY : </span><input type="text" id="nexusApiKey" class="input" th:value="${nexusInfo.vendorApiKey}" /><a class="btn modalBtn3">전용설정</a></li>
                            		</ul>
                            	</td>
                            </tr>
                            <tr>
                            	<th>Xtreem 전용설정</th>
                            	<td>
                            		<ul class="nexuswrap">
                            			<li><span>API ID : </span><input type="text" id="xtreemApiId" class="input" th:value="${xtreemInfo.vendorApiId}" /></li>
                            			<li><span>API KEY : </span><input type="text" id="xtreemApiKey" class="input" th:value="${xtreemInfo.vendorApiKey}" /><a class="btn modalBtn4">전용설정</a></li>
                            		</ul>
                            	</td>
                            </tr>
                        </tbody>
                    </table>
				</div>
			</div>
		</div>

              <div class="modal-content">
                <div class="modal-header"><h5>비밀번호 변경</h5><a>×</a></div>
                <div class="modal-body">
                  <ul>
                    <li>현재 비밀번호</li>
                    <li><input type="password" id="nowPass"></li>
                  </ul>
                  <ul>
                    <li>새 비밀번호</li>
                    <li><input type="password"  id="newPass"><span class="rdc">특수문자, 숫자, 영문을 모두 포함한 8자리 이상으로 설정해주시기 바랍니다.</span></li>
                  </ul>
                  <ul>
                    <li>새 비밀번호 재입력</li>
                    <li><input type="password" id="newPass2"></li>
                  </ul>
                </div>
                <div class="modal-footer">
                  <a href='javascript:$(".modal-content").hide()')>취소</a>
                  <a href='javascript:passUpdate()'>변경</a>
                </div>
              </div>
              
              <div class="modal-content1">
              	<div class="modal-header"><h5>기본설정</h5><a>×</a></div>
              	<div class="modal-body">
              		<h3>기본설정 하시겠습니까?</h3>
              	</div>
              	<div class="modal-footer">
                  <a href='javascript:$(".modal-content2").hide()')>취소</a>
                  <a href='javascript:forDefault()'>확인</a>
                </div>
              </div>
              <div class="modal-content3">
              	<div class="modal-header"><h5>Nexus 전용설정</h5><a>×</a></div>
              	<div class="modal-body">
              		<h3>Nexus 전용으로 설정 하시겠습니까?</h3>
              	</div>
              	<div class="modal-footer">
                  <a href='javascript:$(".modal-content3").hide()')>취소</a>
                  <a href='javascript:forNexus()'>확인</a>
                </div>
              </div>
              
              <div class="modal-content4">
              	<div class="modal-header"><h5>Xtreem 전용설정</h5><a>×</a></div>
              	<div class="modal-body">
              		<h3>Xtreem 전용으로 설정 하시겠습니까?</h3>
              	</div>
              	<div class="modal-footer">
                  <a href='javascript:$(".modal-content4").hide()')>취소</a>
                  <a href='javascript:forXtreem()'>확인</a>
                </div>
              </div>

	</div>
		<div  class="tab-content" id="tab-3">

			<div class="table">
				<div class="head">
					<h6>에이전시 <span th:text="${targetSite.siteName}"></span>의 게임회사 연결설정</h6>
				</div>
				<div class="body">
					<div class="table-responsive">
						<!--<button class="allsavebtn">전체저장</button>-->
						<ul class="tabs">
							<li class="tab-link current" data-tab="data-1">카지노</li>
							<li class="tab-link" data-tab="data-2">슬롯</li>
							<li class="tab-link" data-tab="data-3">스포츠</li>
							<li class="tab-link" data-tab="data-4">미니게임</li>
						</ul>
						<button id="saveAllBtn" onclick="javascript:saveScvrAll()">전체 저장</button>
						<table class="tab-content current" id="data-1">
							<colgroup>
								<col width="30%">
								<col width="30%">
								<col width="20%">
								<col width="20%">
								<col width="10%">
							</colgroup>
							<thead>
								<tr>
									<th>게임명</th>
									<th>벤더사 선택</th>
									<th>선택 벤더사 요율</th>
									<th>현재 나의 요율</th>
									<th>저장</th>
								</tr>
							</thead>
							<tbody  id="rateList">
								<th:block th:each="list,seq : ${mylist}">
									<th:block th:if="${list.vendorCetegory eq 'CASINO' || list.vendorCetegory eq 'HCASINO'}">
										<tr>
											<th th:text="${list.vendorName}">에볼루션</th>
											<td>
												<select  th:id="|select_${list.vendorIdx}|" class="vl vendorCode">
													<th:block  th:each="vlist,vseq : ${vendorlist}">
													<option th:data-vidx="${list.vendorIdx}" th:data-vrate="${vlist.get('vrate')}" th:value = "${vlist.vendorCode}" th:if="${list.vendorIdx == vlist.vendorIdx }" th:text="${vlist.vendorName2}" th:selected="${list.vendorCode == vlist.vendorCode}">에볼루션 1</option>
													</th:block>                        	                        	
												</select>
											</td>
											<td class="fontR" th:id="|v${list.vendorIdx}|" th:text="${list.get('myrate')}">4.2</td>
											<td th:text="${list.get('myrate')}">3.9</td>
											<td><button th:onclick="|javascript:saveScvr('${list.vendorIdx}')|">저장</button></td>
										</tr>
									</th:block>
								</th:block>
							</tbody>
						</table>
						
						<table class="tab-content" id="data-2">
							<colgroup>
								<col width="30%">
								<col width="30%">
								<col width="20%">
								<col width="20%">
								<col width="10%">
							</colgroup>
							<thead>
								<tr>
									<th>게임명</th>
									<th>벤더사 선택</th>
									<th>선택 벤더사 요율</th>
									<th>현재 나의 요율</th>
									<th>저장</th>
								</tr>
							</thead>
							<tbody  id="rateList">
								<th:block th:each="list,seq : ${mylist}">
									<th:block th:if="${list.vendorCetegory eq 'SLOT'}">
										<tr>
											<th th:text="${list.vendorName}">에볼루션</th>
											<td>
												<input type="hidden"> 
												<select  th:id="|select_${list.vendorIdx}|" class="vl vendorCode">
													<th:block  th:each="vlist,vseq : ${vendorlist}">
													<option th:data-vidx="${list.vendorIdx}" th:data-vrate="${vlist.get('vrate')}" th:value = "${vlist.vendorCode}" th:if="${list.vendorIdx == vlist.vendorIdx }" th:text="${vlist.vendorName2}" th:selected="${list.vendorCode == vlist.vendorCode}">에볼루션 1</option>
													</th:block>                        	                        	
												</select>
											</td>
											<td class="fontR" th:id="|v${list.vendorIdx}|" th:text="${list.get('myrate')}">4.2</td>
											<td th:text="${list.get('myrate')}">3.9</td>
											<td><button th:onclick="|javascript:saveScvr('${list.vendorIdx}')|">저장</button></td>
										</tr>
									</th:block>
								</th:block>
							</tbody>
						</table>
						
						<table class="tab-content" id="data-3">
							<colgroup>
								<col width="30%">
								<col width="30%">
								<col width="20%">
								<col width="20%">
								<col width="10%">
							</colgroup>
							<thead>
								<tr>
									<th>게임명</th>
									<th>벤더사 선택</th>
									<th>선택 벤더사 요율</th>
									<th>현재 나의 요율</th>
									<th>저장</th>
								</tr>
							</thead>
							<tbody  id="rateList">
								<th:block th:each="list,seq : ${mylist}">
									<th:block th:if="${list.vendorCetegory eq 'SPORT'}">
										<tr>
											<th th:text="${list.vendorName}">에볼루션</th>
											<td>
												<input type="hidden"> 
												<select  th:id="|select_${list.vendorIdx}|" class="vl vendorCode">
													<th:block  th:each="vlist,vseq : ${vendorlist}">
													<option th:data-vidx="${list.vendorIdx}" th:data-vrate="${vlist.get('vrate')}" th:value = "${vlist.vendorCode}" th:if="${list.vendorIdx == vlist.vendorIdx }" th:text="${vlist.vendorName2}" th:selected="${list.vendorCode == vlist.vendorCode}">에볼루션 1</option>
													</th:block>                        	                        	
												</select>
											</td>
											<td class="fontR" th:id="|v${list.vendorIdx}|" th:text="${list.get('myrate')}">4.2</td>
											<td th:text="${list.get('myrate')}">3.9</td>
											<td><button th:onclick="|javascript:saveScvr('${list.vendorIdx}')|">저장</button></td>
										</tr>
									</th:block>
								</th:block>
							</tbody>
						</table>
						
						<table class="tab-content" id="data-4">
							<colgroup>
								<col width="30%">
								<col width="30%">
								<col width="20%">
								<col width="20%">
								<col width="10%">
							</colgroup>
							<thead>
								<tr>
									<th>게임명</th>
									<th>벤더사 선택</th>
									<th>선택 벤더사 요율</th>
									<th>현재 나의 요율</th>
									<th>저장</th>
								</tr>
							</thead>
							<tbody  id="rateList">
								<th:block th:each="list,seq : ${mylist}">
									<th:block th:if="${list.vendorCetegory eq 'MINIGAME'}">
										<tr>
											<th th:text="${list.vendorName}">에볼루션</th>
											<td>
												<input type="hidden"> 
												<select  th:id="|select_${list.vendorIdx}|" class="vl vendorCode">
													<th:block  th:each="vlist,vseq : ${vendorlist}">
													<option th:data-vidx="${list.vendorIdx}" th:data-vrate="${vlist.get('vrate')}" th:value = "${vlist.vendorCode}" th:if="${list.vendorIdx == vlist.vendorIdx }" th:text="${vlist.vendorName2}" th:selected="${list.vendorCode == vlist.vendorCode}">에볼루션 1</option>
													</th:block>                        	                        	
												</select>
											</td>
											<td class="fontR" th:id="|v${list.vendorIdx}|" th:text="${list.get('myrate')}">4.2</td>
											<td th:text="${list.get('myrate')}">3.9</td>
											<td><button th:onclick="|javascript:saveScvr('${list.vendorIdx}')|">저장</button></td>
										</tr>
									</th:block>
								</th:block>
							</tbody>
						</table>
					</div>
				</div>
			</div>

		</div>
	</div>
</th:block>