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

📄 modmenuqx.jsp

📁 “JSP数据库项目案例导航”一书从第一章到第十一章各章实例的源程序文件以及数据库文件。 注意: 1. 本书中的案例提供的数据库环境不同
💻 JSP
📖 第 1 页 / 共 4 页
字号:


				////////////////////////////////////////////////////////////////////////////////////////////////////
				for(int i=0;i<5;i++)
				{
					if(!qx_checkid[i].equals(""))
					{
						//sf +"_"+wt+"_"+ dxbh +"_"+ cz;
						//System.out.println("qx_checkid=prefy:"+qx_checkid[i]);						
						//System.out.println("yyyy:"+yyyy);
						//System.out.println("temp_id=midden:"+temp_id);		

						//qx_checkid[i] = qx_checkid[i].substring(0,4) + temp_id + qx_checkid[i].substring((qx_checkid[i]).length()-2);
						//System.out.println("qx_checkid=modified:"+qx_checkid[i]);
						//bon = makenew.hasSuchData(strPersonNo,temp_id,state,String.valueOf(i),"1");						
						//if(state.equals("1"))	bon = makenew.hasSuchData(strPersonNo,temp_id,state,"","1");
						out.print("<input type='checkbox' id='"+qx_checkid[i]+"' name='selectmenu' value='");

						String ss1 = qx_checkid[i].substring(0,1);
//System.out.println("ss1 :"+ss1);
						String ss2 = qx_checkid[i].substring((qx_checkid[i]).length()-1);
						bon = personqx[Integer.parseInt(id1)][Integer.parseInt(temp_id2)][0][Integer.parseInt(ss1)][Integer.parseInt(ss2)];	
						if(bon!=-1) out.print(bon+"' style='color: #66FF66;border-style: double; border-color: #6699FF' checked>");
						else out.print("' style='color: #66FF66;border-style: double; border-color: #6699FF'>");
						
						
						if(ss1.equals("2"))//管理员
							out.print("<font color='blue'>"+QXtitle[Integer.parseInt(ss2)]+"</font>&nbsp;&nbsp;");
						else
							out.print("<font color='blue'>"+QXtitle[4]+"</font>&nbsp;&nbsp;");
					}
				}
				if(sfstate==2 && state==2)//没有录入员的身份,但有管理员的身份
				{
					String lrcheckid = "1_1_"+temp_id+"_0";//sf +"_"+wt+"_"+ dxbh +"_"+ cz;
					int lrischecked = personqx[Integer.parseInt(id1)][Integer.parseInt(temp_id2)][0][1][0];
					out.print("<input type='checkbox' id='"+lrcheckid+"' name='selectmenu' value='");
					if(lrischecked!=-1) out.print(lrischecked+"' style='color: #66FF66;border-style: double; border-color: #6699FF' checked>");
					else				out.print("' style='color: #66FF66;border-style: double; border-color: #6699FF'>");
					out.print("<font color='blue'>"+QXtitle[4]+"</font>&nbsp;&nbsp;");
				}

				
				////////////////////////////////////////////////////////////////////////////////////////////////


			
				out.println("<div style='display:none' id='"+radioid+"'><table border='0' cellpadding='0' style='border-collapse: collapse; color:#FFFFFF' width='100%' height='18' bgcolor='#ffffff'>");
				
				//三级
				sql = " select distinct menu3,id3,id "
					+ "   from menu "
					+ "  where id1=" + id1
					+ "    and id2=" + temp_id2
					+ "    and id3<>0 "
					+"   order by id3";
				ResultSet rsid3 = docBean.QuerySQL(sql);
				while(rsid3.next())
				{
					temp_id = ds.toString(rsid3.getString("id"));
					String temp_id3 = ds.toString(rsid3.getString("id3"));
					String temp_memu3 = ds.toString(rsid3.getString("menu3"));

					menuhrachyname = menu1 +"\\\\"+ temp_menu2 +"\\\\"+ temp_memu3;
						
					out.println("<tr bgcolor='#ffffff' height='22'><td width='12%'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");



					//////////////////////////////////////////////////////////////////////////////////////////					
					for(int i=0;i<5;i++)//修改qx_checkid[i]的BMBH	
					{
						if(!qx_checkid[i].equals(""))					
							qx_checkid[i] = qx_checkid[i].substring(0,4) + temp_id + qx_checkid[i].substring((qx_checkid[i]).length()-2);
					}												

					String selmenu00id3 = ""; //将 selectmenu00 的 id 设为 selectmenu 的 id 的集合,用 E 连接
					for(int i=0;i<5;i++)
					{
						if(!qx_checkid[i].equals(""))						
							selmenu00id3 = selmenu00id3 + qx_checkid[i] + "E";
					}	
					if(sfstate==2 && state==2) selmenu00id3 = selmenu00id3 + "1_1_"+temp_id+"_0" + "E";
					out.print("<input type='checkbox' name='selectmenu00' id='"+selmenu00id3+"' value='' onclick='allChecked(\""+selmenu00id3+"\")'>");
					/////////////////////////////////////////////////////////////////////////////////////////////



					out.println("<font color='blue'>"+temp_memu3+"</font>");



					///////////////////////////////////////////////////////////////////////////////
					for(int i=0;i<5;i++)
					{
						if(!qx_checkid[i].equals(""))
						{
							out.print("<input type='checkbox' id='"+qx_checkid[i]+"' name='selectmenu' value='");
							
							String ss1 = qx_checkid[i].substring(0,1);
//System.out.println("ss1 :"+ss1);
							String ss2 = qx_checkid[i].substring((qx_checkid[i]).length()-1);
							bon = personqx[Integer.parseInt(id1)][Integer.parseInt(temp_id2)][Integer.parseInt(temp_id3)][Integer.parseInt(ss1)][Integer.parseInt(ss2)];	
							if(bon!=-1) out.print(bon+"' style='color: #66FF66;border-style: double; border-color: #6699FF' checked>");
							else out.print("' style='color: #66FF66;border-style: double; border-color: #6699FF'>");								
							
							if(ss1.equals("2"))//管理员
								out.print("<font color='blue'>"+QXtitle[Integer.parseInt(ss2)]+"</font>&nbsp;&nbsp;");
							else
								out.print("<font color='blue'>"+QXtitle[4]+"</font>&nbsp;&nbsp;");
						}
					}
					if(sfstate==2 && state==2)//没有录入员的身份,但有管理员的身份
					{
						String lrcheckid = "1_1_"+temp_id+"_0";//sf +"_"+wt+"_"+ dxbh +"_"+ cz;
						int lrischecked = personqx[Integer.parseInt(id1)][Integer.parseInt(temp_id2)][Integer.parseInt(temp_id3)][1][0];
						out.print("<input type='checkbox' id='"+lrcheckid+"' name='selectmenu' value='");
						if(lrischecked!=-1) out.print(lrischecked+"' style='color: #66FF66;border-style: double; border-color: #6699FF' checked>");
						else				out.print("' style='color: #66FF66;border-style: double; border-color: #6699FF'>");
						out.print("<font color='blue'>"+QXtitle[4]+"</font>&nbsp;&nbsp;");
					}
					///////////////////////////////////////////////////////////////////////////////




					out.println("</td></tr>");//三级
				}

				if(rsid3!=null) {stmt = rsid3.getStatement(); rsid3.close();}
			if(stmt!=null) stmt.close();
				
				out.println("</table></div></td></tr>");//二级
			}
			if(rsid2!=null) {stmt = rsid2.getStatement(); rsid2.close();}
			if(stmt!=null) stmt.close();
				
		}

		if(Integer.parseInt(id2)!=0 && Integer.parseInt(id3)==0)//说明zz_fbxwb.dxbh是二级菜单id,则将此小树全部展开
		{
			radioid = id1 + "_" + id2 + "_0";
			out.println("<tr bgcolor='#ffffff' height='22'><td width='12%'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");




			////////////////////////////////////////////////////////////////////////////////////////////////////*
			String selmenu00id2 = "";//将 selectmenu00 的 id 设为 selectmenu 的 id 的集合,用 E 连接
			for(int i=0;i<5;i++)
			{
				if(!qx_checkid[i].equals(""))						
					selmenu00id2 = selmenu00id2 + qx_checkid[i] + "E";
			}
			if(sfstate==2 && state==2) selmenu00id2 = selmenu00id2 + "1_1_"+dxbh+"_0" + "E";
			out.print("<input type='checkbox' name='selectmenu00' id='"+selmenu00id2+"' value='' onclick='allChecked(\""+selmenu00id2+"\")'>");
			////////////////////////////////////////////////////////////////////////////////////////////////////



			out.println("<q class='mout' style='cursor:hand' onclick='Expand(\""+radioid+"\")'><font color='blue'>"+menu2+"</font></q>");//二级



			////////////////////////////////////////////////////////////////////////////////////////////////
			for(int i=0;i<5;i++)
			{
				if(!qx_checkid[i].equals(""))
				{
					out.print("<input type='checkbox' id='"+qx_checkid[i]+"' name='selectmenu' value='");
					if(ischecked[i]!=-1) out.print(ischecked[i]+"' style='color: #66FF66;border-style: double; border-color: #6699FF' checked>");
					else out.print("' style='color: #66FF66;border-style: double; border-color: #6699FF'>");
					String ss1 = qx_checkid[i].substring(0,1);
					String ss2 = qx_checkid[i].substring((qx_checkid[i]).length()-1);
					if(ss1.equals("2"))//管理员
						out.print("<font color='blue'>"+QXtitle[Integer.parseInt(ss2)]+"</font>&nbsp;&nbsp;");
					else
						out.print("<font color='blue'>"+QXtitle[4]+"</font>&nbsp;&nbsp;");
				}
			}
			if(sfstate==2 && state==2)//没有录入员的身份,但有管理员的身份
			{
				String lrcheckid = "1_1_"+dxbh+"_0";//sf +"_"+wt+"_"+ dxbh +"_"+ cz;
				int lrischecked = personqx[Integer.parseInt(id1)][Integer.parseInt(id2)][0][1][0];
				out.print("<input type='checkbox' id='"+lrcheckid+"' name='selectmenu' value='");
				if(lrischecked!=-1) out.print(lrischecked+"' style='color: #66FF66;border-style: double; border-color: #6699FF' checked>");
				else				out.print("' style='color: #66FF66;border-style: double; border-color: #6699FF'>");
				out.print("<font color='blue'>"+QXtitle[4]+"</font>&nbsp;&nbsp;");
			}			
			////////////////////////////////////////////////////////////////////////////////////////////////




			out.println("<div style='display:none' id='"+radioid+"'><table border='0' cellpadding='0' style='border-collapse: collapse; color:#FFFFFF' width='100%' height='18' bgcolor='#ffffff'>");

			//三级
			sql = " select distinct menu3,id3,id "
				+ "   from menu "
				+ "  where id1=" + id1
				+ "    and id2=" + id2
				+ "    and id3<>0 "
				+ "  order by id3";
			ResultSet rsid3 = docBean.QuerySQL(sql);
			while(rsid3.next())
			{
				temp_id = ds.toString(rsid3.getString("id")); 
				String temp_id3 = ds.toString(rsid3.getString("id3"));
				String temp_menu3 = ds.toString(rsid3.getString("menu3"));

				menuhrachyname = menu1 +"\\\\"+ menu2 +"\\\\"+ temp_menu3;

				out.println("<tr bgcolor='#ffffff' height='22'><td width='12%'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");



				///////////////////////////////////////////////////////////////////////////////////////////				
				for(int i=0;i<5;i++)//修改qx_checkid[i]的BMBH
				{
					if(!qx_checkid[i].equals(""))						
						qx_checkid[i] = qx_checkid[i].substring(0,4) + temp_id + qx_checkid[i].substring((qx_checkid[i]).length()-2);
				}

				String selmenu00id3 = ""; //将 selectmenu00 的 id 设为 selectmenu 的 id 的集合,用 E 连接
				for(int i=0;i<5;i++)
				{
					if(!qx_checkid[i].equals(""))						
						selmenu00id3 = selmenu00id3 + qx_checkid[i] + "E";
				}		
				if(sfstate==2 && state==2) selmenu00id3 = selmenu00id3 + "1_1_"+temp_id+"_0" + "E";
				out.print("<input type='checkbox' name='selectmenu00' id='"+selmenu00id3+"' value='' onclick='allChecked(\""+selmenu00id3+"\")'>");
				/////////////////////////////////////////////////////////////////////////////////



				out.println("<font color='blue'>"+temp_menu3+"</font>");




				///////////////////////////////////////////////////////////////////////////////
				for(int i=0;i<5;i++)
				{
					if(!qx_checkid[i].equals(""))
					{
						out.print("<input type='checkbox' id='"+qx_checkid[i]+"' name='selectmenu' value='");
						
						String ss1 = qx_checkid[i].substring(0,1);
//System.out.println("ss1 :"+ss1);//Integer.parseInt(ss1)
						String ss2 = qx_checkid[i].substring((qx_checkid[i]).length()-1);
						bon = personqx[Integer.parseInt(id1)][Integer.parseInt(id2)][Integer.parseInt(temp_id3)][Integer.parseInt(ss1)][Integer.parseInt(ss2)];	
						if(bon!=-1) out.print(bon+"' style='color: #66FF66;border-style: double; border-color: #6699FF' checked>");
						else out.print("' style='color: #66FF66;border-style: double; border-color: #6699FF'>");
											
						if(ss1.equals("2"))//管理员
							out.print("<font color='blue'>"+QXtitle[Integer.parseInt(ss2)]+"</font>&nbsp;&nbsp;");
						else
							out.print("<font color='blue'>"+QXtitle[4]+"</font>&nbsp;&nbsp;");
					}
				}
				if(sfstate==2 && state==2)//没有录入员的身份,但有管理员的身份
				{
					String lrcheckid = "1_1_"+temp_id+"_0";//sf +"_"+wt+"_"+ dxbh +"_"+ cz;
					int lrischecked = personqx[Integer.parseInt(id1)][Integer.parseInt(id2)][Integer.parseInt(temp_id3)][1][0];
					out.print("<input type='checkbox' id='"+lrcheckid+"' name='selectmenu' value='");
					if(lrischecked!=-1) out.print(lrischecked+"' style='color: #66FF66;border-style: double; border-color: #6699FF' checked>");
					else				out.print("' style='color: #66FF66;border-style: double; border-color: #6699FF'>");
					out.print("<font color='blue'>"+QXtitle[4]+"</font>&nbsp;&nbsp;");
				}
				///////////////////////////////////////////////////////////////////////////////




				out.println("</td></tr>"); //三级
			}
			if(rsid3!=null) {stmt = rsid3.getStatement(); rsid3.close();}
			if(stmt!=null) stmt.close();
			
			out.println("</table></div></td></tr>");//二级					
		}
		
		if(Integer.parseInt(id2)!=0 && Integer.parseInt(id3)!=0)//说明zz_fbxwb.dxbh是三级菜单id
		{
			radioid = id1 + "_" + id2 + "_0";		
			out.println("<tr bgcolor='#ffffff' height='22'><td width='12%'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<q class='mout' style='cursor:hand' onclick='Expand(\""+radioid+"\")'><font color='blue'>"+menu2+"</font></q>");//二级
			out.println("<div style='display:none' id='"+radioid+"'><table border='0' cellpadding='0' style='border-collapse: collapse; color:#FFFFFF' width='100%' height='18' bgcolor='#ffffff'>");

⌨️ 快捷键说明

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