<%@language=vbscript codepage=936%>
<%path="basedata"%>
<%
dim name_a,pwd_a
name_a=replace(replace(replace(trim(Request.cookies("name")),"'",""),"or",""),"and","")
pwd_a=replace(replace(replace(trim(Request.cookies("pwd")),"'",""),"or",""),"and","")
if name_a<>"" and pwd_a<>"" then
%>
<!--#include file="inc/md5.asp"-->
<!--#include file="conn/conn_admin.asp"-->
<%
                                         								pwd_a=md5(strreverse(mid(pwd_a,17,16)))
sql="Select * from Admin where admin_user='"&name_a&"' and admin_pass='"&pwd_a&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn_admin,1,3
	if rs.bof and rs.eof then
	rs.close
	set rs=nothing
	conn_admin.close
	set conn_admin=nothing
	response.cookies("name").expires=Now()-1
	response.cookies("pwd").expires=Now()-1
	response.Redirect "login.asp"
	response.end
	else
		IP=Request.ServerVariables("HTTP_X_FORWARDED_FOR") '如果客户端使用了代理服务器,得到真正IP地址
		If IP = "" Then IP=Request.ServerVariables("REMOTE_ADDR") '如果没用使用代理服务器,得到真正IP地址
		info=request.servervariables("http_user_agent") '得到用户HTTP设备的变量,如:你使用的IE浏览器版本,还有你的机器名和操作系统
			session.Timeout=SessionTimeout
			session("LastLoginIP")=rs("admin_last_login_ip")
	   		session("LastLoginTime")=rs("admin_last_login_time")
			session("AdminName")=rs("admin_user")
			session("AdminPassword")=rs("Admin_Pass")
	   		session("sum")=rs("admin_login_numeric")
			if rs("admin_flag") then
			session("masterflag")=true
			else
			session("masterflag")=false
			end if
    rs.close
    set rs=nothing
    conn_admin.close
    set conn_admin=nothing
	end if
elseif session("AdminName") = "" then
    response.Redirect "Login.asp"
    response.end
end if
%>
<html>
<head>
<meta http-equiv=Content-Type content=text/html;charset=gb2312>
<title>网站管理系统</title>
<style type="text/css">
.navPoint {COLOR: white; CURSOR: hand; FONT-FAMILY: Webdings; FONT-SIZE: 9pt}
.a2{BACKGROUND-COLOR: A4B6D7;}
</style>
</head>
<body style="MARGIN: 0px; overflow:hidden" onResize="javascript:parent.carnoc.location.reload()" scroll="no">
<script>
if(self!=top){top.location=self.location;}
function switchSysBar(){
if (switchPoint.innerText==3){
switchPoint.innerText=4
document.all("frmTitle").style.display="none"
}else{
switchPoint.innerText=3
document.all("frmTitle").style.display=""
}}
</script>

<table border="0" cellPadding="0" cellSpacing="0" height="100%" width="100%" scroll="no">
  <tr>
    <td align="middle" noWrap vAlign="center" id="frmTitle">
    <iframe frameBorder="0" id="carnoc" name="carnoc" scrolling=no src="Tree_Left.asp" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 170px; Z-INDEX: 2">
    </iframe>
    </td>
    <td bgcolor="A4B6D7" style="WIDTH: 9pt">
    <table border="0" cellPadding="0" cellSpacing="0" height="100%">
      <tr>
        <td style="HEIGHT: 100%" onClick="switchSysBar()">
        <font style="FONT-SIZE: 9pt; CURSOR: default; COLOR: #ffffff">
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <span class="navPoint" id="switchPoint" title="关闭/打开左栏">3</span><br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        屏幕切换 </font></td>
      </tr>
    </table>
    </td>
		<td style="WIDTH: 100%">
		<iframe frameborder="0" id="main" name="main" scrolling="auto" src="Tree_right.asp" style="HEIGHT:100%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 1"></iframe></td>
  </tr>
</table>
<script>
  if(window.screen.width<'1024'){switchSysBar()}
</script>
</body>
</html>