<!doctype html>
<html lang="en" class="fixed accounts sign-in">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>GM游戏管理后台</title>
    <link rel="stylesheet" href="/html/vendor/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="/html/vendor/font-awesome/css/font-awesome.css">
    <link rel="stylesheet" href="/html/vendor/animate.css/animate.css">
    <link rel="stylesheet" href="/html/stylesheets/css/style.css">
</head>

<body>
<div class="wrap">
    <div class="page-body animated slideInDown">
        <div class="logo">
            <img alt="" src="" />
        </div>

        @if( isset($ERROR) && $ERROR )
            <div class="al1" style="position: absolute;width: 100%;margin-top: -35px">
                <div class="alctr" style="width:250px;position: relative;z-index: 1500;margin: 0 auto">
                    <div style="position:absolute;z-index:1000;padding:5px 15px;background-color: #D50600;opacity: 0.6;width: 100%;height: 100%;border-radius: 5px"></div>
                    <div style="position:relative;z-index: 1500;padding:5px 15px;color: white">{{ $ERROR }}</div>
                </div>
            </div>
        @endif

        <div class="box">
            <div class="panel mb-none">
                <div class="panel-content bg-scale-0">
                    <form action="{{ URL::action('Admin\AdminController@getPostLogin',array()) }}" method="post" name="userlogin" id="userlogin" onsubmit="return check();">
                        <div class="form-group mt-md">
                            <span class="input-with-icon">
                                    <input type="text" class="form-control" id="txname" placeholder="用户名" name="username">
                                    <i class="fa fa-user"></i>
                            </span>
                            <i id="txSpan" class="col-lg-12 m-sm" style="color: gray"></i>
                        </div>
                        <div class="form-group">
                                <span class="input-with-icon">
                                        <input type="password" class="form-control" id="pwd" placeholder="密码" name="password" id="pwd">
                                        <i class="fa fa-key"></i>
                                    </span>
                            <i id="pwdSpan" class="col-lg-12 m-sm" style="color: gray"></i>
                        </div>
                        <input type="hidden" id="_token" name="_token" value="{{ csrf_token() }}">
                        <div class="form-group">
                            <button type="submit" class="btn btn-primary btn-block" id="submit">登入</button>
                        </div>
                    </form>

                </div>
            </div>
        </div>
    </div>
</div>
<script src="/html/vendor/jquery/jquery-1.12.3.min.js"></script>
<script src="/html/vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="/html/vendor/nano-scroller/nano-scroller.js"></script>
<script src="/html/javascripts/template-script.min.js"></script>
<script src="/html/javascripts/template-init.min.js"></script>

<script>
    function check(){
        $('#submit').attr('disabled','disabled');
        var rxname = $('#txname').val();
        var pwd = $('#pwd').val();
        if(rxname.length < 1){
            $("#txSpan").empty();
            $("#txSpan").append("<i class='fa fa-remove color-danger'></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;通行证用户名不可以为空");
            $('#submit').removeAttr("disabled");
            return false;
        }else{
            $("#txSpan").empty();
        }

        if(pwd.length < 6 || pwd.length > 16){
            $("#pwdSpan").empty();
            $("#pwdSpan").append("<i class='fa fa-remove color-danger'></i>&nbsp;密码长度为6-16位");
            $('#submit').removeAttr("disabled");
            return false;
        }else{
            $("#pwdSpan").empty();
        }
    }
</script>
</body>
</html>
