<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>私塾家</title>
<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
<script th:include="sys/common/metaJS" th:remove="tag"></script> 
<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
</head>
<style>
	.tablelink{margin-right:10px;}
	.stylecss{
	      color: red;
	}
	.select_width{
	     width: 70px;
	}
	.date_width{
	     width: 100px;
	}
</style>
<body>
<div class="place">
	<span>位置：</span>
	<ul class="placeul">
		<li><a href="#">微信管理</a></li>
		<li><a href="#">微信活动</a></li>
		<li><a href="#">抽奖日志</a></li>
	</ul>
</div>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/card/awardLog/{id}.html(id=${id})}" method="post">
	<ul class="seachform">
		<li>
			<label>抽奖人</label>
			<input name="wx_name" type="text" class="scinput" th:value="${search.get('wx_name')} == null  ? '': ${search.get('wx_name')}"/>
		</li>
	    <li>
				<label>中奖状态</label>
					<select class="scinput select_width"  name="stat" th:switch="${search.get('stat')}" >
						<option value=""  th:selected="${ search.get('stat') eq '' }"  >全部</option>
						<option value="1" th:selected="${ search.get('stat') eq '1' }"  >被抽中</option>
						<option value="0" th:selected="${ search.get('stat') eq '0' }" >未抽中</option>
					</select>
		</li>
		<li>
				<label>开始时间</label>
				<input type="text" id="beginDate" name="beginDate"  onclick="WdatePicker({maxDate:'#F{$dp.$D(\'endDate\')}'})" th:value="${search.beginDate }" class="scinput date_width " placeholder="开始时间">
			</li>
			
			
			<li>
				<label>结束时间</label>
				<input type="text" id="endDate" name="endDate"  onclick="WdatePicker({minDate:'#F{$dp.$D(\'beginDate\')}'})" th:value="${search.endDate }" class="scinput date_width" placeholder="结束时间">
			</li>
		<li>
		<li>
			<label>&nbsp;</label>
			<input type="button" class="scbtn" value="查询" />
		</li>
		
		<li>
			<input type="button" id="zbbutton" style="width: 120px;" class="scbtnbution" value="导出抽奖记录" />
		</li>
		<li>
				<ul class="toolbar">
					<a th:href="@{/sys/card/cardlist.html}"><li class="click"><span><img style="width: 24px;height: 24px" th:src="@{/static/sys/images/goto.png}" /></span>返回</li></a>
				</ul>
		</li>
		
	</ul>
	</form>
	<table class="tablelist">
		<thead>
		    <tr>
		        <th style="width: 50px;">序号</th>
		        <th>用户昵称</th>
		        <th>中奖状态</th>
		        <th>兑奖SN码</th>
		        <th>奖品名次</th>
		        <th>奖品内容</th>
		        <th>抽奖时间</th>
		    </tr>
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
				    <td th:text="${itemStat.count}" ></td>
					<td th:text="${item.get('wx_name')}" ></td>
					<td th:switch="${item.get('stat')}" >
					    <span th:case="1" class="stylecss">被抽中</span>
					    <span th:case="*" >未抽中</span>
					</td>
					<td th:text="${item.get('sn_code')}" ></td>
					<td th:text="${item.get('award_place')}" ></td>
					<td th:text="${item.get('award_type')}" ></td>
					<td th:text="${#calendars.format(item.get('create_time'),'yyyy-MM-dd HH:mm:ss')}"></td>
			</tr>
		</tbody>
	</table>
	<!-- 分页 -->
	<div class="pagin">
    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录，当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
   	</div>
</div>
</body>
<script type="text/javascript">
$("#zbbutton").on('click',function(){
	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/card/exportCJlog/[[${id}]]";
	$("#seachform").submit();
	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/card/awardLog/[[${id}]].html";
});
</script>
</html>