<!--#include file="inc_common.asp"-->
<!--#include file="UBB.asp"-->
<%
'**************************************
'**		viewreply.asp
'**
'** 文件说明：查看回复页面
'** 修改日期：2005-08-20
'** 作者：Howlion
'** Email：howlion@163.com
'**************************************

dim id,replycode
	id=sql_filter(Trim(Request.QueryString("id")))
	replycode=Request.Form("replycode")

if id="" or (not isnumeric(id)) then
	errinfo="<li>非法的页面参数！"
	call showError()
end if

sql="Select * from [topic] where id="&id
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3

if rs.eof and rs.bof then
	rs.close
	set rs=nothing
	errinfo="<li>该留言不存在。"
else
	if rs("replycode")="" or (not rs("reply")=1) then
		rs.close
		set rs=nothing
		errinfo="<li>该留言没有被回复。"
	end if
end if
call showError()

pagename="查看回复"
call pageHead()
getReply()

function getReply()

if replycode="" then
	Response.Write ""
else
%>
        <div id="smallWrapper" style="padding: 12px 6px;">
	<%if replycode=rs("replycode") then%>
            <div class="msgTitle">标题：<h3><%=rs("usertitle")%></h3></div>
            <div class="msgTime" ><%=rs("usertime")%></div>
            <div class="msgContent"><table><tr><td><%=UBBCode(rs("usercontent"),0)%></td></tr></table></div>
            <div class="msgReply">
              <div class="msgReply-top"><b>管理员回复 : </b>( <%=rs("retime")%> )</div>
              <div class="msgReply-content"><table><tr><td><%=UBBCode(rs("recontent"),1)%></td></tr></table></div>
            </div>
	<%else%>

          <div class="row" style="margin: 190px 0px; text-align: center;">
            您输入的回复查看码不正确，请重新输入：<br /><br />
            <p><form action="viewreply.asp?id=<%=id%>" method="POST" name="replyform">
            回复查看码：<input name="replycode" type="password" size="15" maxlength="100">&nbsp;
            <input type="submit" class="button" name="submit" value="查看回复">
            </form></p>
          </div>
	<%end if%>
        </div>
<%
end if
end function

rs.close
set rs=nothing
%>