<!-- #include file="include/config.asp" -->
<%
if action="logout" then
  session.abandon
  format_redirect("video.asp")
  response.end
end if

if web_login=0 then web_login=2
if session("csk3000_online_admin")="csk3000_admin" and session("csk3000_online_admines")=login_username then
  format_redirect("admin.asp")
  response.end
end if
%>
<!-- #include file="include/jk_md5.asp" -->
<!-- #include file="include/conn.asp" -->
<html>
<head>
<title><%response.write objv7.web_var(web_config,1)%> - 管理后台登陆</title>
<meta http-equiv=Content-Type content=text/html; charset=gb2312>
<link rel=stylesheet href='skins/<%=login_skins%>/style.css' type=text/css>
<script language=javascript>
<!--
function CheckBrowser() 
{
  var app=navigator.appName;
  var verStr=navigator.appVersion;
  if (app.indexOf('Netscape') != -1) {
    alert("友情提示：\n    您使用的是Netscape浏览器，可能会导致无法使用后台的部分功能。建议您使用 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></head>
<body><br><br><br><br><br><br>
<%
dim achk
if trim(request.form("admin_log"))="ok" then
  achk=admin_chk()
  if achk="yes" then
    close_conn
    response.redirect "admin.asp"
    response.end
  else
    response.write admin_login()
  end if
else
  response.write admin_login()
end if

close_conn

function admin_login()
response.write admin_bar("管理登陆",1,"350")
%>
<table cellpadding=4 width="100%" align="center" >
<form action='admin_login.asp' method=post>
<input type=hidden name=admin_log value='ok'>
<tr></td><td align="left">&nbsp;&nbsp;&nbsp;&nbsp;
用户名：<input type=text name=username size=20 maxlength=20 value='<%response.write login_username%>'>
</td></tr>
<tr><td align="left">&nbsp;&nbsp;&nbsp;&nbsp;
密&nbsp;&nbsp;码：<input type=password name=password size=21 maxlength=20>
</td></tr>
<tr><td align="left">&nbsp;&nbsp;&nbsp;&nbsp;
验证码：<INPUT name=CheckCode type=text size=6 maxlength=4>&nbsp;&nbsp;请输入&nbsp;<img src="include/checkcode.asp"></td></tr>
<tr><td align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;增加安全性&nbsp;<input type=checkbox name=safety value='yes'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;同时登陆前台&nbsp;<input type=checkbox name=logins value='yes'></td></tr>
<tr><td align=center height=30><input type=submit value="登 陆 后 台">&nbsp;&nbsp;&nbsp;<input type=button value="取 消"></td></form></tr>
<tr></tr>
<tr><td align=center>Copyright &copy 2002-2006 <a class=menu href='http://www.dt110map.com/info.asp?dwmc=中国时代商贸网' target='_blank' title='时代商贸网互动实名'>时代商贸网</a> All Rights Reserved</td></tr>
</table>
<%
response.write admin_bar("",2,"350")
end function

function admin_chk()
  dim username,password,founderr,rs,sql,id,power,hidden,valcodes,valcode,safety,logins,CheckCode
  username=trim(request.form("username"))
  password=trim(request.form("password"))
  'valcode=trim(request.form("valcode"))
  safety=trim(request.form("safety"))
  logins=trim(request.form("logins"))
  CheckCode=replace(trim(Request("CheckCode")),"'","")
  founderr="no"
  'valcodes=objv7.web_var(web_config,12)
  'if len(valcodes)>1 then
  '  if len(valcode)<1 then admin_chk=founderr:exit function
  '  if jk_md5(valcode,"short")<>valcodes then admin_chk=founderr:exit function
  'end if
  if symbol_name(username)="no" then
    admin_chk=founderr:exit function
  end if
  if symbol_ok(password)="no" then
    admin_chk=founderr:exit function
  end if
  if symbol_ok(CheckCode)="no" then
    admin_chk=founderr:exit function
  elseif session("CheckCode")="" then
    admin_chk=founderr:exit function
  elseif CheckCode<>CStr(session("CheckCode")) then
    admin_chk=founderr:exit function
  end if
  session("CheckCode")=""
  if founderr="no" then
    password=jk_md5(password,"short")
    sql="select popedom,uip from user_data where username='"&username&"' and password='"&password&"' and power='"&objv7.format_power2(user_power,1,1)&"' and hidden=1"
    set rs=conn.execute(sql)
    if rs.eof and rs.bof then
      rs.close:set rs=nothing
      admin_chk=founderr:exit function
    elseif rs("uip")<>"" then
      if rs("uip")<>request.servervariables("remote_addr") then
      response.write"<script>alert('你现在的IP是"&request.servervariables("remote_addr")&"  该用户帐号已经限制 IP= "&rs("uip")&" 登录,禁止同一用户同时在不同IP多次登陆！请向管理员"&objv7.web_var(web_config,3)&"联系');window.open('gbook.asp');</script>"
      rs.close:set rs=nothing
      admin_chk=founderr:exit function
      else
            if login_username="" or logins="yes" then
        response.cookies("csk3000_online")("login_username")=username
        if safety<>"yes" and logins<>"yes" then response.cookies("csk3000_online")("login_password")=password
        call cookies_yes()
      end if
      session("csk3000_online_admin")="csk3000_admin"
      session("csk3000_online_admines")=username
      session("csk3000_online_popedom")=rs("popedom")
      
      rs.close:set rs=nothing
      admin_chk="yes":exit function
      
      end if 
   else
      if login_username="" or logins="yes" then
        response.cookies("csk3000_online")("login_username")=username
        if safety<>"yes" and logins<>"yes" then response.cookies("csk3000_online")("login_password")=password
        call cookies_yes()
      end if
      session("csk3000_online_admin")="csk3000_admin"
      session("csk3000_online_admines")=username
      session("csk3000_online_popedom")=rs("popedom")
      
      rs.close:set rs=nothing
      admin_chk="yes":exit function
    end if
    rs.close:set rs=nothing
  end if
end function
%></td></tr></table>
<script language="JavaScript" type="text/JavaScript">
CheckBrowser();
</script>
</body>
</HTML>