<div class="content-wrapper">

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

        <h1 class="pull-right">
            <a href="<?php echo $this->url('user-group', ['action'=> 'add']);?>" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> <?php echo $this->translate('添加客户组'); ?></a>
            <?php echo $this->HelpUrl('userGroupList'); ?>
        </h1>

    </section>

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

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

                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <thead>
                            <tr class="shop-bg-thead">
                                <th width="4%">ID</th>
                                <th><?php echo $this->translate('客户组名称'); ?></th>
                                <th width="20%"><?php echo $this->translate('等级积分范围'); ?></th>
                                <th width="10%"><?php echo $this->translate('等级积分状态'); ?></th>
                                <th width="15%"><?php echo $this->translate('操作'); ?></th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if($this->userGroup) foreach ($this->userGroup as $value) { ?>
                                <tr>
                                    <td><?php echo $value->getUserGroupId(); ?></td>
                                    <td><?php echo $this->escapeHtml($value->getUserGroupName()); ?></td>
                                    <td><?php echo $this->escapeHtml($value->getIntegralStart() . ' ~ ' . $value->getIntegralEnd()); ?></td>
                                    <td><?php echo $this->userHelper()->userGroupIntegralState($value->getIntegralState()); ?></td>
                                    <td>
                                        <a href="<?php echo $this->url('user-group',
                                            ['action'=>'edit', 'id'=>$value->getUserGroupId()]); ?>"
                                           class="btn btn-xs btn-success"><i class="fa fa-pencil"></i> <?php echo $this->translate('编辑'); ?></a>
                                        <?php if($value->getUserGroupId() > 1) { ?>
                                            <a href="javascript:;" onclick="deleteConfirm('<?php echo $this->translate('您确实要删除该客户组吗?'); ?>', '<?php echo $this->url('user-group', ['action'=>'delete', 'id'=>$value->getUserGroupId()], ['query' => ['qToken' => $this->adminHelper()->getCsrfValue()]]); ?>');" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i> <?php echo $this->translate('删除'); ?></a>
                                        <?php } ?>
                                    </td>
                                </tr>
                            <?php } ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

    </section>
</div>