<!--#include file="QvodCms_Conn.asp"-->
<!--#include file="QvodCms_Check.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<TITLE>管理页面</TITLE>
<link href="skins/css/JaJa_main.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript">
<!--
d=escape(document.URL);
function CheckOthers(form)
{
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
//		if (e.name != 'chkall')
			if (e.checked==false)
			{
				e.checked = true;// form.chkall.checked;
			}
			else
			{
				e.checked = false;
			}
	}
}
function ErrAll()
{
var con;
con=confirm('将删除所有信息是否确定？');
if (con==true) window.location='qvodcms_err.asp?action=delall';
}
//-->
</script>
<style type="text/css">
<!--
.tdbg{ background-color:#CCCCCC}
.tdbgmouseover{ background-color: #666666}
-->
</style></head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th colspan=7 background="Skins/images/tdbg.gif" style="text-align:center;"><strong>影片报错管理系统</strong></th>
  </tr>
 <!--主页面 -->
<form method='post' action='?action=del' onSubmit='javascript:return CheckForm()'> 
<%
Dim Action,Errid,Dataname,Dataname2,Urlintro,Urlji,Server_id,Data_id
Action=Trim(Request.QueryString("action"))
Page=QvodCms_CLng(request.QueryString ("page"))
If page<=0 or page="" then page=1'初始化分页参数
Call OpenConn()
If action="del" then
    Call err_del()
Elseif action="deluid" Then
    Call err_deluid()			
Elseif action="delall" Then
    Call err_delall()		
Else 
    Call err_main() 
End If
%> 

<%
Sub err_main()
Set rs = Server.CreateObject("adodb.recordset")
sql = "select * from qvodcms_err order by err_times desc"
rs.Open sql, Conn, 1, 1
If Not (rs.bof And rs.eof) Then
	i=0
	rs.pagesize=QvodCms_CLng(AdminId(16))'每页数据
	rs.AbsolutePage=page
	m=rs.recordcount     '总记录
	n=rs.PageCount       '总页数
	z=rs.pagesize        '每页数量
%>
  <tr style="text-align:center;"> 　
    <td width="31" class="td2">选中</td>
    <td width="41" class="td2">序号</td>
    <td width="208" class="td2">影片名称</td>
    <td width="494" class="td2">错误报告</td>
    <td width="88" class="td2">报错时间</td>
    <td width="113" class="td2">相关操作</td>	
  </tr>
<%
	Do while not rs.eof  and i<rs.pagesize '通过参数查询数据库后替换标签的内容（嵌套标签）
	Call data_url(rs("err_sv"))
%>
  <tr bgcolor="#FFFFFF" onMouseOver="javascript:this.bgColor='#ecf5f8'" onMouseOut="javascript:this.bgColor='#FFFFFF'">
    <td ><input type='checkbox' name='e' value='<%=rs("err_id")%>' style="border: none"/></td>
    <td ><%=rs("err_id")%>.</td>
    <td ><%=Dataname2%>&nbsp;<Font color="red">[<%=rs("err_txt")%>]</Font></td>
    <td  align="left"><%=rs("err_about")%> <font color="red"><%=Urlji%> 错误</font></td>
    <td ><div align="center"><%=qvodcms_Time(rs("err_times"),3)%></div></td>
    <td align="center"><a href="qvodcms_data_edit.asp?data_id=<%=Data_id%>">修改地址</a> <a href="?e=<%=rs("err_id")%>&action=del"  title="删除">删错</a></td>
  </tr>
  <%
    i=i+1
    rs.movenext  
    Loop
  %>
  <tr style="text-align:left;">
    <td height="43" colspan="6" class="td2"><input type='button' value='全/反选' onClick=CheckOthers(this.form) />&nbsp;
     <input type='submit' value='删除所选'/>&nbsp;
      <input type='button' value='删除所有报错' onClick='Javascript:ErrAll()' />
      <%=ShowPage("qvodcms_err.asp", m, z, page, True, False, "条", False)%></td>
    </tr>
<%
Else
    Response.Write("<tr><td>暂时没有报错信息！</td></tr>") 
End If
rs.Close
set rs=nothing
Call CloseConn()'关闭数据库连接
%>
<%End Sub%>
</form>  
</table>
<div style="text-align:center; margin-top:5px; color: #FF0000">页面执行时间：<%=GetRunTime()%>秒</div>
</body>
</html>
<%
Sub data_url(err_sv)
    dim url_s,url_u,jishu
	Set urs=conn.execute(" select name_id,data_name,data_py,data_PlayPath from qvodcms_name where name_id="&rs("err_jiid")&"")
	If Not(urs.bof and urs.eof) Then
		Data_id=urs("name_id")
		Dataname=urs("data_name")
		Urlintro=urs("data_PlayPath")
		If instr(Urlintro,"$$")>0 Then
		    url_s=split(Urlintro,"$$")
			 for i=0 to Ubound(url_s)
	            pfm=url_s(i)
				If i=err_sv then Exit for
	         Next
		Else
		    Urlji="未知"
		End If	
	Else
		Dataname="未知"
		Urlintro="未知"
	End If
	Set urs=nothing
	Urlji=pfm
	Dataname2="<a href='"&DataUrl&"' title='"&Dataname&"' target='_blank'>"&GetSubStr(Dataname, 24, True)&"</a>"
End Sub

Sub err_del()'删除该影片该服务器组下具体一集的出错信息
    dim e_id
    e_id=trim(request("e"))
	e_id=replace(e_id,", ",",")
	If e_id="" Then
	    Call QvodCms_Err("请指定参数!")		
		response.end
	End If
	Conn.Execute(" delete from qvodcms_err where err_id in ("&e_id&") ")'删除地址
	Response.redirect("QvodCms_Err.asp?page="&page&"")		
End Sub

Sub err_deluid()'删除该影片该服务器组下的所有出错信息
    dim e_id
    e_id=Clng(request("e"))
	If e_id="" Then
	    Call QvodCms_Err("请指定参数!")		
		response.end
	End If
	Conn.Execute(" delete from qvodcms_err where err_urlid="&e_id&" ")
	Response.redirect("QvodCms_Err?page="&page&"")		
End Sub

Sub err_delall
	Conn.Execute(" delete from qvodcms_err ")'删除地址
	Response.redirect("QvodCms_Err.asp")		
End Sub

%>