index.php 2.83 KB
<?php
use yii\helpers\Url;
use app\ht\widgets\LinkPager;

$this->title = '权限列表';
$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:5%"></th>
                    <th style="width:40%"></th>
                    <th style="width:20%"></th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td><a class="btn btn-primary" href="<?=Url::toRoute("/system/perm/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>&nbsp;&nbsp;
                        <a href="<?php echo Url::toRoute('/system/perm/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($perms)) : ?>
            <table class="table table-striped table-bordered">
                <thead>
                <tr>
                    <th style="width:5%;">ID</th>
                    <th style="width:20%;">权限名称</th>
                    <th style="width:55%;">路由</th>
                    <th style="width:20%;">操作</th>
                </tr>
                </thead>
                <tbody>
                <?php foreach ($perms as $perm) : ?>
                    <tr>
                        <td><?= $perm['id'] ?></td>
                        <td><?= $perm['name'] ?></td>
                        <td><?= $perm['route'] ?></td>
                        <td>
                            <a href="<?php echo Url::toRoute(['/system/perm/update', 'id' => $perm['id']])  ?>">编辑</a> &nbsp;|&nbsp;
                            <a onclick="confirmRedirect('<?= Url::toRoute(['/system/perm/delete', 'id' => $perm['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>