<!-- #include file="common.asp" -->
<!-- #include file="admcomm.asp"-->
<!-- #include file="isadm.asp" -->
<%
Dim zsb_auth, hasAuth
hasAuth = False
zsb_auth = Split( Trim( session("zsb_auth") ), ",", -1, 1 )

For Each auth In zsb_auth
	If ( auth = "batchadm" ) Then
			hasAuth = True
		Exit For
	End If
Next

If hasAuth = false Then
	Response.Write("<script language=javascript>alert('对不起，你没有权限，请联系超级管理员！');history.back(-1);</script>")
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>批量管理列表</title>
<link href="commcss.css" rel="stylesheet" type="text/css">
<link href="<%=GBCss%>/common.css" rel="stylesheet" type="text/css">
<script src="common.js" language="JavaScript" type="text/JavaScript"></script>
<script language="javascript">
function selectAll(chkAllId)
{
	try
	{
		var chked	= document.getElementById("checkAll"+chkAllId).checked;
		for( var i=0; i<document.getElementById("rowCount").value; i++ )
		{
			var chks = document.getElementById("SubLine"+i).childNodes;
			for( var j=0; j<chks.length; j++ )
			{
				if( chks[j].tagName == "INPUT" || chks[j].tagName == "input" )
				{
					chks[j].checked = chked;
					break;
				}
			}
		}
	}
	catch(err)
	{}
}

function DspAll()
{
	try
	{
		var Dsped = document.getElementById("DspChk").checked;
		for( var i=0; i<document.getElementById("rowCount").value; i++ )
		{
			var dsp = document.getElementById("ContLine"+i);
			if( Dsped )
			{
				dsp.style.display = "";
			}
			else
			{
				dsp.style.display = "none";
			}
		}
	}
	catch(err)
	{}
}

function LineOnSty(LineID)
{
	document.getElementById(LineID).style.backgroundImage="url(<% =GBSkin %>/guest_top.gif)";
}

function LineOutSty(LineID)
{
	document.getElementById(LineID).style.backgroundImage="url(<% =GBSkin %>/guest_bg.gif)";
}

function SelLine(LineID)
{
	try
	{
		var chks = document.getElementById(LineID).childNodes;
		for( var i=0; i<chks.length; i++ )
		{
			if( chks[i].tagName == "INPUT" || chks[i].tagName == "input" )
			{
				chk = chks[i].checked;
				chks[i].checked = !chk;
				break;
			}
		}
	}
	catch(err)
	{}
}

function SubmitConfirm(OpAction,Tips)
{
	if( confirm(Tips) )
	{
		document.getElementById("OpAction").value = OpAction;
		document.atListForm.submit();
		return true;
	}
	else
	{
		return false;
	}
}
</script>
</head>

<body style="text-align:center;">
<%Call AdmPageTop()%>
<div style="margin:auto;width:100%;background-color:#fff;">
<%
  Dim SearchKeyword
  SearchKeyword = Replace(Request("keyword"),"'","")
%>
<form method="post" action="admglist.asp">
<div style="padding-top:10px;height:30px;text-align:center;">
搜索留言：<input id="keyword" name="keyword" value="<%=SearchKeyword%>" class="input_common" style="width:200px;" />
<input type="submit" value="搜索" class="button_common" />
</div>
</form>
<form id="atListForm" name="atListForm" method="post" action="BatchExec.asp?pn=<%=Request("pn")%>">
<%
  Set rs = Server.CreateObject("ADODB.Recordset")
  If SearchKeyword <> "" Then
  	sqlstr = "select * from guest where title like '%"&SearchKeyword&"%' or content like '%"&SearchKeyword&"%' or Name like '%"&SearchKeyword&"%' order by TopG,id DESC"
  Else
  	sqlstr = "select * from guest order by TopG,id DESC"
  End If
  
  rs.Open sqlstr,conn,1,3
  
  TotRsCount	 = rs.RecordCount	'总记录数
  PerPageRsCount = GBENum			'每页记录数 
  CurrPageNum = Trim( Request("pn") )
  If CurrPageNum = "" Then
	CurrPageNum = 1
	rs.MoveFirst
  Else
	rs.Move Clng(CurrPageNum - 1) * PerPageRsCount
  End If
%>
<%Call DiPage( TotRsCount, PerPageRsCount, CurrPageNum, "admglist.asp?keyWord=" & Request("keyWord") & "&", "条记录")%>
<div style="background-image:url(<%=GBSkin%>/guest_top.gif);text-align:left;">
&nbsp;全选<input type="checkbox" id="checkAll1" onClick="selectAll('1');" />
展开全部<input type="checkbox" id="DspChk" onClick="DspAll();" />
</div>
<div id="cListing" style="text-align:left;">
<%
  i = 0
  While i<PerPageRsCount And Not rs.EOF
