<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<% data_path="../../" 'ACC连接数据库路径，对SQL无效 %>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->

  <!--#include file="../checkrole.asp"-->
  <link rel="stylesheet" href="<%=HOPE_InstallDir%>news/new.css" type="text/css" />

 <%
       call checkuser("ly")
	   
   if issession=0 then
	gsid=Replace_Text(request.Cookies("Yxmemberid"))
	 username=Replace_Text(request.Cookies("Yxmember"))
 	else
	gsid=session("id")
	username=session("user")
 	end if
 if Not ChkPost then 
		response.write "<script language='javascript'>"
		response.write"parent.location.href='"&HOPE_InstallDir&"login/login1.asp';</SCRIPT>"
		response.end
end if

  

%>

<script Language="JavaScript">
function check()
{
  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>
 
<%
year_now = year(date())
month_now = month(date())
day_now = day(date()) 
 
dim sql
dim rs
dim info_id
 info_id=Replace_Text(request("info_id"))
 Verifycode=Replace_Text(request("Verifycode"))
  title=Replace_Text(request.form("messageTitle"))
content=Replace_Text(request.form("messageContent"))
needtrust=Replace_Text(request.form("needtrust"))
sendemail=Replace_Text(request.form("sendemail"))
saveSendMessage=Replace_Text(request.form("saveSendMessage"))
sendContact=Replace_Text(request.form("sendContact"))
checkdate=Replace_Text(request.form("checkdate"))
start_year=Replace_Text(request.form("start_year"))
start_month=Replace_Text(request.form("start_month"))
start_day=Replace_Text(request.form("start_day"))
requestinfo=Replace_Text(request.form("requestinfo"))
mycid=Replace_Text(request.form("mycid"))
 if issession=0 then 
safecode=Replace_Text(request.Cookies("safecode"))
else
safecode=Session("SafeCode")
end if
 gogo=request("gogo")
if gogo<>"" then
if not isnumeric(Verifycode) then
response.Write("<script language=javascript>alert('请输入正确的验证码！');history.back(-1);</script>")
response.End()
end if
if cstr(Verifycode)<>cstr(safecode) then 
 response.Write("<script language=javascript>alert('请输入正确的验证码！');history.back(-1);</script>")
response.End()
end if


if saveSendMessage<>"" then
set rs1=server.createobject("adodb.recordset")
sql1="select * from Websen_getprice1 where id<>0" 
rs1.open sql1,conn,1,3
rs1.addnew
rs1("title")=title
rs1("content")=content
 if sendemail<>"" then
 rs1("sendemail")=1
end if
if needtrust<>"" then
 rs1("needtrust")=1
end if
if sendContact<>"" then
 rs1("sendcontact")=1
end if

if checkdate<>"" then 
rs1("checkdate")=1
rs1("limitedtime")=start_year&"年"&start_month&"月"&start_day
end if
rs1("requestinfo")=requestinfo
rs1("mycid")=mycid
rs1("sendcid")=gsid
rs1("datetime")=now()
rs1.update
end if

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

if sendemail<>"" then 
rs("sendemail")=1
end if
if needtrust<>"" then 
rs("needtrust")=1
end if
if sendContact<>"" then
 rs("sendcontact")=1
end if
if checkdate<>"" then 
rs("checkdate")=1
rs("limitedtime")=start_year&"年"&start_month&"月"&start_day
end if
rs("requestinfo")=requestinfo
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
 response.Write("<script language=javascript>alert('消息发送成功！');window.close();</script>")
response.End()
rs.close
set rs=nothing
 	if issession=0 then 
	 response.Cookies("safecode")=""
	else
	 Session("SafeCode")=""
	end if
 end if
 
 
 '----------------------------------------------------------
%>
<title>留言询价</title>
<!--#include file="../../inc/head.asp"-->

<style>
.tdc{
 
	filter:	progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=#E6F7FF, EndColorStr=#FFFFFF);
}
#main_nav {
	width:820px;
}
</style>
</head>
<body>
<%
 
   sql="select Websen_info.*,Websen_corporation.* from Websen_Info,Websen_corporation where Websen_info.info_id="&info_id&" and Websen_corporation.id=Websen_info.gsid and Websen_corporation.flag=1"
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
if rs.eof then

 response.Write("<script language=javascript>alert('对不起，没有您要查询的信息	！');history.back(-1);</script>")
response.End()
 else
gsidt=rs("gsid")

if gsidt=gsid then
  response.write"<SCRIPT language=JavaScript>alert('请不要向自己询价！');"
  response.write"javascript:window.close();</script>"
  response.end
