<%@ page import="com.sys.model.SysUser" %>
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page isELIgnored="false" %>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<link href="<%=request.getContextPath() %>/js/bootstrap/css/bootstrap.css" rel="stylesheet">
	<link href="<%=request.getContextPath() %>/js/bootstrap/css/bootstrap-theme.css" rel="stylesheet">
	<script src="<%=request.getContextPath() %>/js/jquery/jquery-1.11.2.js"></script>
	<script src="<%=request.getContextPath() %>/js/bootstrap/js/bootstrap.js"></script>
</head>
<body>
<div class="container-fluid">
   <!-- Static navbar -->
    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <div class="navbar-header">
                <a class="navbar-brand" href="#">
                    <img style="display: inline;height: 25px; margin: -10px 0px -8px 0;" src="<%=request.getContextPath() %>/logo.png">
                    	宠爱王国编辑系统
                </a>
            </div>
            <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li><a href="javascript:openTab('content_admin','图文视频专题管理','<%=request.getContextPath() %>/publish/list.do')">图文视频专题管理</a></li>
                    <li><a href="javascript:openTab('content_type','图文视频专题栏目管理','<%=request.getContextPath() %>/jsp/contentTypeList.jsp')">图文视频专题栏目管理</a></li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">赛事管理 <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="javascript:openTab('match_res','赛事推荐配置','<%=request.getContextPath() %>/admin/ckuMatchAdmin.jsp')">赛事推荐配置</a></li>
                            <li><a href="javascript:openTab('match_res_img','赛事配图','<%=request.getContextPath() %>/admin/ckuMatchImage.jsp')">赛事配图</a></li>
                            <li><a href="javascript:openTab('match_caipan','赛事裁判管理','<%=request.getContextPath() %>/ckuCaiPan/getList.do')">赛事裁判管理</a></li>
                            <li><a href="javascript:openTab('match_hotel','赛事酒店管理','<%=request.getContextPath() %>/ckuMatchHotel/getList.do')">赛事酒店管理</a></li>
                            <li><a href="javascript:openTab('match_venue','赛事场馆管理','<%=request.getContextPath() %>/ckuMatchVenue/getList.do')">赛事场馆管理</a></li>
                            <li><a href="javascript:openTab('match_rule','赛事规则管理','<%=request.getContextPath() %>/ckuMatchRule/getList.do')">赛事规则管理</a></li>

                        </ul>
                    </li>
                    <li><a href="javascript:openTab('live_content','视频管理','<%=request.getContextPath() %>/live/listContent.do')">视频管理</a></li>
                    <li><a href="javascript:openTab('upload_xls','上传xls','<%=request.getContextPath() %>/admin/upload.jsp')">上传xls</a></li>
                    <c:if test="${user.role==1}">
                        <li><a href="javascript:openTab('sys_user','用户管理','<%=request.getContextPath() %>/sys/listUser.do')">用户管理</a></li>
                    </c:if>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">消息管理 <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><a href="javascript:openTab('sys_message','消息管理','<%=request.getContextPath() %>/message/getList.do')">消息管理</a></li>
                            <li><a href="javascript:openTab('cab_push','手机推送管理','<%=request.getContextPath() %>/cabPush/getList.do')">手机推送管理</a></li>
                            <c:if test="${user.role==1}">
                                <li><a href="javascript:openTab('sys_sendMessage','短信群发','<%=request.getContextPath() %>/sys/message/sendMessage.jsp')">短信群发</a></li>
                            </c:if>
                        </ul>
                    </li>


                </ul>

                <ul class="nav navbar-right">
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
                                <img style="display: inline;height: 25px; margin: -10px 0px -8px 0;" src="<%=request.getContextPath() %>/ok.png"><%=((SysUser)request.getSession().getAttribute("user")).getUserName()%>
                                <span class="caret"></span></a>
                            <ul class="dropdown-menu" role="menu">
                               <%-- <li><a onclick="logout()">修改信息</a></li>--%>
                                <li><a href="<%=request.getContextPath() %>/sys/logout.do">退出登录</a></li>
                            </ul>
                        </li>
                </ul>
            </div><!--/.nav-collapse -->
        </div><!--/.container-fluid -->
    </nav>

    <ul id="myTab" class="nav nav-tabs" role="tablist">
        <li role="presentation" data-toggle="tab" class="active"><a href="#buy">主页</a></li>
    </ul>

    <div id="myTabCnt" class="tab-content">
        <div class="tab-pane active" id="buy" style="padding: 15px;">
            <ul class="list-group" style="width:300px;">
                <a class="list-group-item" href="<%=request.getContextPath() %>/admin/ckuMatchImage.jsp">赛事配图</a>
                <a class="list-group-item" href="<%=request.getContextPath() %>/admin/ckuMatchAdmin.jsp">赛事管理</a>
                <a class="list-group-item" href="<%=request.getContextPath() %>/ckuCaiPan/getList.do">赛事裁判管理</a>
                <a class="list-group-item" href="<%=request.getContextPath() %>/ckuMatchHotel/getList.do">赛事酒店管理</a>
                <a class="list-group-item" href="<%=request.getContextPath() %>/ckuMatchVenue/getList.do">赛事场馆管理</a>
                <a class="list-group-item" href="<%=request.getContextPath() %>/ckuMatchRule/getList.do">赛事规则管理</a>
                <a class="list-group-item" href="<%=request.getContextPath() %>/publish/list.do">图文视频管理</a>
                <a class="list-group-item" href="<%=request.getContextPath() %>/jsp/contentTypeList.jsp">图文视频专题栏目管理</a>
                <a class="list-group-item" href="<%=request.getContextPath() %>/admin/upload.jsp">上传xls</a>
                <a class="list-group-item" href="<%=request.getContextPath() %>/live/listContent.do">视频管理</a>
                <c:if test="${user.role==1}">
                    <a class="list-group-item" href="<%=request.getContextPath() %>/sys/listUser.do">用户管理</a>
                    <a class="list-group-item" href="<%=request.getContextPath() %>/sys/message/sendMessage.jsp">短信群发</a>
                    <a class="list-group-item" href="<%=request.getContextPath() %>/message/getList.do">推荐消息管理</a>
                </c:if>
            </ul>
        </div>
    </div>
</div>
</body>
<script>
   $(document).ready(function(){


        $("#myTab").on("click", "a", function(e){
            e.preventDefault();
            $(this).tab('show');
        });
        $("#myTab").on("click", "span", function (e) {
            e.preventDefault();
            var anchor = $(this).parent();
            $(anchor.attr('href')).remove();
            $(this).parent().remove();
            $("#myTab li").children('a').first().click();
        });
    });

    function openTab(tabId,tabName,url){
        var id = "__tab_"+ tabId;
            var tab = $('#'+id);
            if (tab.length > 0) {
                tab[0].click();
                return false;
            }
        $("#myTab").append('<li role="presentation" data-toggle="tab"><a id="'+id+'" href="#_cnt_'+tabId+'">'+tabName+'<span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></li>');
        $("#myTabCnt").append('<div class="tab-pane" style="padding: 15px;" id="_cnt_'+tabId+'"><iframe width="100%" height="99%" frameborder="0" src="'+url+'"></iframe></div>');
        $('#'+id).click();
    }
</script>
</html>
