<!-- #include file="conn.asp" -->
<%
if instr(allsx,"isreg")<=0 then response.write "<script language=JavaScript>" & "alert('系统账户注册功能未开通！');" & "history.back()" & "</script>":response.end
if usershu>=int(chk0(sunzs(3)))  then response.write "<script language=JavaScript>" & "alert('您的注册用户端已超出，请联系软件开发商！！');" & "history.back()" & "</script>":response.end
nowqx=""
%>
<!-- #include file="inc/md5.asp" -->

<html>
<head>
<title><%=dianming%> - 注册账号</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="web/web.css" rel="stylesheet" type="text/css">

<script>
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
</script>
</HEAD>
<BODY>
<%if instr(allsx,"isweb")>0 then %>
<!-- #include file="web/top.asp" -->
<%end if%>

<%if request("hid1")="" then%> 
<script language="javascript">
function check()
{
if (document.form1.bianhao.value==""||document.form1.username.value==""||document.form1.pwd.value==""||document.form1.repwd.value==""||document.form1.tel.value=="")
{
alert("有*号的必须填写！");
return false;
}
}
</script>
<form name="form1">
		  <input type="hidden" name="hid1" value="ok">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td><img src="images/r_1.gif" alt="" /></td>
<td width="100%" background="images/r_0.gif">
  <table cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>&nbsp;注册系统账号(带*号的为必填项)</td>
	  <td align="right">　</td>
    </tr>
  </table>
</td>
<td><img src="images/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td>
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
      <tr>
        <td height="30" align="right">注册类型：</td>
        <td class="category"><%
sql="select * from zu_login  where instr(zuzw,'[reglx]')>0 and zuzt=1 order by zupx desc,id asc"
set rsc4=conn.execute(sql)
if not rsc4.bof then
do while not rsc4.eof
response.write "<input type=""radio"" name=""zuid"" value="""&rsc4("id")&""">"&rsc4("zu")&"</option>"
rsc4.movenext
loop
end if
rsc4.close:set rsc4=nothing        
        %></td>
      </tr>
      <tr>
        <td height="30" align="right">登陆账号：</td>
        <td class="category"><input type="text" name="username"> *&nbsp;</td>
      </tr>
	  <tr>
        <td height="30" align="right">公司名称：</td>
        <td class="category"><input type="text" name="bianhao" >
          *&nbsp; 个人写姓名</td>
      </tr>
      <tr>
        <td align="right" height="30">登陆密码：</td>
        <td class="category">
		<input type="password" name="pwd"> *   </td>
      </tr>
	  <tr>
        <td align="right" height="30">确认密码：</td>
        <td class="category"><input type="password" name="repwd"> *</td>
      </tr>
	  <tr>
        <td align="right" height="30">手机号码：</td>
        <td class="category"><input type="text" name="tel" >&nbsp; *</td>
      </tr>
      <tr>
	    <td height="30">　</td>
        <td class="category"><input type="submit" value=" 确认注册 " onClick="return check()" class="button">		</td>
      </tr>	    
</table>
</td>
<td></td>
</tr>
<tr>
<td><img src="images/r_4.gif" alt="" /></td>
<td></td>
<td><img src="images/r_3.gif" alt="" /></td>
</tr>
</table>
</form>
<%
else
nowbianhao=requestA("bianhao")
nowemail=requestA("email")
nowusername=requestA("username")
nowpwd=requestA("pwd")
nowrepwd=requestA("repwd")
nowid_zu=requestA("zuid")

nowuserzt=1
nowtel=requestA("tel")
nowaddress=requestA("address")

if nowpwd<>nowrepwd then  Response.Write "<script language='javascript'>alert('登陆密码和重复密码不一致，请重新输入密码！');history.back();</script>" :response.end


sql="select * from login where bianhao='"&username&"'"
set rs=conn.execute(sql)
if rs.eof=false then
Response.Write "<script language='javascript'>alert('您输入的账号已经存在,请重新输入！');history.back();</script>" :response.end
end if
sql="select * from login where tel='"&nowtel&"'"
set rs=conn.execute(sql)
if rs.eof=false then
Response.Write "<script language='javascript'>alert('您输入的手机号码已经存在,请重新输入或通过找回密码找回！');history.back();</script>" :response.end
end if

sql="insert into login(bianhao,username,pwd,tel,address,qq,email,id_zu,userzt) values('"&nowbianhao&"','"&nowusername&"','"&md5(nowpwd)&"','"&nowtel&"','"&nowaddress&"','"&nowqq&"','"&nowemail&"',"&nowid_zu&","&nowuserzt&")"
conn.execute(sql)
conn.execute("insert into rizi(username,class,address,rznr) values('"&nowuser&"|"&nowuserhao&"','前台注册账号','"&userip&"','"&nowbianhao&"|"&nowusername&"')")
%>
<script language="javascript">
alert("您的账号已经注册成功！")
window.location.href="login.asp"
</script> 
<%
end if
%>
<%if instr(allsx,"isweb")>0 then %>
<!-- #include file="web/end.asp" -->
<%end if%>
</body>
</html>