<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="">
    
    <title>出票监控</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="/WebTpt/tpt/js/jqy.js"></script>

	<script type="text/javascript" src="<%=request.getContextPath()%>/LetouBack/js/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="/WebTpt/tpt/js/jquery.datepick.js"></script>
	<link href="/WebTpt/tpt/css/jquery.datepick.css" rel="stylesheet" type="text/css">
	<link href="/WebTpt/tpt/css/index.css" rel="stylesheet" type="text/css">
 	<style type='text/css'>
 		td{
 			border:1px #333 solid;
 			border-left:0px;
 			border-bottom:0px;
 			text-align:center;
 		}
 	</style>
  </head>

  <body>

	<div>
		<div class='header'>
			<ul>
				<li class='header_jt'></li>
				<li class='header_text'>出票监控</li>
			</ul>
		</div>
		<div>
	  		<select id="time"  onchange="on_changge(this)">
	  			<option value="15">--15--</option>
	  			<option value="20">--20--</option>
	  			<option value="25">--25--</option>
	  		</select>
			<!--
	  		开始时间:<input type="text" readOnly="readOnly" id='startDate' />
	  		结束时间:<input type="text" readOnly="readOnly" id='endDate' />
			-->
	  		定时刷新:<span id ='refTime' style='color:red;'>100</span>
			<input name="search" onclick='load()' style="width:45px;height:20px;" value="查询" type="button"/>
			<!--&nbsp;&nbsp;&nbsp;<span style='color:red;'>*注：时间范围只针对出票成功</span>-->
	  	</div>
	  	<div style="margin-top:3px;">
	  		<table   id='_tab' width="100%" style="border:1px #906E14 solid;border:0px;border-left:1px #333 solid;border-bottom:1px #333 solid;" cellspacing="0" cellpadding="0">
	  			<thead>
			  		<tr height="25" style="background:#FFF4C6;font:12px Arial;">
			  			<td width="120" >序号</td>
			  			<td width="200">出票ID</td>
			  			<td width="">状态</td>
			  			<td width="200">彩票种类</td>
			  			<td width="200">购买最晚时间</td>
			  			<td width="200">售票时间</td>
			  			<td width="200">购买金额</td>
			  			<td width="60">退单操作</td>
			  		</tr>
		  		</thead>
		  		<tbody id='ct_content'>
		  			<c:forEach items="${listSec}" var="item2">
		  					<tr>
		  					<td>${item2[0]}</td>
		  					<td>${item2[1]}</td>
		  					<td>${item2[2]}</td>
		  					<td>${item2[3]}</td>
		  					<td>${item2[4]}</td>
		  					<td>${item2[5]}</td>
		  					<td>${item2[6]}</td>
		  					<td> <a  onclick="betCancle('${item2[6]}','${item2[0]}')" href="#">撤 单</a></td>
		  					</tr>
		  			</c:forEach>
		  		</tbody>
		  		<tbody id='jc_content'>
		  			<c:forEach items="${chipinList}" var="item2">
		  					<tr>
		  					<td>${item2[0]}</td>
		  					<td>${item2[1]}</td>
		  					<td>${item2[2]}</td>
		  					<td>${item2[3]}</td>
		  					<td>${item2[4]}</td>
		  					<td>${item2[5]}</td>
		  					<td>${item2[6]}</td>
		  					<td> <a  onclick="betCancle('${item2[6]}','${item2[0]}')" href="#">撤 单</a></td>
		  					</tr>
		  			</c:forEach>
		  		</tbody>
		  		<tbody id='gp_content'>
		  			
		  		</tbody>
				<tbody>
		  			<tr style='font:bold 16px Arial;'><td colspan='8'>异常票</td></tr>
					<tr><td id="errorPrint" colspan='8'></td></tr>
		  		</tbody>
		  	</table>
 		<div>
		<!--<div id="mp3"></div>-->
	</div>
  </body>
</html>
<script type="text/javascript" src="/WebTpt/tpt/js/printTpt.js"></script>
<script type="text/javascript">
	$(function(){
		 var time=$('#refTime').text();
		 fun_timedown(time);
		 if(time!="无"&&time=='0'){
			//TimeingRef();
				setTimeout('load()',1000); //指定1秒刷新一次 
		 }
		 
	});

	function load()
	{
		//alert("test load...");
		//alert("<%=request.getContextPath()%>/jianKongAction.do?action=jianKong&status=1");
		window.location.href="<%=request.getContextPath()%>/jianKongAction.do?action=jianKong&status=1";
	}

	//倒计时 账户信息 手机绑定
	function fun_timedown(time)
	{
	    if(time=='undefined')
	        time = 100;
        time=time;
	    $("#refTime").html(time+"秒");
	    
	    time = time-1;
	    if(time>=0)
	    {
	        setTimeout("fun_timedown("+time+")",1000);
	    }else
	    {
	        //alert('倒计时结束！');
	        load();
	        setTimeout("fun_timedown("+100+")",1000);
	    }
	}

	function on_changge(val)
	{
		 var time=$('#refTime').text();
		 if(time=='0')
		 {
			$("#refTime").html(val.value+"秒");
		 	fun_timedown(val.value);
		 }
	}

	function betCancle(bet,serno)
	{
		var url="<%=request.getContextPath()%>/jianKongAction.do?action=betCancel&bet="+bet+"&serno="+serno;
		//alert(url);
		document.location.href=url;
	}
		
</script>
