<!--#include file="../conn.asp"-->
<!--#include file="../inc/function.asp"-->
<%
dim dl,xl,wtlx,wtys,zs,wts,showfl,showuser,showxsf
dim showtime,showdjs,showzt,addpoint,showhd,openstyle
dl=request.QueryString("dl")
xl=request.QueryString("xl")
wtlx=int(request.QueryString("wtlx"))
wtys=request.QueryString("wtys")
zs=int(request.QueryString("zs"))
wts=int(request.QueryString("wts"))
showfl=request.QueryString("showfl")
showuser=request.QueryString("showuser")
showtime=request.QueryString("showtime")
showdjs=request.QueryString("showdjs")
showzt=request.QueryString("showzt")
addpoint=request.QueryString("addpoint")
showhd=request.QueryString("showhd")
showxsf=request.QueryString("showxsf")
openstyle=request.QueryString("openstyle")

		dim rs,sql,i
		set rs=server.CreateObject("adodb.recordset")
		if wtlx="1" or wtlx="" then
		   if xl<>"" then
		      sql ="Select * from kw_wt where xiaolei='"&xl&"' order by id desc"
		   else
		      sql ="Select * from kw_wt where dalei='"&dl&"' order by id desc"
		   end if
		 elseif wtlx="2" then
		   if xl<>"" then
		      sql ="Select * from kw_wt where xiaolei='"&xl&"' order by djs desc"
		   else
		      sql ="Select * from kw_wt where dalei='"&dl&"' order by djs desc"
		   end if
		 elseif wtlx="3" then  
		   if xl<>"" then
		      sql ="Select * from kw_wt where xiaolei='"&xl&"' order by xsf desc"
		   else
		      sql ="Select * from kw_wt where dalei='"&dl&"' order by xsf desc"
		   end if
		 elseif wtlx="4" then
		    if xl<>"" then
		      sql ="Select * from kw_wt where xiaolei='"&xl&"' and zt=2 order by id desc"
		   else
		      sql ="Select * from kw_wt where dalei='"&dl&"' and zt=2 order by id desc"
		   end if
		 end if
		   
rs.open sql,conn,1,1

dim str
  		if rs.eof and rs.bof then
str="document.write('该类还没有提问！');"
		response.End()
		end if
str=str&"document.write('<table width="""" border=""0"" cellspacing=""1"" cellpadding=""0"">');"
        For i=1 to wts
           if rs("bt")="" then
           exit for
        end if
str=str&"document.write('<tr>');"
        if showfl="true" then
str=str&"document.write('<td>');"
	        if xl<>"" then 
str=str&"document.write('[<a href=""list.asp?dl="&server.URLEncode(rs("dalei"))&"&xl="&server.URLEncode(rs("xiaolei"))&""" target="&openstyle&""">"&rs("xiaolei")&"</a>]');"
	        else
str=str&"document.write('[<a href=""list.asp?dl="&server.URLEncode(rs("dalei"))&""" target="&openstyle&""">"&rs("dalei")&"</a>]');"
	        end if
str=str&"document.write('</td>');"
        end if
str=str&"document.write('<td>&nbsp;&nbsp;<a href=""../show/"&rs("wt_filename")&""" target="""&openstyle&""">"&leftstr(rs("bt"),zs)&"');"
          if checklen(rs("bt"))>zs and addpoint="true" then
str=str&"document.write('&nbsp;…');"
          end if
str=str&"document.write('</a></td>');"
          if showuser="true" then
str=str&"document.write('<td>&nbsp;&nbsp;"&rs("userid")&"</td>');"
          end if
          if showzt="true" then
str=str&"document.write('<td>');"
	      if rs("zt")=1 and rs("gq")=1 then
str=str&"document.write('&nbsp;&nbsp;<img src=""../images/no_point.gif"">');"
	      elseif rs("zt")=2 then
str=str&"document.write('&nbsp;&nbsp;<img src=""../images/yes_point.gif"">');"
	      elseif rs("zt")=3 then
str=str&"document.write('&nbsp;&nbsp;<img src=""../images/wu_point.gif"">');"
	      elseif rs("gq")=2 then
str=str&"document.write('&nbsp;&nbsp;<img src=""../images/gq_point.gif"">');"
	      end if
str=str&"document.write('</td>');"
	      end if
	      if showxsf="true" then
str=str&"document.write('<td>&nbsp;&nbsp;<img src=""../images/jf_point.gif""> <font style=""font-size:14px;"" color=""#ff5400"">"&rs("xsf")&"</td>');"
	      end if
	      if showdjs="true" then
str=str&"document.write('<td>&nbsp;&nbsp;浏览："&rs("djs")&"</td>');"
	      end if
          if showhd="true" then
str=str&"document.write('<td>');"
	 	dim rs1,sql1,i1
		set rs1=server.CreateObject("adodb.recordset")
		sql1 ="Select * from kw_hd where hdques="&rs("id")
        rs1.open sql1,conn,1,1
str=str&"document.write('&nbsp;&nbsp;回答："&rs1.recordcount&"</td>');"
	    end if
	     if showtime="true" then
str=str&"document.write('<td>&nbsp;&nbsp;"&FormatDateTime(rs("twtime"),vbshortDate)&"</td>');"
	     end if
str=str&"document.write('</tr>');"
rs.movenext
next
str=str&"document.write('</table>');"
response.Write(str)
   rs.close
   set rs=nothing
   closedb
%>



