{include file="public/seller_top" /}
<div class="seller_main w1200">
    {include file="public/seller_left" /}
    <div class="seller_right">
        <div class="seller_items">
            {include file="public/seller_items" /}
        </div>

        <div class="dssc-form-default">
            {if $Request.action == 'booth_quota_add'}
            <form id="add_form" action="{:url('Sellerpromotionbooth/booth_quota_add')}" method="post">
                {else}
                <form id="add_form" action="{:url('Sellerpromotionbooth/booth_renew')}" method="post">
                   {/if}
                    <input type="hidden" name="form_submit" value="ok" />
                    <dl>
                        <dt><i class="required">*</i>套餐购买数量：</dt>
                        <dd>
                            <input id="booth_quota_quantity" name="booth_quota_quantity" type="text" class="text w50"/><em class="add-on">月</em><span></span>
                            <p class="hint">购买单位为月(30天)，一次最多购买12个月，购买后立即生效，即可添加推荐商品。</p>
                            <p class="hint"><?php printf('每月您需要支付%d元。', intval(config('promotion_booth_price')));?></p>
                            <p class="hint"><strong style="color: red">相关费用会在店铺的账期结算中扣除</strong></p>
                        </dd>
                    </dl>
                    <div class="bottom">
                        <label class="submit-border"><input id="submit_button" type="submit" value="{$Think.lang.ds_submit}" class="submit"></label>
                    </div>
                </form>
            </div>
        </div>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        //页面输入内容验证
        $("#add_form").validate({
            errorPlacement: function(error, element){
                var error_td = element.parent('dd').children('span');
                error_td.append(error);
            },
            submitHandler:function(form){
                var unit_price = parseInt({:config('promotion_booth_price')});
                var quantity = parseInt($("#booth_quota_quantity").val());
                var price = unit_price * quantity;
                showDialog('确认购买?您总共需要支付'+price+'元', 'confirm', '', function(){ajaxpost('add_form', '', '', 'onerror');});
            },
            rules : {
                booth_quota_quantity : {
                    required : true,
                    digits : true,
                    range : [1,12]
                }
            },
            messages : {
                booth_quota_quantity : {
                    required : '<i class="icon-exclamation-sign"></i>套餐购买数量不能为空，且必须为1~12之间的整数',
                    digits : '<i class="icon-exclamation-sign"></i>套餐购买数量不能为空，且必须为1~12之间的整数',
                    range : '<i class="icon-exclamation-sign"></i>套餐购买数量不能为空，且必须为1~12之间的整数'
                }
            }
        });
    });
</script> 