<div class="content-wrapper">

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

        <h1 class="pull-right">
            <a href="<?=$this->url('unit', ['action'=> 'add']);?>" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> <?=$this->translate('添加计量单位')?></a>
            <?=$this->HelpUrl('unitList')?>
        </h1>

    </section>

    <section class="content">
        <?=$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><?=$this->translate('单位名称')?></th>
                                <th><?=$this->translate('排序')?></th>
                                <th width="18%"><?=$this->translate('操作')?></th>
                            </tr>
                            </thead>

                            <?php if($this->unitList) foreach ($this->unitList as $unit) { ?>
                                <tr>
                                    <td><?= $unit->getUnitId()?></td>
                                    <td><?= $this->escapeHtml($unit->getUnitName())?></td>
                                    <td><?= $this->escapeHtml($unit->getUnitSort())?></td>
                                    <td>
                                        <a href="<?= $this->url('unit',
                                            ['action'=>'edit', 'id'=>$unit->getUnitId()]); ?>"
                                           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('unit', ['action'=>'delete', 'id'=>$unit->getUnitId()], ['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>

            </div>
        </div>

    </section>
</div>