<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->

<%
dim rs,sql,id,xid,i,u,str1,str2,username,tupian,objFSO,fileExt,sql1,rs1
username=request.cookies("jle")("username")
id=trim(request("selectedid"))
if request("chk")="hfdel" then
xid=trim(request("xid"))
if xid<>"" then
Conn.Execute("Update jle_info Set hfcs=hfcs-1 where id="&xid)
end if

if id="" then
response.write "<script language=JavaScript>" & chr(13) & "alert('没有选择记录！');" & "history.back()" & "</script>"
end if

str2=split(id,",")
set rs1 = Server.CreateObject("ADODB.RecordSet")
for u=0 to ubound(str2)
sql1="delete from [reply] where id="&cstr(str2(u))&" "
rs1.open sql1,conn,1,3
next
response.write "<script language=JavaScript>" & chr(13) & "alert('删除回复信息成功！')</script>"
response.write "<meta http-equiv=refresh content=""1;URL=admin_information_reply.asp"">"

response.end
rs1.close
set rs1=nothing
end if
%>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="inc_style.css" rel="stylesheet" type="text/css">
<body topmargin="0" leftmargin="0"><script>
function loadThreadFollow(t_id,b_id){
	var targetImg =eval("document.all.followImg" + t_id);
	var targetDiv =eval("document.all.follow" + t_id);
	
	if ("object"==typeof(targetImg)){
		if (targetDiv.style.display!='block'){
			targetDiv.style.display="block";
			
		}else{
			targetDiv.style.display="none";
		}
	}
}
</script>
<SCRIPT language=JavaScript>
function showoperatealert(id)
{
		if (id==1)
        {

		{
		  	thisForm.target='_self';
			thisForm.action="#";
			thisForm.submit();
		}
		}
		if (id==2)
        {

		{
		  	thisForm.target='_self';
			thisForm.action="?chk=hfdel";
			thisForm.submit();
		}
		}
		if (id==3)
        {

		{
		  	thisForm.target='_self';
			thisForm.action="#";
			thisForm.submit();
		}
		}
}

function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall' )
       e.checked = form.chkall.checked;
    }
  }
//-->
    </SCRIPT>
<div align="center">
<table width="98%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#c5cfe0" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
<td align="center" height="29"  class="tdbar" colspan="5">
<table width="100%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#c5cfe0" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
<td align="center" height="62"  class="tdbar">
<FORM name=sou3 action="?jle=1" method=POST style="line-height: 150%; margin-top: 0; margin-bottom: 0">
<p align="center">按关键词：<input type="text" name="T3" size="42">
<input type="submit" value="查找" name="B1">
</form>
</td>
<td class="tdbar">
<a href="?jle="><font color="#FF0000">显示全部回复</font></a></td>
</tr>
</table>
</td>
</tr>
<FORM name=thisForm action="" method=POST>
<%
dim ThisPage,Pagesize,Allrecord,Allpage
k=1
set rs = Server.CreateObject("ADODB.RecordSet")
jle=trim(request("jle"))
Select Case jle
Case "1"
sql="select * from [reply] where username like '%"&trim(request("T3"))&"%' or neirong like '%"&trim(request("T3"))&"%' or xxid like '%"&trim(request("T3"))&"%'  order by id desc" 
Case Else
sql="select * from [reply] order by hfsj desc" 
End Select
rs.open sql,conn,1,1
if rs.eof then
response.write "sorry,暂时没有任何回复记录！"
response.end
end if
if request("page")="" then
  ThisPage=1		
else
  ThisPage=request("page")
