<!--#include file=conn.asp-->
<!--#include file="function.asp"-->
<!--#include file="config.asp"-->
<!--#include file="md5.asp"-->
<%
if not IsNumeric(request("id")) then
		Response.Write ("<script>alert('友情提示!\n\参数错误!');history.back();</script>")
		Response.end
	end if
%>
<%
if IsNumeric(request("jie"))=False then
jie=""
else
jie=request("jie")
end if
if request("id")="" then 
response.write"<script>alert('参数错误!');history.back();</script>"
response.End()
end if
if request("topic")<>"" or request("id")<>"" then

	id=CLNG(request("id"))
	if request("topic")="" then
	rs2.open"select * from class where id="&id,conn,1,1
	if rs2.eof then
response.write"<script>alert('参数错误!');history.back();</script>"
response.End()
end if
	topic=rs2("topic")
	rs2.close
	else
	topic=request("topic")
	end if

%>
<html>
<head>
<title><%=webname%>_<%=topic%>_全部问题</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="iknow.css" rel="stylesheet" type="text/css">
</head>
<body class="bgbdy" topmargin="0">
<center>
<!--#include file=top.asp-->
<table width="770" border="0"  cellpadding="0" cellspacing="0">
<tr><td height="25" nowrap><a href="<%=weburl%>"><%=webname%></a> &gt; <%=topic%> </td>  </tr></table>                                                                                                                                                                
</center>
<div align="center">
  <center>
  <table border="0" width="770" height="374" cellspacing="0" cellpadding="0">
    <tr>
      <td height="368" valign="top">
        <table border="0" width="100%" cellspacing="0" cellpadding="0" height="259">
          <tr>
            <td class="bgtle" nowrap height="24" ><%=topic%></td>
          </tr>
          <tr>
            <td class="bgcntLn" height="34" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
            <% 
            rs.open"select * from assort where shuxing="&id&" order by paixu",conn,1,1 
		if rs.eof then%>
		<tr>
暂时没有分类!                                                                                                                                                                   
          		<%else
          		while not rs.eof
		i=i+1
		rs2.open"select * from question where fenleiid="&rs("id")&"",conn,1,1
            totalquestion=rs2.recordcount
            rs2.close
		%>
          <td height="20" bgcolor="#FFFFFF" class="f14ln20"> ·<a href=assort1.asp?id=<%=rs("id")%>&topic=<%=rs("topic")%>><%=rs("topic")%></a> (<%=totalquestion%>)</td>                                                             
          <%rs.movenext
		  if i>=3 then
		  i=0%>
	    </tr>
		  <%end if
		  wend
		  end if
		  rs.close
		  %>
              </table>
          </tr>
          <tr>
            <td width="100%" height="17" valign="top"></td>
          </tr>
          <tr>
            <td width="100%" height="184" valign="top">
<table width="588" border="0"  cellpadding="0" cellspacing="0">
  <tr> 
    <td width="81" height="24" valign="bottom" class="<%if jie="" then%>bgtabCr<%else%>bgtab<%end if%>" nowrap><div align="center"><%if jie="" then%>全部问题<%else%><a href="assort.asp?id=<%=id%>&topic=<%=topic%>" class="f14">全部问题</a><%end if%></div></td>
    <td width="10"></td>
    <td width="81" valign="bottom" class="<%if jie="1" then%>bgtabCr<%else%>bgtab<%end if%>" nowrap><div align="center"><%if jie="1" then%>已解决问题<%else%><a href="assort.asp?id=<%=id%>&topic=<%=topic%>&jie=1" class="f14">已解决问题</a><%end if%></div></td>
    <td width="10"></td>
    <td width="81" valign="bottom" class="<%if jie="0" then%>bgtabCr<%else%>bgtab<%end if%>" nowrap><div align="center"><%if jie="0" then%>待解决问题<%else%><a href="assort.asp?id=<%=id%>&topic=<%=topic%>&jie=0" class="f14">待解决问题</a><%end if%></div></td>
    <td width="10"></td>
    <td width="81" valign="bottom" class="<%if jie="4" then%>bgtabCr<%else%>bgtab<%end if%>" nowrap><div align="center"><%if jie="4" then%>投票中问题<%else%><a href="assort.asp?id=<%=id%>&topic=<%=topic%>&jie=4" class="f14" >投票中问题</a><%end if%></div></td>
    <td width="10"></td>
    <td width="81" valign="bottom" class="<%if jie="3" then%>bgtabCr<%else%>bgtab<%end if%>" nowrap><div align="center"><%if jie="3" then%>高分问题<%else%><a href="assort.asp?id=<%=id%>&topic=<%=topic%>&jie=3" class="f14" >高分问题</a><%end if%></div></td>
    <td width="10"></td>
    <td width="81" valign="bottom" class="<%if jie="2" then%>bgtabCr<%else%>bgtab<%end if%>" nowrap><div align="center"><%if jie="2" then%>零回答问题<%else%><a href="assort.asp?id=<%=id%>&topic=<%=topic%>&jie=2" class="f14" >零回答问题</a><%end if%></div></td>
	<td valign="bottom">&nbsp;</td>
  </tr>
