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

Act = Request.QueryString("action")

Set Rs=Server.CreateObject("ADODB.RecordSet")


If Act = "submit" Then

ch=TextEnCode(Request.Form("ch"))
yx=TextEnCode(Request.Form("yx"))
sj=TextEnCode(Request.Form("sj"))
nr=HTMLEnCode(Request.Form("nr"))
yzm=Request.Form("yzm")

If ch="" Then
	Response.Write "<script>alert('请输入您的称呼');history.back()</script>"
	Set Rs=Nothing:Conn.Close:Set Conn=Nothing:Response.End
End If
If yx="" AND sj="" Then
	Response.Write "<script>alert('邮箱跟手机请至少填写一项');history.back()</script>"
	Set Rs=Nothing:Conn.Close:Set Conn=Nothing:Response.End
End If
If nr="" Then
	Response.Write "<script>alert('请填写您要咨询的内容');history.back()</script>"
	Set Rs=Nothing:Conn.Close:Set Conn=Nothing:Response.End
End If
If yzm="" Or yzm<>Session("tyxjd") Then
	Response.Write "<script>alert('请填写正确的验证码');history.back()</script>"
	Set Rs=Nothing:Conn.Close:Set Conn=Nothing:Response.End
End If

ipaddr=GetIp()

Rs.Open "xjd",Conn,1,3
Rs.AddNew

Rs("cpid")=0
Rs("lxr")=Left(ch,200)
Rs("sex")=""
Rs("gsmc")=""
Rs("sjhm")=Left(sj,200)
Rs("email")=Left(yx,200)
Rs("content")=Left(nr,2000)
Rs("addip")=ipaddr

Rs.Update
Rs.Close
Set Rs=Nothing

Conn.Close:Set Conn=Nothing



If jmon=1 Then

cbstr = webname & "客户留言：<br /><br />联系人："&ch
cbstr = cbstr & "<br /><br />手机号码："& sj
cbstr = cbstr & "<br /><br />电子邮箱："& yx
cbstr = cbstr & "<br /><br />内容："& HTMLUnCode1(nr)

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

Session("tyxjd")=""

Response.Write "<script>alert('您的信息已提交，感谢您的咨询');location.href='ct.asp'</script>"
Response.End
End If


Rs.Open "SELECT pageskeywords,pagesdescription,pagescontent FROM pages WHERE pagesstate>0 AND pagestitle='联系我们'",Conn,1,1
If Not Rs.Bof And Not Rs.Eof Then
	pageskeywords=Rs("pageskeywords")
	pagesdescription=Rs("pagesdescription")
	pagescontent=Rs("pagescontent")
End If
Rs.Close

Rs.Open "SELECT TOP 1 dbc FROM gg",Conn,1,1
If Not Rs.Bof And Not Rs.Eof Then
	dbc=Rs("dbc")
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="<%If pageskeywords<>"" Then Response.Write pageskeywords Else Response.Write keywords End If%>" />
<meta name="description" content="<%If pagesdescription<>"" Then Response.Write pagesdescription Else Response.Write description End If%>" />
<title><%=nav6 & "【" & webname & "】"%></title>
<link rel="stylesheet" type="text/css" href="s/c.css" />
</head>
<body>
<div id="container">
<%subTop%>
<div class="wrap_content">
	<div class="location"><a href="/">首页</a> > <span><%=nav6%></span></div>
	<div class="pg">
		<div class="pt">Contact Us</div>
		<div class="ct"><%If pagescontent<>"" Then Response.Write HTMLUnCode(pagescontent) End If%></div>
		<div class="clear"></div>
		<form class="llb" method="post" action="ct.asp?action=submit">
			<div class="lt">填写联络表<span>（由工程师主动与您联系）</span></div>
			<div class="lb1"><label>称呼 <span>*</span></label><input type="text" name="ch" class="txt" /></div>
			<div class="lb1"><label>邮箱 <span>*</span></label><input type="text" name="yx" class="txt" /></div>
			<div class="lb1"><label>手机</label><input type="text" class="txt" name="sj" /></div>
			<div class="lb2"><label>您想咨询的内容 <span>*</span></label><textarea name="nr" class="txt"></textarea></div>
			<div class="lb3"><label>验证码 <span>*</span></label><input type="text" name="yzm" class="txt" /><img src="xjdcode.asp" align="absmiddle" style="cursor:pointer;float:left" onClick="this.src+='?'+Math.random();" /></div>
			<div class="lb3"><input type="submit" class="btn" value="Submit" /></div>
		</form>
		<div class="lqt">
			<div class="lt">手机请扫描二维码</div>
			<div class="lb">
				<%If dbc<>"" Then%><img src="<%=dbc%>" /><%End If%>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>
<%subBottom%>
</div>
</body>
</html><%Conn.Close:Set Conn=Nothing%>