<!--#include file="Config.asp" -->
<% 
TypeID = Wed_Lot_ID
eims = "About"
Title="提交抽奖"
PageTitle=eRead("Abaut",TypeID,"Title")
%>
<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="img/eims.css">

<script language="javascript">
function tel()
{
   if (trim(document.eform.UserName.value).length<2 || trim(document.eform.UserName.value).length>22)
   {
	  alert("请正确输入姓名！");
	  return false;
	  exit;
   }
   if (trim(document.eform.Tel.value).length != 11)
   {
	  alert("请正确输入手机号！");
	  return false;
	  exit;
   }
   return true;
}
function trim(str){return str.replace(/(^\s*)|(\s*$)/g, "");} //删除左右两端的空格
function ltrim(str){return str.replace(/(^\s*)/g,"");} //删除左边的空格
function rtrim(str){return str.replace(/(\s*$)/g,"");} //删除右边的空格
</script>

<title><% =Title %></title>
</head><body style="background:#f8f8f8">

<div id="wrapper">	
<div id="scroller">

<div class="about">
<h1 align="center" style="color:#FF0000;font-family:'微软雅黑';"><%=PageTitle%></h1>
<h3 align="center"><%=Title%></h3>
<p align="center" style="color:red">*不能重复提交，否则无法保存。</p>
<form name='eform' method='post' onSubmit='return tel();' action="?Action=Save&TypeID=<%=TypeID%>" data-ajax="false">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
  <tr align="center">
    <td><input type='text' name='UserName' placeholder='请输入姓名' class="input1"></td>
  </tr>
  <tr align="center">
    <td><input type='text' name='Tel' placeholder='请输入手机号' class="input1">	</td>
  </tr>
  <tr align="center">
    <td><input type='submit' value=' 提 交 ' style="border-radius:10px;-moz-border-radius:10px;outline: none; border:#333 solid 1px; 
color:#333333;padding:11px;font-weight:bold; font-size:18px; background:#fec; width:200px;"></td>
  </tr>
</table>
</form>
<br><br><br>

<p align="center">技术支持：<a href="http://www.eims.org.cn/" target="_blank" style="color:#3366FF">EIMS工作室</a></p>

</div>

<%
If Action = "Save" Then
UserName = CheckSql(Trim(Request.Form("UserName")))
Tel = Trim(Request.Form("Tel"))

set crs=conn.execute("select ItemID from [eims_Lottery] where ItemRec=1 and Tel='"&Tel&"'")
if not crs.eof then WtMsg("此号码已存在，请不要重复提交！")

Set Rs=Server.CreateObject("Adodb.RecordSet")
Rs.Open "Select * From [eims_Lottery]",Conn,1,3
Rs.AddNew
Rs("UserName") = UserName
Rs("Tel") = Tel
Rs("AddDate") = Now()
Rs("TypeID") = TypeID
Rs("ItemRec") = 1

Rs("st1") = 0
Rs("st2") = 0
Rs("st3") = 1

Rs.Update
Rs.Close:Set Rs=Nothing
response.Redirect "Redirect.asp?TypeID="&TypeID&"&xn=1"
End If
%>

</div>	
</div>

</body></html>
<% Call CloseConn() %>