<!-- #include file="../admin/check_master.asp" -->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/inputfilter.asp"-->
<link href="../css/xmwuye.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
searchcontent=trim(request("searchcontent"))
searchkind=request("searchkind")
if searchkind="" then
	sql="select * from bbsmenu order by id desc"
else
	select case searchkind
		case "id"
			sql="select * from bbsmenu where id="&searchcontent&" order by id desc"
		case "user_id"
			sql="select * from bbsmenu where user_id='"&searchcontent&"' order by id desc"
		case "pid"
			sql="select * from bbsmenu where pid="&searchcontent&" order by id desc"
		case "deleted"
			sql="select * from bbsmenu where deleted=1 order by id desc"
		case "ip"
			sql="select * from bbsmenu where reip ='"&searchcontent&"' order by id desc"
		case "bbs_img"
			sql="select * from bbsmenu where bbs_img<>'' order by id desc"
		case "img_url"
			sql="select * from bbsmenu where img_url<>'' order by id desc"

	end select
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,3,1
page=request("page")
if page="" then
page=1
else 
page=cint(trim(request("page")))
end if
ipagesize=20
rs.pagesize=ipagesize
count1=rs.recordcount	 

%>

<script language="javascript">
<!--
	function check(form)
		{
		if (form.content.value=="")
			{
			alert("删除内容未填写！");
			form.content.focus();
			return false;
			}
			return true;
		}
//-->
</script>

<SCRIPT LANGUAGE="JavaScript">
<!--//分页显示
	function openpage(pagenum)
	{
		window.location.href="<%=request.servervariables("script_name")%>?page="+pagenum+"&searchcontent=<%=searchcontent%>&searchkind=<%=searchkind%>";
	}
	
//-->
</SCRIPT>
<%
Function showpage()
 response.write "共<FONT COLOR='red'>"&count1&"</FONT>条信息 "
 response.write "第"&page&"页/共"&rs.pagecount&"页"
 response.write "　"
 if page>1 then
	response.write "<a href='javascript:openpage(1)'><FONT COLOR='blue'>首 页</FONT></a>"
	response.write "|"
	response.write "<a href='javascript:openpage("&page-1&")'><FONT COLOR='blue'>上一页</FONT></a>"
 else
	response.write "首 页"
	response.write "|"
	response.write "上一页"
 end if
	response.write "|"

 if page<rs.pagecount then
	response.write "<a href='javascript:openpage("&page+1&")'><FONT COLOR='blue'>下一页</FONT></a>"
 else
	response.write "下一页"
 end if
	response.write "|"
 
 if page<>rs.pagecount then
	response.write "<a href='javascript:openpage("&rs.pagecount&")'><FONT COLOR='blue'>尾 页</FONT></a>"
 else
	response.write "尾 页"
 end if
		  
End Function
%>
    <!--<table border="0" width="98%" cellspacing="0" cellpadding="0" align=center>
      <tr>
  <FORM METHOD=POST ACTION="reply_batch_del.asp" onsubmit="return check(this)">
        
      <td width="100%" align=center> 批量删除回贴： 
        <INPUT TYPE="text" NAME="content">
		<SELECT NAME="title">
		<option value="reip">IP地址
		<option value="pid">问题ID号
		</SELECT>
		<INPUT TYPE="submit" value="删除" onclick="return confirm('确实要删除吗？');">
		</td>
  </FORM>
  </tr>
</table>-->
<table width="98%" border="0" align="center">
<TR align=center>
<FORM METHOD=POST ACTION="<%=request.servervariables("script_name")%>" >
	  <TD height="35"> 搜索： 
        <INPUT TYPE="text" NAME="searchcontent" size=20>
        <select name="searchkind">
          <option value="id">ID号</option>
          <option value="user_id">用户名</option>
          <option value="pid">主题ID</option>
          <option value="ip">IP地址</option>
        </select>
        <INPUT TYPE="submit" value="搜索" name="">
      </TD>
</FORM>
</TR>
</TABLE>

<div align="center"><center>

