<!--#include file="chklogin.asp"-->
<!--#include file="../conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>快问我知道 - 回答管理</title>
<link href="css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-color: #FF9999;
	scrollbar-face-color: #FF3333;
        scrollbar-highlight-color: #FFFFFF;
}
-->
</style>
</head>
<body bgcolor="#FF9999"><br>
<br>
<br>
<%
Response.Buffer = True 
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache"

dim action,id
action=request.QueryString("action")
id=request.QueryString("id")
if action="sc" then
sc
elseif action="tj" then
tj
elseif action="cj" then
cj
end if

sub tj()
dim rs,sql
'set rs=server.CreateObject("adodb.recordset")
'sql="select * from kw_hd where strong=1"
'rs.open sql,conn,1,3
'if  not (rs.bof and rs.eof) then
'rs("strong")=0
'rs.update
'end if
'rs.close
'set rs=nothing

set rs=server.CreateObject("adodb.recordset")
sql="select * from kw_hd where id="&id
rs.open sql,conn,1,3
rs("strong")=1
rs.update
rs.close
set rs=nothing
response.write "<script language=javascript>alert('推荐问题成功!');history.go(-1);</script>"
end sub

sub cj()
dim rs,sql
set rs=server.CreateObject("adodb.recordset")
sql="select * from kw_hd where id="&id
rs.open sql,conn,1,3
rs("strong")=0
rs.update
rs.close
set rs=nothing
response.write "<script language=javascript>alert('推荐撤消成功!');history.go(-1);</script>"
end sub

sub sc()
dim rs,sql
set rs=nothing

sql="delete from kw_hd where id="&request("id")
conn.execute sql
response.write "<script language=javascript>alert('成功的删除了回答');history.go(-1);</script>"
response.End
end sub

dim rs,sql,i,wtans,zt
zt=request.QueryString("zt")
wtans=request("wtans")
set rs=server.CreateObject("adodb.recordset")
if wtans<>"" then
sql ="Select * from kw_hd where bt like '%"&wtans&"%' order by id desc"
elseif zt="" then
sql="select * from kw_hd order by id desc"
elseif zt="hot" then
sql ="Select * from kw_hd order by djs desc"
elseif zt="ok" then
sql ="Select* from kw_hd where zt=2 order by id desc"
elseif zt="gf" then
sql ="Select * from kw_hd order by xsf desc"
elseif zt="no" then
sql ="Select* from kw_hd where zt=1 order by id desc"
end if
rs.open sql,conn,1,3
%>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" class="tablebg">
  <tr align="center" bgcolor="#ff6666">
    <td colspan="3" class="font_bt">回 答 管 理</td>
  </tr>
  <tr align="center" bgcolor="#ff6666">
    <form action="kw_hd.asp" method="post">
	<td height="30" colspan="3">
	查找提问：&nbsp;&nbsp;&nbsp;&nbsp;
	<input name="wt" type="text">&nbsp;&nbsp;<input name="submit" type="submit" id="submit" value="查 找">
    </td>
    </form>
  </tr>
  <tr align="center" bgcolor="#ff6666">
    <td height="40" width="78%"><b style="color:#0033CC">回答标题</b></td>
    <td width="15%"><b style="color:#0033CC">操 作</b></td>
    <td width="6%"><b style="color:#0033CC">回答管理</b></td>
  </tr>
          <%
	if rs.bof and rs.eof then
	   response.Write("<tr><td>还没有回答</td></tr>")
	else
		  dim page
		  rs.pagesize=15
          page=clng(Request.QueryString("page"))
          if page<1 then page=1
          if page>rs.pagecount then page=rs.pagecount
          rs.absolutepage=page
          for i=1 to rs.pagesize
		       if rs.eof then
		       exit for
		       end if
		  %>
  <tr bgcolor="#ff6666">
    <td height="30" width="78%"><font color="#3B427D"><b><%=rs("wtans")%></b></td>
    <td align="center">&nbsp;&nbsp;<a href="kw_hd.asp?action=sc&id=<%=rs("id")%>" onClick="return confirm('您确定进行删除操作吗？')">删除 ？</a>&nbsp;&nbsp;</td>
    <td align="center"><a href="../show/<%=rs("hdques")%>" target="_blank">>>查看</a></td>
  </tr>
  <%
       rs.movenext
       next
  end if
  if wtans="" then
  %>
  <tr align="center" bgcolor="#ff6666">
    <td colspan="3">
	<a href="Kw_hd.asp?page=1">首页</a>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="Kw_hd.asp?page=<%=page-1%>">上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="Kw_hd.asp?page=<%=page+1%>">下一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="Kw_hd.asp?page=<%=rs.pagecount%>">尾页</a></td>
  </tr>
</table>
<%
  end if
  rs.close
  set rs=nothing
  closedb
%>
</body>
</html>