<!-- #include file="conn.asp" -->
<!-- #include file="inc/md5.asp" -->
<%
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"

'if instr(allsx,"islogin")>0  then response.redirect "main.asp"

if request("action")="" then%>
<HTML>
<HEAD>
<TITLE><%=dianming%> - 系统登陆</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link href="images/sunzom.css" rel="stylesheet" type="text/css">
<%if instr(allsx,"userkey")>0  and jiam=1 then%><script src="client.js"></script><%end if%>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/bg.gif"  <%if instr(allsx,"userkey")>0 and jiam=1 then%>onload="SendKeyInfo()"<%end if%>>
<div align="center" valign="middle" style="padding-top: 80px">
<FORM ACTION="?action=login" METHOD="post" name="loginform">
		      <div align="center">
		      <table width="700" border="0" cellpadding="0" cellspacing="0" background="images/login.gif" height="380" style="border: 6px solid #ECFAFB">
          <tr>
            <td height="120" align="center" style="font-size: 24pt; font-family: 黑体; color: #FFFFFF; font-weight: bold;filter:alpha(opacity=80); line-height:200%; margin-top:0; margin-bottom:0" bgcolor="#005A8F"><%=dianming%></td>
            </tr>
          <tr>
            <td align="center" height="55" style="filter:Alpha(opacity=50); background:#ffffff;">
			<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="4" style="position:relative;">
				<tr>
					<td align="right">登录账号：<input type="text" name="username" id="username" tabindex="1" style="width:100px; font-size:12pt; height:25px" size="20"> 
					密码：<INPUT name="pwd"  type="password" tabindex="2" style="width:100px; font-size:12pt; height:25px" size="20" autocomplete="off"></td>
					<td>			<input src="images/dl.gif"  type="image" tabindex="5" name="submit" id="submit" border="0" onClick="return checkform()"></td>
					<td><%if instr(allsx,"isreg")>0 then%><a href="reguser.asp">新账号注册</a><%end if%></td>
					<td width="10%"></td>
				</tr>
			</table> </td>
            </tr>
          <tr>
            <td width="401">　</td>
          </tr>
          </table>
				<p style="line-height: 250%; margin-top: 0; margin-bottom: 0"><font style="font-size: 9pt">
				<a target="_blank" href="http://www.sunzom.com/">三众科技</a>@荣誉出品  全国服务热线：4006-0518-00&nbsp;&nbsp;&nbsp; 
				Power by
				<a target="_blank" href="http://www.cnmai.com/">Sunzom_SES</a></font></div>
		</form>
</div>
<script language=javascript>
<!--
function checkform() {
  if(loginform.username.value == '') {
    alert('请输入登陆账号！');
    loginform.username.focus();
    return false;
  }
  if(loginform.pwd.value == '') {
    alert('请输入登陆密码！');
    loginform.pwd.focus();
    return false;
  }
}
//-->
</script><%'=Session("sunzom_key0")%><%'=Session("sunzom_key1")%><%'=Session("sunzom_key2")%></html><%
else
sunzom_user=request.form("username")
nowpwd=request.form("pwd")

sql="select * from login where (username='"&sunzom_user&"' and pwd='"&md5(nowpwd)&"') or (bianhao='"&sunzom_user&"' and pwd='"&md5(nowpwd)&"')"
set rs=conn.execute(sql)
if rs.eof then
conn.execute("insert into rizi(username,class,address,rznr) values('"&sunzom_user&"','登陆失败','"&userip&"','')")
Response.Write "<script language='javascript'>alert('登录名称或密码错误！');history.back();</script>":Response.end
end if

sql="update login set lgsj='"&now()&"' where username='"&sunzom_user&"' or bianhao='"&sunzom_user&"'"
conn.execute(sql)

if rs("userzt")=0 then Response.Write "<script language='javascript'>alert('您的账号已被关闭，不能登录系统！');history.back();</script>":Response.end

conn.execute("insert into rizi(username,class,address,rznr) values('"&sunzom_user&"','登陆成功','"&userip&"','')")
Response.Cookies("sunzom_username")=rs("username")
Response.Cookies("sunzom_userhao")=rs("bianhao")
Response.Cookies("sunzom_id")=rs("id")
'Cookies_Time1=1440
'Cookies_Time=Dateadd("n",Cookies_Time1,Now())
'Response.Cookies("sunzom_username").expires=Cookies_Time
'Response.Cookies("sunzom_id").expires=Cookies_Time
if instr(allsx,"dingcd")>0  then response.redirect "main1.asp" else response.redirect "main.asp" 
end if
%>