<div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title"><?php echo $this->translate('选择商品'); ?></h4>
    </div>
    <div class="modal-body box-body table-responsive no-padding">
        <table class="table table-hover">
            <thead>
            <tr>
                <td colspan="5">
                    <div class="col-xs-12 form-group">
                        <div class="col-sm-8">
                            <input type="text" name="searchGoodsName" id="searchGoodsName" class="form-control input-sm" placeholder="<?php echo $this->translate('输入全部或部分商品名称'); ?>" value="<?php echo $this->searchGoodsName;?>">
                        </div>
                        <div>
                            <button type="button" class="btn btn-primary btn-sm" onclick="searchGoods();"><?php echo $this->translate('搜索'); ?></button>
                        </div>
                    </div>

                </td>
            </tr>
            <tr>
                <th width="2%"></th>
                <th width="15%"><?php echo $this->translate('商品编号'); ?></th>
                <th><?php echo $this->translate('商品名称'); ?></th>
                <th><?php echo $this->translate('商品规格'); ?></th>
                <th width="10%"><?php echo $this->translate('操作'); ?></th>
            </tr>
            </thead>
            <tbody>
            <?php if($this->goodsList) foreach ($this->goodsList as $goods) { ?>
                <tr>
                    <td><input  name="selectGoodsId[]" value="<?php echo $goods->getGoodsId(); ?>" type="checkbox" class="minimal"></td>
                    <td><?php echo $this->escapeHtml($goods->getGoodsNumber()); ?></td>
                    <td>
                        <?php if (!empty($goods->getGoodsImage())) { ?><img src="<?php echo $this->storeHelper()->goodsImage($goods->getGoodsImage()); ?>" class="img-thumbnail" style="<?php echo $this->adminHelper()->defaultGoodsImageWidth(); ?>float:left;margin-right: 3px;"><?php } ?>
                        <?php echo $this->escapeHtml($goods->getGoodsName()); ?>
                    </td>
                    <td><?php echo empty($goods->getGoodsSpec()) ? $this->translate('无') : $this->escapeHtml($goods->getGoodsSpec()); ?>
                    </td>
                    <td><button type="button" class="btn btn-primary btn-sm" onclick="addSelectGoods(<?php echo $goods->getGoodsId(); ?>);"><?php echo $this->translate('点击添加'); ?></button></td>
                </tr>
            <?php } ?>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="5">
                        <?php echo $this->paginationControl($this->goodsList,
                            'Sliding',
                            'layout/ajaxPage',
                            ['route' => 'goods', 'action' => 'ajaxGoodsSearch', 'showDivId' => 'addGoodsListBody']); ?>
                    </td>
                </tr>
            </tfoot>

        </table>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-primary btn-sm" onclick="addMoreSelectGoods();"><?php echo $this->translate('选择商品添加'); ?></button>
        <button type="button" class="btn btn-default btn-sm" data-dismiss="modal"><?php echo $this->translate('关闭'); ?></button>
    </div>
</div>