<!-- #include file="include/adovbs.inc" -->
<!-- #include file="include/dataconn.asp" -->
<!-- #include file="include/168soft_back_SqlIn.Asp" -->
<%
WuliuArea1 = trim(request("s1"))
WuliuArea2 = trim(request("s2"))
WuliuArea3 = trim(request("s3"))

WuliuLevel = trim(request("WuliuLevel"))
if WuliuLevel="市级" then
	WuliuArea3=""
end if
WuliuNumber = trim(request("WuliuNumber"))
TujianNumber= trim(request("TujianNumber"))
WuliuName = trim(request("WuliuName"))
WuliuLevel = trim(request("WuliuLevel"))
WuliuArea = trim(request("WuliuArea"))
HyMemo = trim(request("HyMemo"))
'HyID=session("HyID")
HyNumber=trim(request("HyNumber"))

set rs=server.CreateObject("adodb.recordset")
sql ="select ID from hyclub where HyNumber='" & HyNumber & "' and IsApproved=true"
rs.Open sql,conn
if rs.RecordCount=0 then%>
	<script language="javascript">
		alert("你输入的会员卡号不存在，请确认该卡号是已报单会员!");
		history.back();
	</script>
<%response.End 
end if
set rs=server.CreateObject("adodb.recordset")
sql ="select ID from hyclub where HyNumber='" & TujianNumber & "' and IsApproved=true"
rs.Open sql,conn
if rs.RecordCount=0 then%>
	<script language="javascript">
		alert("你输入的推荐人会员卡号不存在，请确认该卡号是否存在!");
		history.back();
	</script>
<%response.End 
end if	
set rs=server.CreateObject("adodb.recordset")
sql ="select ID from wuliuinfo where WuliuNumber='" & WuliuNumber & "'"
rs.Open sql,conn
if rs.RecordCount>0 then%>
	<script language="javascript">
		alert("你输入的专卖店编号已存在!");
		history.back();
	</script>
<%response.End 
end if
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<link rel="stylesheet" href="include/e1.css" type="text/css">
</HEAD>
<BODY>
<%
set rs=server.CreateObject("adodb.recordset")
sql = "insert into WuliuInfo(HyNumber,WuliuNumber,TujianNumber,WuliuName,WuliuLevel,WuliuArea1,WuliuArea2,WuliuArea3,AddTime,HyMemo) values("
sql = sql & "'" & HyNumber & "','" & WuliuNumber & "','"& TujianNumber & "','" &  WuliuName 
sql = sql & "','" & WuliuLevel & "','"& WuliuArea1& "','"& WuliuArea2& "','"& WuliuArea3& "','"& Thistoday & "','"& HyMemo & "'"
sql = sql & ")"

rs.Open sql,conn
%>
<table width="80%" height="193" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="193">专卖店申请成功，我们将尽快处理你的申请! </td>
  </tr>
</table>

</BODY>
</HTML>