<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="../head.asp"-->
<!--#include file="../inc/Function2.asp"-->
  <!--#include file="../checkrole.asp"-->
 <%
     call checkuser("ly")
	if issession=0 then
	gsid=Replace_Text(request.Cookies("Yxmemberid"))
	else
	gsid=session("id")
	end if	
secuser=Replace_Text(request.form("selected_friend_id"))
secuser=replace(replace(replace(secuser,"-1+",""),"0+",""),"1+","")
if request("Verifycode")="" then 
if request.form("Verifycode")="" and request.form("messageContent")="" then 
response.write""
else
response.write"<TABLE width='100%' border=0 align='center' cellPadding=0 cellSpacing=0>"
response.write"<TR><td>"
response.write"<ul>"
response.write"<li><FONT color='ff0000'> 亲爱的会员，您的验证码输入错误，请再试一下</font><br>"
response.write"</li>"
response.write"</ul>"
response.write"</TR></td></table>"
end if
else
touser=Replace_Text(request.form("touser"))
set rs=conn.execute("select id,user from Websen_corporation where [user]='"&touser&"' and id<>"&gsid&"")
if rs.eof or rs.bof then
  response.write"<SCRIPT language=JavaScript>alert('您填写的对方会员登陆名不正确或会员登陆名是您自己！');"
  response.write"javascript:history.go(-1)</SCRIPT>"
  response.end
else
mycid=rs("id")

end if
end if 
title=Replace_Text(request.form("messageTitle"))
content=Replace_Text(request.form("messageContent"))
sendemail=Replace_Text(request.form("sendemail"))
saveSendMessage=Replace_Text(request.form("saveSendMessage"))
sendContact=Replace_Text(request.form("sendContact"))


set rs1=server.createobject("adodb.recordset")
sql1="select * from Websen_getprice1 where (id is null)" 
rs1.open sql1,conn,1,3
rs1.addnew
rs1("title")=title
rs1("content")=content

if sendemail<>"" then rs1("sendemail")=1

if sendContact<>"" then rs1("sendcontact")=1

rs1("mycid")=mycid
rs1("sendcid")=gsid
rs1("datetime")=now()
rs1.update


set rs=server.createobject("adodb.recordset")
sql="select * from Websen_getprice where (id is null)" 
rs.open sql,conn,1,3
rs.addnew
rs("title")=title
rs("content")=content

if sendemail<>"" then rs("sendemail")=1
if sendContact<>"" then rs("sendcontact")=1

rs("mycid")=mycid
rs("sendcid")=gsid
rs("datetime")=now()
if saveSendMessage<>"" then 
rs("getprice1id")=rs1("id")
rs1.close
set rs1=nothing
end if
rs.update

rs.close
set rs=nothing

%>
                	
