<!--#include file="system/Conn.asp"--><%


Act = Request.QueryString("act")

If Act = "post" Then

yzm=Request.Form("yzm")
If yzm="" Or yzm<>Session("tyxjd") Then
Conn.Close:Set Conn=Nothing
Response.Write "<script>alert('验证码有误');history.back()</script>"
Response.End
End If

Session("tyxjd")=""
cpid=Request.Form("cpid")
If cpid="" Or Not IsNumeric(cpid) Then cpid=0
If cpid<=0 Then Conn.Close:Set Conn=Nothing:Response.Write "<script>top.location.href='/index.asp'</script>":Response.End

lxr=Request.Form("lxr")
lxrcode=TextEnCode(lxr)
lxr=Server.URLEnCode(Request.Form("lxr"))

sex=Request.Form("sex")
sexcode=TextEnCode(sex)
sex=Server.URLEnCode(Request.Form("sex"))

sjhm=Request.Form("sjhm")
sjhmcode=TextEnCode(sjhm)
sjhm=Server.URLEnCode(Request.Form("sjhm"))

email=Request.Form("email")
emailcode=TextEnCode(email)
email=Server.URLEnCode(Request.Form("email"))

gsmc=Request.Form("gsmc")
gsmccode=TextEnCode(gsmc)
gsmc=Server.URLEnCode(Request.Form("gsmc"))

fid=1

ppmc=Request.Form("ppmc")
ppmccode=TextEnCode(ppmc)
ppmc=Server.URLEnCode(Request.Form("ppmc"))


cpmc=Request.Form("cpmc")
cpmccode=TextEnCode(cpmc)
cpmc=Server.URLEnCode(Request.Form("cpmc"))

cpxh=Request.Form("cpxh")
cpxhcode=TextEnCode(cpxh)
cpxh=Server.URLEnCode(Request.Form("cpxh"))

ipaddr = GetIp

Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.Open "xjd",Conn,1,3
Rs.AddNew

Rs("cpid")=cpid
Rs("lxr")=lxrcode
Rs("sex")=sexcode
Rs("gsmc")=gsmccode
Rs("sjhm")=sjhmcode
Rs("email")=emailcode
Rs("addip")=ipaddr

Rs.Update
Rs.Close

If jmon=1 Then

cbstr = cpmccode&"-"&cpxhcode&"询价单：<br /><br />联系人："&lxrcode&sexcode
cbstr = cbstr & "<br /><br />手机号码："&sjhmcode
cbstr = cbstr & "<br /><br />电子邮箱："&emailcode
cbstr = cbstr & "<br /><br />公司名称："&gsmccode

