<!--#include file="../Conn.asp"-->
<!--#include file="CheckCode.asp"-->
<!--#include file="../fy_inc/fy.Main.asp"-->
<% 
	ConnectionDatabase
	Dim fycms
	Set fycms = New ACT_Main
	Select Case Request("Action")
			Case "LoginCheck"
				Call LoginCheck()
			Case "LoginOut"
				Call LoginOut()
			Case Else
				Call ACT_login_Main()
	End Select
	
	Sub LoginCheck()
		Dim A_PWD,PassWord,UserName,Act_Code,SqlStr,RS
		If CheckCode=True Then 
			Act_Code = Request.Form("Code")
			If CStr(Act_Code) <>CStr(Session("GetCode")) then
				echo("<script>alert('验证码有误，重新输入！');history.back();</script>")
				Response.End
			End If
		End If 

		If CheckManageCode=True Then 
			If CStr(Request.Form("CheckManageCode")) <>CStr(CheckManageCodeContent) then
				echo("<script>alert('认证码有误，重新输入！');history.back();</script>")
				Response.End
			End If
		End If 

		A_PWD = MD5(Request.Form("PassWord"),64)
		UserName = RSQL(Request.Form("UserName"))
		PassWord = RSQL(Request.Form("PassWord"))
	 	 Set RS = Server.CreateObject("ADODB.RecordSet")
	 	 SqlStr = "select * from Admin_fy where Admin_Name='" & UserName & "'"
	 	 RS.Open SqlStr,Conn,1,3
		 	IF Rs.eof And Rs.bof Then
				Call fycms.InsertLog(UserName,1,0,PassWord)
				echo("<script>alert('登录失败:\n\n您输入了错误的管理帐号，请再次输入！');history.back();</script>")
				Response.End
			Else
				IF Rs("PassWord") = A_PWD Then
					IF Rs("Locked") = 1 Then
						echo("<script>alert('登录失败:\n\n您的账号已被管理员锁定，请与您的系统管理员联系！');history.back();</script>")
						Response.End
					Else
							Rs("LoginTime") = Now
							Rs("LoginIP") = GetIP()
							Rs("LoginNumber") = Rs("LoginNumber")+1
							Rs.Update
							Response.Cookies(fycmsN)("AdminName") = Rs("Admin_Name")
							Response.Cookies(fycmsN)("AdminPassword") = Rs("PassWord")
							Response.Cookies(fycmsN)("AdminID") = Rs("ID")
							If Rs("SuperTF")=1 Then Response.Cookies(fycmsN)("SuperTF")=1
							Response.Cookies(fycmsN)("Purview") = Rs("Purview")
							Response.Cookies(fycmsN)("ACT_Other") = Rs("ACT_Other")
							session("upload")=true
 							If CheckManageCode=True Then  Response.Cookies(fycmsN)("CheckManageCode") = CheckManageCodeContent
							
							Session.Timeout = 30
							session("HQQXLX")=Rs("fycms_QXLX")
					End IF
				Else
						Call fycms.InsertLog(UserName,1,"登陆失败",Request.ServerVariables("QUERY_STRING"))
						echo("<script>alert('登录失败:\n\n您输入了错误的口令，请再次输入！');history.back();</script>")
						Response.End
				End IF
						Rs.Close:Set Rs = Nothing
						Call fycms.InsertLog(UserName,1,"登陆成功",Request.ServerVariables("QUERY_STRING"))
						Response.Redirect("index.asp")
			End IF
	End Sub

	Sub LoginOut()
		Response.Cookies(fycmsN)("CheckManageCode") =""
		Response.Cookies(fycmsN)("AdminName") =""
		Response.Cookies(fycmsN)("AdminPassword") = ""
		Response.Cookies(fycmsN)("AdminID") = ""
		Response.Cookies(fycmsN)("SuperTF")=0
		Response.Cookies(fycmsN)("Purview") = ""
		Response.Cookies(fycmsN)("ACT_Other") = ""
		Response.Cookies(fycmsN)("HQQXLX") = ""
		Response.Redirect("Login.asp")
	End Sub
	Sub ACT_login_Main()
