<?php
include_once("htui_header.php");

//一级分类
$sql   = "select * from {$tablepre}treemenu where category_parentid=0 and category_status=1 order by category_order asc"; 
$cate1 = $db->get_all($sql);

$sql ="select * from {$tablepre}scuser where ID='".$_SESSION["a_uid"]."'";
$group_id = $db->get_row($sql);

$main_iframe="home.php";
?>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>后台管理中心_<?php echo $site_name;?></title>
	<link href="../css/htstyle.css" rel="stylesheet">
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/theme.css" rel="stylesheet">
    <link href="../css/fonts.css" rel="stylesheet">
    <script src="../js/jquery.min.js"></script>
    <script src="../js/bootstrap.js"></script>
    <script src="../js/jquery.cookie.js"></script>
    <script src="../js/framework.js"></script>
  </head>
  
  <body class="theme-blue-gradient" style="overflow: hidden; ">
    <div id="theme-wrapper">

      <header class="navbar" id="header-navbar">
        <div class="container" style="padding-right: 0px;">

          <a class="navbar-brand" id="logo" href="#">后台管理中心</a>
            <div>
              <ul class="nav navbar-nav pull-left">
                <li>
                  <a id="make-small-nav" title="收起菜单">
					<div class="ftdms-aside-toggler">
                      <span class="ftdms-toggler-bar"></span>
                      <span class="ftdms-toggler-bar"></span>
                      <span class="ftdms-toggler-bar"></span>
                    </div>
                  </a>
                </li>
              </ul>
            </div>

            <div class="pull-right" id="header-nav">
			  <ul class="user-nav">
                 <li style="list-style:none;margin-top:5px;">
                 <a href="javascript:void(0)" data-toggle="dropdown">
			     <img class="img-qrcode img-qrcode-46" src="../images/sjui.png" alt="用户头像" /><span> <?php echo $_SESSION["admin_user"];?> <span class="caret"></span></span>
                 </a>
                 <ul class="dropdown-menu dropdown-menu-right">
                   <li> <a class="submenuitem" href="edit_user.php?id=<?php echo $_SESSION["a_uid"];?>" data-id="rofile" data-index="100"><i class="ftsucai-58"></i> 个人信息</a> </li>
                   <li> <a class="submenuitem" href="edit_pwd.php" data-id="linkpwd" data-index="101"><i class="ftsucai-edit-2"></i> 修改密码</a> </li>
                   <li> <a  class="submenuitem" href="clearcache.php" data-id="cache" data-index="102"><i class="ftsucai-del-2"></i> 清空缓存</a></li>
                   <li class="divider"></li>
                   <li><a href="logout.php"><i class="ftsucai-exit2"></i> 退出登录</a> </li>
                 </ul>
                 </li>
              </ul>
            </div>

        </div>
      </header>

      <div class="container" id="page-wrapper">
        <div class="row">
          <div id="nav-col">
                <div class="navbar-collapse navbar-ex1-collapse" id="sidebar-nav">
                  <ul class="nav nav-pills nav-stacked">
                    <li>
                      <a class="dropdown-toggle" href="#" data-id="a1">
                        <i class="ft ftsucai-82"></i>
                        <span>数据看板首页</span>
                        <i class="ft ftsucai-139 drop-icon"></i>
                      </a>
                    </li>
<?php
    
	foreach ($cate1 as $k1 => $v1){
	  $sql="select * from {$tablepre}treemenu where category_parentid='".$v1['category_id']."' and category_status=1 order by category_order asc"; 
	  $cate2 = $db->get_all($sql);
	  $style='';
	  if ($v1['category_shrink']==1){
	     $style='style="display: block;"';
	  }
?>
                    <li>
                      <a class="dropdown-toggle" href="#" data-id="a2">
                        <i class="ft <?php echo $v1['category_icon'];?>"></i>
                        <span><?php echo $v1['category_name'];?></span>
                        <i class="ft ftsucai-139 drop-icon"></i>
                      </a>
                      <ul class="submenu">
		  <?php 
	      foreach ($cate2 as $k2 => $v2){
	           if (check_permission($_SESSION["a_uid"],$v2['category_url'],0)===false){
                   continue;
			   }
          ?>
                        <li>
                          <a class="submenuitem" href="<?php echo $v2['category_url'];?>" data-id="link<?php echo $v2['category_id'];?>" data-index="<?php echo $v2['category_id'];?>"><?php echo $v2['category_name'];?></a>
						</li>
		  <?php 
          }
          ?>
                      </ul>
                    </li>
<?php
	}  
