<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layout/layout}">
<th:block layout:fragment="script">
  <script type="text/javascript" th:src="@{/js/codeMgt/codeMgt.js}"></script>
</th:block>
<div layout:fragment="content">
  <main class="pt-3">
    <h4>코드 관리</h4>
    <input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
    <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
    <div class="row mx-0">
      <div class="col-12 card text-center">
        <div class="card-body">
          <div class="row">
            <div class="col-10">
              <div class="row justify-content-end">
                <button class="col-auto btn btn-success mx-3 my-2" id="codeSaveBtn">저장</button>
              </div>
            </div>
          </div>
          <div class="row justify-content-start">
            <div class="col-6">
              <div class="card">
                <div class="card-body">
                  <div class="row">
                    <table class="table table-striped" id="categoryTable">
                      <thead>
                      <tr>
                        <th></th>
                        <th>분류코드</th>
                        <th>분류명</th>
                        <th>설명</th>
                      </tr>
                      </thead>
                      <tbody class="overflow-scroll">

                      </tbody>
                    </table>
                  </div>
                  <div class="row justify-content-center">
                    <button class="btn btn-sm btn-outline-primary col-auto" id="categoryAddBtn"><i class="bi bi-plus-lg"></i></button>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-4" id="valueDiv">
              <div class="card">
                <div class="card-body">
                  <div class="row">
                    <table class="table table-striped" id="itemTable">
                      <thead>
                      <tr>
                        <th></th>
                        <th>하위코드</th>
                        <th>값</th>
                        <th>사용</th>
                      </tr>
                      </thead>
                      <tbody class="overflow-scroll">

                      </tbody>
                      <tfoot>
                        <tr id="emptyTr"><td colspan="4">분류를 선택해주세요.</td></tr>
                      </tfoot>
                    </table>
                  </div>
                  <div class="row justify-content-center" id="itemBtnRow" style="display: none">
                    <button class="btn btn-sm btn-outline-primary col-auto" id="itemAddBtn"><i class="bi bi-plus-lg"></i></button>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </main>
</div>
</html>