·<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="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" />
<!--[if lt IE 9]>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/html5.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/respond.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/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/css/style.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/common/admin/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/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">
	<div class="text-c">
	<form action="${pageContext.request.contextPath }/admin/channel/listUI" method="post" class="form form-horizontal" id="form-member-add">
		<input type="text" value="${text }" name="text" id="" placeholder=" 渠道名称" style="width:250px" class="input-text">
		<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜机构</button>
	</form>
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
		<span class="l">
			<a class="btn btn-primary radius" onclick="showLayer('添加图片','${pageContext.request.contextPath}/admin/channel/addChannelUI')" href="javascript:;">
				<i class="Hui-iconfont">&#xe600;</i> 添加渠道
			</a>
		</span> 
	</div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
				<tr class="text-c">
					<th width="180">渠道名称</th>
					<th width="100">渠道推广值</th>
					<th width="80">渠道吸收人数</th>
					<th width="80">渠道访问数</th>
					<th width="80">渠道类型</th>
					<th width="100">渠道创建时间</th>
					<th width="100">登陆用户名</th>
					<!-- <th width="60">用户密码</th> -->
					<th width="80">用户账号状态</th>
					<th width="90">操作</th>
				</tr>
			</thead>
			<tbody>
				<c:choose>
					<c:when test="${!(empty channels) }">
						<c:forEach items="${channels }" var="channel">
							<tr class="text-c">
								<td>${channel.channelName }</td>
								<td>${channel.channelStr }</td>
								<td>${channel.channelNum }</td>
								<td>${channel.channelAccessNum }</td>
								<td>
									<c:choose>
										<c:when test="${channel.channelType == 1 }">
											电视渠道
										</c:when>
										<c:when test="${channel.channelType == 2 }">
											传单渠道
										</c:when>
										<c:when test="${channel.channelType == 3 }">
											活动渠道
										</c:when>
										<c:otherwise>
											其他渠道
										</c:otherwise>
									</c:choose>
								</td>
								<td>
									<fmt:formatDate value="${channel.channelCreateDate }" pattern="yy-MM-dd"/>
								</td>
								<td>${channel.channelAdminUserName }</td>
								<!-- <td>
									<a href="#" title="查看密码">******</a>
								</td> -->
								<td class="channel-status">${channel.channelStatus == 1 ? "用户启用" : "未启用" }</td>
								<td class="td-manage">
									<a style="text-decoration:none" onClick="showLayer('查看二维码','${pageContext.request.contextPath}/admin/channel/getQrcode/${channel.channelId }')" href="javascript:;" title="查看二维码">
										<i class="Hui-iconfont">&#xe6de;</i>
									</a>
									<a style="text-decoration:none" class="ml-5" onClick="showLayer('修改机构信息','${pageContext.request.contextPath}/admin/channel/updateChannelUI/${channel.channelId }')" href="javascript:;" title="编辑">
										<i class="Hui-iconfont">&#xe6df;</i>
									</a> 
									<c:if test="${channel.channelStatus == 2 }">
										<a style="text-decoration:none" class="ml-5" onClick="enableChannelFun(this,'${channel.channelId }')" href="javascript:;" title="启用">
											<i class="Hui-iconfont">&#xe631;</i>
										</a>
									</c:if>
								</td>
							</tr>
						</c:forEach>
					</c:when>
					<c:otherwise>
						<tr align="center"><td colspan="16" style="text-align: center;">未查询到该类数据!</td></tr>
					</c:otherwise>
				</c:choose>
			</tbody>
		</table>
	</div>
</div>
<div align="right">
	<%@include file="/common/other/paper/pager.jsp"%>
</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/lib/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/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">
/*图片-添加*/
function showLayer(title,url){
	layer_show(title,url,900,400);
}
function enableChannelFun(_this, id) {
	// 基本请求地址
	var $this = $(_this);
	var url = "${pageContext.request.contextPath}/admin/channel/enable/" + id;
	$.getJSON(url, {"qrcodeType":new Date().getTime(), "dateTime" : new Date().getTime()}, function(data) {
		if (data.flag) {
			layer.msg(data.info,{icon:1,time:2000});
			$this.parent().prevAll(".channel-status").html("用户启用");
			$this.hide();
		} else {
			layer.msg(data.info,{icon:5,time:2000});
		}
	});
}
</script>
</body>
</html>