<div class="content-wrapper">

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

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

    </section>

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

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

                    <form method="post" action="<?=$this->url('warehouse', ['action' => 'updateAll']);?>" name="edit-all-form" id="edit-all-form">
                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <thead>
                            <tr class="erp-bg-thead">
                                <th width="2%"><input type="checkbox" class="minimal select-all-checkbox"></th>
                                <th>ID</th>
                                <th><?=$this->translate('仓库编号')?></th>
                                <th><?=$this->translate('仓库名称')?></th>
                                <th><?=$this->translate('仓位数')?></th>
                                <th><?=$this->translate('仓库管理员')?></th>
                                <th><?=$this->translate('联系电话')?></th>
                                <th width="8%"><?=$this->translate('排序')?></th>
                                <th width="18%"><?=$this->translate('操作')?></th>
                            </tr>
                            </thead>

                            <?php if($this->warehouses) foreach ($this->warehouses as $warehouse) { ?>
                                <tr>
                                    <td><input  name="select_id[]" value="<?=$warehouse[0]->getWarehouseId()?>" type="checkbox" class="minimal"></td>
                                    <td><?=$warehouse[0]->getWarehouseId()?></td>
                                    <td><?= $this->escapeHtml($warehouse[0]->getWarehouseSn())?></td>
                                    <td><?= $this->escapeHtml($warehouse[0]->getWarehouseName())?></td>
                                    <td><?= $warehouse['number_p']?></td>
                                    <td><?=$warehouse[0]->getWarehouseContacts()?></td>
                                    <td><?=$warehouse[0]->getWarehousePhone()?></td>
                                    <td><input type="text" name="warehouse_sort[<?=$warehouse[0]->getWarehouseId()?>]" value="<?=$warehouse[0]->getWarehouseSort()?>" class="form-control input-sm"></td>
                                    <td>
                                        <a href="<?= $this->url('warehouse',
                                            ['action'=>'edit', 'id'=>$warehouse[0]->getWarehouseId()]); ?>"
                                           class="btn btn-xs btn-success"><i class="fa fa-pencil"></i> <?=$this->translate('编辑')?>
                                        </a>

                                        <a href="javascript:;" onclick="deleteConfirm('<?php echo $this->translate('您确实要删除该仓库吗？'); ?>', '<?= $this->url('warehouse', ['action'=>'delete', 'id'=>$warehouse[0]->getWarehouseId()], ['query' => ['qToken' => $this->common()->getCsrfValue()]]); ?>');" class="btn btn-xs btn-danger">
                                            <i class="fa fa-trash"></i> <?=$this->translate('删除')?>
                                        </a>

                                    </td>
                                </tr>
                            <?php } ?>
                        </table>
                    </div>
                    <div class="box-footer clearfix">
                        <input type="checkbox" class="minimal select-all-checkbox"> <?=$this->translate('全选')?>
                        <select name="editAllState">
                            <option value=""><?=$this->translate('选择状态')?></option>
                            <option value="sort"><?=$this->translate('更新排序')?></option>
                        </select>
                        <button type="submit" class="btn btn-primary btn-sm"><i class="fa fa-check"></i> <?=$this->translate('更新')?></button>

                        <?= $this->paginationControl($this->warehouses,
                            'Sliding',
                            'layout/page',
                            ['route' => 'warehouse']); ?>
                    </div>
                    </form>
                </div>

            </div>
        </div>

    </section>
</div>