<div class="content-wrapper">
    <?php
    $form = $this->form;
    $form->prepare();
    ?>
    <?php echo $this->form()->openTag($form); ?>
    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>

        <h1 class="pull-right">
            <a href="<?php echo $this->url('user', [], ['query' => $this->queryData]);?>" class="btn btn-default btn-sm"><i class="fa fa-arrow-left"></i> <?php echo $this->translate('返回客户列表'); ?></a>
            <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-check"></i> <?php echo $this->translate('修改余额支付密码'); ?></button>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title"><?php echo $this->translate('修改余额支付密码'); ?></h3>
                    </div>

                    <div class="box-body">
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('客户账号'); ?></label>
                            <div class="col-sm-6">
                                <p class="form-control-static"><?php echo $this->escapeHtml($this->userInfo->getUserName()); ?></p>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('余额支付密码'); ?><span class="must_add_value">*</span></label>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('payPassword')); ?>
                                <?php echo $this->formElementErrors($form->get('payPassword'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('确认余额支付密码'); ?><span class="must_add_value">*</span></label>
                            <div class="col-sm-3">
                                <?php echo $this->formElement($form->get('payComPassword')); ?>
                                <?php echo $this->formElementErrors($form->get('payComPassword'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>

    </section>
    <?php echo $this->form()->closeTag(); ?>
</div>
<script>
    $(document).ready(function() {
        $("#<?php echo $form->getName(); ?>").validate({
            rules: {
                payPassword: {
                    required: true
                },
                payComPassword: {
                    required: true,
                    equalTo: "#payPassword"
                }
            },
            messages: {
                payPassword: {
                    required: "<?php echo $this->translate('请输入余额支付密码'); ?>"
                },
                payComPassword: {
                    required: "<?php echo $this->translate('请输入确认密码'); ?>",
                    equalTo: "<?php echo $this->translate('两次输入的密码不一致'); ?>"
                }
            }
        });
    });
</script>