<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

$this->title = '管理员登录';

$cssString = "html{
    background: url('".Yii::$app->config->get('site_login_bg')."');
    background-size: cover !important;
    background-attachment: fixed !important;
}
.login-page, .register-page{background: transparent;}
 .footer {
        position: absolute;
        height: 70px;
        background: #000000;
        color: #ffffff;
        bottom: 0;
        left: 0;
        width: 100%;
    }

    .copyright {
        padding: 24px 0;
    }
    .copyright a {
        color: #ffffff;
    }

";
$this->registerCss($cssString);


$fieldOptions1 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-envelope form-control-feedback'></span>"
];

$fieldOptions2 = [
    'options' => ['class' => 'form-group has-feedback'],
    'inputTemplate' => "{input}<span class='glyphicon glyphicon-lock form-control-feedback'></span>"
];
?>

<div class="login-box">
    <div class="login-logo">
        <a href="#"><b  style="color: #fff;"><?= Yii::$app->config->get('name') ?></b></a>
    </div>
    <!-- /.login-logo -->
    <div class="login-box-body">
        <a href="qrcode-login" style="display: none;">
            <img src="/assets/images/qrcode.png"
                 style="height: 40px; margin-left: 250px; cursor: pointer; position: absolute;" title="扫码登录">
        </a>
        <h4 class="login-box-msg" style="padding-bottom: 30px;">管理员登录</h4>

        <?php $form = ActiveForm::begin(['id' => 'login-form', 'enableClientValidation' => false]); ?>

        <?= $form
            ->field($model, 'username', $fieldOptions1)
            ->label(false)
            ->textInput(['placeholder' => $model->getAttributeLabel('username')]) ?>

        <?= $form
            ->field($model, 'password', $fieldOptions2)
            ->label(false)
            ->passwordInput(['placeholder' => $model->getAttributeLabel('password')]) ?>

        <div class="row">
            <div class="col-xs-8">
                <?= $form->field($model, 'rememberMe')->checkbox() ?>
            </div>
            <!-- /.col -->
            <div class="col-xs-4">
                <?= Html::submitButton('登录', ['class' => 'btn btn-primary btn-flat btn-block btn-flat', 'name' => 'login-button']) ?>
            </div>
            <!-- /.col -->
        </div>


        <?php ActiveForm::end(); ?>


    </div>
    <!-- /.login-box-body -->
</div><!-- /.login-box -->

<div class="footer" style="opacity: 0.5;">
</div>
<div class="footer" style="background: transparent;">
    <div class="text-center copyright">© <?= Yii::$app->config->get('copyright') ?> <a href="https://beian.miit.gov.cn/"
                                                                                  target="_blank"><?= Yii::$app->config->get('icp') ?></a></div>
</div>
