{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 == 'bundling_quota_add'}
            <form id="add_form" action="{:url('Sellerpromotionbundling/bundling_quota_add')}" method="post">
                {else /}
                <form id="add_form" action="{:url('Sellerpromotionbundling/bundling_renew')}" method="post">
                    {/if}
                    <input type="hidden" name="form_submit" value="ok" />
                    <dl>
                        <dt><i class="required">*</i>{$Think.lang.bundling_quota_add_quantity}{$Think.lang.ds_colon}</dt>
                        <dd>
                            <input id="bundling_quota_quantity" name="bundling_quota_quantity" type="text" class="text w50"/><em class="add-on">{$Think.lang.ds_month}</em><span></span>
                            <p class="hint">{$Think.lang.bundling_price_explain1}</p>
                            <p class="hint"><?php printf(lang('bundling_price_explain2'), intval(config('promotion_bundling_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_bundling_price')});
                var quantity = parseInt($("#bundling_quota_quantity").val());
                var price = unit_price * quantity;
                showDialog('{$Think.lang.bundling_quota_add_confirm}'+price+'{$Think.lang.bundling_gold}', 'confirm', '', function(){ajaxpost('add_form', '', '', 'onerror');});
            },
            rules : {
                bundling_quota_quantity : {
                    required : true,
                    digits : true,
                    min : 1,
                    max : 12
                }
            },
            messages : {
                bundling_quota_quantity : {
                    required : '<i class="icon-exclamation-sign"></i>{$Think.lang.bundling_quota_quantity_error}',
                    digits : '<i class="icon-exclamation-sign"></i>{$Think.lang.bundling_quota_quantity_error}',
                    min : '<i class="icon-exclamation-sign"></i>{$Think.lang.bundling_quota_quantity_error}',
                    max : '<i class="icon-exclamation-sign"></i>{$Think.lang.bundling_quota_quantity_error}'
                }
            }
        });
    });
</script> 