<div class="header_menu">
    <div class="container">
        <div class="header-nav clearfix">
            <?php echo $this->partial('shop/layout/headerMenu'); ?>
        </div>
    </div>
</div>
</div>
<div class="container breadcrumbs">
    <a href="<?php echo $this->url('shop'); ?>"><?php echo $this->translate('首页'); ?></a>
    <span class="sep">/</span><span><?php echo $this->translate('登录密码'); ?></span>
</div>
<?php
$form = $this->form;
$form->prepare();

$form->setAttributes(['class' => 'form-horizontal']);

$form->get('originalPassword')->setAttributes(['class' => 'form-control', 'placeholder' => $this->translate('原登录密码')]);
$form->get('userPassword')->setAttributes(['class' => 'form-control', 'placeholder' => $this->translate('新登录密码')]);
$form->get('userComPassword')->setAttributes(['class' => 'form-control', 'placeholder' => $this->translate('新登录确认密码')]);
?>
<div class="container">
    <div class="uc-full-box">
        <div class="row">
            <div class="span4">
                <?php echo $this->partial('shop/partial/home/leftMenu'); ?>
            </div>
            <div class="span16">
                <div class="xm-line-box uc-box uc-order-detail-box">
                    <div class="box-hd">
                        <h3 class="title">
                            <?php echo $this->translate('登录密码'); ?>
                            &nbsp;&nbsp;
                            <a href="<?php echo $this->url('home-security'); ?>" class="btn btn-default"><?php echo $this->translate('返回'); ?></a>
                        </h3>
                    </div>
                    <div class="box-bd">
                        <?php echo $this->partial('shop/message'); ?>
                        <?php echo $this->form()->openTag($form); ?>
                        <div class="control-group">
                            <label class="control-label"><?php echo $this->translate('原登录密码'); ?><span class="must_add_value">*</span>：</label>
                            <div class="controls">
                                <?php echo $this->formElement($form->get('originalPassword')); ?>
                                <?php echo $this->formElementErrors($form->get('originalPassword'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label"><?php echo $this->translate('新登录密码'); ?><span class="must_add_value">*</span>：</label>
                            <div class="controls">
                                <?php echo $this->formElement($form->get('userPassword')); ?>
                                <?php echo $this->formElementErrors($form->get('userPassword'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label"><?php echo $this->translate('新登录确认密码'); ?><span class="must_add_value">*</span>：</label>
                            <div class="controls">
                                <?php echo $this->formElement($form->get('userComPassword')); ?>
                                <?php echo $this->formElementErrors($form->get('userComPassword'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="offset3">
                            <button class="btn btn-primary" type="submit"><?php echo $this->translate('提交修改'); ?></button>
                        </div>
                        <?php echo $this->form()->closeTag(); ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        $("#<?php echo $form->getName(); ?>").validate({
            rules: {
                originalPassword: {
                    required: true
                },
                userPassword: {
                    required: true
                },
                userComPassword: {
                    required: true,
                    equalTo: "#userPassword"
                }
            },
            messages: {
                originalPassword: {
                    required: "<?php echo $this->translate('请输入原登录密码'); ?>"
                },
                userPassword: {
                    required: "<?php echo $this->translate('请输入新登录密码'); ?>"
                },
                userComPassword: {
                    required: "<?php echo $this->translate('请输入新登录确认密码'); ?>",
                    equalTo: "<?php echo $this->translate('两次输入的密码不一致'); ?>"
                }
            }
        });
    });
</script>