<%@ 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" />
<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="${pageContext.request.contextPath }/admin/withdraw/seachInfo" method="get" id="form-admin-add">
		<div class="text-c"> 
			日期范围：
			<input readonly="readonly" type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'endDate\')||\'2020-10-01\'}'})" id="beginDate" name="beginDate" value="${beginDate }" class="input-text Wdate" style="width: 120px;">
			- <input readonly="readonly" type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'2020-10-01'})" id="endDate" name="endDate" value="${endDate }" class="input-text Wdate" style="width: 120px;">
			<input type="text" class="input-text" style="width:250px" placeholder="输入会员昵称、电话" value="${userInput }" id="userInput" name="userInput">
			<button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜用户</button>
		</div>
	</form> --%>
	<form id="adminlist">
		<table class="table table-border table-bordered table-bg">
			<thead>
				<tr>
					<th scope="col" colspan="9">代理商信息审核列表</th>
				</tr>
				<tr class="text-c">
					<th width="130">姓名</th>
					<th width="90">公司名称</th>
					<th width="150">电话号码</th>
					<th width="130">区域</th>
					<th width="130">申请时间</th>
					<th width="130">申请状态</th>
					<th width="100">详细地址</th>
					<th width="120">操作</th>
				</tr>
			</thead>
			<tbody>
				<c:if test="${! (empty list) }">
					<c:forEach items="${list }" var="infolist">
						<tr class="text-c">
							<td>${infolist.applyUserName }</td>
							<td>${infolist.applyName }</td>
							<td>${infolist.applyTel }</td>
							<td>${infolist.applyArea }</td>
							
							<td><fmt:formatDate value="${infolist.applyDate }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
							<td>${infolist.applyStatus==1?'<font color=green >申请中</font>':''}${infolist.applyStatus==2?'<font >审核通过</font>':''}${infolist.applyStatus==3?'<font color=red >审核未通过</font>':''}</td>
							<td>${infolist.applyAddr }</td>
							<td class="td-manage">
								<c:if test="${infolist.applyStatus==1 }">
								<input id="through" class="btn btn-primary radius upload-btn" onclick="updateApplyStatus(${infolist.applyID },2);" type="button" value="同意" />&nbsp;
								<input id="rejected" class="btn btn-primary radius upload-btn" onclick="updateApplyStatus(${infolist.applyID },3);" type="button" value="驳回" />
								</c:if>
							</td>
					</c:forEach>
				</c:if>
				<c:if test="${empty list }">
				<tr class="text-c">
					<td colspan="11">没有查询到数据</td>
				</tr>
			</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">
	function dataValidation(){
		if($("#withdrawUsername").val()!=null){
			 //收款人姓名数据验证
			if(!commonLengthJdg('withdrawUsername',1,30,null,true)){
				layer.msg("收款人姓名长度为1-30位",{icon: 2,time:2000});
				return false;
			}
		}
	}
	function updateApplyStatus(id,status){
		var msg = "";
		if(status == 1){
			msg = "确认要通过吗？";
		}else{
			msg = "确认要驳回吗？";
		}
		layer.confirm(msg,function(index){
		$.ajax({
			url : '${pageContext.request.contextPath }/admin/drp/apply/'+id + '/' + status,
			type : "POST",
			dataType : "json",
			beforeSubmit: function (data) {
            	  $("#through").attr("disabled","disabled");
            	  $("#rejected").attr("disabled","disabled");
              },
			success : function(data) {
				layer.msg(data.status,{icon: 1,time:1000},function(){
					$("#through").attr("disabled","");
	            	$("#rejected").attr("disabled","");
	            	window.location.href = '${pageContext.request.contextPath }/admin/drp/apply/list';
				});
			},
			error : function(data) {
				layer.msg(data.status,{icon: 5,time:1000});
			}
		});
		});
	}

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