permission.php 2.84 KB
<?php
use yii\web\View;
use yii\helpers\Html;

$this->title = $this->params['main_title'].'-'.$this->params['sub_title'];
?>

<div class="col-md-6">
    <form id="form" method="POST" action="">
        <div class="panel panel-default">
            <div class="panel-body">
                    <div class="row">
                        <div class="form-group">
                            <div class="col-sm-4">
                                <input type="text" name="name" class="form-control" required="required" placeholder="权限标签">
                            </div>
                            <div class="col-sm-5">
                                <input type="text" name="description" class="form-control" required="required" placeholder="描述">
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-3">
                                <button class="btn btn-primary mr5" id="upload_button">添加</button>
                            </div>
                        </div>
                    </div><!-- row -->
            </div><!-- panel-body -->
        </div><!-- panel -->
    </form>
</div>

<div class="row">
    <div class="col-md-12">
        <div class="table-responsive">
            <table class="table mb30">
                <thead>
                    <tr style="white-space:nowrap">
                        <th><input type="checkbox" onclick="checkall(this)">选择</th>
                        <th>权限标签</th>
                        <th>描述</th>
                        <th>添加时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($list as $model):?>
                    <tr data-stock="1" data-source="1" data-status="2" data-id="5011880">
                        <td><input type="checkbox" value="<?=$model->name?>" name="room[]"></td>
                        <td><?=$model->name?></td>
                        <td><?=$model->description?></td>
                        <td style="white-space:nowrap"><?=date('Y-m-d H:i:s',$model->createdAt)?></td>
                        <td>
                            <?php if ($model->name != 'index/index'):?>
                            <a href="/admin/permissionedit/?name=<?=$model->name?>" class="btn btn-default btn-white">编辑</a>
                            <a onclick="return confirm('删除用户组?')" href="/admin/operate/?target=permission&type=del&name=<?=$model->name?>" class="btn btn-danger btn-metro">删除</a>
                            <?php endif;?>
                        </td>
                    </tr>
                    <?php endforeach;?>
                </tbody>
            </table>
        </div>
        <!-- table-responsive -->
    </div>
    <!-- col-md-12 -->
</div>