end if
rs.Pagesize=30
Pagesize=rs.Pagesize
Allrecord=rs.Recordcount
Allpage=rs.Pagecount
if ThisPage<1 then                           
ThisPage=1
end if
On Error Resume Next
rs.move (ThisPage-1)*Pagesize
%>
<tr>
<td height="25" align="center" bgcolor="#FEEEBC" class="tdbar">选择</td>
<td bgcolor="#FEEEBC" class="tdbar" align=center>回复内容</td>
<td bgcolor="#FEEEBC" class="tdbar">
<p align="center">用户名</td>
<td bgcolor="#FEEEBC" class="tdbar">
<p align="center">日期</td>
<td bgcolor="#FEEEBC" align="center" class="tdbar">
操作</td>
</tr>
<%
dim uid
do while not rs.eof
uid=rs("xxid")
%>
<TR bgcolor="#e4edf9" onMouseOver="this.bgColor='#ffffff'" onMouseOut="this.bgColor='#e4edf9'" style="CURSOR:default"> 
<td height="24" align="center" >
<INPUT type=checkbox value="<%=rs("id")%>" name=selectedid></td>
<td id="ff" style="width:450px;word-wrap:break-word">
<script type="text/javascript">
/* <![CDATA[ */
function toBreakWord(intLen){
var obj=document.getElementById("ff");
var strContent=obj.innerHTML; 
var strTemp="";
while(strContent.length>intLen){
strTemp+=strContent.substr(0,intLen)+"&#10;"; 
strContent=strContent.substr(intLen,strContent.length); 
}
strTemp+="&#10;"+strContent;
obj.innerHTML=strTemp;
}
if(document.getElementById && !document.all) toBreakWord(37)
/* ]]> */
</script>

<%=rs("neirong")%><font color="#FF0000">(信息ID:<%=UID%>)</font></td>
<td align="center" style=""><%if rs("username")<>"" then%><%=rs("username")%><%else%>匿名<%end if%></td>
<td align="center" style=""><%=rs("hfsj")%></td>
<td style="">
<p align="center"><font color="#FF0000">
<span id="followImg<%=k%>" style="CURSOR: hand" onClick="loadThreadFollow(<%=k%>,5)">
&nbsp;</span></font><a href="?selectedid=<%=rs("id")%>&xid=<%=uid%>&chk=hfdel">删除</a></td>
</tr>
<%
k=k+1
rs.movenext
if k>=Pagesize then exit do
loop
rs.close
set rs=nothing
closedb
%>
<tr>
<td height="35" colspan="5" style="border-top-style: solid; border-top-width: 1">
<p align="center" class="tdbar">
　<INPUT onclick=CheckAll(this.form) type=checkbox value=on name=chkall>全选
<input onclick=javascript:showoperatealert(2) type="submit" value="删除" name="B2">
请慎用全部删除功能，全部删除不能将回复次数归零。单条信息删除时每删除一条就减去一次回复次数。
</td>
</tr>
  
</form>
</table><br>
<table width="98%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#c5cfe0" bordercolordark="#FFFFFF" bgcolor="#C5D5E4"  style="font-size:12px; letter-spacing:1px;">
        <tr align="center" bgcolor="#FFFFFF" height="20"> 
<td align="center" height="29"  class="tdbar">
共有&nbsp;<font color="#CC5200"><%=Allrecord%></font>&nbsp;条记录</td>
<td width="126" height="25" align="center" class="tdbar">
共 <font color="#CC5200"><%=Allpage%></font> 页</td>
<td width="118" height="25" align="center" class="tdbar">
现在是第 
<font color="#CC5200"><%=ThisPage%></font> 页</td>
<td width="200" height="25" align="center" class="tdbar">
<%
if ThisPage<2 then     
response.write "<font color=""#808080"">首页</font>&nbsp;"
response.write "<font color=""#808080"">上一页</font>&nbsp;"     
else     
response.write "<a href=?page=1&t1="&trim(request("t1"))&"&t2="&trim(request("t2"))&"&t3="&trim(request("t3"))&"&jle="&jle&">首页</a>&nbsp;"
response.write "<a href=?page="&ThisPage-1&"&t1="&trim(request("t1"))&"&t2="&trim(request("t2"))&"&t3="&trim(request("t3"))&"&jle="&jle&">上一页</a>&nbsp;"     
end if
if Allpage-ThisPage<1 then     
response.write "<font color=""#808080"">下一页</font>&nbsp;"
response.write "<font color=""#808080"">尾页</font>&nbsp;"  
else     
response.write "<a href=?page="&(ThisPage+1)&"&t1="&trim(request("t1"))&"&t2="&trim(request("t2"))&"&t3="&trim(request("t3"))&"&jle="&jle&">下一页</a>&nbsp;"   
response.write "<a href=?page="&Allpage&"&t1="&trim(request("t1"))&"&t2="&trim(request("t2"))&"&t3="&trim(request("t3"))&"&jle="&jle&">尾页</a>&nbsp;"     
end if
%></td>
</tr>

</table>
</div>