<!--#include file="conn.asp"-->
<!--#include file="denlu.asp"-->
<%
if request("Submit2")="ok" and request("delbox")<>"" then
	conn.execute "delete from Faq where id in ("&request("delbox")&")"
end if
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel=stylesheet type="text/css" href="js/media.css">
<link rel=stylesheet type="text/css" href="js/form_media.css">
<script language="JavaScript" src="js/whir.js"></script>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style3 {color: #4e6a82}
-->
</style>
</head>
<script language=javascript>
function CheckAll(form)
  {
  for (var i=0;i<form1.elements.length;i++)
    {
    var e = form1.elements[i];
    if (e.name != 'chkall')
       e.checked = form1.chkall.checked;
    }
  }
</script>	
<script language="javascript">
function fy(){
if (isNaN(document.fanye.topage.value)){
alert("请输入数字！")
document.fanye.topage.focus()
return false
}
}
</script>

<body text="#000000" leftmargin="0" topmargin="5">
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center" height="25">
  <tr> 
    <td width="701" height="20" valign="middle"><font color="#FF0000">当前位置：FAQ留言板数据库
    -&gt; FAQ留言板管理</font><br></td>
  </tr>
</table>

<form action="faq.asp" method="post" name="form2">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr align="center">
  
      <td width="56%" height="20" align="center"> <div align="right">留言者：
          <input name="title" type="text" class="text" id="title" value="<%=request("title")%>" size="25">
        <input type="hidden" value="eee" name="Submit">
</div></td>
      <td width="44%" align="center"><div align="left">
        &nbsp;
        <input name="image" type="image" src="images/shousuo.gif" width="72" height="21">
      </div></td>

  </tr>
</table> 
</form>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
      <td height="1" bgcolor="#4E6A82"></td>
  </tr>
 <form action="faq.asp" method="post" name="form1">
    <tr> 
      <td height="35" valign="bottom"> 
        <input type="hidden" name="Submit2">
        <input type="hidden" name="topage2" <%if request("topage")<>"" then%>value="<%=request("topage")%>"<%else%>value="1"<%end if%>>        
        <input type="image" src="images/del.gif" width="72" height="21" onclick="javascript:if(window.confirm('您确实要删除吗？')) window.form1.Submit2.value='ok'"> <a href="addfaq.asp"><img src="images/add.gif" width="72" height="21" border="0"></a>
        
      </td>
    </tr>
    <tr> 
      <td width="100%" align="center" valign="top"> <table width="100%" border="0" cellspacing="1" cellpadding="1" bordercolordark="#ffffff">
          <tr bgcolor="177B2F">
            <td width="5%" align="center">&nbsp;</td> 
            <td width="6%" height="23" align="center"><font color="#FFFFFF">序号</font></td>
            <td height="23" align="center"><font color="#FFFFFF">留言标题</font></td>
            <td width="9%" height="23" align="center" class="style1">是否以审核</td>
            <td width="16%" align="center" bgcolor="177B2F" class="style1">类别</td>
            <td width="12%" align="center" bgcolor="177B2F" class="style1">时间</td>
            <td height="23" colspan="2" align="center"><font color="#FFFFFF">相关操作</font></td>
          </tr>
          <%
set rs=server.createobject("adodb.recordset")
if request("Submit")<>"" then
	title=request("title")
	
	if title<>"" then
	  aa=aa+" and setname like '%"&title&"%'"
	end if

  rs.open "select * from faq where id is not null"+aa+" order by cdate(settime) desc,id desc",conn,3
else
  rs.open "select * from faq order by cdate(settime) desc,id desc",conn,3
end if
%>
          <% if rs.bof and rs.eof then %>
          <tr bgcolor="#F6F6F6"> 
            <td height="22" colspan="13" align=center>数据库里还没有数据!</td>
          </tr>
          <% else %>
          <%
if request("topage")="" then
topage=1
end if
rs.pagesize=15
if not isempty(request("topage")) then
topage=clng(request("topage"))
if topage>rs.pagecount then
rs.absolutepage=rs.pagecount
elseif topage<=0 then
rs.absolutepage=1
else
rs.absolutepage=topage
end if
end if
intcurpage=rs.absolutepage
%>

      <%
				for i=1 to rs.pagesize
                if rs.eof then
				exit for
				end if
				%>
          <tr bgcolor="#F6F6F6" onmouseover="this.bgColor='#e6e6e6';" onmouseout="this.bgColor='#F6F6F6';">
            <td align="center"><input type="checkbox" name="delbox" value="<%=rs("id")%>"></td> 
            <td height="22" align="center"><%=i+(topage-1)*(rs.pagesize)%></td>
            <td>
              <div align="left"><%if len(rs("title"))>25 then%><%=left(rs("title"),25)%>....<%else%><%=rs("title")%><%end if%></div>              <div align="center"></div></td>
            <td height="22" align="center"><%if rs("isreply")=1 then%>是<%else%>否<%end if%></td>
            <td height="22" align="center"><%=rs("mgtype")%></td>
            <td height="22" align="center"><div align="center"></div>              <%=rs("settime")%></td>
            <td width="12%" height="22" align="center"><%if rs("mgtype")<>"常见问题" then%><a href="faqshow.asp?id=<%=rs("id")%>&topage=<%=intcurpage%>">回复此留言</a><%else%><a href="faq_modi.asp?id=<%=rs("id")%>&topage=<%=intcurpage%>">修改</a><%end if%></td>
         

          </tr>
          <%
				  rs.movenext
				  next
				  end if

		  %>

        </table></td>
    </tr>
    <tr> 
      <td width="100%" height="30">　　 
        <input type="checkbox" name="chkall" value="on" onclick="CheckAll(this.form)"> 
        <span class="style3">全部选中</span> </td>
    </tr>
  </form>
</table>
<%if intcurpage<>0 then%>
<table width="98%" height="26" border="0" align="center" cellpadding="0" cellspacing="0">
  <form action="faq.asp" method="post" name="fanye" onsubmit="return(fy())">
    <tr> 
      <td height="26" align="right">目前在第<%=intcurpage %>页，共有<%=rs.pagecount%>页,共有<%=rs.recordcount%>条记录　
      <%if intcurpage<>1 then%>
          <a href="faq.asp?topage=<%=1%>&title=<%=request("title")%>&Submit=eee">第一页</a> <a href="faq.asp?topage=<%=intcurpage-1%>&title=<%=request("title")%>&Submit=eee">上一页</a> 
        <%
		end if
		if intcurpage<>rs.pagecount then
		%>
          <a href="faq.asp?topage=<%=intcurpage+1%>&title=<%=request("title")%>&Submit=eee">下一页</a> <a href="faq.asp?topage=<%=rs.pagecount%>&title=<%=request("title")%>&Submit=eee">最后一页</a>
		<%end if%>
		请输入页次:<input type=text size=3 name=topage value="<%=intcurpage%>" class="text">&nbsp;&nbsp;
<input type="submit" name="Submit" value="Go" class="text">
		<input type="hidden" value="<%=request("title")%>" name="zt">
		<input type="hidden" value="eee" name="Submit">
      </td>
    </tr>
  </form>
</table>
<%end if%>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
%>