<!--#include file="conn.asp"-->
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');history.go(-1);</script>"
response.End
else
if request.cookies("timesshop")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');history.go(-1);</script>"
response.End
end if
end if

dim reviewid,action
reviewid=SafeRequest("id",1)
action=Request.Form("action")
select case action
case "save"
if session("rank")>2 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权回复评论！');history.go(-1);</script>"
response.End
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select replyto,audit from review where reviewid="&reviewid,conn,1,3
rs("replyto")=trim(request.form("replyto"))
rs("audit")=trim(request.form("audit"))
rs.update
rs.close
set rs=nothing
conn.close
set conn = nothing
response.write "<script language=javascript>alert('回复成功！');history.go(-1);</script>"
response.End
case ""
%>
<title>回复评论</title>
<% set rs=server.CreateObject("adodb.recordset")
rs.open "select review.*,product.name from review inner join product on product.id=review.id  where reviewid="&reviewid,conn,1,1

%>

	
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class=table-zuoyou>
  <form name="form1" method="post" action="replyview.asp?id=<% = reviewid %>">
    <tr> 
      <td align="center" colspan="3" class=table-xia><b>回复评论</b></td>
    </tr>
    <tr height=25> 
      <td width="10%" class=table-youxia style="PADDING-LEFT: 6px">评论主题：</td>
      <td width="40%" class=table-youxia style="PADDING-LEFT: 6px"><%=trim(rs("title"))%></td>
      <td width="50%" class=table-xia style="PADDING-LEFT: 6px">评论商品： 
        <%if len(rs("name"))>20 then
			response.write "<a href=../product.asp?id="&rs("id")&" target=_blank>"&left(trim(rs("name")),18)&"...</a>"
			else
			response.write "<a href=../product.asp?id="&rs("id")&" target=_blank>"&trim(rs("name"))&"</a>"
			end if
			%>
      </td>
    </tr>
    <tr height=25> 
      <td class=table-youxia style="PADDING-LEFT: 6px">评论时间：</td>
      <td class=table-youxia style="PADDING-LEFT: 6px"> 
        <% = trim(rs("reviewdtm"))%>
      </td>
      <td class=table-xia style="PADDING-LEFT: 6px">审核状态： <a href=mailto:<% = trim(rs("messemail"))%>> 
        <select name="audit" id="audit">
          <option value="0" <% if rs("audit")=0 Then Response.write("Selected") %>>未审核</option>
          <option value="1" <% if rs("audit")=1 Then Response.write("Selected") %>>已审核</option>
        </select>
        </a></td>
    </tr>
    <tr height=30> 
      <td valign="middle" class=table-youxia style="PADDING-LEFT: 6px">留言内容：</td>
      <td colspan="2" style="PADDING-LEFT: 6px" class=table-youxia><%=trim(rs("reviewcontent"))%></td>
    </tr>
    <tr height=25>
      <td valign="middle" class=table-youxia style="PADDING-LEFT: 6px">来访 IP：</td>
      <td colspan="2" style="PADDING-LEFT: 6px" class=table-youxia><%=trim(rs("ipaddr"))%></td>
    </tr>
    <tr> 
      <td valign="top" class=table-youxia style="PADDING-LEFT: 6px">回　　复：</td>
      <td colspan="2" class=table-xia style="PADDING-LEFT: 6px"><TEXTAREA NAME="replyto" COLS="80" ROWS="6"><%=trim(rs("replyto"))%></TEXTAREA></td>
    </tr>
    <tr> 
      <td colspan="3" class=table-xia style="PADDING-LEFT: 6px" align="center"> 
        <input name="action" type="hidden" value="save"> <input type="submit" name="Submit" value="回 复"></td>
    </tr>
  </form>
</table>
      
<%
rs.close
set rs=nothing 
conn.close
set conn = nothing%>
 <!--#include file="footer.asp"-->
<% end select %>