<div class="content-wrapper">

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

        <h1 class="pull-right">
            <a href="<?php echo $this->url('position', ['action'=> 'add']);?>" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> <?php echo $this->translate('添加仓位'); ?></a>
            <?php echo $this->HelpUrl('positionList'); ?>
        </h1>

    </section>

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

        <div class="row">
            <div class="col-xs-12">
                <div class="box erp-box">

                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <thead>
                            <tr class="erp-bg-thead">
                                <th>ID</th>
                                <th><?php echo $this->translate('仓位号'); ?></th>
                                <th><?php echo $this->translate('所在仓库'); ?></th>
                                <th width="18%"><?php echo $this->translate('操作'); ?></th>
                            </tr>
                            </thead>

                            <?php if($this->positions) foreach ($this->positions as $position) { ?>
                                <tr>
                                    <td><?php echo $position->getPositionId(); ?></td>
                                    <td><?php echo $this->escapeHtml($position->getPositionSn()); ?></td>
                                    <td><?php echo $this->escapeHtml($position->getWarehouse()->getWarehouseName() . ' [' . $position->getWarehouse()->getWarehouseSn() . ']'); ?></td>
                                    <td>
                                        <a href="<?php echo $this->url('position',
                                            ['action'=>'edit', 'id'=>$position->getPositionId()]); ?>"
                                           class="btn btn-xs btn-success"><i class="fa fa-pencil"></i> <?php echo $this->translate('编辑'); ?>
                                        </a>

                                        <a href="<?php echo $this->url('position', ['action'=>'delete', 'id'=>$position->getPositionId()], ['query' => ['qToken' => $this->common()->getCsrfValue()]]); ?>" onclick="return window.confirm('<?php echo $this->translate('您确实要删除该仓位吗？'); ?>');" class="btn btn-xs btn-danger">
                                            <i class="fa fa-trash"></i> <?php echo $this->translate('删除'); ?>
                                        </a>

                                    </td>
                                </tr>
                            <?php } ?>
                        </table>
                    </div>
                    <div class="box-footer clearfix">
                    <?php echo $this->paginationControl($this->positions, 'Sliding', 'layout/page', ['route' => 'position']); ?>
                    </div>
                </div>

            </div>
        </div>

    </section>
</div>