?>

					<!--
                    <li>
                      <a class="dropdown-toggle" href="#" data-id="a3">
                        <i class="ft ftsucai-edit-2"></i>
                        <span>权限管理</span>
                        <i class="ft ftsucai-139 drop-icon"></i>
                      </a>
                      <ul class="submenu">
                        <li>
                          <a class="submenuitem" href="forms_elements.html" data-id="link21" data-index="21">基本元素</a>
						</li>
						<li>
                          <a class="submenuitem" href="forms_radio.html" data-id="link22" data-index="22">单选框</a>
						</li>
						<li>
                          <a class="submenuitem" href="forms_checkbox.html" data-id="link23" data-index="23">复选框</a>
						</li>
						<li>
                          <a class="submenuitem" href="forms_switch.html" data-id="link24" data-index="24">开关</a>
						</li>
                      </ul>
                    </li>
					-->
                  </ul>
              </div>

          </div>
		  <!--右侧内容部分开始-->
          <div id="content-wrapper">
            <div class="content-tabs" style="height:44px;border-bottom:2px solid #f0f0f0;">
              <button class="roll-nav roll-left tabLeft">
                <i class="ft ftsucai-backward2"></i>
              </button>
              <nav class="page-tabs menuTabs">
                <div class="page-tabs-content" style="margin-left: 0px;">
                  <a class="menuTab active" href="javascript:;" data-id="<?php echo $main_iframe;?>">数据看板首页</a></div>
              </nav>
              <button class="roll-nav roll-right tabRight">
                <i class="ft ftsucai-forward3"></i>
              </button>
              <div class="btn-group roll-nav roll-right">
                <button class="dropdown tabClose" data-toggle="dropdown">页签操作
                  <i class="ft caret" style="padding-top: 3px;"></i>
				</button>
                <ul class="dropdown-menu dropdown-menu-right">
                  <li>
                    <a class="tabReload" href="javascript:void();"><i class="ft ftsucai-spinner3"></i>刷新当前页面</a></li>
                  <li>
                    <a class="tabCloseCurrent" href="javascript:void();"><i class="ft ftsucai-close-3"></i>关闭当前页面</a></li>
                  <li>
                    <a class="tabCloseAll" href="javascript:void();"><i class="ft ftsucai-77"></i>关闭全部页面</a></li>
                  <li>
                    <a class="tabCloseOther" href="javascript:void();"><i class="ft ftsucai-120"></i>除此之外全关</a></li>
                </ul>
              </div>
            </div>
            <div class="content-iframe" style="background-color: #f9f9f9;">
              <div class="mainContent" id="content-main" style="margin: 0px; padding: 0px; height: 1050px;">
				<iframe width="100%" height="100%" class="main_iframe" id="default" src="<?php echo $main_iframe;?>" frameborder="0" data-id="<?php echo $main_iframe;?>"></iframe>
              </div>
            </div>
          </div>
		  <!--右侧内容部分结束-->
        </div>
      </div>
    </div>
    <div id="loadingPage" style="display: none;">
      <div class="loading-shade"></div>
      <div class="loading-content" onClick="$.loading(false)">数据加载中，请稍后…</div>
	</div>
    <script src="../js/index.js"></script>
    <script src="../js/indextab.js"></script>
    <script src="../js/pace.min.js"></script>
  </body>

</html>