<table border="0" width="98%" cellspacing="0" cellpadding="0">
  <tr>
        <td width="100%"> 
          <div align="center">

      <div align="center"><center>
                <table border="0" cellspacing="1" width="100%" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="0" bgcolor="#6D6576">
                  <tr>
                    <td width="6%" height="20" align="center" bgcolor="#D0D0D0"><strong>ID号</strong></td>
                    <td width="5%" align="center" bgcolor="#D0D0D0"><strong>主题</strong></td>
                    <td width="5%" align="center" bgcolor="#D0D0D0"><strong>作者</strong></td>
                    <td width="10%" align="center" bgcolor="#D0D0D0"><strong>电子邮件</strong></td>
                    <td width="23%" align="center" bgcolor="#D0D0D0"><strong>内容</strong></td>
                    <td width="12%" align="center" bgcolor="#D0D0D0"><strong>IP</strong></td>
                    <td width="12%" align="center" bgcolor="#D0D0D0"><strong>日期</strong></td>
                    <td width="5%" align="center" bgcolor="#D0D0D0"><strong>图片</strong></td>
                    <td width="5%" align="center" bgcolor="#D0D0D0"><strong>预览</strong></td>
                    <!--<td width="5%" align="center" bgcolor="#D0D0D0"><strong>标志</strong></td>
                    <td width="8%" align="center" bgcolor="#D0D0D0"><strong>修改</strong></td>
                    <td width="10%" align="center" bgcolor="#D0D0D0"><strong>删除</strong></td>-->
        </tr>
  <%if not rs.eof then
	  rs.absolutepage=page
	  i=1
	  do while not rs.eof
	  str="SELECT id,rep,htmfilename FROM bbstitle WHERE id="&rs("pid")
	  rs0=conn.execute(str)
	  k=rs0("rep")/20
      if int(k)=k then
         xpage=k
      else
         xpage=int(k)+1
      end if
%>
                  <tr bgcolor="#FFFFFF"> 
                    <td height="25"> 
                      <p align="center"><%=rs("id")%> </td>
                    <td > 
                      <p align="center"><a href="../html/<%=rs0("htmfilename")%>" target="_blank"><%=rs("pid")%></a>
                    </td>
                    <td > 
                      <p align="center"><%=rs("user_id")%><br></p></td>
                    <td > 
                      <p align="center"><%=rs("remail")%><br></p></td>
                    <td > <%=rs("remenu")%></td>
                    <td > 
                      <p align="center"><%=rs("reip")%><br></p></td>
                    <td > 
                      <p align="center"><%=right(year(rs("dateh")),2)%>/<%=month(rs("dateh"))%>/<%=day(rs("dateh"))%><br></p></td>
                    <td align="center"> 
                      <%if rs("bbs_img")<>"" then
							if rs("bbs_img_display")=0 then
					  %>
                      <A HREF="del_rep_sign.asp?id=<%=rs("id")%>&mode=1&kind=1"><FONT COLOR="green">未转正</FONT></A> 
                      <%else%>
                      <A HREF="del_rep_sign.asp?id=<%=rs("id")%>&mode=0&kind=1"><FONT COLOR="red">已转正</FONT></A> 
                      <%
							end if
						else
							response.write "&nbsp;"
						end if%>
                    </td>
					<td> 
                      <%if rs("bbs_img")<>"" then%>
                      <A HREF="../bbs/img_detail.asp?id=<%=rs("id")%>&kind=2&mode=1">预览</A> 
                      <%else%>
                      &nbsp; 
                      <%end if%>
                    </td>
                    <!--<td ><div align="center"> 
                      <%if rs("deleted")=0 then%>
                      <A HREF="del_rep_sign.asp?id=<%=rs("id")%>&mode=1&kind=3"><FONT COLOR="green">未删除</FONT></A> 
                        <%else%>
                        <A HREF="del_rep_sign.asp?id=<%=rs("id")%>&mode=0&kind=3"><FONT COLOR="red">已删除</FONT></A> 
                        <%end if%>
                      </div>
                    </td>
                    <td > 
                      <p align="center"><a href="../bbs/editpost.asp?id=<%=rs("pid")%>&File=<%=rs("pid")%>.htm&reid=<%=rs("id")%>&ps=y&page=<%=xpage%>">修改</a></td>
                    <td > 
                      <p align="center"><a href="../bbs/bzdelbbs.asp?id=<%=rs("pid")%>&bbs_img=<%=rs("bbs_img")%>&File=<%=rs0("htmfilename")%>&postuser=<%=request.cookies("name")%>&reid=<%=rs("id")%>&page=<%=xpage%>" onclick="return confirm('确实要删除吗？');">删除</a></td>
        </tr>-->
  <%
  rs.movenext
  i=i+1
  if i>ipagesize then exit do
  loop
  %>
	<tr>
	<td align=center colspan=15 bgcolor="#EFEFEF" height=20>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>		
        <td width="60%" align=right> 
			<%showpage()%>
          </td>
          <form name="form2" method="post" action="<%=request.servervariables("script_name")%>">
            <td > 
               &nbsp;第 
                <input type="text" name="page" size="3" class=input>
                页 
                <input type="submit" name="Submit" value="确定" class="button">
                <INPUT TYPE="hidden" name="searchcontent" value="<%=searchcontent%>">
                <INPUT TYPE="hidden" name="searchkind" value="<%=searchkind%>">
            </td>
          </form>
        </tr>
      </table>

	</td>
	</tr>	  
  <%else%>
  <tr bgcolor="#F2F9F9"> 
    <td colspan=15> 
      <div align=center> 找不到纪录！ </div>
    </td>
  </tr>
  <%end if%>

      </table>
      </center></div>
<br>
            </div>
        </td>
  </tr>
</table>
</center></div>