</table>
<%
rs2.open"select * from class where id="&id,conn,1,1
shu=rs2("id")
if jie="0" then
rs.open"select * from question where shuxing="&shu&" and jie=0 order by sendtime desc",conn,1,1
elseif jie="1" then
rs.open"select * from question where shuxing="&shu&" and jie=1 order by views desc",conn,1,1
elseif jie="2" then
rs.open"select * from question where shuxing="&shu&" and replys=0 order by sendtime desc",conn,1,1
elseif jie="3" then
rs.open"select * from question where shuxing="&shu&" and shang>0 order by shang desc",conn,1,1
elseif jie="4" then
rs.open"select * from question where shuxing="&shu&" and jie=4 order by sendtime desc",conn,1,1
elseif jie<>"0" or jie <>"1" or jie<>"2" or jie<>"3" or jie<>"4" or jie="" then
rs.open"select * from question where shuxing="&shu&" order by sendtime desc",conn,1,1
end if
totalquestion1=rs.recordcount
%>
<table width="588" border="0"  cellpadding="0" cellspacing="0" >
  <tr> 
    <td height="24" class="bglne"><div align="right" class="f12we">共有相关问题 <%=totalquestion1%>                                                                                                                                                                   
        项</div></td>                                                
</tr>  <tr><td height="10"></td></tr></table>
<table width="588" border="0" cellspacing="0" class=zhtable>
<tr class="f12b">
<td height="30" nowrap> 　标题</td>
<td width=40 nowrap align=center>回答数</td><td width="32" nowrap align="center">状态</td><td width="52" nowrap align="center">提问时间</td>
</tr>	  <%if rs.eof then%>
	  <tr>
          <td height="34" colspan=6>暂时没有问题!</td>
</tr><tr><%else
		rs.pagesize=MaxPerPage
		maxnum=rs.recordcount
		maxpage=rs.pagecount
		if request("p")="" then
		p=1
		else
		p=cint(request("p"))
		end if
		if p>maxpage then
		p=maxpage
		end if
		if p=0 then
		p=1
		end if
		if p<>1 then
		rs.move (p-1)*rs.pagesize
		end if
		for i=1 to rs.pagesize
		yue=Month(rs("sendtime"))
		ri=day(rs("sendtime"))
		%>