%>
<!doctype html>
<html>
<head>
<title>FYCMS管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="fycms V1.0">
<style type="text/css">
html{-webkit-text-size-adjust:none;width:100%; height:100%;_overflow-x:hidden;}
body{background-color: #f5f5f5;margin:0; width:100%; height:100%;color:#555; padding-top:236px;}
ul,ol,form,h1,h2{ margin-top:0; margin-bottom:0;}
ul{padding-left:0;*margin-left:0;list-style-type: none;}
img{border:none;}
.tinput,.submit{border:0;outline:0;background:transparent;resize:none;}
a:focus,input:focus,textarea:focus{outline:none;}
ul li{*zoom:1;*vertical-align:bottom;}
/*img{vertical-align:top;}*/
img,input{ vertical-align:middle;}
.submit{ cursor:pointer;}
body,input,a{font-size:14px;font-family:"\5FAE\8F6F\96C5\9ED1"}
a{text-decoration:none;color:#555;}a:hover{ color:#00ABA9; text-decoration:underline;}
input[type='text'],input[type='password']{ height:24px; line-height:24px; padding:0 2px;background-color:#fff; vertical-align:top;color:#333;}
input[type='text']:focus,input[type='password']:focus{ border-color:#fff;color:#999;box-shadow:0 0 3px rgba(255,255,255, 0.8);}
*html .tinput{height:24px; line-height:24px; padding:0 2px;background-color:#fff;color:#666;vertical-align:top;}

.main{ width:900px;margin:0 auto; overflow:hidden;background:#088987;color:#fff;}
.logo{ position:relative; display:inline-block;*display:inline;*zoom:1;}
.logo var{ position:absolute; right:-30px; top:0; font-size:11px; font-family:Tahoma, Geneva, sans-serif;}

.login{ width:620px; float:left;background:#09B3B2 url(images/login/bg.jpg); border-right:#fff solid 8px;}
.login .inner{min-height:200px;_height:200px; padding:37px 0 0 53px;background:url(images/login/brd.jpg) repeat-y 0 0;}
.news{ width:268px; float:right;background-color:#088987; overflow:hidden;}
.news h2{ padding-bottom:12px; font-size:18px;}

.formbox { width:447px; margin:36px 0 0 50px; height:120px;	 position:relative;}
	.formbox li{ width:200px;height:26px; float:left; margin-bottom:14px;}
	.formbox li label{height:16px;padding:4px 4px 4px 22px; border:#068F8E solid 1px;
		background-color:#fff;background-repeat:no-repeat; background-position:4px center;
		display:inline-block;*display:inline;*zoom:1; vertical-align:top; overflow:hidden;}
	.uname label{ 	background-image:url(images/login/uname.png);}
	.pw label{ 		background-image:url(images/login/pw.png);}
	.ccode label{ 	background-image:url(images/login/ccode.png);}
	.yzm label{ 	background-image:url(images/login/yzm.png);}
	
	.formbox .tinput{ width:130px; height:16px; line-height:16px;}
	.formbox .yzm input{ width:52px;}
	.formbox .yzmimg{ height:24px; margin-left:4px;border:#068F8E solid 1px;}
.login .btns{display:block; width:32px; height:32px; margin-bottom:0; position:absolute; right:0; top:-2px}
.login .btns0{top:16px;}
.login .submit{ display:block;width:32px; height:32px;background:url(images/login/jt.jpg) no-repeat 0 0; text-indent:-99999px;}
	
.newsinner{ padding:20px 12px 10px 12px;}
.newlist li{ height:28px; overflow:hidden; }
.newlist a{ color:#fff;line-height:24px; width:250px;
display:inline-block;*display:inline;*zoom:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
.newlist a:hover{ color:#fff;}

.copyright{ text-align:center; margin-top:90px;}

.box_ie67{ display:none; padding:0 10px 20px 0;}
.box_ie67,.box_ie67 a{ font-size:18px; color:#fff;}
.box_ie67 a{ padding-right:12px; text-decoration:underline;}
.box_ie67 a:hover{ color:#fff;}
.ie67 .formbox{ display:none;}
.ie67 .box_ie67{ display:block;}
.wushi a{ font-size:11px;}
/*滚动*/
.newsinner .scroll{ height:164px;overflow:hidden;}
.ie67 .scroll{ height:250px;}
</style>
</head>
<body>
<script type="text/javascript">
	//懒人建站 制造
	function browserFun(){         	
		var browserName=navigator.userAgent.toLowerCase();
		this.ver = (browserName.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [0, '0'])[1];  
		this.msie = /msie/i.test(browserName) && !/opera/.test(browserName);
		this.firefox = /firefox/i.test(browserName);
		this.chrome = /chrome/i.test(browserName) && /webkit/i.test(browserName) && /mozilla/i.test(browserName);
		this.opera = /opera/i.test(browserName);
		this.safari = /webkit/i.test(browserName) &&!(/chrome/i.test(browserName) && /webkit/i.test(browserName) && /mozilla/i.test(browserName));
	}
	var $browser = new browserFun();
    if ($browser.msie && $browser.ver < 8){
		var ie6body=document.getElementsByTagName('body')[0];
		ie6body.className = "ie67";
	}
	function wushi(){ie6body.className = "";}
</script>
<div  class="main">
    <div class="login"><div class="inner">
        <h1 class="logo"><img src="images/login/logo.jpg" alt="Fycms.com"><var>V 1.0</var></h1>
        <form action="login.asp?Action=LoginCheck" method="post" onSubmit="return chk(this);" name="NETSJ_Login">
        <ul  class="formbox">
             <li class="uname"><label><input class="tinput" name="UserName" type="TEXT" id="UserName" value="" placeholder="请输入用户名"></label></li>
             <li class="pw"><label><input class="tinput" name="Password" TYPE="PASSWORD" id="Password" value="" placeholder="请输入密码"></label></li>
             
            <%If CheckManageCode=True Then %>
             <li class="ccode"><label><input class="tinput" maxlength='20' name="CheckManageCode" type="text" id="CheckManageCode" value="" placeholder="请输入安全码"></label></li>
             <%End If %>
            <%If CheckCode=True Then %>
             <li class="yzm"><label><input  class="tinput" name="Code" type="text" id="Code" placeholder="验证码"></label><img src="../fy_inc/code.asp?s='+Math.random();" alt="验证码" title="看不清楚? 换一张！" class="yzmimg" style="cursor:hand;" onClick="src='../fy_inc/code.asp?s='+Math.random()"/></li>
            <%End If %>
            <li class="btns <%If CheckManageCode=True Then %>btns0<%End If %>"><input name="submit" type="submit" class="submit" value="登录" title="登录"></li>
        </ul>
        
        <div class="box_ie67">
            <p>你的IE浏览器版本低于IE8.0，IE6/IE7存在严重漏洞，对您的账号安全带来严重威胁。</p>
            <strong>安全浏览器推荐：</strong>
            <p>
                <a href="http://www.baidu.com/baidu?wd=Chrome" target="_blank">谷歌浏览器</a>
                <a href="http://www.baidu.com/baidu?wd=Firefox" target="_blank">火狐浏览器</a>
                <a href="http://www.baidu.com/baidu?wd=ie9" target="_blank">IE9.0</a>
                <a href="http://www.baidu.com/baidu?wd=ie10" target="_blank">IE10.0</a>
            </p>
            <p class="wushi"><a href="javascript:;" onClick="wushi()">无视此警告！继续登录！</a></p>
        </div>
        </form>
    </div></div>
    
    <div class="news">
        <div class="newsinner">
            <h2>更新日志</h2>
            <div class="scroll" id="scroll"><ul class="newlist" id="newlist">
			<script charset='gb2312' src="http://www.fycms.com/sys/login.asp?lan=asp&url=<%=Request.Servervariables("Server_Name")%>&char=<%=Response.Charset%>"></script>
                
            </ul></div>
        </div>
    </div>

</div>
<div class="copyright">Powered by <a href="http://www.fycms.com/" target="_blank">Fycms.com</a></div>
<script language="JavaScript" type="text/JavaScript">
function chk(a){
	if (a.UserName.value==""){
		alert ("请输入管理帐号！");
		a.UserName.focus();
		return false;
	}
	if (a.Password.value==""){
		alert("请输入管理密码");
		a.Password.focus();
		return false;
	}
	<%If CheckCode=True Then %>
	if (isNaN(a.Code.value) || a.Code.value.length!=4){
		alert("验证码输入错误！");
		a.Code.focus();
		return false;
	}
	<%End If %>
 
}
window.onload = function(){
	setFocus("UserName");	
}
function setFocus(obj){
	var focusId = document.getElementById(obj);
	focusId.focus();
}
//placeholder 兼容低版本浏览器
(function(){
	var inputs=document.getElementsByTagName('input');
	
	var supportPlaceHolder='placeholder' in document.createElement('input');
	function placeHolder(input){
		var value=input.getAttribute('placeholder');
		input.value=value;
		input.onfocus=function(){
			if(this.value===value){
				this.value='';
			}
		};
		input.onblur=function(){
			if(input.value===''){
				this.value=value;
			}
		}
	}
	if(!supportPlaceHolder){
		for(var i= 0,len=inputs.length;i<len;i++){
			var input=inputs[i],text=input.getAttribute('placeholder');
			if(input.type=='text'||input.type=='password'){
				placeHolder(input);
			}
		}
	}
})();
//滚动
function ScrollText(content, btnPrevious, btnNext, autoStart) {
  this.Delay = 10;
  this.LineHeight = 20;
  this.Amount = 1; //注意:LineHeight一定要能整除Amount.
  this.Direction = "up";
  this.Timeout = 1500;
  this.ScrollContent = this.$(content);
  this.ScrollContent.innerHTML += this.ScrollContent.innerHTML;
  //this.ScrollContent.scrollTop = 0;
  if (btnNext) {
    this.NextButton = this.$(btnNext);
    this.NextButton.onclick = this.GetFunction(this, "Next");
    this.NextButton.onmouseover = this.GetFunction(this, "Stop");
    this.NextButton.onmouseout = this.GetFunction(this, "Start");
  }
  if (btnPrevious) {
    this.PreviousButton = this.$(btnPrevious);
    this.PreviousButton.onclick = this.GetFunction(this, "Previous");
    this.PreviousButton.onmouseover = this.GetFunction(this, "Stop");
    this.PreviousButton.onmouseout = this.GetFunction(this, "Start");
  }
  this.ScrollContent.onmouseover = this.GetFunction(this, "Stop");
  this.ScrollContent.onmouseout = this.GetFunction(this, "Start");
  if (autoStart) {
    this.Start();
  }
}

ScrollText.prototype.$ = function(element) {
  return document.getElementById(element);
}

ScrollText.prototype.Previous = function() {
  clearTimeout(this.AutoScrollTimer);
  clearTimeout(this.ScrollTimer);
  this.Scroll("up");
}

ScrollText.prototype.Next = function() {
  clearTimeout(this.AutoScrollTimer);
  clearTimeout(this.ScrollTimer);
  this.Scroll("down");
}

ScrollText.prototype.Start = function() {
  clearTimeout(this.AutoScrollTimer);
  this.AutoScrollTimer = setTimeout(this.GetFunction(this, "AutoScroll"), this.Timeout);
}

ScrollText.prototype.Stop = function() {
  clearTimeout(this.ScrollTimer);
  clearTimeout(this.AutoScrollTimer);
}

ScrollText.prototype.AutoScroll = function() {
  if (this.Direction == "up") {
    if (parseInt(this.ScrollContent.scrollTop) >= parseInt(this.ScrollContent.scrollHeight) / 2) {
      this.ScrollContent.scrollTop = 0;
    }
    this.ScrollContent.scrollTop += this.Amount;
  } else {
    if (parseInt(this.ScrollContent.scrollTop) <= 0) {
      this.ScrollContent.scrollTop = parseInt(this.ScrollContent.scrollHeight) / 2;
    }
    this.ScrollContent.scrollTop -= this.Amount;
  }
  if (parseInt(this.ScrollContent.scrollTop) % this.LineHeight != 0) {
    this.ScrollTimer = setTimeout(this.GetFunction(this, "AutoScroll"), this.Delay);
  } else {
    this.AutoScrollTimer = setTimeout(this.GetFunction(this, "AutoScroll"), this.Timeout);
  }
}

ScrollText.prototype.Scroll = function(direction) {
  if (direction == "up") {
    if (this.ScrollContent.scrollTop == 0) {
      this.ScrollContent.scrollTop = parseInt(this.ScrollContent.scrollHeight) / 2;
    }
    this.ScrollContent.scrollTop -= this.Amount;
  } else {
    this.ScrollContent.scrollTop += this.Amount;
  }
  if (parseInt(this.ScrollContent.scrollTop) >= parseInt(this.ScrollContent.scrollHeight) / 2) {
    this.ScrollContent.scrollTop = 0;
  }
  if (parseInt(this.ScrollContent.scrollTop) % this.LineHeight != 0) {
    this.ScrollTimer = setTimeout(this.GetFunction(this, "Scroll", direction), this.Delay);
  }
}

ScrollText.prototype.GetFunction = function(variable, method, param) {
  return function() {
    variable[method](param);
  }
}
if(document.getElementById("scroll")){
	var scrollup = new ScrollText("scroll");
	scrollup.LineHeight = 28;        //单排文字滚动的高度
	scrollup.Amount = 1;            //注意:子模块(LineHeight)一定要能整除Amount.
	scrollup.Delay = 20;           //延时
	scrollup.Start();             //文字自动滚动
	scrollup.Direction = "up"; //文字向下滚动
}
</script>
</body>
</html>
<% 	End Sub
 %>
