<!--#include file="conn.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="ChkCode.asp"-->
<!--#include file="md5.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	session.Timeout=999   '登陆超时时间(单位为分钟)
	'强制浏览器重新访问服务器下载页面，而不是从缓存读取页面
	Response.Buffer = True
	Response.Expires = -1
	Response.ExpiresAbsolute = Now() - 1
	Response.Expires = 0
	Response.CacheControl = "no-cache"
	
	Select Case  Trim(Request.QueryString("Action"))
	 Case "LoginCheck"
	  Call CheckLogin()
	 Case "LoginOut"
	  Call LoginOut()
	 Case Else
	  Call Main()
	End Select
	
Sub Main()
End Sub
	Sub CheckLogin()
		AdminLoginCode=Trim(Request.Form("AdminLoginCode"))
		IF Trim(Request.Form("Verifycode"))<>Trim(Session("Verifycode")) then 
			response.write"<script language=JavaScript>alert('登录失败:\n\n验证码有误，请重新输入！');"    
			response.write"this.location.href='Login.asp';</script>"
			Response.End
	exit Sub
  		end if
	If EnableSiteManageCode = True And AdminLoginCode <> SiteManageCode Then
			response.write"<script language=JavaScript>alert('登录失败:\n\n您输入的后台管理认证码不对，请重新输入！');"    
			response.write"this.location.href='Login.asp';</script>"
			Response.End
	exit Sub
	End If
	
	Pwd =replace(Trim(Request.Form("PWD")),"'","")

	UserName = replace(trim(Request.form("username")),"'","")
	Set LoginRS = Server.CreateObject("ADODB.RecordSet")
	SqlStr = "select * from admin where admin='" & UserName & "'"
	LoginRS.Open SqlStr,Conn,1,3
  If LoginRS.EOF AND LoginRS.BOF Then
		response.write"<script language=JavaScript>alert('登录失败:\n\n您输入了错误的帐号，请再次输入！');"    
		response.write"this.location.href='Login.asp';</script>"
	    Response.End
  Else
  
     IF LoginRS("PassWord")=md5(pwd) THEN
       IF Cint(LoginRS("Locked"))=1 Then
			response.write"<script language=JavaScript>alert('登录失败:\n\n您的账号已被管理员锁定，请与您的系统管理员联系！');"
			response.write"this.location.href='Login.asp';</script>"
	      	Response.End
	   Else
		  	 '登录成功，并更新数据
			userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
			If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")
			LoginRS("LastTime")=Now()
			LoginRS("LastLoginIP")=userip
			LoginRS("num")=LoginRS("num")+1
			LoginRS.UpDate
			Response.Cookies("job_admin_Name")=LoginRS("admin")
			Response.Cookies("job_admin_PassWord")=LoginRS("PassWord")
			Response.Cookies("job_admin_flag")=LoginRS("flag")
			
			Response.Cookies("job_admin_Name").expires=(now()+1/24)
			Response.Cookies("job_admin_PassWord").expires=(now()+1/24)
			Response.Cookies("job_admin_flag").expires=(now()+1/24)
			
			Response.Redirect("Admin_Index.asp")
			Response.end
			End IF
  ELse
		response.write"<script language=JavaScript>alert('登录失败:\n\n您输入了错误的口令，请再次输入！');"
		response.write"this.location.href='Login.asp';</script>"
		response.end
	END IF
End If
END Sub
Sub LoginOut()
	Response.Cookies("job_admin_Name")=""
	Response.Cookies("job_admin_PassWord")=""
	Response.Cookies("job_admin_flag")=""
	response.write"<script language=JavaScript>alert('您登出成功，感谢您的使用!');"
	response.write"this.location.href='Login.asp';</script>"
	response.end
