
<div class="row">
    <div class="container" id="mainDiv_uga">

        <div class="row">


            <div class="col-lg-5 col-lg-offset-4">
                <div class="panel panel_login">
                    <div class="panel-heading loginpanel">
                        <h3 class="panel-title">تأكيد الصلاحية</h3>
                    </div>
                    <form class="form-horizontal" id="uga-login-form">
                        <div class="form-group">
                            <label for="password" class="col-lg-4 control-label">كلمة المرور</label>
                            <div class="col-lg-8">
                                <input type="password" class="form-control" id="password" name="password" placeholder="كلمة المرور">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-lg-offset-2 col-lg-10">
                                <button type="submit" id="uga-go-btn" class="btn btn-default pull-left submit color-white">متابعة</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>




        </div>



    </div>
</div>

{literal}
<script type="text/javascript">
    var attempts = 0;
    $('#uga-login-form').live('submit', function (e) {
        e.preventDefault();
        e.stopPropagation();
        var thisis = $(this);
        if (!thisis.hasClass('processing...')) {
            thisis.addClass('processing...');
            if ($('#password').val() == "") {
                $('#password').css('background-color', 'yellow');
                thisis.removeClass('processing...');
            } else {
                $('#password').css('background-color', 'white');
                $.ajax({
                    type: "POST",
                    url: 'usergroupControllerAdmin.php?do=en',
                    data: {password: $('#password').val()},
                    async: false,
                    success: function (data) {
                        thisis.removeClass('processing...');
                        if (data == -1) {
                            attempts = attempts + 1;
                            if (attempts < 3) {
                                $('#password').css('background-color', '#d43f3a');
                                setTimeout(function () {
                                    $('#password').css('background-color', 'white');
                                    $('#password').val("");
                                }, 2000)
                            } else {
                                window.location.href = 'logout.php';
                            }
                        } else {
                            $('#mainDiv_uga').html(data);
                        }

                    }

                });

            }
        }
    });
    $(function () {
        setTimeout(function () {
            $('#password').focus();
        }, 0);
    })
</script>
{/literal}