<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--#include file="buy2buysys.asp"-->
<% 
id=SafeRequest("id",1)
action=request("action")
if action="save" then

	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
	
	
	set rs=server.CreateObject("adodb.recordset")
	rs.open "select * from review",conn,1,3
	rs.addnew
	rs("id")=id
	'rs("title")=HTMLEncode2(trim(request.form("title")))
	rs("reviewcontent")=HTMLEncode2(trim(request("reviewcontent")))
	rs("reviewdtm")=now()
	rs("audit")=0
	rs("ipaddr") = Request.ServerVariables("REMOTE_ADDR")
	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
%> 

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<table width="180"  border="0" align="center" cellpadding="0" cellspacing="0">
 <tr>
                <form name="reviewform" method="post" action="pinglun.asp?action=save&id=<%=id%>">
				<td width="209">
				<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                        <td align="center" valign="top"><textarea name="reviewcontent" cols="30" rows="8" id="reviewcontent"></textarea>                        </td>
                      </tr>
                      <tr>
                        <td align="center"><input name="action2" type="hidden" value="save">
                            <input name="Submit3" type="submit" class="input_bot" onClick="return check();" value="提 交">
                            <input name="Submit22" type="reset" class="input_bot" value="清 除">
                          <a href="b2b_reproductlist.asp?id=<%=id%>" target="_blank"></a> </td>
                      </tr>
                </table>                 </td></form>
              </tr>
            </table>
</body>
</html>
<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.reviewform.reviewcontent.value)) {
	document.reviewform.reviewcontent.focus();
    alert("对不起，您还什么都没填！");
	return false;
  }
	  }
	  //-->
</script>