<td class="ln28"><span class="f14ln20"><%if rs("shang")>"0" then %><img src="img/icn_ps.gif" alt="悬赏<%=rs("shang")%>分" width="12" height="11" align="absmiddle"><span class="f10rd" title="悬赏<%=rs("shang")%>分"><%=rs("shang")%></span> <%end if%><a href=showquestion.asp?id=<%=rs("id")%> target=_blank><%if len(rs("title"))>28 then%><%=left(rs("title"),28)&"..."%><%else%><%=rs("title")%><%end if%></a> [<a href=assort1.asp?id=<%=rs("fenleiid")%>&topic=<%=rs("topic")%> class=lgy><%=rs("topic")%></a>]</span></td>    
<td align="center" valign="middle" class="ln28"><%=rs("replys")%></td>
<td align="center" valign="middle" class="ln28"><%if rs("jie")=0 then %><img src=img/icn_time.gif  alt=待解决问题><%elseif rs("jie")=1 or rs("jie")=3 then%><img src=img/icn_ok.gif  alt =已解决问题><%elseif rs("jie")=2 then%><img src=img/icn_cancel.gif  alt =问题已关闭><%elseif rs("jie")=4 then%><img src=img/icn_vote.gif  alt =投票中问题><%end if%></td>
<td align="center" valign="middle" class="ln28" nowrap><%=yue%>-<%=ri%></td></tr>
<%rs.movenext
		if rs.eof then exit for
		next%>
</table>

<br>
<div style="width:588px;" align="center"> 
<table width="90%" height="30" border="0"  cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" class="bgpagLn">问题数:<font color=red><%=maxnum%></font> | 每页数:<font color=green><%=rs.pagesize%></font> | 总页数:<font color=green><%=maxpage%></font> | 当前页:<font color=red><%=p%></font>                                                                                                                                                          
		  <a href=assort.asp?id=<%=shu%>&p=1&topic=<%=topic%>&jie=<%=jie%>>首页</a>                                                                                                                                                           
		  <a href=assort.asp?id=<%=shu%>&p=<%=p-1%>&topic=<%=topic%>&jie=<%=jie%>>上页</a>                                                                                                                                                           
		  <a href=assort.asp?id=<%=shu%>&p=<%=p+1%>&topic=<%=topic%>&jie=<%=jie%>>下页</a>                                                                                                                                                           
		  <a href=assort.asp?id=<%=shu%>&p=<%=maxpage%>&topic=<%=topic%>&jie=<%=jie%>>尾页</a></td>                                                                                                                                                             
  </tr>
</table>
<%end if
		rs.close
		rs2.close
%>

</div>

              <p>　</td>
          </tr>
        </table>
      </td>
      <td width="181" height="368" valign="top" align="right">
        <table border="0" width="100%" cellspacing="0" cellpadding="0">
          <tr>
            <td width="100%" valign="top">
              <div align="right">
                <table border="0" width="95%" cellspacing="0" cellpadding="0" height="118">
                  <tr>
<td class="bgtle" nowrap height="1"><%if session("person")<>"" then%>用户信息<%else%>用户登录<%end if%></td>
                  </tr>
                  <tr>
 <td class="bgcntBor3" height="60">
    <%if request("login")="登录" then
jiance=request("name")
if InStr(jiance,"or")<>0 or InStr(jiance,"'")<>0 or InStr(jiance,"`")<>0 or InStr(jiance,"=")<>0 or InStr(jiance,"-")<>0 or InStr(jiance,",")<>0 or InStr(jiance,"and")<>0 then 
Response.Write "<script language=JavaScript>{alert('用户名非法！');history.back();}</script>"
Response.End 
end if
		if not IsNumeric(request("verifycode")) then
		Response.Write ("<script>alert('友情提示!\n\n验证编码必须是数字!');history.back();</script>")
		Response.end
	end if
	if (int(session("SafeCode"))<>int(request("verifycode"))) then
		Response.Write ("<script>alert('友情提示!\n\n验证编码输入错误!');history.back();</script>")
		Response.end
	end if
	  if request("name")="" then
	  response.write"<script>alert('用户名不能为空!');history.back();</script>"
	  elseif request("pwd")="" then
	  response.write"<script>alert('密码不能为空!');history.back();</script>"
	  else
	  name=request("name")
	  pwd=request("pwd")
	  rs.open"select * from person where name='"&name&"' and pwd='"&md5(pwd)&"'",conn,1,1
	  if rs.eof then
	  response.write"<script>alert('用户名或密码错误!');history.back();</script>"
	  else
	  rs3.open"select * from person where name='"&name&"'",conn,1,3
	  rs3("logintime")=now
	  rs3.update
	  rs3.close
	  session("person")=name
	  %>
	  <%end if
	  rs.close
	  end if
	  end if%>
	  
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="zhtable"><%if session("person")<>"" then%>
              <tr> 
                <td  class="f14">您好：<%=session("person")%> </td>
              </tr>
              <tr> 
                <td><%rs.open"select * from person where name='"&session("person")&"'",conn,1,1%> 
                  <a href="help.asp#n5" target=_blank><%=rs("touxian")%></a> ( <%=rs("jifen")%> )</td>                 
              </tr>
      </table>
