index.php 3.85 KB
<?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">
        <div class="col-md-12" style="padding:0px 5px 10px 0px;">
            <form action="" method="get" class="filter-form">
                <table>
                    <tr>
                        <td width="5%">
                            <a href="<?php echo Url::toRoute('/system/account/create'); ?>" class="btn btn-success">新建账号</a>
                        </td>
                        <td width="1%">
                            &nbsp;
                        </td>
                        <td width="40%">
                            <div class="input-group">
                                <input type="text" class="form-control"   name="keyword"  value="<?= $get['keyword']  ?>" placeholder="输入用户名/真实姓名" style="width:300px">
                                <button type="submit" class="btn btn-primary" >搜索</button> &nbsp;&nbsp;&nbsp;
                                <a href="<?php echo Url::toRoute('/system/account/index'); ?>" class="btn btn-default">重置</a>
                            </div>
                        </td>
                        <td width="53%">&nbsp;</td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
<div class="panel panel-default">
    <div class="panel-body">
        <table class="table table-striped table-bordered">
            <thead>
            <tr>
                <th width="10%">用户名</th>
                <th width="20%">角色</th>
                <th width="15%">邮箱</th>
                <th width="10%">姓名</th>
                <th width="10%">手机</th>
                <th width="5%">是否启用</th>
                <th width="15%">操作</th>
            </tr>
            </thead>

            <tbody>
            <?php foreach ($users as $user) : ?>
                <tr>
                    <td style="padding:12px;">
                        <?= $user['username'] ?>
                    </td>
                    <td style="padding:12px;">
                        <?= $user['roles'] ?>
                    </td>
                    <td style="padding:12px;">
                        <?= $user['email'] ?>
                    </td>
                    <td style="padding:12px;">
                        <?= $user['realname'] ?>
                    </td>
                    <td style="padding:12px;">
                        <?= $user['mobile'] ?>
                    </td>
                    <td style="padding:12px;">
                        <?= $user['is_enable_label'] ?>
                    </td>
                    <td style="padding:12px;">
                        <?php if('admin' != $user['username'] ) {?><a href="<?php echo Url::toRoute(['/system/account/set-role', 'id' => $user['id']])  ?>"><span class="btn btn-success" style="padding:8px;">设置角色</span></a> &nbsp;&nbsp; <?php }?>
                        <a href="<?php echo Url::toRoute(['/system/account/update', 'id' => $user['id']])  ?>"><span class="btn btn-primary" style="padding:8px;">编辑</span></a> &nbsp;&nbsp;
                        <?php if('admin' != $user['username'] ) {?> <a href="<?php echo Url::toRoute(['/system/account/enable', 'id' => $user['id']])  ?>"><span class="btn btn-danger" style="padding:8px;"><?php echo $user['is_enable_opt']  ?></span></a><?php }?>
                    </td>
                </tr>
            <?php endforeach; ?>
            </tbody>
        </table>
    </div>
    <div class="panel-footer">
        <div class="hqy-panel-pager">
            <?= LinkPager::widget([
                'pagination' => $pages,
            ]); ?>
            <div class="clearfix"></div>
        </div>
    </div>
</div>