index.php
3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
use yii\helpers\Url;
use app\ht\widgets\LinkPager;
$this->title = '角色管理';
$this->params['breadcrumbs'][] = '系统管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="panel panel-default">
<div class="panel-body">
<form action="" method="get" class="filter-form">
<table width="100%">
<thead>
<tr>
<th style="width:10%"></th>
<th style="width:40%"></th>
<th style="width:50%"></th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="btn btn-success" href="<?=Url::toRoute("/system/role/create")?>"><i class="glyphicon glyphicon-plus"></i> 添加角色</a></td>
<td> <input type="text" class="form-control" name="keyword" value="<?= $get['keyword'] ?>" placeholder="输入角色名称" style="width:95%"></td>
<td>
<button type="submit" class="btn btn-primary">搜索</button>
<a href="<?php echo Url::toRoute('/system/role/index'); ?>" class="btn btn-default">重置</a>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<?php if (!empty($roles)) : ?>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th style="width:10%;">ID</th>
<th style="width:10%;">角色名称</th>
<th style="width:10%;">描述</th>
<th style="width:50%;">拥有权限</th>
<th style="width:20%;">操作</th>
</tr>
</thead>
<tbody>
<?php foreach ($roles as $k => $role) : ?>
<tr>
<td><?= $role['id'] ?></td>
<td><?= $role['name'] ?></td>
<td><?= $role['description'] ?></td>
<td><?= $role['perms'] ?></td>
<td>
<a href="<?php echo Url::toRoute(['/system/role/assign-permission', 'id' => $role['id']]) ?>">分配权限</a> |
<a href="<?php echo Url::toRoute(['/system/role/update', 'id' => $role['id']]) ?>">编辑</a> |
<a onclick="confirmRedirect('<?= Url::toRoute(['/system/role/delete', 'id' => $role['id']]) ?>')" title="删除" href="javascript:void(0)">删除</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else : ?>
<p class="text-center">
没有找到数据
</p>
<?php endif; ?>
</div>
<div class="panel-footer">
<div class="hqy-panel-pager">
<?= LinkPager::widget([
'pagination' => $pages,
]); ?>
<div class="clearfix"></div>
</div>
</div>
</div>