<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>금칙어 관리</title>
<%@ include file="/WEB-INF/jsp/adm/include/topLinkTag.jsp"%>
</head>
<body>

	<h1>ICOMSYS ADMIN</h1>
	<div class="skip_navigation">
		<ul>
			<li>
				<a href="#Content" class="go_content">본문 바로가기</a>
			</li>
			<li>
				<a href="#Gnb">메뉴 바로가기</a>
			</li>
		</ul>
	</div>

	<header id="header">
		<%@ include file="/WEB-INF/jsp/adm/include/header.jsp"%>
	</header>

	<c:import url="/adm/menu/getLnbMenu.do" />

	<%-- 업로드 결과 --%>
	<script>
		<c:if test="${not empty message}">
			<c:if test="${result}">
				$.utils.success('${message}');
			</c:if>
			<c:if test="${!result}">
				$.utils.error('${message}');
			</c:if>
		</c:if>
	</script>

	<script type="text/javascript" src="<c:url value='/aajs/dictionary.js' />"></script>

	<!-- 컨텐트 시작 -->
	<section id="Content" class="conversation">
		<div class="cont_top">
			<div class="location">
				<ul>
					<li class="home">
						<a href="#">HOME</a>
					</li>
					<li>
						<a href="#">대화관리</a>
					</li>
					<li>
						<a href="#">금칙어 관리</a>
					</li>
				</ul>
			</div>
		</div>
		<div class="sub_cont">
			<div class="cont_box">
				<div class="box_title">

					<div class="fl">
						<h2 class="mt12">금칙어 관리</h2>
					</div>
					<div class="fr">
					 <dl class="customer fl">
                       		<dt class="fl">
								<c:if test="${'SYS_ADMIN'==LoginVO.authCode}">
		                                고객사 :
		                            </c:if>
							</dt>
							<dd class="fl">
								<div class="sel_box">
									<c:choose>
										<c:when test="${'SYS_ADMIN'==LoginVO.authCode}">
											<select class="top" name="custCode" id="custCode">
												<c:forEach var="siteInfo" items="${siteLists}"
													varStatus="status">
													<option value="<c:out value="${siteInfo.custCode}"/>"><c:out
															value="${siteInfo.custName}" /></option>
												</c:forEach>
											</select>
										</c:when>
										<c:otherwise>
											<input name="custCode" id="custCode" type="hidden"
												value="${LoginVO.siteCode}" />
										</c:otherwise>
									</c:choose>
								</div>
							</dd>
                        </dl>
						<%-- <dl class="customer fl">
							<dt class="fl">고객사 :</dt>
							<dd class="fl">
								<div class="sel_box">
									<select onchange="fncServiceList(this)" class="top" id="selectCustName" name="selectCustName" title="검색조건-고객사">
										<option value="">고객사 선택</option>
										<c:forEach var="siteInfo" items="${siteLists}" varStatus="status">
											<option value="<c:out value="${siteInfo.custCode}"/>"><c:out value="${siteInfo.custName}" /></option>
										</c:forEach>
									</select>
								</div>
							</dd>
						</dl> --%>
						<div class="btn_wrap fl">
							<a href="#" class="btn" onclick="fncSendData();">조회</a>
						</div>
					</div>
				</div>
				<div class="tbl">
					<form id="searchInfo">
						<table class="search table-fixed">
							<colgroup>
								<col width="130px">
								<col>
								<col width="130px">
								<col>
							</colgroup>
							<tbody>
								<tr>
									<th class="tl">서비스 명</th>
									    <td class="tl">
                                        <div class="sel_box" id="selOprMng">
                                             <select class="wide" id="oprMngName" name="oprMngCode">
				                                    <option value="">서비스 선택</option>
				                                </select>
                                        </div>
                                    </td>
									<th class="tl">대표어</th>
									<td class="tl">
										<input type="text" placeholder="대표어" id="oprMngName1" class="form-control">
									</td>
								</tr>
							</tbody>
						</table>
					</form>
				</div>
			</div>

			<div class="cont_box">
				<div class="box_title">
					<div class="fl">
						<h2 class="mt12">금칙어 리스트</h2>
					</div>
					<div class="btn_wrap fr">
						<a href="javascript:dictionaryGroup();" rel="dictionary_management_modal" class="btn line modalLoad">금칙어 그룹 관리</a>
