17b98f65cc883ce8fcbbe24ada8f982de8fe27ed.svn-base 9.72 KB
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<%@ include file="/WEB-INF/views/jsp/admin/public/publicjs.jsp"%>
		<script type="text/javascript">
		function disable(liveId) {
            $.post("disable.html",{liveId:liveId},function(data){
                jAlert( "封禁成功","提示" );
                window.location.reload();
            })
        }
		//全部选中/全部不选中
		   function checkAllUser(user){
			  var selectuser = document.getElementsByName("ids");
		      for(var i=0;i<selectuser.length;i++){
		     	 selectuser[i].checked = user.checked;
		      }
		   }
		
		   function query(statics, url){
				var startTime = $("#startTime").val();
				var endTime = $("#endTime").val();
				$.post(url, {
					"startTime" : startTime,
					"endTime" : endTime},
					function(data) { 
						
					});
			}
		
	function recommend(commend){
		 var selectuser = document.getElementsByName("ids");
		 var flag = false;
		 var ids="";
	     for(var i=0;i<selectuser.length;i++){
	     	if(selectuser[i].checked){
	     		var val = selectuser[i].value;
	     		flag = true;
	     		ids+=val+",";
	     	} 
	     }
	     
	     if(!flag){
	     	alert("没有选择执行操作的选项!不能执行该操作");
	     	return;
	     }
		$.post('<%=request.getContextPath()%>/live/recommend.html', {
			"recommend" : commend,
			"ids" : ids},
			function(data) {  
				if(commend==0){
				     for(var i=0;i<selectuser.length;i++){
					     	if(selectuser[i].checked){
					     		selectuser[i].checked = false;
					     	} 
					     }
					
				}
				alert(eval("(" + data + ")").msg);
			});  
	}
 //批量删除
    function deleteall(){
	 var selectuser = document.getElementsByName("ids");
	 var flag = false;
     for(var i=0;i<selectuser.length;i++){
     	if(selectuser[i].checked){
     		flag = true;
     	} 
     }
     if(!flag){
     	alert("没有选择执行操作的选项!不能执行该操作");
     }
     else{
     $("#dialog").dialog("destroy");
		$("#dialog-confirm").dialog({
			resizable: false,
			height:140,
			modal: true,
			buttons: {
				'确定': function() {
					$(this).dialog('close');
					document.Form1.action = "${basePath }/live/recommend.html";
     				document.Form1.submit();
				},
				'取消': function() {
					$(this).dialog('close');
				}
			}
		});
     }
   }
   function pageRefresh(){
       window.location.reload();
   }
   setTimeout('pageRefresh()',60000); //指定1分钟刷新一次
