⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 havemenutop.jsp

📁 培训考试系统代码
💻 JSP
字号:

<%@page language="java" %>
<%@page import = "java.util.LinkedList" %>
<%@page import = "java.util.StringTokenizer" %>

<%
String theFirID=request.getParameter("firID"); //第一级菜单的menuid
String theSecNo=request.getParameter("secNo"); //当前选择的第二级菜单所在第一级菜单所有第二级菜单中的序号
String theThrNo=request.getParameter("thrNo"); //当前选择的第三级菜单所在第二级菜单所有第三级菜单中的序号
int theSecCount=0;		//当前第一级菜单中第二级菜单的总数
int theThrCount=0;		//当前第二级菜单中第三级菜单的总数
if (request.getParameter("secCount")!=null)
{
	theSecCount=Integer.parseInt(request.getParameter("secCount"));		//接收二级目录总数
}
if (request.getParameter("thrCount")!=null)
{
	theThrCount=Integer.parseInt(request.getParameter("thrCount"));		//接收三级目录总数
}
if (theFirID!=null && theSecNo!=null && theThrNo!=null)
{
	session.setAttribute("urlPara","&"+theFirID+"&"+theSecNo+"&"+theThrNo+"&"+theSecCount+"&"+theThrCount);
}else if(session.getAttribute("urlPara")!=null)
{
	String theParaStr=(String)session.getAttribute("urlPara");
	String[] theParaArr=theParaStr.split("&");
	theFirID=theParaArr[1];
	theSecNo=theParaArr[2];
	theThrNo=theParaArr[3];
	theSecCount=Integer.parseInt(theParaArr[4]);
	theThrCount=Integer.parseInt(theParaArr[5]);
}
%>
<html>
<head>
<title>培训考试系统 </title>
<link href="/agt/public/css/gb.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>BODY {
	SCROLLBAR-FACE-COLOR: #d6efff; SCROLLBAR-HIGHLIGHT-COLOR: #9E9E9E; SCROLLBAR-SHADOW-COLOR: #9E9E9E; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #666666; SCROLLBAR-TRACK-COLOR: #d6efff; SCROLLBAR-DARKSHADOW-COLOR: #ffffff}
</STYLE>
<script type="text/javascript" language="JavaScript1.2" src="/agt/public/js/stm31.js"></script>
<SCRIPT LANGUAGE=javascript>
document.RecentMenuEvent=0; //当前菜单事件ID
document.RecentMenuID=0;    //当前操作菜单的ID
document.RecentMenuIDChild=0;  //当前子MOUSE菜单ID
</script>
<SCRIPT language=javascript>
                          
var theFirstID="";		//用于记录字符串中第一个一级菜单ID
var theFirstMenuID="";		//每次循环记录第一级菜单的ID

var theSecondMenuID="";		//每次循环记录第二级菜单的ID
var theUrl="javascript:;";
var secNo=0;	//每一个一级菜单的二级菜单循环计数
var thrNo=0;	//每一个二级菜单的三级菜单循环计数
var theSecCount=0;	//记录每个一级菜单下属二级菜单的个数
var theThrCount=0;	//记录每个二级菜单下属三级菜单的个数
var iFirstMenuCount=0;
var iMenuCount=0;
var iPrveMenuLevel=1;


for (;iMenuCount<parent.theArr.length;iMenuCount++)
{
	var secArr=new Array();
	secArr=parent.getArray(parent.theArr[iMenuCount],"|");
	

	if (secArr[3]=="1")     //第一级
	{
		iFirstMenuCount++;
		theSecCount=0;	//每次到下一个一级菜单时清空统计其下属二级菜单的计数
		secNo=0;	//每次到下一个一级菜单时清空计数
		thrNo=0;	//每次到下一个一级菜单时清空计数
		
		for (var j=iMenuCount+1;j<parent.theArr.length;j++)
		{
                if (parent.theArr[j].indexOf("|"+secArr[0])!=-1 )
                {
                        if ( parent.theArr[j].indexOf("|2|")!=-1)
        			    	theSecCount++;
                }else
                        break;
		}
		theFirstMenuID=secArr[0];

		if(secArr[0]=="<%=theFirID%>")
        {
                parent.theFirstMenuText=secArr[1];
               
                parent.iCurrentMenuId = iMenuCount;
                iCurrentSecMenuCount =theSecCount;
        }
	}else if (secArr[3]=="2")
	{
		theThrCount=0;//每次到下一个二级菜单时清空统计其下属三级菜单的计数
		secNo++;
	
		if (theSecondMenuID=="")
			theSecondMenuID=theFirstMenuID;
		for (var j=iMenuCount+1;j<parent.theArr.length;j++)
		{
			if (parent.theArr[j].indexOf("|"+secArr[0]+"|")!=-1 && parent.theArr[j].indexOf("|3|")!=-1)
				theThrCount++;
            else
                break;
		}
		theSecondMenuID=secArr[0];

	}else if(secArr[3]=="3")
	{
		thrNo++;
	}
}                         