<%--						<a href="javascript:downDictionary();" class="btn">금칙어 다운로드</a>--%>
<%--						<a href="#" rel="dictionary_upload_modal" class="btn modalLoad">금칙어 업로드</a>--%>
					</div>
				</div>

				<div id="resultTable_wrapper" class="tbl">
					<table id="resultTable" class="table-fixed" aria-describedby="resultTable_info" role="grid">
						<colgroup>
							<col width="20">
							<col width="20%">
							<col width="60%">
						</colgroup>
						<thead>
							<tr>
								<th>금칙어 그룹</th>
								<th>대표어</th>
								<th>용어</th>
							</tr>
						</thead>
						<tbody>

						</tbody>
					</table>
				</div>

				<div class="btn-side">
					<div class="btn_wrap fr">
						<a id="btnSave" href="#" class="btn" onclick="fncAdd();">추가</a>
						<!-- <a id="btnSave" href="#" class="btn blue" onclick="fncSaveList();">저장</a> -->
					</div>
				</div>
			</div>
		</div>
	</section>
	<!-- 컨텐트 끝 -->

	<!--  modal :: 사전 업로드 안내 팝업-->
	<div class="modal" id="dictionary_upload_modal" tabindex="-1">
		<div class="modal-dialog modal-lg">
			<div class="modal_header">
				<h3>금칙어 업로드 안내</h3>
			</div>
			<div class="modal_body">
				<div class="modal_cont">
					<div class="text-right">
						<a href="/document/dictionary.xlsx" class="btn" download="금칙어 업로드 샘플">샘플 다운로드</a>
					</div>

					<div class="my-5">
						<ul class="dot-list">

							<li>업로드는 Excel 파일만 가능합니다.</li>
							<li>파일 작성 방법은 [샘플 다운로드] 버튼을 선택하시고 샘플 파일을 다운받아 [작성방법] sheet를 참고해주세요.</li>
							<li>파일 당 최대 3MB까지 업로드 할 수 있습니다.</li>
							<li>파일명은 최대 70자까지 허용합니다.</li>

						</ul>
					</div>

					<div class="title-sm">금칙어 파일 업로드</div>
					<div class="tbl">
						<form id="fileUploadForm" name="fileUploadForm" enctype="multipart/form-data" method="POST" action="<c:url value='/admin/conversation/dictionary/uploadSynonym.do'/>">
							<table class="search">
								<colgroup>
									<col width="130px">
									<col>
								</colgroup>
								<tbody>
									<tr>
										<th class="tl">파일선택</th>
										<td class="tl">
											<div class="file_upload">
												<!-- view input -->
												<input class="upload_name" value="파일을 선택해주세요" disabled="disabled">

												<!-- upload input -->
												<input type="file" name="csvFile" id="file" class="upload_hidden" accept="application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" multiple onchange="uploadFileChange(this);">
												<input type="hidden" name="serviceCode">
												<label for="file" class="btn line">파일선택</label>

												<button type="reset" class="btn ml-1">삭제</button>

											</div>
										</td>
									</tr>
								</tbody>
							</table>
						</form>
					</div>
				</div>
			</div>
			<div class="modal_footer">
				<div class="btn_wrap fr">
					<a href="#" onclick="" class="btn grey close">취소</a>
					<a href="javascript:fncUploadFile();" class="btn">저장</a>
				</div>
			</div>
			<div class="modal_controller">
				<a href="#" class="close">close</a>
			</div>
		</div>
	</div>
	<!--  modal :: 사전 업로드 안내 end -->

	<!--  modal :: 사전 그룹 관리 팝업-->
	<div class="modal" id="dictionary_management_modal" tabindex="-1">
		<div class="modal-dialog">
			<div class="modal_header">
				<h3>금칙어 그룹 관리</h3>
			</div>
			<div class="modal_body">
				<div class="modal_cont min-height-150px max-height-300px overflow-y-auto">
					<div class="p-3">
						<dl>
							<dt>
								<h4>
									<em class="important">금칙어 그룹명</em>
								</h4>
							</dt>
							<dd>
								<ul class="dictionary_list">

								</ul>
							</dd>
						</dl>
					</div>
				</div>
			</div>
			<div class="modal_footer">
				<div class="btn_wrap">
					<a href="#" onclick="" class="btn grey close">취소</a>
					<a href="#" onclick="fncGroupSave();" class="btn">저장</a>
				</div>
			</div>
			<div class="modal_controller">
				<a href="#" class="close">close</a>
			</div>
		</div>
	</div>
	<!--  modal :: 사전 그룹 관리 end -->


	<ul class="vakata-context"></ul>
	<div id="jstree-marker" style="display: none;">&nbsp;</div>


</body>
</html>