<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="/favicon.ico">
<LINK rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="${pageContext.request.contextPath }/common/admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/skin/default/skin.css" rel="stylesheet" type="text/css" id="skin" />
<link href="${pageContext.request.contextPath }/common/admin/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/css/style.css" rel="stylesheet" type="text/css" />

<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>用户机器码绑定关系列表</title>
</head>
<body>
	<nav class="breadcrumb">
		<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>
		会员管理 <span class="c-gray en">&gt;</span> 用户机器码绑定关系列表 <a
			class="btn btn-success radius r mr-20"
			style="line-height: 1.6em; margin-top: 3px"
			href="javascript:location.replace(location.href);" title="刷新"><i
			class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<div class="pd-20">
	<form action="" method="post" name="form1">
			机器码：<input name="macId" value="${macId }" id="macId" style="width: 100px" class="input-text" type="text">
			 绑定时间： <input  id="beginDate" value="${beginDate }" name="beginDate" class="input-text Wdate" style="width: 120px;" type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'endDate\')||\'%y-%M-%d\'}'})" readonly>
				 - <input  id="endDate" value="${endDate }" name="endDate" class="input-text Wdate" style="width: 120px;" type="text" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'beginDate\')||\'%y-%M-%d\'}'})" readonly>
			<button name="" id="submitBtn" onclick="getList();" class="btn btn-success" type="submit" >
				<i class="Hui-iconfont"></i> 搜索
			</button>
			<button name="" id="submitBtn" onclick="excel()" class="btn btn-success" type="submit">
				<i class="Hui-iconfont"></i>导出Excel
			</button>
	</form>
	<form id="goodsform" >
		<!-- <div class="cl pd-5 bg-1 bk-gray mt-20">
			<span class="l"><a href="javascript:;" onclick="excel()"
				class="btn btn-danger radius">导出Excel</a>&nbsp;
		    </span>
		</div> -->
		<table class="table table-border table-bordered table-bg" id="example">
			<thead>
				<tr>
					<th scope="col" colspan="11">关系列表</th>
				</tr>
				<tr class="text-c">
					<th width="25"><input type="checkbox" name="" value=""></th>
					<th width="150">用户昵称</th>
					<th width="200">机器码</th>

					<th width="130">代理商</th>
					<th width="150">代理商电话</th>
					<th width="290">绑定时间</th>
					<th width="50">操作</th>
				</tr>
			</thead>
			<tbody>
				<c:if test="${! (empty list) }">
					<c:forEach items="${list }" var="binding">
						<tr class="text-c">
							<td><input type="checkbox" value="${binding.id }" name="id"></td>
							<td>${binding.userNickName }</td>
							<td>
							<%-- <img src="${binding.productIntroduceImg }" width="50" height="50"></img> --%>
							${binding.macId }
							</td>
							
							<td>${binding.drpName}</td>
							<td>${binding.drpPhone}</td>
							<td><fmt:formatDate value="${binding.bindTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
							
							<td class="td-manage">
								<a onclick="deleteBinding(this,${binding.id })"  title="删除" href="javascript:;"  class="ml-5" style="text-decoration:none;"> 
								<!-- <i class="Hui-iconfont">&#xe6df;</i> --> 
								删除
								</a> 
								
							</td>
					</c:forEach>
				</c:if>
			</tbody>
		</table>
		<div align="right" class="mt-10 mb-10 mr-10">
			<%@include file="/common/other/paper/pager.jsp"%>
  		</div>
  		</form>
	</div>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.admin.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/tips.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/My97DatePicker/WdatePicker.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/js/page/jqPaginator.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/common/goods/js/utils.js"></script>
	<script type="text/javascript">
	/* $(document).ready(function(){
		$('#beginDate').datepicker();//时间控件
        $('#endDate').datepicker();
	}); */
	//按条件查询
	function getList(){
		document.form1.action='${pageContext.request.contextPath }/admin/binding/list';
		document.form1.submit();
		//document.form1.action='';
	}
	//导出Excel
	function excel(){
		document.form1.action='${pageContext.request.contextPath }/admin/binding/excel';
		document.form1.submit();
	}
	//删除一条记录
	function deleteBinding(_this,id){
		var obj = $(_this);	
		layer.confirm('确认要删除该记录吗？',function(index){
			$.ajax({
		        url: '${pageContext.request.contextPath }/admin/binding/delete',
		        type: "POST",
		        dataType: "json",
		        data: {id : id},
		        error:function(data){
		        	//alert("---error:function----->>" + data);
		      		//layer.msg(data.status,{icon: 5,time:5000});
		      		window.location.href = window.location.href; 
		        },
		        success:function(data){
		        	//alert("---success:function----->>" + data);
		      		//layer.msg(data.status,{icon: 1,time:5000});
		        	window.location.href = window.location.href;
		        }
		    });
		});
	}
	
	function updateProductStatus(_this,id){
		var obj = $(_this);	
		layer.confirm('确认要修改状态吗？',function(index){
			$.ajax({
		        url: '${pageContext.request.contextPath }/admin/product/updateStatus',
		        type: "POST",
		        dataType: "json",
		        data: {productId : id,productStatus : obj.val()},
		        error:function(data){
		      	  layer.msg(data.status,{icon: 5,time:2000});
		        },
		        success:  function(data){
		      	  layer.msg(data.status,{icon: 1,time:2000});
		      	  /* $("#Goodstatus").val(obj.val()); */
		      	  /* window.location.href = '${pageContext.request.contextPath }/admin/goods/listGoodsUI'; */
		        }
		    });
			}
		);

	}
	</script>
</body>
</html>