<!--#include file="../head.asp"-->
<script Language="JavaScript">
function check()
{
  if (trim(form1.touser.value)=="") {
		alert("对方的会员登陆名不能为空！");
		form1.touser.focus();		
		    return (false);
  }
  if (trim(form1.messageTitle.value)=="") {
		alert("主题不能为空！");
		form1.messageTitle.focus();		
		    return (false);
  }
  if (trim(form1.messageContent.value)=="") {
		alert("主要内容不能为空！");
		form1.messageContent.focus();		
		    return (false);
  }
else
	document.form1.submit();
}
//-->
function trim(inputString) {
	   
              if (typeof inputString != "string") { return inputString; }
              var retValue = inputString;
              var ch = retValue.substring(0, 1);
              while (ch == " ") { 
	          //检查字符串开始部分的空格
                  retValue = retValue.substring(1, retValue.length);
                  ch = retValue.substring(0, 1);
              }
              ch = retValue.substring(retValue.length-1, retValue.length);
              while (ch == " ") {
                 //检查字符串结束部分的空格
                 retValue = retValue.substring(0, retValue.length-1);
                 ch = retValue.substring(retValue.length-1, retValue.length);
              }
              while (retValue.indexOf("  ") != -1) { 
	         //将文字中间多个相连的空格变为一个空格
                 retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
              }
              return retValue;
           } 

