<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/9/11
  Time: 12:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.util.*" %>
<%@ page import="com.censoft.common.db.ConnectionFactory" %>
<%@ page import="com.censoft.common.base.Pub" %>
<%@ page import="com.censoft.db.DBUtil" %>
<%@ page import="com.censoft.db.Logger" %>
<%
    Pub pub = new Pub();
    String s_id = pub.trimNull((String) session.getAttribute("session_login_id"));
    if ("".equals(s_id)) {
        response.sendRedirect(request.getContextPath());
        return;
    }
    ConnectionFactory cf = new ConnectionFactory();
    Connection conn = null;
    Vector v_list_temp = null;
    String id_1 = "";
    String menu_name_1 = "";
    String menu_url_1 = "";
    try {
        conn = com.censoft.db.DBUtil.getConnection();
        StringBuffer sb = new StringBuffer();
        sb.append(" select distinct menu.* from t_book_role_menu_rel rel  ");
        sb.append(" join t_book_role role on role.id=rel.role_id ");
        sb.append(" join t_book_user_role_rel ur on ur.role_id=role.id ");
        sb.append(" join  zb_bgs_user ad on ad.id=ur.login_id ");
        sb.append(" join t_book_menu menu on menu.id=rel.menu_id ");
        sb.append(" where ad.id=?  and (menu.p_id ='' or menu.p_id is null) and (menu.sys_id='3' or menu.sys_id is null or menu.sys_id ='') order by menu.menu_order asc");
        v_list_temp = cf.doQuery(conn, sb.toString(), null, new Object[]{s_id});
        if ("admin1".equals(s_id)) {
            sb = new StringBuffer("select * from t_book_menu menu where  (menu.p_id ='' or menu.p_id is null) and (menu.sys_id='2' or menu.sys_id is null) order by  menu_order asc");
            v_list_temp = cf.doQuery(conn, sb.toString(), null, new Object[]{});
        }
        if (v_list_temp == null) {
            out.println("查询策略出错");
            return;
        }
        if (v_list_temp.size() > 0) {
            Hashtable ht = (Hashtable) v_list_temp.get(0);
            id_1 = pub.trimNull((String) ht.get("id"));
            menu_name_1 = pub.trimNull((String) ht.get("menu_name"));
            menu_url_1 = pub.trimNull((String) ht.get("menu_url"));

        }
    } catch (Exception e) {
        out.println("查询用户信息异常" + e);
        return;
    } finally {
        if (conn != null) {
            try {
                conn.close();
            } catch (Exception e) {
            }
        }
    }

%>
<style>

    .dislpayArrow {
        top: 50px;
        left: 15%;
        width:1%;
    }
    .big-page .Hui-aside{
        left: -16%;
    }

    .dislpayArrow a {
        top: 40%;
        width:100%;

    }

    .Hui-article-box {
        top: 50px;
        left: 15%;
        width: 85%;
    }

    .navbar-wrapper {
        height: 50px;
    }

    .Hui-tabNav {

        background-color: #f4f7fe;
    }

    .Hui-aside {
        top: 50px;
        height: 94%;
        width: 15%;
        background-color: #3492c6;
    }

    .Hui-article {
        top: 34px;
    }

    .big-page .Hui-article-box {
        width: 100%;

    }

    .navbar .logo {
        height: 50px;
        line-height: 50px;
    }

    body {
        background-color: #d9e4f6;
        overflow: hidden;
    }

    .navbar-fixed-top {
        background: #269ddf
    }
    .Hui-aside .menu_dropdown dt{
        border-bottom: 0;
        padding-left: 20px;

    }

    .Hui-aside .menu_dropdown dt a,.Hui-aside .menu_dropdown dd li a,.Hui-aside .menu_dropdown dt{

        color:#d8e4f6;
        font-weight: bold;
    }

    .Hui-aside .menu_dropdown dt.selected a,.Hui-aside .menu_dropdown dt.selected,.Hui-aside .menu_dropdown dd li.selected a,.Hui-aside .menu_dropdown dt:hover,.Hui-aside .menu_dropdown dd li a:hover,.Hui-aside .menu_dropdown dt a:hover{
        color:#fff;
        background-color:#70e3de;
    }
    .Hui-aside .menu_dropdown dt .Hui-iconfont{
        color:#d8e4f6;
    }

    .acrossTab li.active{
        color: #5dafe4;
    }

    .Hui-aside .menu_dropdown dd ul{
        padding:0;
    }




</style>
<header class="navbar-wrapper">
    <div class="navbar navbar-fixed-top">
        <div class="container-fluid cl">
            <a class="logo navbar-logo f-l mr-10 hidden-xs" style="font-size:15px;">
                <%--<i class="Hui-iconfont">&#xe625;</i>--%>&nbsp;值班管理系统
            </a>
            <nav id="Hui-userbar" class="nav navbar-nav navbar-userbar hidden-xs">
                <ul class="cl">
                    <li class="dropDown dropDown_hover">
                        <a href="#" class="dropDown_A">
                            <i class="Hui-iconfont">&#xe60d;</i>
                            &nbsp;<%=pub.trimNull((String) session.getAttribute("session_login_name"))%>
                            <i class="Hui-iconfont">&#xe6d5;</i></a>
                        <ul class="dropDown-menu menu radius box-shadow">
                            <li>
                                <a href="<%=request.getContextPath()%>/login_ztj.jsp">
                                    <i class="Hui-iconfont">&#xe644;</i>
                                    &nbsp;退出
                                </a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</header>
<%@include file="./leftMenu_bgs.jsp" %>
<div class="dislpayArrow hidden-xs">
    <a class="pngfix" href="javascript:void(0);" onClick="displaynavbar(this)"></a>
</div>
<section class="Hui-article-box">
    <div id="Hui-tabNav" class="Hui-tabNav hidden-xs" >
        <div class="Hui-tabNav-wp" >
            <ul id="min_title_list" class="acrossTab cl">
                <li class="active" >
                    <span title="<%=menu_name_1%>" data-href="<%=menu_url_1%>?menu_id=<%=id_1%>"><%=menu_name_1%></span>
                    <em></em>
                </li>
            </ul>
        </div>
        <div class="Hui-tabNav-more btn-group">
            <a id="js-tabNav-prev" class="btn radius btn-default size-S" href="javascript:void(0);">
                <i class="Hui-iconfont">&#xe6d4;</i>
            </a>
            <a id="js-tabNav-next" class="btn radius btn-default size-S" href="javascript:void(0);">
                <i class="Hui-iconfont">&#xe6d7;</i>
            </a>
        </div>
    </div>
    <div id="iframe_box" class="Hui-article">
        <div class="show_iframe">
            <div style="display:none" class="loading"></div>
            <%if("#".equals(menu_url_1)){%>
            <iframe scrolling="no" frameborder="0" src=""></iframe>
            <%}else{%>
            <iframe scrolling="no" frameborder="0" src="<%=menu_url_1%>?menu_id=<%=id_1%>"></iframe>
            <%}%>
        </div>
    </div>
</section>
<script>
    $(".Hui-aside").on("click","dd li",function(){
        $(".Hui-aside dd li").removeClass("selected");
        $(this).addClass("selected");
    });
</script>