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

            <div class="container-fluid">
              <div class="page-name">
                  <h1>보험관리</h1>
              </div>
			  <form class="searchWrap-form" name="searchVO">
                  <input type="hidden" id="page" name="page" th:value="${searchVO.page}"/>
                  <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="20"  th:selected="${searchVO.count_per_list == 20}">20</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-->
                    <div>
                      <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 class="br0" 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()">
	                           전체검색
	                       </a>
                        </li>
                      </ul>

                    </div>
                  </div>
			  </form>
              <div class="table">
                <div class="head">
                
                <h6 th:if="${searchVO.updown eq 'up' }" th:text="상부보험베팅내역"></h6>
	            <h6 th:if="${searchVO.updown eq 'down' }" th:text="하부보험베팅내역"></h6>
               
                
                </div>
                <div class="body">                 
                  <div class="table-responsive">
                    <table class="center">
                      <thead>
                        <tr>
                          <th rowspan="2">번호</th>
                          <th rowspan="2">사이트아이디</th>
                          <th rowspan="2">유저아이디</th>
                          <th rowspan="2">게임종류</th>
                          <th rowspan="2">베팅날짜</th>
                          <th rowspan="2">베팅금</th>
                          <th rowspan="2">윈루즈</th>
                          <th colspan="4">보험베팅</th>
                          <th colspan="4">보험포인트</th>
                        </tr>
                        
                        <tr>
                 
                          <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.idx}"> </td>
								<td th:text="${list.siteId}"> </td>
									<td th:text="${list.memberId}"> </td>
									<td th:text="${list.vendorIdx}"> </td>
									<td th:text="${list.regDate}"> </td>
									<td th:text="|${#numbers.formatInteger(list.betAmt, 0, 'COMMA')}|"> </td>
									<td th:text="|${#numbers.formatInteger(list.winLoseAmt, 0, 'COMMA')}|"> </td>
									<td th:text="|${list.insureRate}%|"> </td>
									<td th:text="|${#numbers.formatInteger(list.preInsureAmt, 0, 'COMMA')}|"> </td>
									<td th:text="|${#numbers.formatInteger(list.insureAmt, 0, 'COMMA')}|"> </td>
									<td th:text="${#numbers.formatInteger(      (T(Long).parseLong(list.preInsureAmt)) + (T(Long).parseLong(list.insureAmt)), 0, 'COMMA') }"> </td>
									<td th:text="|${list.insurePointRate}%|"> </td>
									<td th:text="|${#numbers.formatInteger(list.preInsurePoint, 0, 'COMMA')}|"> </td>
									<td th:text="|${#numbers.formatInteger(list.insurePointAmt, 0, 'COMMA')}|"> </td>
									<td  th:text="${#numbers.formatInteger(      (T(Long).parseLong(list.preInsurePoint)) + (T(Long).parseLong(list.insurePointAmt)), 0, 'COMMA') }"> </td>
							
									
							</tr>
							</th:block>
                      </tbody>
                    </table>
                      <th:block th:utext="${pageInfo}"></th:block>
                  </div>
                </div>
              </div>

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

</th:block>