//--> 
</script>
<TABLE cellSpacing=0 cellPadding=0 width=778 border=0>
  <TBODY>
  <TR>
    <TD vAlign=top align=middle width=150>
      <SCRIPT LANGUAGE='JavaScript' SRC='../images/left.js' TYPE='text/javascript'></script>

      <TABLE cellSpacing=0 cellPadding=0 width=150 border=0>
        <TBODY>
        <TR>
          <TD vAlign=top align=middle width=150 
          background=../images/leftmanu_bg.gif>
            <TABLE cellSpacing=0 cellPadding=0 width=150 border=0>
              <TBODY>
              <TR>
                <TD width=150 
                  background=../images/leftmanu_topbg.gif><IMG height=30 
                  src="../images/leftmanu_top.gif" 
              width=150></TD></TR></TBODY></TABLE>
            <TABLE cellSpacing=0 cellPadding=0 width=150 border=0>
              <TBODY>
              <TR>
                <TD class=leftmenu1 
                onclick="location.href='../index.asp'"><IMG 
                  height=18 src="../images/leftmanu_home.gif" width=16 
                  align=absMiddle> 商务助手首页</TD></TR><TR>
                <TD class=leftmenu1 
                onclick=javascript:menu_display(table1,img1);><IMG id=img1 
                  height=16 src="../images/fold_2.gif" width=16 
                  align=absMiddle> 发布商业信息</TD></TR>
              <TBODY id=table1><!-- 正常情况下  -->
              <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="../tradeinfo/add_info.asp">发布供求信息</A> </TD>
                    </TR><!-- 正常情况下  -->
              <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="../tradeinfo/edit.asp">管理供求信息</A> </TD>
                    </TR><!-- 正常情况下  -->
			  <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="../productshow/add_product.asp">发布产品信息</A> </TD>
                    </TR><!-- 正常情况下  -->
			   <TR>

                      <TD class=leftmenu2><IMG src="../images/plus.gif"> 

					  <A 

                  class=linkstyle2 

                  href="../productshow/edit.asp">管理产品信息</A></TD>

                    </TR><!-- 正常情况下  --><TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="../modify/modify_mine.asp">展会信息管理</A> </TD>
                    </TR>



              



              <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="../corporation/company_edit.asp">公司介绍</A></TD>
                    </TR><!-- 正常情况下  -->
					<TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="../bizre/index.asp">商贸通档案</A></TD>
                    </TR><!-- 正常情况下  --></TBODY>
              <TBODY>
              <TR>
                <TD class=leftmenu1 onclick=menu_display(table2,img2)><IMG 
                  id=img2 height=16 src="../images/fold_2.gif" width=16 
                  align=absMiddle> 查看商业往来</TD></TR>
              <TBODY id=table2><!-- 正常情况下  -->
               <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="receivemessagelist.asp">我收到的留言</A> </TD>
                    </TR>
              <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="sendmessagelist.asp">我发出的留言</A> </TD>
                    </TR>
					              <TR>
                   <TD class=leftmenu3 height=29><IMG src="../images/minus.gif"> 
					  <A 
                  class=linkstyle3 
                  href="sendnewmessage.asp"><STRONG>发新留言</STRONG></a> <IMG src="../images/now.gif"></TD>
                    </TR><!-- 正常情况下  -->
              <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="../myemail/index.asp">我订阅的信息</A></TD>
                    </TR><!-- 正常情况下  -->
              <TR>

                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 

                  class=linkstyle2 

                  href="../myfriend/index.asp">我的商业伙伴</A> </TD>

                    </TR><TR>

                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 

                  class=linkstyle2 

                  href="../trust/index.asp">会员评价</A> </TD>

                    </TR></TBODY>
              
              <TR>
                    <TD class=leftmenu1 onclick=menu_display(table3,img3)><IMG 
                  id=img3 height=16 src="../images/fold_1.gif" width=14 
                  align=absMiddle> 我的会员资料</TD>
                  </TR>
              <TBODY id=table3 style="DISPLAY: none"><!-- 正常情况下  -->
              <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="../modify/modify_info.asp">修改注册信息</A> </TD>
                    </TR><!-- 正常情况下  -->
              <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="../modify/modify_pass.asp">修改密码</A> </TD>
                    </TR><!-- 正常情况下  -->
                    <TD class=leftmenu1 onclick=menu_display(table4,img4)><IMG 
                  id=img4 height=16 src="../images/fold_1.gif" width=14 
                  align=absMiddle> 我的自助网站</TD>
                  </TR>
              <TBODY id=table4 style="DISPLAY: none">
              <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="webmod.asp">网站模板选择</A></TD>
                    </TR>
              <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="cimg_add.asp?id=<%=session("id")%>">上传公司图片</A> </TD>
                    </TR>
              <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="../feedback/contact_edit.asp?id=<%=session("id")%>">客户反馈管理</A></TD>
                    
                    </TR>
              <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="../work/work.asp">发布招聘信息</A></TD>
                    </TR>
			  <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="../work/edit.asp">管理招聘信息</A></TD>
                    </TR>
              <TR>
                      <TD class=leftmenu2><IMG src="../images/plus.gif"> <A 
                  class=linkstyle2 
                  href="../../companyweb.asp" 
                  target=_blank>浏览我的网站</A></TD>
                    </TR></TBODY>
              <TBODY>
              <TR>
                <TD class=leftmenu1 
                onclick="javascript:window.open('../../help/index.asp')"><IMG 
                  id=img5 src="../images/leftmenu_help.gif" 
                  align=absMiddle> 帮助</TD></TR></TBODY></TABLE>
            <IMG height=6 
            src="../images/leftmanu_bottom.gif" width=150><BR><BR>
            
            <!--#include file="../guestsubmit.asp"-->
            <BR><BR></TD></TR>
        </TABLE><BR><BR><BR></TD>
    <TD 
    style="BACKGROUND-POSITION: right 50%; BACKGROUND-IMAGE: url(i../mages/bg1.gif); BACKGROUND-REPEAT: repeat-y; BACKGROUND-COLOR: #ffffff" 
    vAlign=top align=middle width=628>
      <TABLE cellSpacing=0 cellPadding=0 width=628 border=0>
        <TBODY>
        <TR>
          <TD width=459><IMG height=30 
            src="../images/leftmanu_top1.gif" width=459></TD>
          <TD vAlign=top width=141 
          background=../images/top_nav_bg2.gif></TD>
          <TD width=28><IMG height=30 src="../images/top_nav_5.gif" 
            width=28></TD></TR></TBODY></TABLE><BR>
      <TABLE cellSpacing=0 cellPadding=0 width=578 border=0>
        <TBODY>
        <TR>
          <TD><IMG height=32 src="../images/sendmessage.gif" width=578 
            border=0></TD>
        </TR></TBODY></TABLE>
      <TABLE class=content_border cellSpacing=0 cellPadding=0 width=578 
border=0>
        <TBODY>
        <TR>
          <TD align=middle><BR>
                <%
secuser=Replace_Text(request.form("selected_friend_id"))
secuser=replace(replace(replace(secuser,"-1+",""),"0+",""),"1+","")
if Cint(request("Verifycode"))<>Session("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 corporation where [user]='"&touser&"' and id<>"&session("id")&"")
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
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"))

if saveSendMessage<>"" then
set rs1=server.createobject("adodb.recordset")
sql1="select * from 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")=session("id")
rs1("datetime")=now()
rs1.update
end if

set rs=server.createobject("adodb.recordset")
sql="select * from 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")=session("id")
rs("datetime")=now()
if saveSendMessage<>"" then 
rs("getprice1id")=rs1("id")
rs1.close
set rs1=noting
end if
rs.update

rs.close
set rs=noting



