<!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/fipTarget/partWork.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">
           <form id="searchFm" method="get" th:action="@{/target/partWorkList}">
            <input type="hidden" name="excel">
            <input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
            <div class="row justify-content-between pe-3 py-1">
              <div class="col-auto">
                <select class="form-select" name="rowCnt" id="rowCnt">
                  <th:block th:each="num : ${#numbers.sequence(1,5)}">
                    <option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.rowCnt==num*10}"></option>
                  </th:block>
                </select>
              </div>
              <input type="submit" class="btn btn-sm btn-primary col-auto" id="searchBtn" value="검색">           
            </div>
          </form> 
          <div class="row justify-content-start">
            <div class="col-12">
              <div class="card">
                <div class="card-body">
                  <div class="row">
                  <input type="hidden" id="selectedKey">
                  <input type="hidden" id="selectedVerNo">
                    <table class="table table-striped">
                      <thead>
                      <tr>
                      	<th rowspan="2">보안<br>터미널명</th>
                      	<th rowspan="2">작성자</th>
                      	<th rowspan="2">일시</th>
                      	<th colspan="6">종류</th>
                      	<th rowspan="2">비고</th>
                      	<th rowspan="2">첨부파일</th>
                      	<th rowspan="2">최근수정일</th>
                      </tr>
                      <tr>
                      	<th>사건처리</th>
                      	<th>범죄첩보제공</th>
                      	<th>SRI</th>
                      	<th>합동점검</th>
                      	<th>회의</th>
                      	<th>기타</th>
                      </tr>                  
                      </thead>
                      <tbody>
                      <tr class="partWorkTr" th:each="pw:${partWorkList}">
                      <th:block th:if="${pw.saveYn eq 'N'} and ${pw.wrtNm eq uesrId}">
                        <th:block>
                        	<input type="hidden" class="pwSeq" th:value="${pw.pwSeq}">
                        	<input type="hidden" class="piSeq" th:value="${pw.piSeq}">
                        </th:block>
                      	<td th:text="|[임시]${pw.terminalNm}|"></td>
                      	<td th:text="${pw.wrtNm}"></td>
                      	<td th:text="${pw.workDt}"></td>
                      	<td th:text="${pw.workTypeCh}"></td>
                      	<td th:text="${pw.workTypePoci}"></td>
                      	<td th:text="${pw.workTypeSri}"></td>
                      	<td th:text="${pw.workTypeJi}"></td>
                      	<td th:text="${pw.workTypeMt}"></td>
                      	<td th:text="${pw.workTypeEtc}"></td>
                      	<td th:text="${pw.description}"></td>
                      	<td th:if="${pw.fileCnt > 0}">●</td>
                      	<td th:unless="${pw.fileCnt > 0}"></td>
                      	<td th:text="${#temporals.format(pw.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
                      </th:block>
                      <th:block th:unless="${pw.saveYn eq 'N'} and ${pw.wrtNm eq uesrId}">
                      	<th:block th:if="${pw.saveYn eq 'Y'}">
                      	<th:block>
                        	<input type="hidden" class="pwSeq" th:value="${pw.pwSeq}">
                        	<input type="hidden" class="piSeq" th:value="${pw.piSeq}">
                        </th:block>
                      	<td th:text="${pw.terminalNm}"></td>
                      	<td th:text="${pw.wrtNm}"></td>
                      	<td th:text="${pw.workDt}"></td>
                      	<td th:text="${pw.workTypeCh}"></td>
                      	<td th:text="${pw.workTypePoci}"></td>
                      	<td th:text="${pw.workTypeSri}"></td>
                      	<td th:text="${pw.workTypeJi}"></td>
                      	<td th:text="${pw.workTypeMt}"></td>
                      	<td th:text="${pw.workTypeEtc}"></td>
                      	<td th:text="${pw.description}"></td>
                      	<td th:if="${pw.fileCnt > 0}">●</td>
                      	<td th:unless="${pw.fileCnt > 0}"></td>
                      	<td th:text="${#temporals.format(pw.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
                      	</th:block> 
                      </th:block>
                      </tr>
                      </tbody>
                    </table>
                  </div>
                 <div class="row justify-content-center">
                    <div class="col-auto">
                      <nav aria-label="Page navigation">
                        <ul class="pagination">
                          <th:block th:if="${searchParams.pageIndex>3}">
                            <li class="page-item" th:data-pageindex="${(searchParams.pageIndex)-3}">
                              <a class="page-link" href="#" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                              </a>
                            </li>
                          </th:block>
                          <th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}">
                            <li class="page-item" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex==num?'active':''}">
                              <a class="page-link" href="#" th:text="${num}"></a>
                            </li>
                          </th:block>
                          <th:block th:if="${searchParams.maxNum>searchParams.endNum+2}">
                            <li class="page-item" th:data-pageindex="${(searchParams.pageIndex)+3}">
                              <a class="page-link" href="#" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                              </a>
                            </li>
                          </th:block>
                        </ul>
                      </nav>
                      <div class="col-auto">
			          <input type="button" class="btn btn-success" value="등록" id="addPartWork" th:unless="${accessAuth eq 'ACC001'}">
			          <button id="goExcel">엑셀다운</button>
			        </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </main>
  
	
	<div class="modal fade" id="partWorkEditModal" 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="partWorkEditModalEditModalContent">
        <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>