<!--#include file="inc/config.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/route_func.asp"-->
<%
dim id,a_cid,a_title,a_content,a_userid,a_hits,a_pubdate,a_pubip,a_status,ctitle
if(request.QueryString("id")<>"") then
	id=Clng(request.QueryString("id"))
	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
	rs.close
	set rs=nothing
else
	id=0
end if
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
%>
<!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><%=ctitle%>-旅游问答</title>
<meta name="keywords" content="<%=ctitle%>-旅游问答" />
<meta name="description" content="<%=ctitle%>-旅游问答" />
<link href="style/global.css" rel="stylesheet" type="text/css" />
<link href="style/list.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/common.js"></script>
<script language="javascript">
function GetChkCode()
{
	document.getElementById('CertImg').src='image.asp'
}
</script>
<style type="text/css">
<!--
.tel {	color: #128203;
}
.f_in{ border:1px solid #CCC; color:#333;}
-->
</style>
</head>

<body>
<div id="wrapper">
	<div id="page">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="25%"><a href="/"><img src="images/logo.gif" width="250" height="80" alt="$SiteName$" /></a></td>
        <td width="75%" valign="bottom">
        <div id="menu">
          <ul>
            <li><a href="/">网站首页</a></li>
            <li><a href="/routes.asp">旅游线路</a></li>
            <li><a href="/hotel.asp">特惠酒店</a></li>
            <li><a href="/meeting.asp">会议接待</a></li>
            <li><a href="/ticket.asp">景点门票</a></li>
            <li><a href="/picture/">风光图片</a></li>
            <li><a href="/wenda.asp" class="current">旅游问答</a></li>
          </ul>        
        </div>
        </td>
      </tr>
    </table>
    <!--#include file="nav.asp"-->
    <div class="br"></div>
		<div id="rows">
    	<div id="left">
    	  <div class="cont">
    	    <div class="topic">问题搜索</div>
          <div class="br"></div>
          <form id="form2" name="form2" method="get" action="wenda_list.asp">
            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="32" align="center" class="tel"><strong>关键字：</strong></td>
                <td><input name="key" type="text" id="key" size="10" /></td>
                <td><input type="image" name="imageField" id="imageField" src="image/but1.jpg" /></td>
              </tr>
            </table>
          </form>
<div class="br"></div>
  	    </div>
    	  <div class="br"></div>
    	  <div class="cont">
    	    <div class="topic">快速提问</div>
          <div class="br"></div>
    	    <form id="form3" name="form3" method="post" action="wenda_add.asp">
    	      <table width="90%" border="0" align="center" cellpadding="1" cellspacing="0">
    	        <tr>
    	          <td height="25">分类：
    	            <select name="CatalogId" id="CatalogId">
									<%=getSourceOption(0,"t_wenda_catalog")%>
                  </select>
                </td>
  	          </tr>
    	        <tr>
    	          <td height="25"><input name="Title" type="text" class="f_in" id="Title" onclick="if(this.value=='标题：') this.value='';" value="标题：" style="width:230px;" /></td>
  	          </tr>
    	        <tr>
    	          <td><textarea name="Content" class="f_in" id="Content" onclick="if(this.value=='内容：') this.value='';" style="width:230px; height:100px;">内容：</textarea></td>
  	          </tr>
    	        <tr>
    	          <td height="25" align="center">妮称：
   	            <input name="UserName" type="text" class="f_in" id="UserName" size="5" /> 
   	            验证码：
   	            <input name="vertcode" type="text" class="f_in" id="vertcode" size="4" /> <img src="/image.asp" onclick="this.src='/image.asp?time='+Math.random()"></td>
  	          </tr>
    	        <tr>
    	          <td height="25" align="center"><input type="submit" name="button2" id="button2" value="提交问题" /></td>
  	          </tr>
  	        </table>
  	      </form>
          <div class="br"></div>
    	  </div>
      </div>
      <div id="right">
        <table width="100%" border="0" cellspacing="0" cellpadding="1">
          <tr>
            <td width="20%"><img src="image/dh.gif" width="137" height="31" alt=" " /></td>
            <td width="80%"> &nbsp;◇ 您现在的位置：<a href="/">首页</a> &gt;&gt; <a href="/wenda.asp">旅游问答</a> &gt;&gt;<%=ctitle%></td>
          </tr>
        </table>
        <div class="br"></div>
        
        <div class="brd_t">
        	<div class="th">问题分类</div>
          <div class="wenda_catalog">
          	<%
						set rs=conn.execute("select id,title from t_wenda_catalog order by id asc")
						while not rs.eof
						%>
            <div class="item"><a href="wenda_list.asp?id=<%=rs(0)%>" <%if(id=rs(0)) then response.Write(" class=""bold""") end if%>><%=rs(1)%></a></div>
            <%
							rs.movenext
						wend
						rs.close
						set rs=nothing
						%>
          </div>
          <div class="br"></div>
        </div>
        <div class="br"></div>
        <div class="brd_t">
        <div class="th">网友提出的问题</div>
    			<h2 class="ask_title">[问]<%=a_title%></h2>
          <table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#ffffff">
            <tr>
              <td valign="top" bgcolor="#FFFFFF">
                <table width="100%" border="0" cellspacing="0" cellpadding="1">
                  <tr>
                    <td width="57%" height="26">发布日期：<%=a_pubdate%></td>
                    <td width="25%">提问者：<%=a_userid%></td>
                    <td width="18%">点击：<%=a_hits%></td>
                  </tr>
                </table>
                <div style="background-color:#F7FFEC; line-height:22px; padding-left:10px; margin:5px;"></div>
                <div class="padd10">
                <%=a_content%>
                <hr style="border:0px sol #666;" />
                <span style="color:#53AF0C; font-size:14px; font-weight:bold;">最佳回答：</span>
                <%
                set rs=server.CreateObject("adodb.recordset")
                rs.open "select UserId,Content,PubIp,PubDate from t_reply where AskId="&id&" and IsAnswer=1",conn,3,1
                if not rs.eof then
                %>
                <div class="ask_cnt">
                  [<%=rs(0)%>]于<%=rs(3)%> 回答：<br />
                  <%=rs(1)%>
                </div>
                </div>
                <%
                end if
                rs.close
                set rs=nothing
                %>            
              </td>
            </tr>        
          </table>
          <table width="97%" border="0" align="center" cellpadding="1" cellspacing="0">
            <tr>
              <td>
              <h4>目前有<%=conn.execute("select count(*) from t_reply where AskId="&id)(0)%>人参与回答</h4>
          <%
          set rs=server.CreateObject("adodb.recordset")
          rs.open "select UserId,Content,PubIp,PubDate,id from t_reply where AskId="&id,conn,3,1
          while not rs.eof
          %>
          <div class="ask_cnt">
            [<%=rs(0)%>]于<%=rs(3)%> 回答：<br />
            <%=rs(1)%><br /><%if(session("TotCms_UserName")=a_userid) then%><a href="setbest.asp?askid=<%=id%>&replyid=<%=rs(4)%>" class="red">设为最佳回答？</a><%end if%>
          </div>
          <div class="br"></div>    
          <%
            rs.movenext
          wend
          rs.close
          set rs=nothing
          %>
  	  <div class="br"></div>
  	  <form id="form2" name="form2" method="post" action="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="UserName" type="text" class="f_in" id="UserName" onclick="GetChkCode()" value="网友" size="5" />
   	              验证码：
   	              <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>
            </tr>
          </table>
<div class="br"></div>
        
  	  <!--start-->
  	</div>
        <div class="br"></div>
        <div align="center">
          <form name="form1" method="post" action="" style="margin:0 0 0 0">
				<%
        dim n,p
        n=currentpage+1
        p=currentpage-1
        if p>0then
        response.write("["&"<a href='?id="&id&"&key="&key&"&page="&cstr(p)&"'>上一页</a>]&nbsp;&nbsp;&nbsp;")
        else response.write("上一页&nbsp;&nbsp;&nbsp;")
        end if 
        if (n-1)*recpage>=allrec then 
        response.write("下一页" )
        else
        response.Write("["&"<a href='?id="&id&"&key="&key&"&page="&cstr(n)&"'>下一页</a>]")
        end if
        response.write("&nbsp;共"&allrec&"条&nbsp;")
        response.Write("&nbsp;共"&totalpage&"页&nbsp;")
        response.Write("&nbsp;第"&currentpage&"页&nbsp;")
        %>
              <input type="hidden" name="hid" value="<%=totalpage%>">
    &nbsp;&nbsp;跳至
        <input name="page" type="text" size="5" onChange="goto(this.form)" style="border:1px solid #000000;height:14px ">
        页
        <input type="button" name="Button22" value="Go->" style="font-size:12px ;border:1px solid #000000;height:18px ">
            </form>
          </div>
      </div>
    </div>
    <div class="br"></div>
    <!--#include file="root.asp"-->
  </div>
</div>
</body>
</html>
<%
conn.execute("update t_wenda set Hits=Hits+1 where id="&id)
call connclose()
%>

