<!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 = "/cash/point";
		form.submit();
	}
	
	function goSearch(){
		
		var form = document.searchVO;
		form.page.value = 1;	
		form.action = "/cash/point";
		form.submit();
	}
	</script>
</th:block>
<th:block layout:fragment="content">

            <div class="container-fluid">
              <div class="page-name">
                  <h1>컴퍼니 관리</h1>
              </div>

              <div class="table">
                <div class="head"><h6>서브포인트 적립내역</h6></div>
                <div class="body">
                  <form class="searchWrap-form" name="searchVO">
                        <input type="hidden" id="page" name="page" th:value="${searchVO.page}"/>
	                      <ul class="tableserach">
	                        <li>
	                          <div class="input-group">
	                            <div>
	                              <label class="input-group-text">소속 에이전시 아이디</label>
	                            </div>
	                            <input type="text" name="searchSiteId" th:value="${searchVO.searchSiteId}" >
	                          </div>
	                        </li>
	                        <li>
	                          <div class="input-group">
	                            <div>
	                              <label class="input-group-text">유저 아이디</label>
	                            </div>
	                            <input type="text" name="searchMemId" th:value="${searchVO.searchMemId}">
	                          </div>
	                        </li>
	                        <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>
	                           <a class="btn" href ="javascript:goSearch()">
	                            <i class="fas fa-search fa-sm text-white-50"></i>
	                          </a>
	                        </li>
	                      </ul>
                      </form>
                  
                  <div class="table-responsive text-center">
                    <table>
                      <thead>
                        <tr>
                          <th rowspan="2">번호</th>
                          <th rowspan="2">컴퍼니</th>
                          <th rowspan="2">유저아이디</th>
                           <th rowspan="2">betId</th>
                          <th rowspan="2">베팅날짜</th>
                          <th rowspan="2">베팅금</th>
                          <th rowspan="2">윈루즈</th>
                      
                    
                          <th colspan="3">수수료율 (%)</th>
                          <th colspan="3">포인트</th>
                        </tr>
                        <tr>
                        
                         
                          <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.pointIdx}">1</td>
                          <td class="gnc"  th:text="${list.siteId}">피넛</td>
                          <td th:text="${list.get('betids')}">vlv01</td>
                          
                          <td th:text="${list.get('memberId')}">vlv01</td>
                          <td th:text="${list.regDate}">2022-07-28 18:32:38</td>
                          <td th:text="|${#numbers.formatInteger(list.get('betAmt'), 0, 'COMMA')}|">30,000</td>
                          <td class="rdc" th:text="|${#numbers.formatInteger(list.get('winLoseAmt'), 0, 'COMMA')}|">-30,000</td>
                          
                      
                          <td th:text="|${list.creditRate}%|">11.00%</td>
                          <td th:text="|${list.vendorRate}%|">8.00%</td>
                          <td class="blc" th:text="|${list.creditRate -list.vendorRate}%|">3%</td>
                          <td th:text="|${#numbers.formatInteger(list.prePointAmt, 0, 'COMMA')}|">35,166</td>
                          <td class="blc" th:text="|${#numbers.formatInteger(list.pointAmt, 0, 'COMMA')}|">0</td>
                          <td th:text="${#numbers.formatInteger(list.pointAmt + list.prePointAmt, 0, 'COMMA')}|">35,166</td>
                        </tr>
                        </th:block>
                      </tbody>
                    </table>
                      <th:block th:utext="${pageInfo}"></th:block>
                  </div>
                </div>
              </div>

            </div><!-- container-fluid -->

        </th:block>