end if
 set rsblak=conn.execute("select id from Websen_memberRelation where [user]='"&rs("user")&"' and secuser='"&username&"' and relation=-1")

'关系是-1就黑名单关系不能询价
if not (rsblak.eof and rsblak.bof) then
  response.write"<SCRIPT language=JavaScript>alert('对方已把您列入黑名单中，\n\n不能向对方询价。');"
  response.write"javascript:window.close();</script>"
  response.end
end if
 
%>
<div class="main_box1 xunjia">
<ul>
<li class="bgxz"></li>
<li class="bgxm">询价接收方</li>
<li class="bgxy"></li>
</ul>
</div>
<table width="772" border="0" align="center" cellpadding="0" cellspacing="0">
<tr ><td width="118" height="30" rowspan="3">
<%
if rs("draw")="" then
%>
<img src="<%=HOPE_InstallDir%>images/nopic.gif" width="100" height="100" border="0" />
<%
else
%>
<img src="<%=HOPE_InstallDir%>vipcom/<%=rs("user")%>/<%=rs("draw")%>" width="100" height="100" border="0" />
<%
end if
%></td>
  <td width="660" height="33" class="h5">&nbsp;货品名称： <span class="h2"><%=rs("showname")%></span></td>
</tr>
<tr >
  <td height="33" class="h5">&nbsp;当前价格： <span class="h2"><%=rs("PriceTerms")%></span></td>
</tr>
<tr >
  <td height="33" class="h5">&nbsp;联 系 人： <span class="h2"><%=rs("name")%>&nbsp;<%=rs("ch")%></span></td>
