<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: 220px;
	}
	.date_width{
	     width: 150px;
	}
	
	.tablelist th,td{
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
	}
	.tablelist td a{
    	text-decoration: underline;
	}
	
</style>
<body>
<div class="place">
	<span>位置：</span>
	<ul class="placeul">
		<li><a href="#">系统数据分析</a></li>
		<li><a href="#">月机构会员统计</a></li>
	</ul>
</div>
<div class="rightinfo">
	<form id="seachform" th:action="@{/sys/analysis/balance.html}" method="post">
	<input type="hidden" name="pageSize" id="pageSize" value="10" />
	<ul class="seachform">
			<li>
			 <label>日期</label>
			  <input type="text" id="date" name="date"  class="form-control scinput"  autocomplete="off"   th:value="${search.date}"  onclick="WdatePicker({dateFmt: 'yyyy-MM',maxDate:'%y-%M'})">
		    </li>	
			<li>
			 <label>商户名称</label>
			  <input name="unitName" type="text" class="scinput" th:value="${search.unitName}"  />
		    </li>
			<li>
				<input type="button" class="scbtn" value="查询" />
				<input type="button" id="button" class="scbtn" value="导出" />
			</li>
	</ul>
	</form> 

	<table class="tablelist">
		<thead>
		    <tr>
		    	<th >商户名称 </th>
		    	<th >机构名称 </th>
		    	<th >新增人数</th>
		    	<th >流失人数</th>
		    	<th >有效人数 </th>
		    	<th >结存人数</th>
		    </tr> 
		</thead>
		<tbody>
			<tr th:each="item:${list}" >
				<td th:title="${item.unit_name}" th:text="${item.unit_name}"></td>
				<td th:text="${item.league_name}"></td>
				<td >
					<a th:href="@{/sys/analysis/balance/vip.html(id=${item.get('id')},type='1',date=${search.get('date')},title='新增人数' )}">
						[[${item.get('count_1')}]]
					</a>
				</td>
				<td >
					<a th:href="@{/sys/analysis/balance/vip.html(id=${item.get('id')},type='2',date=${search.get('date')},title='流失人数'  )}">
						[[${item.get('count_2')}]]
					</a>
				</td>
				<td >
					<a th:href="@{/sys/analysis/balance/vip.html(id=${item.get('id')},type='3',date=${search.get('date')},title='有效人数'  )}">
						[[${item.get('count_3')}]]
					</a>
				</td>
				<td>
					<a th:href="@{/sys/analysis/balance/vip.html(id=${item.get('id')},type='4',date=${search.get('date')},title='结存人数'  )}">
						[[${item.get('count_4')}]]
					</a>
				</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">
$(function () {
	$("#button").on('click',function(){
		document.getElementById("seachform").action = "[[${sysUrl}]]/sys/analysis/balance/export.html";
		$("#seachform").submit();
		window.setTimeout(function(){
			document.getElementById("seachform").action = "[[${sysUrl}]]/sys/analysis/balance.html";
		},3000);
	});
})
</script>

</html>