<%@ 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/synonym.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>
            <input type="hidden" id="custCode">
            <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">
                                    <select class="wide" id="serviceGroup" name="serviceGroup">

                                    </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 id="btnSave" href="#" class="btn line" onclick="fncAdd();">등록</a>
                    <a href="#" rel="synonym_upload_modal" id="btnExcelUp" class="btn excel modalLoad">업로드</a>
                    <a href="#" class="btn excel" id="btnExcelDown" onclick="fnSynonymExcelDown();">다운로드</a>
                </div>
            </div>

            <div id="resultTable_wrapper" class="tbl">
                <table id="resultTable" class="table-fixed" aria-describedby="resultTable_info" role="grid">
                    <colgroup>
                        <col>
                        <col>
                        <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 blue" onclick="fncSaveList();">저장</a> -->
                </div>
            </div>
        </div>
    </div>
</section>
<!-- 컨텐트 끝 -->

<!--  modal :: 동의어 업로드 안내 팝업-->
<div class="modal" id="synonym_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/synonym.xls" class="btn excel" download="동의어 업로드 샘플">샘플 다운로드</a>
                </div>

                <div class="my-5">
                    <ul class="dot-list">
                        <li>업로드는 Excel 파일만 가능합니다.</li>
                        <li>파일 작성 방법은 [샘플 다운로드] 버튼을 선택하시고 샘플 파일을 다운받아 [작성방법] sheet를 참고해주세요.</li>
                        <li>파일 당 최대 3MB까지 업로드 할 수 있습니다.</li>
                        <li>파일명은 최대 70자까지 허용합니다.</li>
                        <li>파일 내 개체어는 50개, 개체어당 동의어는 200개까지 허용합니다.</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/rcp/conversation/synonym/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="serviceGroup">
                                        <input type="hidden" name="custCode">
                                        <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">
                    <span>저장</span>
                    <img class="loading-img" alt="loading" src="/images/loading.gif" style="display: none;">
                </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>