<?php
@header('Content-Type: text/html; charset=UTF-8');
?>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8"/>
  <meta name="renderer" content="webkit">
  <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
  <title><?php echo $title ?></title>
  <link href="https://s4.zstatic.net/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet"/>
  <link href="https://s4.zstatic.net/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
  <link href="../assets/css/bootstrap-table.css?v=1" rel="stylesheet"/>
  <link href="../assets/css/admin-new.css?v=6" rel="stylesheet"/>
  <script src="https://s4.zstatic.net/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
  <script src="https://s4.zstatic.net/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/chart.js@3.7.0/dist/chart.min.js"></script>
</head>
<body <?php if($islogin==1) echo 'class="admin-logged-in"'; ?>>
<?php if($islogin==1){
// 获取当前页面文件名用于高亮
$current_page = basename($_SERVER['PHP_SELF'], '.php');
$current_mod = isset($_GET['mod']) ? $_GET['mod'] : '';
?>
  <!-- 顶部导航栏 -->
  <nav class="navbar navbar-fixed-top admin-topbar">
    <div class="topbar-container">
      <div class="topbar-left">
        <button type="button" class="sidebar-toggle" id="sidebarToggle" title="切换侧边栏">
          <i class="fa fa-bars"></i>
        </button>
        <a class="topbar-brand" href="./"><i class="fa fa-cloud"></i> 彩虹外链网盘</a>
      </div>
      <div class="topbar-right">
        <a href="./login.php?logout=1" class="logout-btn" onclick="return confirm('是否确定退出登录？')" title="退出登录">
          <i class="fa fa-sign-out"></i>
          <span class="logout-text">退出</span>
        </a>
      </div>
    </div>
  </nav>

  <!-- 侧边栏 -->
  <aside class="admin-sidebar" id="adminSidebar">
    <div class="sidebar-header">
      <div class="sidebar-brand">
        <i class="fa fa-cloud"></i>
        <span>管理后台</span>
      </div>
    </div>
    <nav class="sidebar-nav">
      <ul class="sidebar-menu">
        <li class="sidebar-item <?php echo checkIfActive('index');?>">
          <a href="./" class="sidebar-link">
            <i class="fa fa-home"></i>
            <span class="sidebar-text">后台首页</span>
          </a>
        </li>
        
        <li class="sidebar-item <?php echo checkIfActive('file');?>">
          <a href="./file.php" class="sidebar-link">
            <i class="fa fa-folder-open"></i>
            <span class="sidebar-text">文件管理</span>
          </a>
        </li>
        
        <li class="sidebar-item <?php echo checkIfActive('user');?>">
          <a href="./user.php" class="sidebar-link">
            <i class="fa fa-users"></i>
            <span class="sidebar-text">用户管理</span>
          </a>
        </li>
        
        <li class="sidebar-item <?php echo checkIfActive('card');?>">
          <a href="./card.php" class="sidebar-link">
            <i class="fa fa-gift"></i>
            <span class="sidebar-text">卡密管理</span>
          </a>
        </li>
        
        <li class="sidebar-item <?php echo checkIfActive('traffic');?>">
          <a href="./traffic.php" class="sidebar-link">
            <i class="fa fa-bar-chart"></i>
            <span class="sidebar-text">流量监控</span>
          </a>
        </li>
        
        <li class="sidebar-item <?php echo checkIfActive('ipban');?>">
          <a href="./ipban.php" class="sidebar-link">
            <i class="fa fa-ban"></i>
            <span class="sidebar-text">IP封禁管理</span>
          </a>
        </li>
        
        <li class="sidebar-item has-submenu <?php echo checkIfActive('set,set_stor');?>">
          <a href="javascript:void(0);" class="sidebar-link">
            <i class="fa fa-cog"></i>
            <span class="sidebar-text">系统设置</span>
            <i class="fa fa-angle-right submenu-arrow"></i>
          </a>
          <ul class="submenu">
            <li><a href="./set.php?mod=site"><i class="fa fa-globe"></i> 网站信息设置</a></li>
            <li><a href="./set.php?mod=user"><i class="fa fa-user"></i> 用户登录设置</a></li>
            <li><a href="./set.php?mod=traffic"><i class="fa fa-tachometer"></i> 配额与流量设置</a></li>
            <li><a href="./set_stor.php"><i class="fa fa-database"></i> 存储类型设置</a></li>
            <li><a href="./set_email.php"><i class="fa fa-envelope"></i> 邮箱配置</a></li>
            <li><a href="./set.php?mod=file"><i class="fa fa-upload"></i> 文件上传设置</a></li>
            <li><a href="./set.php?mod=green"><i class="fa fa-shield"></i> 图片检测设置</a></li>
            <li><a href="./set.php?mod=api"><i class="fa fa-code"></i> 上传API设置</a></li>
            <li><a href="./set.php?mod=iptype"><i class="fa fa-map-marker"></i> IP地址设置</a></li>
            <li><a href="./set.php?mod=announcement"><i class="fa fa-bullhorn"></i> 用户中心公告</a></li>
            <li><a href="./set.php?mod=account"><i class="fa fa-lock"></i> 管理账号设置</a></li>
            <li class="divider"></li>
            <li><a href="./update.php"><i class="fa fa-refresh"></i> 检查系统更新</a></li>
          </ul>
        </li>
      </ul>
    </nav>
    <div class="sidebar-footer">
      <span>彩虹外链网盘</span>
    </div>
  </aside>

  <!-- 侧边栏遮罩层（移动端） -->
  <div class="sidebar-overlay" id="sidebarOverlay"></div>

  <script src="../assets/js/admin-sidebar.js?v=1"></script>
<?php }?>