%>
<div id="Line<%=i%>" style="padding-left:30px;height:27px;padding-top:3px;background-image:url(<% =GBSkin %>/guest_bg.gif);border-bottom:#DDD 1px solid;cursor:pointer;" onDblClick="SelLine('SubLine<%=i%>')" onClick="ShowHideArea('ContLine<%=i%>')" onMouseOver="LineOnSty('Line<%=i%>')" onMouseOut="LineOutSty('Line<%=i%>')" title="单击显示/隐藏留言内容，双击选中！">
<div id="SubLine<%=i%>" style="float:left;"><input type="checkbox" id="id" name="id" value="<%=rs("id")%>" />
<% '=rs("id") %>
<%If rs("TopG")=True Then%>置顶留言<%Else%>普通留言<%End If%>&nbsp;
<%If ifNeedAuditing="YES" Then%>
<%If rs("ifHadDealAuditing")=False Then%><font color=red>未处理审核</font>
<%Else%><%If rs("ifHadPassAuditing")=False Then%>审核未通过<%Else%>审核已通过<%End If%><%End If%>
<%End If%>&nbsp;<% =rs("Date") %>&nbsp;<% =rs("Time") %>&nbsp;<b><% =rs("title") %></b>
</div>
<div style="float:right;width:40%;font-size:11px;">
<a href="<%=rs("homepage")%>" title="<%=rs("homepage")%>" target="_blank">主页</a>&nbsp;QQ：<% =rs("Oicq") %>&nbsp;邮箱：<%=rs("email")%>&nbsp;IP：<% =rs("IP") %>
</div>
</div>
<div id="ContLine<%=i%>" style="display:none;margin:10px 50px 10px 50px;line-height:2;">
<p style="width:100%;word-break:break-all;word-wrap:break-word;"><% =ubbcode(rs("content")) %></p>
<p>
<% 
  set rsb=Server.CreateObject("ADODB.Recordset")
  strsql="select * from reply where GuestID=" & rs("ID")
  rsb.open strsql,conn,1,3
  if not rsb.eof then
  While Not rsb.EOF
%>	  
<div style="margin-top:5px;padding:5px;border:#bbb 1px dashed;background-color:#f3f3f3;word-break:break-all;word-wrap:break-word;">
<font color=red><b><u><%If rsb("RName")="" Then%>匿名<%Else%><%=rsb("RName")%><%End If%>
<%If rs("ReNoView")= True then%>[已设置为不显示]<% end if %></u>&nbsp;回复</b></font><font style="font-size:10px;color:#999;">[<%=rsb("Date")%>&nbsp;<%=rsb("Time")%>]</font>
<br /><% =ubbcode(rsb("content")) %>
</div>
<%
  rsb.MoveNext
  Wend
  end if
  rsb.close
  set rsb=nothing 
%>    
</p>
</div>
<%
			i=i+1
		  rs.movenext
		wend
%>
</div>
<input type="hidden" id="rowCount" name="rowCount" value="<%=PerPageRsCount%>" />
<input type="hidden" id="OpAction" name="OpAction" value="" />
<div style="height:30px;padding-top:3px;background-image:url(<%=GBSkin%>/guest_top.gif);text-align:left;">
&nbsp;全选<input type="checkbox" id="checkAll2" onClick="selectAll('2');" />
批量操作：
<input type="submit" id="a" name="a" value="删除" onClick="SubmitConfirm('Del','确定批量审核通过？');return false;" class="button_common" style="height:18px;" />
<input type="submit" id="a" name="a" value="审核通过" onClick="SubmitConfirm('SetPass','确定批量审核通过？');return false;" class="button_common" style="height:18px;" />
<input type="submit" id="a" name="a" value="审核不通过" onClick="SubmitConfirm('UnPass','确定批量审核不通过？');return false;" class="button_common" style="height:18px;" />
<input type="submit" id="a" name="a" value="置顶" onClick="SubmitConfirm('SetTop','确定批量置顶？');return false;" class="button_common" style="height:18px;" />
<input type="submit" id="a" name="a" value="取消置顶" onClick="SubmitConfirm('UnTop','确定批量取消置顶？');return false;" class="button_common" style="height:18px;" />
</div>
</form>
<%Call DiPage( TotRsCount, PerPageRsCount, CurrPageNum, "admglist.asp?keyWord=" & Request("keyWord") & "&", "条记录")%>
<%
  rs.close
  set rs = nothing
  conn.close
  set conn = nothing 
%>
<%Call CopyRight()%>
</div>
</body>
</html>