</tr>
</table>
<table width="780" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<div class="main_box1 xunjia">
<ul>
<li class="bgxz"></li>
<li class="bgxm">填写询价内容</li>
<li class="bgxy"></li>
</ul>
</div>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<FORM name=form1 action="" method=post onSubmit="return check();"><tr><td>
<input type=hidden value=<%=rs("gsid")%> name=mycid>
 
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
     <td>
      <TABLE cellSpacing=0 cellPadding=1 width=779 bgColor=#FFFFFF border=0 align="center">
    <TBODY> 
    <TR vAlign=top>
    <TD><TABLE width="100%" 
            border=0 cellPadding=5 cellSpacing=1 bgColor=F3F3F3 class="outborder">
      <TBODY>
        <TR bgColor=#ffffff>
          <TD class=C align=right 
                bgColor=#F3F3F3><B>发送给：</B></TD>
          <TD bgcolor="#F3F3F3" class=C><DIV id=nav><%=rs("qymc")%></DIV></TD>
        </TR>
		<tr><td colspan="2" bgcolor="#666666" height=1></td></tr>
        <TR bgColor=#ffffff>
          <TD class=C align=right bgColor=#FFFFFF><B>附加码： </B></TD>
          <TD class=C><INPUT  maxlength="5"  size=5 name="Verifycode"  onKeyUp="value=value.replace(/[^\d]/g,'') "   tonbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
            请在附加码框中输入： <img src="<%=HOPE_InstallDir%>vCode.asp?" onClick="this.src+=Math.random()" alt="图片看不清？点击重新得到验证码" style="cursor:hand;"></TD>
        </TR>
        <TR bgColor=#ffffff>
          <TD class=C align=right bgColor=F3F3F3><B>主题：</B></TD>
          <TD bgcolor="#F3F3F3"><INPUT maxLength=30 size=60 value=我对您发布的“<%=rs("showname")%>”很感兴趣 
            name=messageTitle>          </TD>
        </TR>
        <TR bgColor=#ffffff>
          <TD class=C vAlign=top noWrap align=right 
                  bgColor=#FAFAFA><B>主要内容：</B></TD>
          <TD bgcolor="#FAFAFA"><TEXTAREA name=messageContent rows=10 cols=50></TEXTAREA></TD>
        </TR>
        <TR bgColor=#ffffff>
          <TD vAlign=top colspan="2"  bgcolor="#FFFFFF" height="3">
         
            </TD>
        </TR>
        <tr>
          <td colspan="2"><INPUT type=checkbox disabled CHECKED value=1 
            name=sendMessage>
            网上留言（限1500字）
            <INPUT type=checkbox 
            CHECKED value=true name=saveSendMessage>
            保存到“我发出的留言”
            <INPUT type=checkbox CHECKED value=true name=sendContact>
            发送我的联系方式
			 <INPUT type=checkbox CHECKED 
                  name=needtrust>
            请对方向我提供<FONT color=#003399>会员</FONT>档案 </FONT></td>
        </tr>
      </TBODY>
    </TABLE>
 <hr size="1"   color="#E8E8E8" width="779" align="center" >
 <TABLE width=100% border=0 align="center" cellPadding=0 cellSpacing=0 bgColor=#ffffff>
  <TBODY>
  <TR>
    <TD height="30"  bgcolor="#EEEEEE"  >
       &nbsp;<INPUT type=checkbox value=yes name=checkDate>对方在 <select name="start_year">
              <%for i=2007 to 2020 %>
              <%if clng(i) = clng(year_now) then%>
               
					<option selected value="<%Response.Write i%>">
              <%Response.Write i%>
              </option>
				
              <%else%>
              
					<option value="<%Response.Write i%>">
              <%Response.Write i%>
              </option>
				
              <%end if%>
              <%next%>
              
	       	  </select> 年
            <select name="start_month">
                    
              <%for i=1 to 12%>
              <%if clng(i) = clng(month_now) then%>
              <option selected value="<%Response.Write i%>">
              <%Response.Write i%>
              </option>
              <%else%>
              <option  value="<%Response.Write i%>">
              <%Response.Write i%>
              </option>
              <%end if%>
              <%next%>
              
       	    </select> 月
	       	  <select name="start_day">
                    
              <% for i=1 to 31%>
              <%if clng(i) = clng(day_now) then%>
              <option selected value="<%Response.Write i%>">
              <%Response.Write i%>
              </option>
              <%else%>
              <option  value="<%Response.Write i%>">
              <%Response.Write i%>
              </option>
              <%end if%>
              <%next%>
              
	       	  </select> 日前答复！ 
      （如您希望对方在此前答复，请将方框点选为 
	       	  <INPUT type=checkbox CHECKED value=yes 
      name=checkDate3   disabled> ） </TD></TR></TBODY></TABLE> 
      <TABLE cellSpacing=1 cellPadding=5 width=100% bgColor=#9ec4e5 border=0>
        <TBODY>
          <TR bgColor=#e6f7ff>
            <TD class=M noWrap colSpan=3>我需要进一步了解的信息：</TD>
          </TR>
          <TR bgColor=#ffffff>
            <TD class=C noWrap><INPUT type=checkbox value=产品规格、型号 name=requestInfo>
              产品规格、型号 </TD>
            <TD class=C noWrap><INPUT type=checkbox value=单价 name=requestInfo>
              单价 </TD>
            <TD class=C noWrap><INPUT type=checkbox value=价格条款 name=requestInfo>
              价格条款 </TD>
          </TR>
          <TR bgColor=#ffffff>
            <TD class=C noWrap><INPUT type=checkbox value=原产地 name=requestInfo>
              原产地 </TD>
            <TD class=C noWrap><INPUT type=checkbox value=供货能力 name=requestInfo>
              供货能力 </TD>
            <TD class=C noWrap><INPUT type=checkbox value=销售条款及附加条件 
      name=requestInfo>
              销售条款及附加条件 </TD>
          </TR>
          <TR bgColor=#ffffff>
            <TD class=C noWrap><INPUT type=checkbox value=最小订货量 name=requestInfo>
              最小订货量 </TD>
            <TD class=C noWrap><INPUT type=checkbox value=交货期 name=requestInfo>
              交货期 </TD>
            <TD class=C noWrap><INPUT type=checkbox value=能否提供样品 name=requestInfo>
              能否提供样品 </TD>
          </TR>
          <TR bgColor=#ffffff>
            <TD class=C noWrap><INPUT type=checkbox value=产品担保 name=requestInfo>
              产品担保 </TD>
            <TD class=C noWrap><INPUT type=checkbox value=包装方式 name=requestInfo>
              包装方式 </TD>
            <TD class=C noWrap><INPUT type=checkbox value=质量/安全认证 name=requestInfo>
              质量/安全认证 </TD>
          </TR>
        </TBODY>
      </TABLE>
      <BR>

 <TABLE width=500 border=0 align="center" cellPadding=4 cellSpacing=0>
  <TBODY>
  <TR align=middle>
    <TD noWrap><INPUT type=submit value="  发送  " name="gogo"  class=m> 
 &nbsp;&nbsp;<INPUT type=reset value="  重填  " name=resetButton class=m> 
  </TD></TR></TBODY></TABLE></TD>
    </TR></TBODY></TABLE></td>
  </tr>
  </table></td></tr>
</FORM></table>
 <table width="779" border="0" align="center" cellpadding="0"  cellspacing="0" >
<tr>
  <td height=25 bgcolor="#E6F7FF">&nbsp;</td>
</tr></table>
<table width="780" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td><!--#include file="../../inc/end.asp"--></td>
  </tr>
</table>


<%
 end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>