{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" /}
            {if $isOwnShop}
            <a class="dssc-btn dssc-btn-green"  href="{:url('Sellerpromotionbundling/bundling_add')}" ><i class="icon-plus-sign"></i>{$Think.lang.bundling_add}</a>
            {else /}
            <?php if (empty($bundling_quota)) { ?>
            <a href="javascript:void(0)" class="dssc-btn dssc-btn-acidblue" onclick="window.location='{:url('Sellerpromotionbundling/bundling_quota_add')}';" title="{$Think.lang.bundling_quota_add}"><i class="icon-money"></i>{$Think.lang.bundling_quota_add}</a>
            <?php } else if((isset($bundling_surplus) && intval($bundling_surplus) != 0 ) || config('promotion_bundling_sum') == 0) { ?>
            {if $bundling_quota.bl_state == 1}
            <a class="dssc-btn dssc-btn-green"  href="{:url('Sellerpromotionbundling/bundling_add')}" style="right:100px"><i class="icon-plus-sign"></i>{$Think.lang.bundling_add}</a>
            {/if}
            <a class="dssc-btn dssc-btn dssc-btn-acidblue" href="{:url('Sellerpromotionbundling/bundling_renew')}"><i class="icon-money"></i>套餐续费</a>
            <?php } ?>
            {/if}
        </div>


        {if $isOwnShop}
        <div class="alert alert-block mt10">
            <ul>
                <li>1、您最多可以发布{:config('promotion_bundling_sum')}个优惠套装。</li>
            </ul>
        </div>
        {else}
        <!-- 有可用套餐，发布活动 -->
        <div class="alert alert-block mt10">
            <?php if(empty($bundling_quota)) { ?>
            <strong>你还没有购买套餐或套餐已经过期，请购买或续费套餐。</strong>
            <?php } else {?>
            <strong>套餐过期时间{$Think.lang.ds_colon}</strong> <strong style=" color:#F00;">{$bundling_quota.bl_quota_endtime|date="Y-m-d H:i:s",###}</strong>
            <?php }?>
            <ul>
                <li>1、点击购买套餐或续费套餐可以购买或续费套餐</li>
                <li>2、<strong style="color: red">相关费用会在店铺的账期结算中扣除</strong>。</li>
                <?php if (config('promotion_bundling_sum') != 0) {?>
                <li>3、您最多可以发布{:config('promotion_bundling_sum')}个优惠套装。</li>
                <?php }?>
            </ul>
        </div>
       {/if}
        <form method="get">
            <table class="search-form">
                <tr>
                    <td>&nbsp;</td>
                    <th>{$Think.lang.bundling_status}</th>
                    <td class="w100"><select name="state">
                        <option value='all'>{$Think.lang.bundling_status_all}</option>
                        <option value='0' {if $Request.param.state == 0}selected="selected"{/if}>{$Think.lang.bundling_status_0}</option>
                        <option value='1' {if $Request.param.state == 1}selected="selected"{/if}>{$Think.lang.bundling_status_1}</option>
                    </select></td>
                    <th class="w110">{$Think.lang.bundling_name}</th>
                    <td class="w160"><input type="text" class="text w150" name="bundling_name" value="{$Request.get.bundling_name}"/></td>
                    <td class="w70 tc"><label class="submit-border"><input type="submit" class="submit" value="{$Think.lang.ds_search}" /></label></td>
                </tr>
            </table>
        </form>
        
        {empty name="list"}
        <!-- 没有添加活动 -->
        <table class="dssc-default-table dssc-promotion-buy">
            <tbody>
            <tr>
                <td colspan="20" class="norecord"><div class="warning-option"><i class="icon-warning-sign"></i><span>{$Think.lang.no_record}</span></div></td>
            </tr>
            </tbody>
        </table>
        {else /}
        <table class="dssc-default-table">
            <thead>
            <tr>
                <th class="w10"></th>
                <th class="w50"></th>
                <th class="tl">{$Think.lang.bundling_name}</th>
                <th class="w180">{$Think.lang.bundling_add_price}</th>
                <th class="w180">{$Think.lang.bundling_list_goods_count}</th>
                <th class="w90">{$Think.lang.ds_state}</th>
                <th class="w110">{$Think.lang.ds_handle}</th>
            </tr>
            <tr>
                <td class="w30 tc"><input type="checkbox" id="all" class="checkall"/></td>
                <td colspan="20"><label for="all" >{$Think.lang.ds_select_all}</label>
                    <a href="javascript:void(0);" class="dssc-btn-mini" nc_type="batchbutton" uri="{:url('Sellerpromotionbundling/drop_bundling')}" name="bundling_id" confirm="{$Think.lang.ds_ensure_del}"><i class="icon-trash"></i>{$Think.lang.ds_del}</a></td>
            </tr>
            </thead>
            {volist name="list" id="val"}
            <tbody>
            <tr class="bd-line">
                <td><input type="checkbox" class="checkitem tc" value="{$val.bl_id}"/></td>
                <td><div class="pic-thumb"><a href="{if $val.goods_id !=''}{:url('goods/index',['goods_id'=>$val.goods_id])}{else}javascript:void(0){/if}" {if $val.goods_id !=''}target='_blank'{else /}target='black'{/if}><img src="{$val.img}"/></a></div></td>
                <td class="tl"><dl class="goods-name">
                    <dt><a href="{if $val.goods_id !=''}{:url('goods/index',['goods_id'=>$val.goods_id])}"target="_blank" {else }javascript:void(0);"{/if}>{$val.bl_name}</a></dt>
                </dl></td>
                <td class="goods-price">{$val.bl_discount_price}</td>
                <td class="">{$val.count}</td>
                <td>{$state_array[$val.bl_state]}</td>
                <td class="nscs-table-handle"><span><a href="{:url('Sellerpromotionbundling/bundling_add',['bundling_id'=>$val.bl_id])}" class="btn-blue"><i class="icon-cog"></i>
        <p>{$Think.lang.bundling_edit}</p>
        </a></span> <span><a class="btn-red" href='javascript:void(0);' onclick="ajax_get_confirm('{$Think.lang.ds_ensure_del}', '{:url('Sellerpromotionbundling/drop_bundling',['bundling_id'=>$val.bl_id])}');"><i class="icon-trash"></i>
        <p>{$Think.lang.ds_del}</p>
        </a></span></td>
            </tr>
            </tbody>
            {/volist}
            <tfoot>
            <tr>
                <th class="tc"><input type="checkbox" id="all" class="checkall"/></th>
                <th colspan="20"><label for="all" >{$Think.lang.ds_select_all}</label>
                    <a href="javascript:void(0);" class="dssc-btn-mini" nc_type="batchbutton" uri="{:url('Sellerpromotionbundling/drop_bundling')}" name="bundling_id" confirm="{$Think.lang.ds_ensure_del}"><i class="icon-trash"></i>{$Think.lang.ds_del}</a></th>
            </tr>
            <tr>
                <td colspan="20"><div class="pagination">{$show_page}</div></td>
            </tr>
            </tfoot>
        </table>
       {/empty}
    </div>
</div>