<!--#include file="../inchuayuwebrlzywzhyweb/CONN.ASP"-->
<!--#include file="../inchuayuwebrlzywzhyweb/cls_huayuweb()^191563631.asp"-->
<!--#include file="../inchuayuwebrlzywzhyweb/md5.asp"-->
<%
if request("action")="login" then
dim username,password,getcode
username=oa.sqlrequest("username")
password=oa.sqlrequest("password")
getcode=oa.sqlrequest("checkcode")
if len(username)<=4 or len(username)>20 or oa.chkchar(username,"char")=false then oa.msgshow("用户名为4-20位英文、数字、“_”的组合。")
if len(password)<4 or len(password)>20 or oa.chkchar(password,"char")=false then oa.msgshow("密码为4-20位英文、数字、“_”的组合。")
	 if getcode<>session("getcode") then oa.msgshow("验证码错误！请返回重新输入！")	    
          set rs=oa.execute("select * from admin where adminname='"&username&"' and adminpswd='"&md5(password,32)&"'")
		  if rs.eof or rs.bof then
		  oa.msgshow ("用户名或密码错误，请返回重新输入")
		  else		
		  oa.execute("update admin set lastip='"&oa.getip()&"',lasttime='"&date()&"' where adminid="&rs("adminid"))		  
		  session(cookies_name&"adminname")=username
		  session(cookies_name&"adminpswd")=md5(password,32)
		 
		  rs.close
		  set rs=nothing
		  response.Redirect("main.asp")
          end if
end if
%>
<html>
<head>
<title>管理员登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=javascript>
<!--
function SetFocus()
{
if (document.Login.UserName.value=="")
	document.Login.UserName.focus();
else
	document.Login.UserName.select();
}
function CheckForm()
{
	if(document.Login.UserName.value=="")
	{
		alert("请输入用户名！");
		document.Login.UserName.focus();
		return false;
	}
	if(document.Login.Password.value == "")
	{
		alert("请输入密码！");
		document.Login.Password.focus();
		return false;
	}
	if (document.Login.CheckCode.value==""){
       alert ("请输入您的验证码！");
       document.Login.CheckCode.focus();
       return(false);
    }
}

function CheckBrowser() 
{
  var app=navigator.appName;
  var verStr=navigator.appVersion;
  if (app.indexOf('Netscape') != -1) {
     alert("友情提示：\n    你使用的不是IE内核的浏览器，可能会导致无法使用后台的部分功能。建议您使用兼容IE或者 IE6.0 或以上浏览器版本。");
  } 
  else if (app.indexOf('Microsoft') != -1) {
    if (verStr.indexOf("MSIE 3.0")!=-1 || verStr.indexOf("MSIE 4.0") != -1 || verStr.indexOf("MSIE 5.0") != -1 || verStr.indexOf("MSIE 5.1") != -1)
       alert("友情提示：\n    您的浏览器版本太低，可能会导致无法使用后台的部分功能。建议您使用 IE6.0 或以上版本。");
  }
}
//-->
</script>
<link href="../img/ht.css" rel="stylesheet" type="text/css">
</head>
<body class="bgcolor" onload=document.login.username.focus()><table width="707" height="607" border="0" align="center" cellpadding="0" cellspacing="0" class="bg1">
  <tr>
    <td height="607" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="hg1">
      <tr>
        <td width="44%">&nbsp;</td>
        <td width="36%"><form name="Login" action="?action=login" method="post" target="_parent" onSubmit="return CheckForm();">
              <div align="center">
        <table width="100%" border="0" align="center" cellspacing="0" bordercolor="#CCCCCC">
  <tr>
                        <td align="right" width="3">&nbsp;</td>
                        <td width="62" height="28" align="right"><strong>用户名：</strong></td>
                    <td width="179" height="28"><input name="UserName"  type="text" class="input"  id="UserName"  onFocus="this.select(); " maxlength="20">                          <div align="center"></div></td>
                  </tr>
                      <tr>
                        <td width="3" align="right">&nbsp;</td>
                        <td height="28" align="right"><strong>密&nbsp; 码：</strong></td>
                        <td height="28"><input name="Password"  type="password" class="input"  onFocus="this.select(); " maxlength="20">                          <div align="center"></div></td>
                  </tr>
                      <tr>
                        <td width="3" align="right">&nbsp;</td>
                        <td height="28" align="right"><strong>验证码：</strong></td>
                        <td height="28"><input name="CheckCode" class="input1"  size="10">                          
                          <img src="../inchuayuwebrlzywzhyweb/checkcode.asp"  alt="验证码,看不清楚?请点击刷新验证码" name="checkimg" align="absmiddle" id="checkimg" style="cursor : pointer;" onClick="document.getElementById('checkimg').src='../inchuayuwebrlzywzhyweb/checkcode.asp?a='+Math.random()" /></td>
                  </tr>
                    </table>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="hg2">
                      <tr>
                        <td valign="middle"><div align="center">
                          <input name="Submit" type="submit" class="buuton1" value="  ">
                          <input name="Submit2" type="reset" class="buuton2" value="  ">
                        </div></td>
                      </tr>
                    </table>
                                   
              </div>
              </form></td>
        <td width="20%">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>


<script language="JavaScript" type="text/JavaScript">
SetFocus(); 
</script>
</body>
</html>