<!--#include file="conn.asp"-->
<title>管理员登陆</title>
<link rel="stylesheet" type="text/css" href="style.css">
<%
function err(strin)                             'err("×　请填写...")
Response.Write("<script language=javascript>")
Response.Write("alert('")
Response.Write(strin)
Response.Write("');")
Response.Write("history.go(-1);")
Response.Write("</script>")
Response.End()
end function
%>
<!--显示-->
<%if request("do")="" then%>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="320" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#006d63" style="border-collapse: collapse">
<form method="POST" action="?do=in">
<tr><td width="320" align="center" bgcolor="#006d63" style="border-bottom:1px solid #FFFFFF;"><strong><font color="#FFFFFF">管理员登陆</font></strong></td>
</tr>
<tr><td width="320" align="center" bgcolor="#FFFFFF"><BR>
  帐号:&nbsp;  <input type="text" name="admname" size="15">  <BR>  <BR>
  密码:&nbsp;  <input type="password" name="admpass" size="15">  <BR>  <BR>  <input type="submit" value="登陆" name="enter">  <BR>
</td>
</tr>
</form>
</table>
<%end if%>
<!--登陆-->
<%
if request("do")="in" then

if request("admname")="" then
	err("×　请输入管理员帐号...")
elseif request("admpass")="" then
	err("×　请输入管理员密码...")
end if

sql="select * from a_dmin where u_id='"&request("admname")&"' and Class=1"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
	err("×　管理员帐号不存在...")
else
	if rs("p_wd")<>request("admpass") then
		err("×　管理员密码错误...")
	else
		
		session("admid")=rs("id")
		session("class")=Rs("class")
		response.redirect ("admin_index.asp")
	end if
end if
rs.close
end if
%>
<!--退出-->
<%
if request("do")="out" then
		
		session("admid")=""
		response.redirect ("../index.asp")
end if
%>