</script>
	</head>
	<body>
		<form:form action="${basePath }/live/list.html" modelAttribute="live" id="liveViewForm" name="Form1">
		    <input type="hidden" value="${page.page}" name="page" id="page"></input>
			<div class="center-main-ss" style="margin-bottom: 5px;">
				<div class="main-title">
					<span style="float: left; display: inline;">
					<img src="<%=request.getContextPath()%>/images/admin/t_mt01.jpg" border="0" />
					</span>
					<span style="float: left; color: #353C44; font-weight: 600; font-size: 14px;">搜索条件</span>
					<span style="float: right; display: inline;">
					<img src="<%=request.getContextPath()%>/images/admin/t_mt03.jpg" />
					</span>
				</div>
				<div style="padding-top: 20px;">
					<table width="80%" align="center" border="0" cellpadding="0"
						cellspacing="1" bgcolor="#CCCCCC" class="productTable">
						<tr>
							<td align="right" nowrap="nowrap" class="productTable_title">
								视频标题:
							</td>
							<td bgcolor="#ffffff">
								 <form:input path="name" />
							</td>
							<td align="right" nowrap="nowrap" class="productTable_title">
								主播(Me+)号:
							</td>
							<td bgcolor="#ffffff">
								 <form:input path="userId" />
							</td>
							<td align="right" nowrap="nowrap" class="productTable_title">
								是否推荐:
							</td>
							<td bgcolor="#ffffff">
      							<form:select path="recommend" cssClass="select">
	      							<form:option value="-1">全部</form:option>
								    <form:option value="0">非推荐</form:option>
								    <form:option value="1">推荐</form:option>
      							</form:select>
							</td>
						</tr>
						<tr>
							<td align="right" nowrap="nowrap" class="productTable_title">
								起始时间:
							</td>
							<td bgcolor="#ffffff">
								 <input type="text" class="input-small" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" placeholder="起始日期" id="startTime" name="startTime" value="${startTime }"/>
							</td>
							<td align="right" nowrap="nowrap" class="productTable_title">
								结束时间:
							</td>
							<td bgcolor="#ffffff">
								<input type="text" class="input-small" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" placeholder="起始日期" id="endTime" name="endTime" value="${endTime }"/>
							</td>
							<td align="right" nowrap="nowrap" class="productTable_title">
								
							</td>
							<td bgcolor="#ffffff">
								 
							</td>
						</tr>
						<tr>
							<td align="center" height="40" colspan="6" bgcolor="#ffffff">
								<input type="submit" value="搜 索" class="admin_again"></input>
							</td>
						</tr>
					</table>
				</div>
			</div> 
				<div class="main-title">
					<span style="float: left"><img src="<%=request.getContextPath()%>/images/admin/t_mt01.jpg" border="0" />
					</span>
					<span style="float: left; color: #353C44; font-weight: 600; font-size: 14px;">视频列表</span>
					<span style="float: right">
					<img src="<%=request.getContextPath()%>/images/admin/t_mt03.jpg" />
					</span>
					<span style="float: left; margin-left: 20px; cursor: pointer;">
						<a href="javascript:parent.reloadTab()" class="addbtn btn">刷 新</a>
					</span>
				</div>

				<div style="padding: 5px;">

					<table width="100%" class="tablestyle" border="0" cellspacing="1"
						cellpadding="0" align="center" bgcolor="#cccccc">
						<tr bgcolor="#F2F2F2" align="center" style="font-weight: 600;"
							height="22">
							<td>
								<input type="checkbox" name="selectUserAll" onclick="checkAllUser(this)">
							</td>
							<td>
								序号
							</td>
							<td>
								直播标题
							</td>
							<td>
								用户id
							</td>
							<td>
								流媒体地址
							</td>
							<td>
								总观众数量
							</td>
							<td>
								当前的观众数
							</td>
							<td>
								点赞数量
							</td>
							<td>
								视频状态
							</td>
							<td>
								是否推荐
							</td>
							<td>
								是否启用
							</td>
							<td>
							    创建时间
							</td>
							<td>
								结束时间
							</td>
							<td>
								操作
							</td>
						</tr>
                         <c:forEach  items="${liveList}" var="tmp" varStatus="statu">
							<tr bgcolor="#FFFFFF" align="center">
							    <td>
								<c:choose>
										<c:when test="${tmp.recommend==1}">
										<input type="checkbox" name="ids" id="ids" value="${tmp.id}" checked="checked">
										</c:when>
										<c:otherwise >
										<input type="checkbox" name="ids" id="ids" value="${tmp.id}">
										</c:otherwise>
							    </c:choose>
								</td>
								<td>
									${statu.count }
								</td>
								<td>
									${tmp.aliaName}
								</td>
								<td>
									${tmp.userId}
								</td>
								<td>
									${tmp.videoAddr}
								</td>
								<td>
									${tmp.audienceTotalNum}
								</td>
								<td>
									${tmp.audienceNowNum}
								</td>
								<td>
									${tmp.likeNum}
								</td>
								<td>
									<c:choose>
										<c:when test="${tmp.type==1}">直播中</c:when>
										<c:when test="${tmp.type==2}">已结束</c:when>
							        </c:choose>
								</td>
								<td>
								<c:choose>
										<c:when test="${tmp.recommend==1}"></c:when>
										<c:otherwise ></c:otherwise>
							    </c:choose>
								</td>
								<td>
									<c:choose>
										<c:when test="${tmp.active==1}">启用</c:when>
										<c:when test="${tmp.active==2}">停用</c:when>
							        </c:choose>
								</td>
								<td>
									<fmt:formatDate value="${tmp.createTime}" pattern="yyyy-MM-dd hh:mm:ss"/>
								</td>
								</td>
								<td>
									<fmt:formatDate value="${tmp.endedTime}" pattern="yyyy-MM-dd hh:mm:ss"/>
								</td>
								<td nowrap="nowrap">
									<c:choose>
										<c:when test="${tmp.type == 1}">
											<a href="<%=request.getContextPath()%>/live/enterLive.html?id=${tmp.id}" class="handle btn" target="_blank"><i class="pencil"></i>直播</a>
											<c:choose>
												<c:when test="${tmp.active == 1}">
													<a href="<%=request.getContextPath()%>/live/update.html?id=${tmp.id}&active=2" class="handle btn"><i class="pencil"></i>停用</a>
												</c:when>
												<c:when test="${tmp.active == 2}">
													<a href="<%=request.getContextPath()%>/live/update.html?id=${tmp.id}&active=1" class="handle btn"><i class="pencil"></i>启用</a>
												</c:when>
											</c:choose>
										</c:when>
										<c:when test="${tmp.type == 2}">
											<a href="<%=request.getContextPath()%>/live/playback.html?id=${tmp.id}" class="handle btn" target="_blank"><i class="pencil"></i>回放</a>
										</c:when>
									</c:choose>
									<a href="javascript:;" onclick="disable(${tmp.id})"  class="handle btn"><i class="pencil"></i>封禁</a>
								</td>
							</tr>
						</c:forEach>
					</table>
                  <%@ include file="/WEB-INF/views/jsp/admin/system/keer_pager.jsp"%>
				</div>
		</form:form>
	</body>
</html>