if sendemail<>"" then
email="webmaster@shangji.cn"
topic="你好！"
mailbody="测试！"
sendjmail email,topic,mailbody
end if
'If SendJmail(email,Topic,MailBody) = 1 Then
'	Response.Write "<br/><br/>资料成功发送到您的注册邮箱！"
'Else
'	Response.Write "<br/><br/>未正确设置邮件发送或您填写的邮件地址有误，资料发送失败！"
'End If
response.write"<SCRIPT language=JavaScript>alert('恭喜！新留言发送成功！');"
response.write"this.location.href='sendnewmessage.asp'</script>"
end if
%>
                	
<SCRIPT language=JavaScript>
function changeFriend() {
    document.form1.touser.value = document.form1.friend.options[document.form1.friend.selectedIndex].value;
}
</script>	  
<FORM name=form1 action="" method=post>

            <TABLE cellSpacing=2 cellPadding=3 width="100%" border=0>
              <COLGROUP>
              <COL class=formtop></COLGROUP>
              <TBODY>
              
              <TR>
                <TD class=C style="PADDING-TOP: 6px" vAlign=top align=right 
                width="25%" bgColor=#eff7ff><B>发送给：</B></TD>
                <TD class=lh15 width="75%" bgColor=#ffffde><INPUT 
                  name=touser value="<%=secuser%>" size=15 maxlength="50"> <SELECT onchange="javascript: changeFriend()" 
                  size=1 name=friend> <OPTION value="" 
                    selected>从商业伙伴中选取</OPTION> 
					        <%sql2="select memberRelation.secuser,corporation.name from memberRelation,corporation where memberRelation.[user]='"&session("user")&"' and memberRelation.relation<>-1 and corporation.[user]=memberRelation.secuser order by memberRelation.id desc"		
					set rs2=conn.execute(sql2)
					if rs2.eof or rs2.bof then 
					response.write""
					else 
					do while not rs2.eof 
                    response.write"<OPTION value='"&rs2("secuser")&"'>"&rs2("name")&"（"&rs2("secuser")&"）</OPTION>"
					rs2.movenext
					loop
					end if
					rs2.close
					set rs2=nothing
					conn.close
                    set conn=nothing%>
                            
					</SELECT><BR><SPAN 
                  class=note>（请填写对方的会员登录名或从商业伙伴中选取）</SPAN> </TD></TR>
				<TR>
                <TD class=C bgColor=#eff7ff><B>附加码： </B></TD>
                <TD bgColor=#ffffde><INPUT size=11 name=verifycode> 
                  请在附加码框中输入：<IMG src="../../inc/verifycode.asp?<%=timer()%>" height="15"></TD></TR>
				
        
        <TR>
          <TD class=C bgColor=#eff7ff><B>主题：</B></TD>
          <TD bgColor=#ffffde><INPUT maxLength=50 size=50 name=messageTitle> </TD></TR>
        <TR bgColor=#ffffff>
          <TD class=C bgColor=#eff7ff><B>主要内容：</B></TD>
          <TD bgColor=#ffffde><TEXTAREA name=messageContent rows=10 cols=60></TEXTAREA> </TD></TR>
        
        <TR bgColor=#ffffff>
          <TD class=C bgColor=#eff7ff>&nbsp; </TD>
          <TD bgColor=#ffffde><INPUT type=checkbox CHECKED value=true
            name=sendEmail>发到对方的电子邮箱中<BR><INPUT type=checkbox disabled CHECKED value=1 
            name=sendMessage>
                          发到对方的“我收到的留言”中<BR>
                          <INPUT type=checkbox 
            CHECKED value=true name=saveSendMessage>
                          保存到我的“我发出的留言”中<BR>
                          <INPUT 
            type=checkbox CHECKED value=true 
        name=sendContact>发送我的联系方式<BR></TD></TR>
				   
	
              </TBODY></TABLE><BR> 
            
            <BR>
            <TABLE width=578 border=0 cellPadding=0 cellSpacing=0 bgColor=#ffffff>
            <TBODY>
  <TR>
    <TD align=left><div align="center"><A 
      href="../modify/modify_info.asp" 
      target=_blank>检查我的联系信息是否有误</A></div></TD></TR></TBODY></TABLE><BR>
          <TABLE width=300 border=0 align="center" cellPadding=4 cellSpacing=0>
            <TBODY>
  <TR align=middle>
    <TD noWrap><INPUT type=button value="  发送  " name=sendButton onClick="check()"> 
    </TD>
    <TD noWrap><INPUT type=reset value="  重填  " name=resetButton> 
  </TD></TR></TBODY></TABLE></FORM><BR>
   
            <BR><BR></TD></TR></TBODY></TABLE><BR><BR></TD></TR>
  </TABLE><IMG 
height=10 src="../images/bottom.gif" width=778><BR>
<!--#include file="../end.asp"-->