<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="AgentManager.admin.login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="renderer" content="webkit" />
<title><% %>代理后台</title>
<link href="/admin/css/admin.css" rel="stylesheet" type="text/css" />
    <link href="admin/css/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <script src="/admin/js/jquery-1.9.1.min.js"></script>
    <script src="admin/css/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<div class="login">
<div class="login-top">
<h1>代理会员后台管理</h1>
</div>
<form action="login.aspx" method="post">
<ul>
<li class="login-li">用&nbsp;&nbsp;&nbsp;&nbsp;户：<input type="text" name="username" autocomplete="off" maxlength="16" /></li>
<li class="login-li">密&nbsp;&nbsp;&nbsp;&nbsp;码：<input type="password" name="password" autocomplete="off" maxlength="16" /></li>
<li class="login-li">验证码：<input type="text" name="vccode" autocomplete="off" maxlength="5" /><img src="/admin/ajax/vaildatacode.ashx" id="vimgreg" alt="" title="点击切换验证码" onclick="changeReg(this)" /></li>
<li class="login-li" style="border:0px;text-align:right;"><input type="submit" name="submit" value="登录" onclick="return inputText()" /></li>
</ul>
<%--<% if (!string.IsNullOrEmpty(message)){ %>
<div class="login_message"><%=message %></div>
<%} %>--%>
</form>
</div>

<div class="modal fade" id="loadingModal">
<div style="width: 200px;height:20px; z-index: 20000; position: absolute; text-align: center; left: 50%; top: 50%;margin-left:-100px;margin-top:-10px">
<div class="progress progress-striped active" style="margin-bottom: 0;">
<div class="progress-bar" style="width: 100%;"></div>
</div>
<h5>正在登录,请稍等...</h5>
</div>
</div>
</body>
</html>
<script type="text/javascript">

    $(function () {
       
    })
    function changeReg(a) { $(a).attr("src", "/admin/ajax/vaildatacode.ashx?t=" + (new Date()).valueOf()); }
    function inputText() {

        $("ul li").removeClass("red");
        var username = $("input[type=text]").eq(0).val()
        var pwd = $("input[type=password]").eq(0).val()
        var yzm = $("input[type=text]").eq(1).val()
        if ($("input[type=text]").eq(0).val() == "") { $("ul li").eq(0).addClass("red"); return false; }
        if ($("input[type=password]").val() == "") { $("ul li").eq(1).addClass("red"); return false; }
        if ($("input[type=text]").eq(1).val() == "") { $("ul li").eq(2).addClass("red"); return false; }

          $("#loadingModal").modal({backdrop:'static'});
        $.post("/admin/ajax/login.ashx", { username: username, password: pwd, yzm: yzm }, function (msg) {
            if (msg == "ok") {
                location.href = "/admin/index1.aspx"
            } else {

                 alert(msg)
            $('#vimgreg').click();
            }
           $("#loadingModal").modal('hide');
        })
        return false;
    }
    $(function () { $("input[type=text]").focus(function () { $(this).parent("li").removeClass("red") }); $("input[type=password]").focus(function () { $(this).parent("li").removeClass("red") }); })

</script>
