<%@ 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="apiDoc.do">新版接口</a></li>
<%--                    <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('upload_xls','上传xls','<%=request.getContextPath() %>/admin/upload.jsp')">上传xls</a></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;">
        </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>
