<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/12/012
 * Time: 9:41
 */
use yii\helpers\Url;

$data['id'] = Yii::$app->user->identity->getId();
$result = (new \frontend\models\AdminApi())->getAdminRoleByUserId($data);
$authorityList = $result['data'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>BIT System 后台管理平台</title>
    <link href="<?= STATIC_URL ?>/static/cp/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <link href="<?= STATIC_URL ?>/static/cp/css/base.css" rel="stylesheet" type="text/css" />
    <link href="<?= STATIC_URL ?>/static/cp/css/admin.css" rel="stylesheet" type="text/css" />
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <script src="<?= STATIC_URL ?>/static/cp/js/jquery-1.7.2.min.js"></script>
    <script src="<?= STATIC_URL ?>/static/cp/bootstrap/js/bootstrap.js"></script>
</head>
<body>
<div class="left-menu">
    <h3><i class="icon-th-large"></i> 管理员管理</h3>
    <ul>
        <?php if (in_array('ROLE_role', $authorityList)) { ?>
        <li><a href="<?= Url::to(['/cp/role/list']) ?>" target="mainFrame">角色管理</a></li>
        <?php } ?>
        <?php if (in_array('ROLE_admin', $authorityList)) { ?>
        <li><a href="<?= Url::to(['/cp/admin/list']) ?>" target="mainFrame">管理员管理</a></li>
        <?php } ?>
    </ul>
</div>
</body>
</html>