<table cellSpacing=0 cellPadding=0 width="100%" border=0>
  <tr>
    <td height=22>&#8226; <a href="user.asp?lei=mywen" target="_blank">我的提问</a></td>                
    <td>&#8226; <a href="user.asp" target="_blank">个人中心</a></TD>                
  </tr>
  <tr>
    <td>&#8226; <a href="user.asp?lei=myda" target="_blank">我的回答</a></td>                
    <td>&#8226; <a href="exit.asp">退出</a><%rs.close%></td>           
  </tr>
  <%end if%><%if session("person")="" then%><tr><form method=post action=assort.asp?id=<%=id%>><td align="center" valign="top">
	<p>用&nbsp;&nbsp;&nbsp;&nbsp;户: <input name="name" type="text" id="name" size="12"><br>密&nbsp;&nbsp;&nbsp;&nbsp;码: <input name="pwd" type="password" id="pwd" size="12"><br>验证码:<input type="text" size=3 maxlength=4 name=verifycode> <%Call GetSafeCode%><br><FONT color=#666666>(请输入图中数字)</FONT><br><input name="login" type="submit" id="login" value="登录">&nbsp;&nbsp;          
    <a href="reg.asp">注册</a>
</td></form><%end if%></tr>
</table>
<tr>
                    <td width="100%" height="10"></td>
                  </tr>
                </table>
              </div>
            </td>
          </tr>
          <tr>
            <td width="100%" valign="top">
              <div align="right">
                <table border="0" width="95%" cellspacing="0" cellpadding="0">
                  <tr><%rs2.open"select * from gonggao where flid=1 order by time desc",conn,1,1
                  if rs2.eof then
                  gonggao="暂时未有公告"
                  else
                  gonggao=rs2("text")
                  end if
                  rs2.close
                  %>
                    <td class="bgcntBor4 f12gy" valign=center ><%=gonggao%></td>
                  </tr>
                </table>
              </div>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  </center>
<div id="cDiv">
　
</div>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" style="clear:both;">
  <tr> 
    <td width="233" height="60" class="bgdsrh"></td>
    <td class="bgdsrh" width="517">
      <table  border="0" cellspacing="0" cellpadding="0" height="55">
       <tr>
        <form name=fbop method=post action=search.asp>
          <td nowrap height="26"><input name="content" type="text" id="content" value="<%=HTMLcode(request("content"))%>" size="47">
            <span style="padding-bottom:15px; "><a href="help.asp" target="_blank">帮助</a></span></td> 
        </tr>
       <tr>
          <td nowrap height="29">&nbsp;<input type="submit" name="Submit" value="搜索答案">&nbsp;&nbsp;     
            <span class="f12gn"><font color="#ffffff"><input onclick="ask(fbop);" type="button" value="我要提问"></font></span></td>
       </tr></form>
      </table></td>
  </tr>
  <tr> 
    <td height="1" class="bglne"></td>
    <td class="bglne"></td>
  </tr>
</table>
<center>
<br>
<br>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" style="clear:both;">
  <tr> 
    <td height="25"><div align="right"><a href="#top">返回页首</a></div></td>
  </tr>
  <tr> 
    <td height="30" align=center><!--#include file=end.asp--></td> 
  </tr>
</table></center>
</div>
<%else%>
参数错误!
</body>
<%
end if
%>
<%
Set rs=nothing
Set rs1=nothing
Set rs2=nothing
Set rs3=nothing
conn.Close
set conn=nothing
%>
