<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/wenda_reset.asp" -->
<%
dim id,rs
checkusername=session("TotCms_UserName")
id=Clng(request.QueryString("id"))
dim a_cid,a_title,a_content,a_userid,a_hits,a_pubdate,a_pubip,a_status,ctitle
if id>0 then
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from t_wenda where id="&id,conn,3,1
	if not rs.eof then
		a_cid=rs("CatalogId")
		a_userid=rs("UserId")
		a_title=rs("Title")
		a_content=rs("Content")
		a_status=rs("Status")
		a_pubip=rs("PubIp")
		a_pubdate=rs("PubDate")
		a_hits=rs("Hits")			
	end if
end if
rs.close
set rs=nothing
if(a_cid>0) then
	set rs=conn.execute("select Title from t_wenda_catalog where id="&a_cid)
	if not rs.eof then
		ctitle=rs(0)
	end if
	rs.close
	set rs=nothing
end if
function GetAnswerList(id)
	dim str
	set rs=conn.execute("select UserId,Content,PubIp,PubDate,id from t_reply where IsAnswer=0 and AskId="&id)
	while not rs.eof
		str=str&"<div class=""c"">"		
		str=str&rs(1)
		if(checkusername=a_userid and a_status=0) then
			str=str&" <a href=""wenda_best.asp?id="&id&"&ansid="&rs(4)&""">[采纳最佳？]</a>"
		end if
		str=str&"</div>"
		str=str&"<div class=""user"">回答者："&rs(0)&"</div>"
		rs.movenext
	wend
	rs.close
	set rs=nothing
	GetAnswerList=str
end function
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=a_title%>-旅游问答-<%=SiteName%></title>
<link href="../style/global.css" rel="stylesheet" type="text/css" />
<link href="style/zd.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/common.js"></script>
<script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script>
<script language="javascript"> 
function GetChkCode()
{
	document.getElementById('CertImg').src='/image.asp'
}
</script>
</head>

<body>
<!--#include file="../templet/head.htm"-->
<!--#include file="nav.asp"-->
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="32" align="left"><a href="/">首页</a>-&gt;<a href="/wd/">旅游问答</a>-&gt;<a href="/wd/list.asp?id=<%=a_cid%>"><%=ctitle%></a></td>
  </tr>
</table>
<div class="br"></div>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top"><form action="/wd/search.asp" method="get">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="zd_brd">
      <tr>
        <td align="center" background="/wd/images/search_bg.gif"><img src="/wd/images/search_left.gif" width="40" height="37" alt=" " /></td>
        <td height="30" align="center" background="/wd/images/search_bg.gif">关键字：
          <input name="KeyWord" type="text" class="input_text" id="KeyWord" size="60" />
           <input name="button2" type="submit" class="input_search" id="button2" value=" " /></td>
        <td align="center" background="/wd/images/search_bg.gif"><a href="/wd/ask.asp" class="wd_btn_pub">我要提问</a></td>
      </tr>
    </table>
    </form>
      <div class="br"></div>
      
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="wenda_th">
          <div class="txt"><img src="/wd/images/<%if(a_status=1) then response.Write("icon6") else response.Write("icon1") end if%>.gif" width="18" height="18" alt=" " /> <%if(a_status=1) then response.Write("已解决") else response.Write("等解决") end if%></div>
          </td>
        </tr>
    </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="act">
        <tr>
          <td class="wd_show_desc"> <h2><%=a_title%></h2>
          <%=a_pubdate%>点击：<span id="ask_hits"></span><br />
          <p><%=a_content%></p>
          <div class="user">提问者：<%=a_userid%></div>
          </td>
        </tr>
      </table>
      <div class="br"></div>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="wenda_th2"><div class="txt"><img src="/wd/images/icon7.gif" alt=" " width="17" height="23" align="absmiddle" /> 最佳答案</div></td>
        </tr>
      </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="act">
        <tr>
          <td class="wd_show_desc">
          <%=GetBestAnswer(id)%>
          </td>
        </tr>
      </table>
      <div class="br"></div>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="wenda_th2"><div class="txt"><img src="/wd/images/icon8.gif" width="19" height="18" alt=" " /> 回答 共<%=conn.execute("select count(*) from t_reply where AskId="&id)(0)%>条</div></td>
        </tr>
      </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="act">
        <tr>
          <td>
            <div class="wd_show_desc"><%=GetAnswerList(id)%><div class="clear"></div></div>
          </td>
        </tr>
      </table>
      <div class="br"></div>
      <form id="form2" name="form2" method="post" action="/wd/wenda_answer.asp">
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#DEE3ED">
          <tr>
            <td height="24" bgcolor="#F8F8F9"><div align="center" class="style1"><strong>我来回答</strong></div></td>
          </tr>
          <tr>
            <td height="35" align="center" bgcolor="#FFFFFF">
            <textarea name="Content" id="Content" cols="45" rows="5" style="width:96%; height:80px;" onclick="GetChkCode()"></textarea></td>
          </tr>
          <tr>
            <td width="84%" height="35" bgcolor="#FFFFFF"><div align="center">              
   	              验证码：
   	              <input name="vertcode" type="text" class="f_in" id="vertcode" size="4" onclick="GetChkCode()" />
                  <img src="/images/blank.gif" id="CertImg" onclick="this.src='/image.asp?time='+Math.random()" />
                  <input type="hidden" name="id" value="<%=id%>" />
              <input type="submit" name="Submit3" value="提交回答" />
            </div></td>
          </tr>
        </table>
	    </form>
      </td>
    <td width="5">&nbsp;</td>
    <td width="220" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="zd_brd">
      <tr>
        <td height="29" class="zd_topic"><img src="images/icon1.gif" alt=" " width="25" height="21" align="absmiddle" /> <span class="zd_topic_txt">知道分类</span></td>
      </tr>
      <tr>
        <td>
        <div class="zd_catalogs">
        	<ul>
          	<%
						set rs=conn.execute("select id,title from t_wenda_catalog order by id asc")
						while not rs.eof
						%>
            <li><a href="/wd/list.asp?id=<%=rs(0)%>"><%=rs(1)%></a></li>
            <%
							rs.movenext
						wend
						rs.close
						set rs=nothing
						%>           
          </ul>
        </div>
        </td>
      </tr>
    </table>
      <div class="br"></div>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="zd_brd">
        <tr>
          <td height="29" class="zd_topic"><img src="images/icon2.gif" alt=" " width="18" height="13" /> <span class="zd_topic_txt">关注排行</span></td>
        </tr>
        <tr>
          <td><div class="rank2">
            <ul>
              <%
						set rs=conn.execute("select top 10 id,UserId,Title,[Status],PubDate,Hits from t_wenda where IsCheck=1 order by Hits desc,id desc")
						while not rs.eof
						%>
            <li><a href="show.asp?id=<%=rs(0)%>"><%=rs(2)%></a></li>          
						<%
              rs.movenext
            wend
            rs.close
            set rs=nothing
            %>            
            </ul>
          </div></td>
        </tr>
    </table></td>
  </tr>
</table>
<!--#include file="../templet/root.htm"-->
</body>
</html>
<%
call connclose()
%>