<!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/equip/equip.js}"></script>
</th:block>
<div layout:fragment="content">
  <main class="pt-3">
    <h4>외사장비 현황</h4>
    <ul class="nav nav-tabs" id="boardTab" role="tablist">
      <li class="nav-item" role="presentation">
        <button class="nav-link active" id="contentTab" data-bs-toggle="tab" data-bs-target="#contentDiv" type="button" role="tab">장비현황</button>
      </li>
      <li class="nav-item" role="presentation">
        <button class="nav-link" th:onclick="|location.href='@{/equip/Log}'|" id="logTab" data-bs-toggle="tab" data-bs-target="#logDiv" type="button" role="tab">수정이력</button>    	
      </li>
    </ul>
    <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">
          <form method="get" th:action="@{/userMgt/userMgtPage}">
          <input type="hidden" name="userStatus" id="userStatus" >
            <div class="row justify-content-end pe-3 py-1">
              <div class="col-auto">
              <input type="button" class="btn btn-success" id="statusExcel" value="엑셀다운">
                <div class="row justify-content-end">
                </div>
              </div>
            </div>
          </form>
          <div class="row justify-content-start">
            <div class="col-12">
              <div class="card">
                <div class="card-body">
                  <div class="row">
                    <table class="table table-hover table-bordered">
                      <thead>
                      <tr class="table-secondary">
                        <th rowspan="2">분류</th>
                        <th rowspan="2">세부분류</th>
                        <th rowspan="2">총계</th>
                        <th rowspan="2">본청</th>                    
                      	<th colspan="6">중부</th>
                      	<th colspan="6">서해</th>
                      	<th colspan="7">남해</th>
                      	<th colspan="5">동해</th>
                      	<th colspan="3">제주</th>
                      </tr>
                      <tr class="table-secondary">
                        <th>청</th>
                        <th>인천서</th>
                        <th>평택서</th>
                        <th>태안서</th>
                        <th>보령서</th>
                        <th>서특단</th>
                        <th>청</th>
                        <th>목포서</th>
                        <th>부안서</th>
                        <th>군산서</th>
                        <th>여수서</th>
                        <th>완도서</th>
                        <th>청</th>
                        <th>울산서</th>
                        <th>부산서</th>
                        <th>창원서</th>
                        <th>통영서</th>
                        <th>사천서</th>
                        <th>중특단</th>
                        <th>청</th>
                        <th>속초서</th>
                        <th>동해서</th>
                        <th>울진서</th>
                        <th>포항서</th>
                        <th>청</th>
                        <th>제주서</th>
                        <th>서귀포서</th>
                      </tr>
                      </thead>
                      <tbody class="table-group-divider">
                      <tr class="" th:each="equip,index:${equipList}">
	                      <td class="table_id" th:text="${equip.equ_type}"></td>
	                      <td th:text="${equip.item_value}" style="color: blue;  cursor:pointer;" th:onclick="|location.href='@{/equip/List(detailType=${equip.item_cd})}'|"></td>
	                      <td th:text="${equip.total}"></td>
	                      <td th:text="${equip.cnt_bon}"></td>
	                      <td th:text="${equip.cnt_center}"></td>
	                      <td th:text="${equip.cnt_incheon}"></td>
	                      <td th:text="${equip.cnt_pyeongtaek}"></td>
	                      <td th:text="${equip.cnt_taean}"></td>
	                      <td th:text="${equip.cnt_boryeong}"></td>
	                      <td th:text="${equip.cnt_seotd}"></td>
	                      <td th:text="${equip.cnt_west}"></td>
	                      <td th:text="${equip.cnt_mokpo}"></td>
	                      <td th:text="${equip.cnt_buan}"></td>
	                      <td th:text="${equip.cnt_gunsan}"></td>
	                      <td th:text="${equip.cnt_yusu}"></td>
	                      <td th:text="${equip.cnt_wando}"></td>
	                      <td th:text="${equip.cnt_south}"></td>
	                      <td th:text="${equip.cnt_ulsan}"></td>
	                      <td th:text="${equip.cnt_busan}"></td>
	                      <td th:text="${equip.cnt_changwon}"></td>
	                      <td th:text="${equip.cnt_tongyong}"></td>
	                      <td th:text="${equip.cnt_sacheon}"></td>
	                      <td th:text="${equip.cnt_jungtd}"></td>
	                      <td th:text="${equip.cnt_east}"></td>
	                      <td th:text="${equip.cnt_sokcho}"></td>
	                      <td th:text="${equip.cnt_donghe}"></td>
	                      <td th:text="${equip.cnt_ulgin}"></td>
	                      <td th:text="${equip.cnt_pohang}"></td>
	                      <td th:text="${equip.cnt_jeju}"></td>
	                      <td th:text="${equip.cnt_jejuseo}"></td>
	                      <td th:text="${equip.cnt_seoguipo}"></td>                    
                      </tr>
                      </tbody>
                    </table>
                  </div>
                  <div class="col-auto">
                      <input type="button" class="btn btn-success" value="등록" id="addEquip" th:unless="${accessAuth eq 'ACC001'}">
                  </div>
                  <div class="row justify-content-center">               
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </main>

  <div class="modal fade" id="equipEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="userEditModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg modal-dialog-scrollable">
      <div class="modal-content" id="equipEditModalContent">
        <div class="modal-header">
        </div>
        <div class="modal-body">
          <div class="tab-content border border-top-0" id="configInfo">
          </div>
        </div>
      </div>
    </div>
  </div>

</div>
</html>