<!--#include file="conn.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
end if
%>
<html>
<head>
<title><%=webname%>--用户评论</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="3" topmargin="4" marginwidth="00">
<%dim shopid,action
pinglunid=request.QueryString("id")
action=request.QueryString("action")
if action="save" then
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_pinglun where pinglunid="&pinglunid,conn,1,3
rs("huifu")=HTMLEncode2(trim(request("huifu")))
rs("huifudate")=now()
rs.update
rs.close
set rs=nothing
response.write "<br><br><table width=96% border=0 align=center cellpadding=0 cellspacing=0><tr><td height=86 bgcolor=#F5F5F5><div align=center>"
response.write "您的回复已成功提交！<br><br><a href=javascript:window.close()>关闭窗口</a></div></td></tr></table>"
response.End
end if
%>
<br><table width="95%" border="0" cellspacing="1" cellpadding="1" bgcolor="#CCCCCC" align="center">
  <tr> 
    <td bgcolor="f1f1f1" height="22">发表评论</td>
  </tr>
  <tr> 
    <form name="pinglunform" method="post" action="pinglun.asp?action=save&id=<%=pinglunid%>">
      <td bgcolor="#FFFFFF"> 
        <%set rs=server.CreateObject("adodb.recordset")
rs.open "select * from shop_pinglun where pinglunid="&pinglunid,conn,1,3
%>
        <table width="90%" border="0" cellpadding="2" cellspacing="1" align="center">
          <tr> 
            <td width="14%"><strong>姓名：</strong></td>
            <td width="25%"> <input name="pinglunname" class="wenbenkuang" type="text" id="pinglunname" size="12" value="<%=rs("pinglunname")%>" readonly> 
            </td>
            <td width="6%"><strong>评级：</strong></td>
            <td width="55%"><img src="../images/pingji/<%=rs("pingji")%>.gif"></td>
          </tr>
          <tr> 
            <td width="14%"><strong>评论标题：</strong></td>
            <td width="25%"> <input name="pingluntitle" class="wenbenkuang" type="text" id="pingluntitle" size="26" value="<%=rs("pingluntitle")%>" readonly> 
            </td>
            <td width="6%"><strong>IP：</strong></td>
            <td width="55%"><%=trim(rs("ip"))%></td>
          </tr>
          <tr> 
            <td valign="top"><strong>评论正文：</strong></td>
            <td colspan="3"> <textarea name="pingluncontent" class="wenbenkuang" cols="50" rows="5" id="pingluncontent" readonly><%=rs("pingluncontent")%></textarea> 
            </td>
          </tr>
          <tr> 
            <td valign="top"><font color="#FF0000">管理回复：</font></td>
            <td colspan="3"> <textarea name="huifu" cols="50" rows="5" id="huifu"><%=rs("huifu")%></textarea> 
            </td>
          </tr>
          <tr> 
            <td colspan="4"> <div align="center"> 
                <input name="Submit" type="submit" class="go-wenbenkuang" value="提交回复" onClick="return check();">
              </div></td>
          </tr>
        </table>
        <%rs.close
set rs=nothing%>
      </td>
    </form>
  </tr>
</table>
</body>
</html>
<%function HTMLEncode2(fString)
	fString = Replace(fString, CHR(13), "")
	fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
	fString = Replace(fString, CHR(10), "<BR>")
	HTMLEncode2 = fString
end function%>
<script LANGUAGE="javascript">
<!--
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function check()
{
  if(checkspace(document.pinglunform.pinglunname.value)) {
	document.pinglunform.pinglunname.focus();
    alert("请填写您的姓名！");
	return false;
  }
  if(checkspace(document.pinglunform.pingluntitle.value)) {
	document.pinglunform.pingluntitle.focus();
    alert("请填写评论标题！");
	return false;
  }
  if(checkspace(document.pinglunform.pingluncontent.value)) {
	document.pinglunform.pingluncontent.focus();
    alert("请填写评论正文！");
	return false;
  }
	  }
//-->
</script>