<div class="content-wrapper">

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

        <h1 class="pull-right">
            <a href="<?php echo $this->url('unit', ['action'=> 'add']);?>" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> <?php echo $this->translate('添加计量单位'); ?></a>
            <?php echo $this->HelpUrl('unitList'); ?>
        </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->unitList) foreach ($this->unitList as $unit) { ?>
                                <tr>
                                    <td><?php echo $unit->getUnitId(); ?></td>
                                    <td><?php echo $this->escapeHtml($unit->getUnitName()); ?></td>
                                    <td><?php echo $this->escapeHtml($unit->getUnitSort()); ?></td>
                                    <td>
                                        <a href="<?php echo $this->url('unit',
                                            ['action'=>'edit', 'id'=>$unit->getUnitId()]); ?>"
                                           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('unit', ['action'=>'delete', 'id'=>$unit->getUnitId()], ['query' => ['qToken' => $this->common()->getCsrfValue()]]); ?>');" class="btn btn-xs btn-danger">
                                            <i class="fa fa-trash"></i> <?php echo $this->translate('删除'); ?>
                                        </a>

                                    </td>
                                </tr>
                            <?php } ?>
                        </table>
                    </div>

                </div>

            </div>
        </div>

    </section>
</div>