cbstr = cbstr & "<br /><br /><a href=""http://www.ip138.com/ips138.asp?ip="&Server.URLEnCode(ipaddr)&""" target=""_blank"">查看IP地址</a>"


On Error Resume Next 

Set Jmail=server.CreateObject ("Jmail.message") 
If Err Then 
SendMail=err.description
Err.clear
Else	'&&&&&&

JMail.Charset="gb2312"
jMail.ContentType="text/html"
Jmail.Silent=true
Jmail.fromname=webname

Jmail.from=jmfrom

Jmail.AddRecipient(jmto)

Jmail.Subject= webname & "询价单提醒"
Jmail.body="<html><head></head><meta http-equiv=""Content-Type"" content=""text/html;charset=gb2312"" /><title>询价单提醒</title></head><body>"&cbstr&"</body></html>"

JMail.MailServerUserName =jmuser
JMail.MailServerPassWord =jmpwd
JMail.send(jmsmtp) 

JMail.Priority=1
JMail.Close() 
Set JMail=nothing

If Err Then
SendMail=err.description
Err.Clear
End if

End If	'&&&&&&&

End If
%><!DOCTYPE html>
<html> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>询价单【<%=webname%>】</title>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="s/c.css" />
</head>
<body>
<div class="win1" style="width:430px;overflow:auto">
	<div class="header">
		<div class="lg"><%=webname%></div>
		<div class="info">全国统一咨询热线：<%=zxrx%></div>
	</div>
	<div style="color:green;height:200px;padding-top:45px;font-weight:bold;line-height:50px;font-size:14px;text-align:center">您的信息已提交<br />感谢您的咨询<br />窗口3秒后自动关闭</div>
	<div class="ft">
		<p><%=copyright%></p>
	</div>

</div>
<script>setTimeout("top.$.fancybox.close()",3000)</script>
</body>
</html>
<%
Set Rs=Nothing:Conn.Close:Set Conn=Nothing:Response.End
End If


id=Request.QueryString("id")
If id="" Or Not IsNumeric(id) Then id=0
If id<=0 Then Conn.Close:Set Conn=Nothing:Response.Write "<script>top.location.href='/index.asp'</script>":Response.End
Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.Open "select cpmc,cpxh,ppmc from cp Left Join pp On pp.id=cp.ppid Where cp.id="&id,Conn,1,1
If Not Rs.Bof And Not Rs.Eof Then
	cpmc=Rs("cpmc"):cpxh=Rs("cpxh"):ppmc=Rs("ppmc")
Else
	Rs.Close:Set Rs=Nothing:Conn.Close:Set Conn=Nothing:Response.Write "<script>top.location.href='/index.asp'</script>":Response.End
End If
Rs.Close
Set Rs=Nothing

%><!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="<%=cpmc%>询价" />
<meta name="description" content="<%=cpmc%>询价单" />
<title>询价单【<%=webname%>】</title>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" href="s/c.css" />
<script language="javascript" src="j/jq.js"></script>
<script language="javascript" src="j/xj.js?ver=20131011"></script>
</head>
<body>
<div class="win1" style="width:430px;overflow:auto">
	<div class="header">
		<div class="lg"><%=webname%></div>
		<div class="info">全国统一咨询热线：<%=zxrx%></div>
	</div>
	<div class="lx">> <%=cpmc&"-"&cpxh&"询价单"%></div>
	<form id="xjd_form" class="form1" method="post" action="?act=post" style="height:240px">
		<p>请配合填写以下信息，我们将及时为您服务：</p>
		<input type="hidden" name="cpid" id="cpid" value="<%=id%>" />
		<input type="hidden" name="ppmc" value="<%=ppmc%>" />
		<input type="hidden" name="cpmc" value="<%=cpmc%>" />
		<input type="hidden" name="cpxh" value="<%=cpxh%>" />
		<div><span>联系人：</span><input type="text" name="lxr" id="lxr" value="<%=usename%>" class="txt2" />
			<label for="sex1"><input type="radio" name="sex" value="先生" id="sex1"<%If usesex<>"女士" Then Response.Write " checked=""checked"""%> />先生</label>
			<label for="sex2"><input type="radio" name="sex" value="女士" id="sex2"<%If usesex="女士" Then Response.Write " checked=""checked"""%> />女士</label>
			<span id="lxrmsg" class="msg"></span>
		</div>
		<div><span>手机号码：</span><input type="text" name="sjhm" id="sjhm" value="<%=usetel%>" class="txt1" /><span id="sjhmmsg" class="msg"></span></div>
		<div><span>电子邮箱：</span><input type="text" name="email" id="email" value="<%=useemail%>" class="txt1" /><span id="emailmsg" class="msg"></span></div>
		<div><span>公司名称：</span><input type="text" name="gsmc" id="gsmc" value="<%=usecompany%>" class="txt1" /><span id="gsmcmsg" class="msg"></span></div>
		<div><span>验证码：</span><input type="text" name="yzm" id="yzm" class="txt1" style="width:60px;" /><img src="xjdcode.asp" align="absmiddle" style="cursor:pointer;float:left" onClick="this.src+='?'+Math.random();" /><span id="yzmmsg" class="msg"></span></div>
		<div class="ac"><input type="submit" class="btn" id="xjdbtn" value="提交询价单" /></div>
	</form>
	<div class="ft">
		<p><%=copyright%></p>
	</div>

</div>
</body>
</html><%Conn.Close:Set Conn=Nothing%>