{template "mheader.html"}


<div class="row table-search-tool">
    <form action="{SELF}" method="get">
        {$search}
        <div class="col-xs-12">
            <label>
                {$select}
            </label>
            <label>
                <select name="field" class="form-control">
                    {loop $field $t}
                    {if $t.ismain}
                    <option value="{$t.fieldname}" {if $param.field==$t.fieldname}selected{/if}>{$t.name}</option>
                    {/if}
                    {/loop}
                </select>
            </label>
            <label><i class="fa fa-caret-right"></i></label>
            <label><input type="text" class="form-control" placeholder="" value="{$param['keyword']}" name="keyword" /></label>

            <label><button type="submit" class="btn green btn-sm onloading" name="submit" > <i class="fa fa-search"></i> {dr_lang('搜索')}</button></label>
        </div>
    </form>
</div>


<form class="form-horizontal" role="form" id="myform">
    {dr_form_hidden()}
    <input type="hidden" name="isajax" value="1">
    <div class="table-scrollable">
        <table class="table table-striped table-bordered table-hover table-checkable dataTable">
            <thead>
            <tr class="heading">
                <th class="myselect">
                    {if $more}
                    <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                        <input type="checkbox" class="group-checkable" data-set=".checkboxes" />
                        <span></span>
                    </label>
                    {/if}
                </th>
                <th>{dr_lang('商品')}</th>
                <th width="100">{dr_lang('库存')}</th>
                <th width="200">{dr_lang('价格')}</th>
            </tr>
            </thead>
            <tbody>
            {loop $list $t}
            <tr class="odd gradeX">
                <td class="myselect">
                    {if !$t.price_sku}
                    {if $more}
                    <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                        <input type="checkbox" class="checkboxes" name="cid[]" value="{$t.id}" />
                        <span></span>
                    </label>
                    {else}
                    <label class="mt-radio mt-radio-outline" style="margin-left: 5px;">
                        <input type="radio"  name="cid" value="{$t.id}-0" />
                        <span></span>
                    </label>
                    {/if}
                    {/if}
                </td>
                <td><a href="{$t.url}" target="_blank">{$t.title}</a></td>
                <td>{$t.price_quantity}</td>
                <td><span class="price">￥{if $t.price_sku}{dr_sku_price($t.price_sku, 2, ' ~ ')}{else}{number_format($t.price, 2)}{/if}</span>元</td>
            </tr>
            {if $t.price_sku}
            <?php $price_sku = dr_string2array($t.price_sku);?>
            {loop $price_sku.value $key $v}
            <?php list($sku)=dr_sku_name($key, $price_sku, 1);?>
            <tr class="odd gradeX">
                <td class="myselect">
                    {if $more}
                    <label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
                        <input type="checkbox" class="checkboxes" name="cid[]" value="{$t.id}-{$key}" />
                        <span></span>
                    </label>
                    {else}
                    <label class="mt-radio mt-radio-outline" style="margin-left: 5px;">
                        <input type="radio"  name="cid" value="{$t.id}-{$key}" />
                        <span></span>
                    </label>
                    {/if}
                </td>
                <td>
                    {loop $sku $nn $vv}
                    <label class="label label-default" style="margin-left: 8px"> {$nn}：{$vv} </label>
                    {/loop}
                </td>
                <td>{$v.quantity}</td>
                <td><span class="price">￥{number_format($v.price, 2)}</span>元</td>
            </tr>
            {/loop}
            {/if}
            {/loop}
            </tbody>
        </table>
    </div>

</form>

{template "mfooter.html"}