<!DOCTYPE html
	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
	layout:decorate="~{admin/layout/layout}" th:with="title='',active='home'">
<th:block layout:fragment="html_head">
	<script>
		function goPage(pageNo) {
			var form = document.searchVO;
			form.page.value = pageNo;
			form.action = "/agent/transaction";
			form.submit();
		}

		function goSearch(pageNo) {
			var form = document.searchVO;
			form.page.value = 1;
			form.action = "/agent/transaction";
			form.submit();
		}
	</script>
</th:block>

<th:block layout:fragment="content">

	<div class="container-fluid">
		<div class="page-name">
			<h1>에이전시 전체 트랜잭션 내역</h1>
		</div>
		<ul class="tabletab">
			<li class="active"><a>에이전시 전체 트랜잭션 내역 목록 (<em class="num" th:text="${list.size()}">2,036</em>)</a></li>
		</ul>
		<form class="searchWrap-form" name="searchVO">
			<div class="tableserachwrap">
				<!--div>
                     <ul class="tableserach">
                       <li>
                         <div class="input-group">
                           <div>
                             <label class="input-group-text">표시</label>
                           </div>
                           <select name="count_per_list">
                             <option value="10"  th:selected="${searchVO.count_per_list == 10}">10</option>
                             <option value="50"  th:selected="${searchVO.count_per_list == 50}">50</option>
                             <option value="100"  th:selected="${searchVO.count_per_list == 100}">100</option>
                           </select>
                         </div>
                       </li>
                     </ul>
                   </div-->

				<input type="hidden" id="page" name="page" th:value="${searchVO.page}" />
				<div>
					<ul class="tableserach">
						<li>
							<div class="input-group">
								<div>
									<label class="input-group-text">기간</label>
								</div>
								<input type="date" name="startDate" th:value="${searchVO.startDate}" />
								<input type="date" name="endDate" th:value="${searchVO.endDate}" />
							</div>
						</li>
						<li>
							<div class="input-group">
								<div>
									<label class="input-group-text">베팅 번호</label>
								</div>
								<input type="text" th:value="${searchVO.searchValue}" name="searchValue">
							</div>
						</li>
						<li>
							<a class="btn" onclick="goSearch()">
								전체검색
							</a>
						</li>
					</ul>

				</div>
			</div>
		</form>
		<div class="table">
			<!--div class="head"><h6>에이전시 전체 트랜잭션 내역 목록 (<em class="num" th:text="${list.size()}">2,036</em>)</h6></div-->
			<div class="body">

				<div class="table-responsive">
					<table class="center">
						<thead>
							<tr>
								<th>베팅 번호</th>
								<th>관련 번호</th>
								<th>대상자 (에이전시)</th>
								<th>원인자 (에이전시/유저)</th>
								<th>타입</th>
								<th>변동 전 잔액</th>
								<th>변동 금액</th>
								<th>변동 후 잔액</th>
								<th>상태</th>
								<th>처리 시각</th>
							</tr>
						</thead>
						<tbody>
							<th:block th:each="list,seq : ${list}">
								<tr>
									<td th:text="${list.get('tranId')}">베팅 번호</td>
									<td th:text="${list.get('creditIdx')}">관련 번호</td>
									<td th:text="${list.siteId}">대상자 (에이전시)</td>
									<td>

										<div class="tgBox">
											<a class="selectBox"
												th:text="${list.memberId}">anhthu98<em>@anhthu98</em></a>
											<div class="tgBoxcon">
												<ul class="b0">
													<li>유저</li>
													<li><a href="userRead.html">수정</a></li>
													<li><a href="transactionList.html">전체 트랜잭션 내역</a></li>
													<li><a href="betlist.html">통합 베팅 내역</a></li>
													<li><a class="modalBtn">머니 지급</a></li>
												</ul>
											</div>
										</div>

									</td>
									<td>
										<span th:if="${list.creditType eq 'AI' }">(관)중전</span>
										<span th:if="${list.creditType eq 'AO' }">(관)회수</span>
										<span th:if="${list.creditType eq 'CI' }">충전</span>
										<span th:if="${list.creditType eq 'CO' }">지급</span>
										<span th:if="${list.creditType eq 'DP' }">베팅</span>
										<span th:if="${list.creditType eq 'CD' }">베팅결과</span>

									</td>
									<td th:text="${#numbers.formatInteger(list.preCreditAmt, 0, 'COMMA')}">변동 전 잔액</td>
	                          <td th:text="${#numbers.formatInteger(list.creditAmt, 0, 'COMMA')}">변동 금액</td>
	                          <td th:text="${#numbers.formatInteger(list.afterCreditAmt, 0, 'COMMA')}">변동 후 잔액</td>
	                          <td ><span class="success">완료됨</span></td>
	                          <td th:text="${#temporals.format(list.updDate, 'yyyy-MM-dd HH:mm:ss')}" >처리 시각</td>
	                        </tr>
						</th:block>
                       
                      </tbody>
                    </table>
                     <th:block th:utext="${pageInfo}"></th:block>
                  </div>
                </div>
              </div>

              <div class="modal-content">
                <div class="modal-header"><h5>유저 머니 지급</h5><a>×</a></div>
                <div class="modal-body">
                  <ul>
                    <li>지급금액</li>
                    <li><input type="text"><em class="pot">C</em><span>마이너스(-)로 입력시 보유 금액을 차감합니다.<br />나의 보유 금액보다 큰 금액을 지급할 수 없습니다.<br />대상 유저의 보유 금액보다 큰 금액을 차감할 수 없습니다.</span></li>
                  </ul>
                </div>
                <div class="modal-footer">
                  <a>취소</a>
                  <a>지급</a>
                </div>
              </div>

</div>
</th:block>