<!--#include file="conn.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
dalei=request("dalei")
xiaolei=request("xiaolei")
nums=request("nums")
zishu=request("zishu")
dates=request("dates")
sql ="Select top "&nums&" Kw_Wt.wt_filename,KW_Wt.bt,Kw_Hd.wtans,KW_Wt.dalei,KW_Wt.xiaolei,kw_wt.twtime from Kw_Wt,Kw_Hd  where Kw_Wt.wt_filename=Kw_Hd.hdques"
if dalei="" then
   
      sql =sql& " and Kw_Wt.xiaolei='"&xiaolei&"' order by Kw_Wt.ID desc"
	  else
	  if dalei="1" then
	  sql =sql& "  order by Kw_Wt.ID desc"
	  else
	   sql =sql& " and Kw_Wt.dalei='"&dalei&"' order by Kw_Wt.ID desc"
	  end if
end if
rs.open sql,conn,1,1
if rs.bof and rs.eof then

else
for i=0 to rs.recordcount
if not rs.eof then
%>
document.write("<li><a href='/ask/show/<%=rs("wt_filename")%>'>กค<%=left(rs("bt"),zishu)%></a><%
if dates=1 then
response.Write DateValue(rs("twtime"))
end if
%></li>");
<%
rs.movenext
end if
next

end if
   rs.close
   set rs=nothing
%>