<!--#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_wt 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_wt 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_wt 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=server.CreateObject("adodb.recordset")
sql="select * from kw_wt where id="&id
rs.open sql,conn,1,1

  dim sql1
   sql1="delete from kw_hd where hdques='"&rs("wt_filename")&"'"
   conn.execute sql1

            Dim FSO
            Set FSO = server.CreateObject("Scripting.FileSystemObject")
			    if FSO.FileExists(Server.mappath("../show/"&rs("wt_filename"))) then
                   FSO.DeleteFile server.MapPath("../show/"&rs("wt_filename")),True
				end if
            Set FSO = Nothing
rs.close
set rs=nothing

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

dim rs,sql,i,wt,zt
zt=request.QueryString("zt")
wt=request("wt")
set rs=server.CreateObject("adodb.recordset")
if wt<>"" then
sql ="Select * from kw_wt where bt like '%"&wt&"%' order by id desc"
elseif zt="" then
sql="select * from kw_wt order by id desc"
elseif zt="hot" then
sql ="Select * from kw_wt order by djs desc"
elseif zt="ok" then
sql ="Select* from kw_wt where zt=2 order by id desc"
elseif zt="gf" then
sql ="Select * from kw_wt order by xsf desc"
elseif zt="no" then
sql ="Select* from kw_wt 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="6" class="font_bt">提 问 问 题 管 理</td>
  </tr>
  <tr align="center" bgcolor="#ff6666">
    <form action="Kw_wt.asp" method="post">
	<td height="30" colspan="6">
	查找提问：&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"><b style="color:#0033CC">提问标题</b></td>
    <td width="60"><b style="color:#0033CC">提问者</b></td>
    <td width="50"><b style="color:#0033CC">悬赏分</b></td>
    <td width="50"><b style="color:#0033CC">状 态</b></td>
    <td width="127"><b style="color:#0033CC">操 作</b></td>
    <td width="80"><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">&nbsp;&nbsp;<font color="#3B427D"><b><%=rs("bt")%></b><%if rs("strong")=1 then%>&nbsp;&nbsp;<font color="#339900">荐！</font><%end if%></font></td>
    <td align="center"><%=rs("userid")%></td>
    <td>&nbsp;&nbsp;<%=rs("xsf")%></td>
    <td align="center">
	<%if rs("zt")=1 then%>
	<img src="../images/no_point.gif">
	<%elseif rs("zt")=2 then%>
	<img src="../images/yes_point.gif">
	<%elseif rs("zt")=3 then%>
	<img src="../images/wu_point.gif">
	<%end if%></td>
    <td align="center">
	<%if rs("strong")=0 then%>
	<a href="kw_wt.asp?action=tj&id=<%=rs("id")%>">推荐！</a>
	<%else%>
	<a href="kw_wt.asp?action=cj&id=<%=rs("id")%>"><font color="#006600">撤荐？</font></a>
	<%end if%>
	&nbsp;&nbsp;<a href="kw_wt.asp?action=sc&id=<%=rs("id")%>" onClick="return confirm('您确定进行删除操作吗？')">删除 ？</a>&nbsp;&nbsp;<a href="crhtml.asp?id=<%=rs("id")%>">生成</a></td>
    <td align="center"><a href="../show/<%=rs("wt_filename")%>" target="_blank">>>查看</a></td>
  </tr>
  <%
       rs.movenext
       next
  end if
  if wt="" then
  %>
  <tr align="center" bgcolor="#ff6666">
    <td colspan="6">
	<a href="Kw_wt.asp?page=1">首页</a>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="Kw_wt.asp?page=<%=page-1%>">上一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="Kw_wt.asp?page=<%=page+1%>">下一页</a>&nbsp;&nbsp;&nbsp;&nbsp;
	<a href="Kw_wt.asp?page=<%=rs.pagecount%>">尾页</a></td>
  </tr>
</table>
<%
  end if
  rs.close
  set rs=nothing
  closedb
%>
</body>
</html>
