<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="java.util.*" %>
<%@page import="com.blueland.bpm.manage.util.*"%>
<%@page import="com.blueland.bpm.application.model.*" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp" %>
<%
	String path = request.getContextPath();
	String basePath = request.getLocalAddr()+request.getLocalPort();
	
	List<ApplicationEntity> appMaps = (List<ApplicationEntity>)request.getSession().getAttribute("APP_MAPS");
%>
<!DOCTYPE html>
<html lang="zh">
	<head>
		<%@ include file="/commons/meta.jsp" %>
		<link rel="icon" href="${ctx }/resource/css/images/favicon.ico" type="image/x-icon">
		<title>BPMC流程中心</title>
		<script type="text/javascript" src="${ctx }/resource/js/jquery-1.8.3.min.js"></script>
		<link href="${ctx}/resource/js/plugins/loadmask/jquery.loadmask.css" rel="stylesheet" type="text/css" />
		<script type='text/javascript' src='${ctx}/resource/js/plugins/loadmask/jquery.loadmask.js'></script> 
		<script type="text/javascript">
		$(function(){		
			iframeChange("${ctx}/procDefMgr/list.do");
		});
		function ChangeApp(appId,appName){
			
			$.ajax({
			url:"${ctx}/pages/user/changeApp.do",
			type:"POST",
			data:{
			appId:appId	
			},
			dataType:"text",
			success:function(resp){
				window.location.href=window.location.href;
			}
			});
		}
		
		
       function iframeChange(srcpath){
    	   $("#main-container").mask("系统正在加载中,请稍后...");
    	   var $iFrame=$("#frmright");      
    	   $iFrame.prop("src",srcpath);    
    	   $iFrame.load(function(){
    	   	    $("#main-container").unmask();
    	   });
       }
       function flowBpm(){
           var url = "<%=MyContants.BPM_FRONT_PATH%>"+"/ebpm-bpa-front/#/";
        	   //$("#bpmUrl").val();
           $("#tabFlow a").removeClass("active");
           $("#flowBpm").addClass("active");
       	   window.open(url);
       }
       function flowBpa(){
           var url = $("#bpaUrl").val();
           $("#tabFlow a").removeClass("active");
           $("#flowBpa").addClass("active");
       	   window.open(url);
       }
       function flowMange(){
    	   $("#tabFlow a").removeClass("active");
           $("#flowMange").addClass("active");
    	   
       }
       <%-- function personalOffice(){
    	   $("#tabFlow a").removeClass("active");
           $("#personalOffice").addClass("active");
           window.open("<%=MyContants.PERSONAL_OFFICE_PATH%>");
       } --%>
		</script>
	</head>

	<body class="skin-1">
		<input type="hidden" name="bpaUrl" id="bpaUrl" value="<%=session.getAttribute("bpaUrl")%>" />
		<input type="hidden" name="bpmUrl" id="bpmUrl" value="<%=session.getAttribute("bpmUrl")%>" />
		<!-- #section:basics/navbar.layout -->
		<c:if test="${customSso != '1'}">
			<div id="navbar" class="navbar navbar-default">
				<script type="text/javascript">
					try{ace.settings.check('navbar' , 'fixed')}catch(e){}
				</script>

				<div class="navbar-container" id="navbar-container">
					<!-- #section:basics/sidebar.mobile.toggle -->
					<button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler">
						<span class="sr-only">Toggle sidebar</span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
					<!-- /section:basics/sidebar.mobile.toggle -->
					<div class="navbar-header pull-left">
						<!-- #section:basics/navbar.layout.brand -->
						<!-- <a href="#" class="navbar-brand">
                            <small>
                                <i class="fa fa-leaf"></i>
                                流程执行管理系统
                            </small>
                        </a> -->
						<img alt="BPMC流程中心" src="${ctx }/resource/css/images/bpm-logo.png" />

						<!-- /section:basics/navbar.layout.brand -->

						<!-- #section:basics/navbar.toggle -->

						<!-- /section:basics/navbar.toggle -->
					</div>
					<div class="nav-tab-box" id="tabFlow">

					</div>
					<!-- #section:basics/navbar.dropdown -->
					<div class="navbar-buttons navbar-header pull-right" role="navigation">
						<ul class="nav ace-nav">
							<!-- #section:basics/navbar.user_menu -->
							<li class="light-blue">
								<a data-toggle="dropdown" href="#" class="dropdown-toggle">
								<span class="user-info" id="appName">
									<small>请点击切换系统<br/><%=((ApplicationEntity)request.getSession(false).getAttribute("application")).getAppName() %></small>
								</span>
									<i class="ace-icon fa fa-caret-down"></i>
								</a>
								<ul id="applist" class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
									<%
										for(ApplicationEntity app : appMaps) {
											if(app.getAppId().equalsIgnoreCase((String)request.getSession(false).getAttribute("app_id"))){
												continue;
											}
									%>
									<li>
										<!-- href="${ctx }/pages/user/changeApp.do?appId=<%=app.getAppId() %>"  href="javascript:void(0);" onclick="ChangeApp('<%=app.getAppId()%>','<%=app.getAppName()%>')" -->
										<a href="javascript:void(0);"   onclick="ChangeApp('<%=app.getAppId()%>','<%=app.getAppName()%>')">
											<i class="fa fa-flag green bigger-130"></i>
											<%=app.getAppName() %>
										</a>
									</li>
									<%}%>
								</ul>
							</li>
							<li class="light-blue">
								<a data-toggle="dropdown" href="#" class="dropdown-toggle">
									<img class="nav-user-photo" src="${ctx }/resource/js/plugins/ace/avatars/avatar4.png" alt="${login_session_user.userName}" />
									<span class="user-info">
									<small>欢迎光临,</small>
									${bpm_login_session_user.userName}
								</span>

									<i class="ace-icon fa fa-caret-down"></i>
								</a>

								<ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">


									<li>
										<a href="pages/user/logout.do">
											<i class="ace-icon fa fa-power-off"></i>
											注销
										</a>
									</li>
								</ul>
							</li>

							<!-- /section:basics/navbar.user_menu -->
						</ul>
					</div>

					<!-- /section:basics/navbar.dropdown -->
				</div><!-- /.navbar-container -->
			</div>
		</c:if>

		<!-- /section:basics/navbar.layout -->
		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<!-- #section:basics/sidebar -->
			<c:if test="${customSso != '1'}">
				<div id="sidebar" class="sidebar  responsive">
					<script type="text/javascript">
						try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
					</script>

					<!--<div class="sidebar-shortcuts" id="sidebar-shortcuts">
                        <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
                            <button class="btn btn-success">
                                <i class="ace-icon fa fa-signal"></i>
                            </button>

                            <button class="btn btn-info">
                                <i class="ace-icon fa fa-pencil"></i>
                            </button>

                            <button class="btn btn-warning">
                                <i class="ace-icon fa fa-users"></i>
                            </button>

                            <button class="btn btn-danger">
                                <i class="ace-icon fa fa-cogs"></i>
                            </button>

                        </div>

                        <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
                            <span class="btn btn-success"></span>

                            <span class="btn btn-info"></span>

                            <span class="btn btn-warning"></span>

                            <span class="btn btn-danger"></span>
                        </div>
                    </div>--><!-- /.sidebar-shortcuts -->

					<!-- /.菜单 -->
					<%@ include file="menu.jsp" %>


					<!-- #section:basics/sidebar.layout.minimize -->
					<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
						<i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
					</div>

					<!-- /section:basics/sidebar.layout.minimize -->
					<script type="text/javascript">
						try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
					</script>
				</div>
			</c:if>

			
			<!-- /section:basics/sidebar -->
			<div class="main-content">
				<!-- #section:basics/content.breadcrumbs 
				<div class="breadcrumbs" id="breadcrumbs">
					<script type="text/javascript">
						try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
					</script>

					<ul class="breadcrumb">
						<li>
							<i class="ace-icon fa fa-home home-icon"></i>
							<a href="#">首页</a>
						</li>
						<li class="active">流程执行管理系统</li>
					</ul>--><!-- /.breadcrumb -->
					<!-- /section:basics/content.searchbox -->
					<!-- 
				</div>-->
				<!-- /section:basics/content.breadcrumbs -->
				<div class="page-content" style="padding: 2px 2px 24px;">
					
					<div id="iframeDiv" class="page-content-area">
					
					
					<IFRAME  width="100%" height="980px" frameBorder=0 id=frmright name=frmright src=""  allowTransparency="true"></IFRAME>
					
				   </div>
				</div><!-- /.page-content -->
			</div><!-- /.main-content -->

			<!-- <div class="footer">
				<div class="footer-inner">
					#section:basics/footer
					<div class="footer-content">
						<span class="bigger-120">
							BPMC流程平台 &copy; 2014-2114
						</span>

					</div>

					/section:basics/footer
				</div>
			</div> -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->

	</body>
</html>
