<!--#include file="conn.asp"-->
<!--#include file="../md5.asp"-->
<%if session("nyeee_admin")<>"" then
response.redirect "index.asp"
end if

dim fname,pass,sql,rs
fname=HtmlEncode(trim(request.form("name")))
pass=HtmlEncode(trim(request.form("pass")))
if fname<>"" then
sql="select * from nyeee_admin where username='"&fname&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
	if md5(pass)=rs("password") then
	session("nyeee_admin")=fname
	rs.close  
    set rs=nothing                                                                                     
    conn.close   
    set conn=nothing
	response.redirect "index.asp"
	end if
end if
end if%>
<html>

<title>网站管理员登陆</title>
<link rel="stylesheet" type="text/css" href="../1.CSS">
<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
<body bgcolor="799ae1"><p>&nbsp;</p>
<p>&nbsp;</p>
<table width="300" border="0" align="center" cellPadding="0" cellSpacing="0">
  <tr>
    <td bgColor="#ADAED6"><table cellSpacing="1" cellPadding="0" width="100%" border="0" height="145">
      <tr>
        <td align="middle" bgColor="#0C4FBC" height="28" sytle="line-height:150%"><div align="center" class="style1">管理员登陆</div></td>
      </tr>
      <tr>
        <td align="middle" bgColor="#D6DFF7" height="123"><table cellSpacing="0" cellPadding="0" width="95%" border="0" height="108">
            <tr>
              <td align="middle" height="91"><form name="myform" action="login.asp" method="post">
                  <table cellSpacing="0" cellPadding="0" width="95%" border="0" height="73">
                    <tr>
                      <td width="20%" align="right" height="38"><font face="Arial, Helvetica, sans-serif" color="#999999"> Username&nbsp;&nbsp;&nbsp;&nbsp; </font></td>
                      <td width="52%" height="38"><input class="editbox4" size="25" name="name">
                      </td>
                    </tr>
                    <tr>
                      <td width="20%" align="right" height="35"><font face="Arial, Helvetica, sans-serif" color="#999999"> Password&nbsp;&nbsp;&nbsp;&nbsp; </font></td>
                      <td width="52%" height="35"><input class="editbox4" type="password" size="25" value name="pass">
                      </td>
                    </tr>
                  </table><br>
                  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><div align="center">
                  <input class="button" type="submit" value="确认登陆" name="Submit" onClick="return check();">
                      </div></td>
                      <td><div align="center">
                        <input class="button" type="reset" value="取消登陆" name="Submit">
                      </div></td>
                    </tr>
                  </table>
                  </form></td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
              
<script LANGUAGE="javascript">
<!--
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function check()
{
  if(checkspace(document.myform.name.value)) {
	document.myform.name.focus();
    alert("管理员用户名不能为空！");
	return false;
  }
  if(checkspace(document.myform.pass.value)) {
	document.myform.pass.focus();
    alert("密码不能为空！");
	return false;
  }
	document.admininfo.submit();
  }
//-->
</script>