<div class="content-wrapper">

    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>
        <h1 class="pull-right">
            <a href="<?php echo $this->url('goods-brand', ['action'=> 'add']);?>" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> <?php echo $this->translate('添加品牌'); ?></a>
            <?php echo $this->HelpUrl('goodsBrandList'); ?>
        </h1>
    </section>

    <section class="content">
        <?php echo $this->partial('layout/messages'); ?>

        <div class="row">
            <div class="col-xs-12">
                <form method="post" action="<?php echo $this->url('goods-brand', ['action' => 'updateAllSort']);?>" name="edit-all-form" id="edit-all-form">
                <div class="box shop-box">
                    <div class="box-body table-responsive no-padding">
                        <table class="table shop-table table-hover">
                            <thead>
                            <tr class="shop-bg-thead">
                                <th width="20%"><?php echo $this->translate('商品品牌(品牌ID)'); ?></th>
                                <th width="5%"><?php echo $this->translate('品牌图片'); ?></th>
                                <th width="5%"><?php echo $this->translate('商品数量'); ?></th>
                                <th width="5%"><?php echo $this->translate('排序'); ?></th>
                                <th width="5%"><?php echo $this->translate('操作'); ?></th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if($this->brandList) foreach ($this->brandList as $value) { ?>
                                <tr>
                                    <td><?php echo $this->escapeHtml($value[0]->getbrandName()) . ' (ID：'.$value[0]->getBrandId().')'; ?></td>
                                    <td>
                                        <?php if(!empty($value[0]->getBrandLogo())) { ?>
                                            <img src="<?php echo $this->basePath($value[0]->getBrandLogo()); ?>" border="0" width="80" height="30">
                                        <?php } ?>
                                    </td>
                                    <td><?php echo $value['goodsNum']; ?></td>
                                    <td><input type="number" name="brandSort[<?php echo $value[0]->getBrandId(); ?>]" value="<?php echo $this->escapeHtml($value[0]->getBrandSort()); ?>" class="form-control input-sm"></td>
                                    <td>
                                        <a href="<?php echo $this->url('goods-brand',
                                            ['action'=>'edit', 'id'=>$value[0]->getBrandId()]); ?>"
                                           class="btn btn-xs btn-success"><i class="fa fa-pencil"></i> <?php echo $this->translate('编辑'); ?></a>

                                        <a href="javascript:;" onclick="deleteConfirm('<?php echo $this->translate('您确实要删除该品牌吗?'); ?>', '<?php echo $this->url('goods-brand', ['action'=>'delete', 'id'=>$value[0]->getBrandId()], ['query' => ['qToken' => $this->adminHelper()->getCsrfValue()]]); ?>');" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i> <?php echo $this->translate('删除'); ?></a>
                                    </td>
                                </tr>
                            <?php } ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="box-footer clearfix">
                        <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-check"></i> <?php echo $this->translate('更新'); ?></button>
                    </div>
                </div>
                </form>
            </div>
        </div>

    </section>
</div>