<?php
/**
 * @var \yii\web\View $this
 */
?>
<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>BIT System 后台管理平台</title>
    <?= $this->render('/common/css_js_main') ?>
</head>
<body id="main">
<div class="main-nav"> <span class="fn-left">编辑个人信息</span> <span class="fn-right"><a href="javascript:history.go(-1);"><i class="icon-chevron-left"></i>返回</a></span>
    <div class="fn-clear"></div>
</div>
<div class="main-content">
    <div class="form-or-table">
        <form class="form-horizontal" id="validateForm" action="/cp/admin/profile" method="post">
            <input type="hidden" name="<?= Yii::$app->request->csrfParam ?>" value="<?= Yii::$app->request->getCsrfToken() ?>" />
            <fieldset>
                <div class="blank15"></div>
                <div class="control-group">
                    <label class="control-label"><span class="must-input">*</span>用户名</label>
                    <div class="controls">
                        <?= Yii::$app->user->identity->username ?>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">当前密码</label>
                    <div class="controls">
                        <input type="password" id="currentPassword" name="currentPassword" class="span3" autocomplete="off" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">新密码</label>
                    <div class="controls">
                        <input type="password" id="newPassword" name="newPassword" class="span3" autocomplete="off" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">重复新密码</label>
                    <div class="controls">
                        <input type="password" id="rePassword" name="rePassword" class="span3" autocomplete="off" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">电子邮箱</label>
                    <div class="controls">
                        <?= Yii::$app->user->identity->email ?>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">部门</label>
                    <div class="controls">
                        <?= Yii::$app->user->identity->department ?>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">姓名</label>
                    <div class="controls">
                        <?= Yii::$app->user->identity->name ?>
                    </div>
                </div>
                <div class="form-actions">
                    <button type="submit" class="btn btn-primary"><i class="icon-upload"></i> 提交</button>
                    <button type="reset" class="btn" onclick="javascript:history.go(-1);"><i class="icon-repeat"></i> 返回</button>
                </div>
            </fieldset>
        </form>
    </div>
</div>
</body>
<script type="text/javascript">
$(function() {
    var $validateForm = $("#validateForm");
    $validateForm.validate({
        rules: {
            newPassword: {
                minlength: 6,
                maxlength: 20
            },
            rePassword: {
                equalTo: "#newPassword"
            }
        },
        messages: {
            newPassword: {
                minlength: "密码必须大于等于6!",
                maxlength: "密码必须小于等于20!"
            },
            rePassword: {
                equalTo: "两次密码输入不一致!"
            }
        }
    });
    
});
</script>
</html>