END Sub
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE><%=homename%>---网站后台管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript" src="js/SoftKeyBoard.js"></script>
<script language=javascript>
<!--
function document.onreadystatechange()
{  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 或以上版本。');
  }
  document.LoginForm.UserName.focus();
}
function CheckForm(ObjForm) {
  if(ObjForm.UserName.value == '') {
    alert('请输入管理账号！');
    ObjForm.UserName.focus();
    return false;
  }
  if(ObjForm.PWD.value == '') {
    alert('请输入授权密码！');
    ObjForm.PWD.focus();
    return false;
  }
  if (ObjForm.PWD.value.length<4)
  {
    alert('授权密码不能少于六位！');
    ObjForm.PWD.focus();
    return false;
  }
  if (ObjForm.Verifycode.value == '') {
    alert ('请输入验证码！');
    ObjForm.Verifycode.focus();
    return false;
  }
  
  if (ObjForm.AdminLoginCode.value == '') {
    alert ('请输入后台管理认证码！');
    ObjForm.AdminLoginCode.focus();
    return false;
  }
  
}
//-->
</script>
<STYLE>
body {font-family: "宋体";font-size: 12px;text-decoration: none;}
td {font-size: 12px;color: #666666;text-decoration: none;line-height: 18px;font-family: "宋体";}
.login {
	height: 15px;
	width: 100px;
	background-color: #fefefe;
	font-family: "Tahoma";
	font-size: 11px;
	color: #333333;
	text-decoration: none;
	border: 1px solid #FFFFFF;
}
.login1 {
	height: 15px;
	width: 40px;
	left:20px;
	background-color: #fefefe;
	font-family: "Tahoma";
	font-size: 11px;
	color: #333333;
	text-decoration: none;
	border: 1px solid #FFFFFF;
}
.S1{
font-family: "宋体"; 
font-weight: bold; 
color: #ffffff; 
font-size:16px;
text-decoration: none}
</STYLE>
<META content="MSHTML 6.00.3790.2577" name=GENERATOR>
</HEAD>
<BODY leftMargin=0 topMargin=0  MARGINWIDTH="0" MARGINHEIGHT="0" onselectstart="return false" oncontextmenu=self.event.returnValue=false style="background:url(Images/login/login.gif) no-repeat center top" bgcolor="#144372">
<TABLE align="center" height=520 cellSpacing=0 cellPadding=0 border=0>
  <TBODY>
  <TR>
    <TD align=left rowSpan=2>
      <FORM ACTION="?Action=LoginCheck" METHOD="post" name="LoginForm" onSubmit="return(CheckForm(this))">
      <TABLE id=table3 height=490 cellSpacing=0 cellPadding=0 width=100%  border=0>
        <TBODY>
        <TR vAlign=bottom align=middle>
          <TD height="150" colSpan=2 align="center">&nbsp;</TD>
          <TD colSpan=2 valign="bottom">&nbsp;</TD>
        </TR>
        <TR vAlign=bottom align=middle>
          <TD height="180" colSpan=2 align="center">&nbsp;</TD>
          <TD colSpan=2 valign="bottom">
		  <table width="445" border="0" cellspacing="0" cellpadding="0" bordercolor="#AAAAAA" height="108">
            <tr bgcolor="F7E4D6">
              <td height="6" colspan="3" valign="top" bordercolor="#FDFEFF" bgcolor="#195D92"><img src="Images/login/1.gif" width="6" height="6"></td>
              </tr>
            <tr bgcolor="#FFFFFF">
              <td width="7" align="center" bgcolor="#195D92"></td>
              <td align="center">
			  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="87" rowspan="3" align="center"><img src="Images/login/login3.gif" width="57" height="55"></td>
                  <td width="53" height="30"><div align="right">登录名：</div></td>
                  <td width="140" valign="middle" nowrap background="Images/login/bg_pa.gif"><center><input type="text" name="UserName" tabindex="1" size="15" class="login"></center></td>
                  <td rowspan="3">
				  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><input onMouseOver=nereidFade(this,100,10,5)  style="FILTER:alpha(opacity=50)" onMouseOut=nereidFade(this,50,10,5) src="Images/login/dl.gif"  type="image" tabindex="5" name="enter" width="52" height="54" border="0"></td>
                    </tr>
					<tr>
                      <td height="25" background="Images/login/bg_pa2.gif">认证码：
                        <input name="AdminLoginCode" type="password" class="login1" id="AdminLoginCode" tabindex="4" size="5" <%if EnableSiteManageCode = True And SiteManageCode = "jobsql" then%> title="认证码初始值“jobsql”,为了系统的安全请及时修改admin目录下的chkcode.asp文件参数!"<%end if%>></td>
                    </tr>
                    
                  </table>
                  </td>
                </tr>
                <tr>
                  <td height="30"><div align="right">密　码：</div></td>
                  <td align="center" nowrap background="Images/login/bg_pa.gif"><INPUT name="PWD"  type="password" tabindex="2" class="login"></td>
                </tr>
                <tr>
                  <td height="30"><div align="right">验证码：</div></td>
                  <td height="25" nowrap background="Images/login/bg_pa1.gif">&nbsp;&nbsp;
                    <input type=text name="Verifycode" maxLength=6 size="6" tabindex="3" class="login1">&nbsp;<IMG style="cursor:hand;" src="verifycode.asp" onClick="this.src=this.src;" align="absmiddle">&nbsp;</td>
                </tr>
                <tr>
                  <td colspan="4"></td>
                </tr>
              </table>
			  </td>
              <td width="7" align="center" valign="middle" bgcolor="#195D92"></td>
            </tr>
            <tr bgcolor="F7E4D6">
              <td height="6" colspan="3" valign="bottom" bordercolor="#FFFFFF" bgcolor="#195D92"><img src="Images/login/1-4.gif" width="6" height="6"></td>
              </tr>
          </table>
		  </TD>
        </TR>
        <TR vAlign=bottom align=middle>
          <TD vAlign=center width=198 height=90>
            <P align=right>
<SCRIPT language=JavaScript type=text/JavaScript>
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
	if (object != "[object]"){ 
	setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
	return;
}
clearTimeout(nereidFadeTimers[object.sourceIndex]);
diff = destOp-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity > destOp){
	direction = -1;
}
delta=Math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if (object.filters.alpha.opacity != destOp){
	nereidFadeObjects[object.sourceIndex]=object;
	nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
}
}
</SCRIPT>
            <A href="javascript:window.close()" target=_parent><IMG onmouseover=nereidFade(this,100,10,5)  style="FILTER:alpha(opacity=30)" onmouseout=nereidFade(this,30,10,5) src="Images/login/login1.gif"  border=0></A></P></TD>
          <TD vAlign=center width=307 height=90><P align=left>&nbsp;<FONT color=#ffffff>取消登入，关闭此窗口!</FONT></P></TD>
          <TD width=320 height=90 align="right" vAlign=center><FONT color=#ffffff>登入后，可以修改或添加新的管理员!</FONT></TD>
          <TD vAlign=center width=153 height=90><P align=left><A href="http://bbs.wishcn.com" target=_blank><IMG onmouseover=nereidFade(this,100,10,5)  style="FILTER: alpha(opacity=30)" onmouseout=nereidFade(this,30,10,5) src="Images/login/tophelp.gif" border=0></A></P></TD>
		  </TR>
		  </TBODY>
		  </TABLE>
	  </FORM>
	  </TD>
	  </TR>
	  </TBODY>
	</TABLE>
</BODY>
</html>