</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('/agt/public/images/left_menu_1.jpg','/agt/public/images/left_menu_2','/agt/public/images/left_menu_11.jpg','/agt/public/images/choise_1.gif','/agt/public/images/save_2.gif','/agt/public/images/submit_2.gif','/agt/public/images/reset_2.gif');
<% if (theFirID!=null && !theSecNo.equals("0")){ %>
    changeBg('bg<%=theSecNo%>',1,0);
    <% if(theThrCount>0){	%>
	ChangeMenu('<%=theSecNo%>','<%=theSecCount%>');
	<%}%>
<% if(theThrNo!=null && !theThrNo.equals("0")){%>
    changeBg('bgg<%=theThrNo%>',1,1);
<%}%>

<%}%>
">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>
	  <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="left-bg">
        <tr>
          <td class="left-bg"><img src="/agt/public/images/space.gif"></td>
        </tr>
      </table>
	</td>
    <td width="778" valign="top">
	  <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td align="center" bgcolor="A1A1A1"></td>
          <td valign="top">
		    <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="B7D5F9">
              <tr>
                <td width="182" valign="top">
				  <table width="182" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" background="/agt/public/images/2_08.gif">
                    <tr>
                      <td valign="top">
					    <table width="100%" height="100" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                            <td height="39">
							  <table width="100%" height="39" border="0" cellpadding="0" cellspacing="0" background="/agt/public/images/2_01.gif">
                                <tr>
                                  <td valign="top">
								    <table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
                                      <tr>
                                        <td width="40%" align="center">&nbsp;</td>
                                        <td width="60%" class="14">
										<font color="#003399">
										<SCRIPT>document.write(parent.theFirstMenuText);</SCRIPT>
                                </FONT></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
                          <SCRIPT language=javascript>
                           
    var iCurrentSecMenuCount=0;
	var theSecMenuText="";		//每次循环记录第一级菜单的文本
    var theThrMenuText="";		//每次循环记录第一级菜单的文本
	var theFirID="<%=theFirID%>";
	if (theFirID!="" && theFirID!="null")
	{
		document.write("<tr>");
		document.write("	<td align='right' valign='top' background='/agt/public/images/2_08.gif'>");
		document.write("	<table width='171' height='29' border='0' cellpadding='0' cellspacing='0'>");
		var thr=0;
		var theCount=0;		//二级菜单的循环计数
		for (var i=parent.iCurrentMenuId +1;i<parent.theArr.length;i++)
		{
			var tempArr=new Array();
			tempArr=parent.theArr[i].split("|");
            if (tempArr[2]!=theFirID)  //因为已经排序了,不是 这个级菜单退出去
                break;
			theCount++;
            theThrCount=0;	//记录有多少个三级菜单
			var url=tempArr[4];
			var icon=tempArr[5];

            if(theCount==<%=theSecNo%>)
    			theSecMenuText=tempArr[1];

			for (var j=i+1;j<parent.theArr.length;j++)
			{
				var tempArray=new Array();
				tempArray=parent.theArr[j].split("|");
                // 查找出子菜单个数
				if (tempArray[2]==tempArr[0] && tempArray[3]=="3")
					theThrCount++;
				else
                    break;
			}
			document.write("<tr>");
            var theTempString="";
            if (theThrCount>0)
			{
			        iCurrentSecMenuCount=10;
					theTempString="  <td height='29' background=\"/agt/public/images/left_menu_1.jpg\" align='center' id='bg"+theCount+"' onMouseOver=\"changeBg('bg"+theCount+"',0,0);\"  onClick=\"changeBg('bg"+theCount+"',1,0); ChangeMenu("+theCount+","+iCurrentSecMenuCount+")\" onMouseOut=\"restoreBg('bg"+theCount+"',0);\">";
			}else
			{
					theTempString="  <td height='29' background=\"/agt/public/images/left_menu_1.jpg\" align='center' id='bg"+theCount+"' onMouseOver=\"changeBg('bg"+theCount+"',0,0);\"  onClick=\"changeBg('bg"+theCount+"',1,0)\"  onMouseOut=\"restoreBg('bg"+theCount+"',0);\" >";
			}
			document.write(theTempString);
			document.write("	<table width='100%' height='20' border=0 cellpadding=0 cellspacing=0>");
			document.write("	  <tr>");
			document.write("		<td width='37%' align='right'>");
			document.write("		  <table width='31' border='0' cellspacing='0' cellpadding='0'>");
			document.write("			<tr> ");
			document.write("			  <td align='center'><img src='"+icon+"' width='16' height='16'></td>");
			document.write("			</tr>");
			document.write("		  </table>");
			document.write("		</td>");
			document.write("		<td width='63%'><a href='"+parent.getUrlforAdd(url)+"firID="+theFirID+"&secNo="+theCount+"&thrNo=0&secCount="+iCurrentSecMenuCount+"&thrCount="+theThrCount+"' class='lnk'>"+tempArr[1]+"</a></td>");
			document.write("	  </tr>");
			document.write("	</table>");
			document.write("  </td>");
			document.write("</tr>");
            if (theThrCount == 0)
                 continue;

            document.write("<tr>");
			document.write("	<td align=center id='Menu"+theCount+"' style='Display:none' height=2>");
			for (var j=i+1;j<i+theThrCount+1;j++)
			{
                var theTempArray=new Array();
				theTempArray=parent.theArr[j].split("|");
				thr++;
                if(thr==<%=theThrNo%>)
                {
			        theThrMenuText=theTempArray[1];
                }
             
				document.write("<table width='100%' border='0' cellpadding='0' cellspacing='0'>");
				document.write("	<tr>");
				document.write("		<td height='25' background=\"/agt/public/images/left_menu_2.jpg\" id='bgg"+thr+"'  onmouseover=\"changeBg('bgg"+thr+"',0,1);\" onMouseOut=\"restoreBg('bgg"+thr+"',1);\">");
				document.write("			<table width='100%' height='20' border='0' cellpadding='0' cellspacing='0'>");
				document.write("				<tr>");
				document.write("					<td width='30%'>&nbsp;</td>");
				document.write("					<td width='70%' class='p12'><a href='"+parent.getUrlforAdd(theTempArray[4])+"firID="+theFirID+"&secNo="+theCount+"&thrNo="+thr+"&secCount="+iCurrentSecMenuCount+"&thrCount="+theThrCount+"' class='lnk'><font color='185A8F'>"+theTempArray[1]+"</font></a></td>");
				document.write("				</tr>");
				document.write("			</table>");
				document.write("		</td>");
				document.write("	</tr>");
				document.write("</table>");
			}
            i=i+theThrCount;
            document.write("	</td>");
	        document.write("</tr>");
		}// end For
        document.write("</table>");
		document.write("</td>");
        document.write("</tr>");
	}
</SCRIPT>


                        </table>
					  </td>
                    </tr>
                  </table>
				</td>
                <td align="center" valign="top" background="/agt/public/images/2_05.gif">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="15"><IMG SRC="/agt/public/images/2_02.gif" WIDTH=594 HEIGHT=15></td>
                    </tr>
                    <tr>
                      <td height="28"><table width="100%" height="28" border="0" cellpadding="0" cellspacing="0" background="/agt/public/images/2_03.gif">
                          <tr>
                            <td><table width="100%" height="22" border="0" cellpadding="0" cellspacing="0">
                                <tr>
                                  <td width="8%">&nbsp;</td>
                                  <td width="92%" class="p12"><script>document.write(parent.theMenuText);</script> &gt;&gt;
                                    <script>document.write(parent.theFirstMenuText);</script>
                        &gt;&gt; <script>
                        if (theThrMenuText.length > 0)
                        {
                            document.write(theSecMenuText);
                            document.write(" &gt;&gt; ");
                        }else
                        {
                            document.write("<font color='#FF0000'>");
                            document.write(theSecMenuText);
                            document.write("</font>");
                        }

                        </script>
                        <font color="#FF0000"><script>document.write(theThrMenuText);</script></font></td>
                                </tr>
                              </table></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -