<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('moneyChangeNum')->setAttributes([
    'class' => 'form-control',
    'placeholder' => $this->translate('提现金额')
]);
$form->get('bankName')->setAttributes([
    'class' => 'form-control',
    'placeholder' => $this->translate('支付名称/开户银行/第三方支付名称')
]);
$form->get('bankAccount')->setAttributes([
    'class' => 'form-control',
    'placeholder' => $this->translate('账户名称/开户名称')
]);
$form->get('bankCardNumber')->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('余额提现操作'); ?>
                        </h3>
                    </div>
                    <div class="box-bd">
                        <?php echo $this->form()->openTag($form); ?>
                        <div class="control-group">
                            <label class="control-label"><?php echo $this->translate('可提现金额'); ?>：</label>
                            <div class="controls">
                                <?php echo $this->shopCurrencyFormat($this->userInfo->getUserMoney()); ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <label for="input01" class="control-label"><?php echo $this->translate('提现金额'); ?><span class="must_add_value">*</span>：</label>
                            <div class="controls">
                                <?php echo $this->formElement($form->get('moneyChangeNum')); ?>
                                <?php echo $this->formElementErrors($form->get('moneyChangeNum'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <label for="input01" class="control-label"><?php echo $this->translate('开户行/支付名称'); ?><span class="must_add_value">*</span>：</label>
                            <div class="controls">
                                <?php echo $this->formElement($form->get('bankName')); ?>
                                <?php echo $this->formElementErrors($form->get('bankName'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <label for="input01" class="control-label"><?php echo $this->translate('开户名称/账户名称'); ?><span class="must_add_value">*</span>：</label>
                            <div class="controls">
                                <?php echo $this->formElement($form->get('bankAccount')); ?>
                                <?php echo $this->formElementErrors($form->get('bankAccount'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="control-group">
                            <label for="input01" class="control-label"><?php echo $this->translate('卡号/账号'); ?><span class="must_add_value">*</span>：</label>
                            <div class="controls">
                                <?php echo $this->formElement($form->get('bankCardNumber')); ?>
                                <?php echo $this->formElementErrors($form->get('bankCardNumber'), ['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: {
                moneyChangeNum: {
                    required: true,
                    number: true,
                    min: 0.01,
                    max: <?php echo $this->userInfo->getUserMoney(); ?>
                },
                bankName: {
                    required: true
                },
                bankAccount: {
                    required: true
                },
                bankCardNumber: {
                    required: true
                }
            },
            messages: {
                moneyChangeNum: {
                    required: "<?php echo $this->translate('提现金额不能为空!'); ?>",
                    number: "<?php echo $this->translate('提现金额必须为数字!'); ?>",
                    min: "<?php echo $this->translate('提现金额最小为 0.01'); ?>",
                    max: "<?php echo $this->translate('提现金额最大为 ').$this->userInfo->getUserMoney(); ?>"
                },
                bankName: {
                    required: "<?php echo $this->translate('支付名称/开户银行 不能为空!'); ?>"
                },
                bankAccount: {
                    required: "<?php echo $this->translate('账户名称/开户名称 不能为空!'); ?>"
                },
                bankCardNumber: {
                    required: "<?php echo $this->translate('账号/卡号 不能为空!'); ?>"
                }
            }
        });
    });
</script>