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

📄 stepmemleft.jsp

📁 “JSP数据库项目案例导航”一书从第一章到第十一章各章实例的源程序文件以及数据库文件。 注意: 1. 本书中的案例提供的数据库环境不同
💻 JSP
字号:
<%@page language="java" contentType="text/html;charset=GBK"%>
<%@page import="java.util.*,java.text.*,com.util.DealString"%>
<jsp:useBean id="myBean" scope="page" class="com.db.ParentBean"/>
<%

String count = (String)request.getParameter("count");
String showdepartment = (String)request.getParameter("showdepartment");
String txt_rybh = (String)request.getParameter("txt_rybh");
String txt_rymc = (String)request.getParameter("txt_rymc");
	DealString ds = new DealString();
	Vector vect = myBean.getDataBySql("select a.id as aid,a.name as aname,b.id as bid,b.name as bname from kjc_college a LEFT JOIN kjc_department b on a.id=b.college order by aid,bid");

%>

<html>
<head><title>选择人员</title>
<link href="js/main.css" type=text/css rel=stylesheet>
</head>
<body>

	<table border="0" cellpadding="2" style="color:#FFFFFF" bordercolor="D0E7FF" width="100%" height="22" bgcolor="#007EAE">
	  <tr>
	    <td align="left" >&nbsp;<b>部门列表</b></td>
	    <td align="right" >
			<!--<a onclick="allopen()" style="cursor:hand;"><font color=white>全部展开</font></a>
			<a onclick="allopen()" style="cursor:hand;"><font color=white>全部折叠</font></a>&nbsp;--></td>

	  </tr>
	</table>


   
	<table border="0" cellpadding="0" cellspacing=0 style="border-top:0px;border-left:1px solid #D0E7FF;border-bottom:1px solid #D0E7FF;border-right:1px solid #D0E7FF;" width="100%" height="22" >
	  <tr>
		<td width="25%">&nbsp;<a onclick="setValue(0,0)" style="cursor:hand;"><font color="blue"><b>所有</b></font></a></td>
		<td width="40%"></td>
		<td width="40%"></td>
	  </tr>
	</table>

<%
	String tempid = "";
	for(int i=0;i<vect.size();i++)
	{
		Hashtable hash = (Hashtable)vect.get(i);
		String aid = (String)hash.get("aid");
		String aname = (String)hash.get("aname");
		String bid = (String)hash.get("bid");
		String bname = (String)hash.get("bname");

		if(!tempid.equals(aid))
		{
		%>
		<table border="0" cellpadding="0" cellspacing=0 style="border-top:0px;border-left:1px solid #D0E7FF;border-bottom:1px solid #D0E7FF;border-right:1px solid #D0E7FF;" width="100%" height="22" >
		  <tr>
			<td width="20%"></td>
			<td width="40%"><a onclick="setValue(1,'<%=aid%>')" style="cursor:hand;"><font color="blue"><b><%=aname%></b></font></a></td>
			<td width="40%"></td>
		  </tr>
		</table>
		<table border="0" cellpadding="0" cellspacing=0 style="border-top:0px;border-left:1px solid #D0E7FF;border-bottom:1px solid #D0E7FF;border-right:1px solid #D0E7FF;" width="100%" height="22" >
		  <tr>
			<td width="20%"></td>
			<td width="40%"></td>
			<td width="40%"><a onclick="setValue(2,'<%=bid%>')" style="cursor:hand;"><font color="blue"><b><%=bname%></b></font></a></td>
		  </tr>
		</table>
		<%
		}
		else
		{
		%>
		<table border="0" cellpadding="0" cellspacing=0 style="border-top:0px;border-left:1px solid #D0E7FF;border-bottom:1px solid #D0E7FF;border-right:1px solid #D0E7FF;" width="100%" height="22" >
		  <tr>
			<td width="20%"></td>
			<td width="40%"></td>
			<td width="40%"><a onclick="setValue(2,'<%=bid%>')" style="cursor:hand;"><font color="blue"><b><%=bname%></b></font></a></td>
		  </tr>
		</table>
		<%
		}
		tempid = aid ;
	}
		
%>
	

<script>
var olastSelected=document.getElementById("span1");
//alert(olastSelected.text);
//olastSelected.style.backgroudColor="D0E7FF";
function treeItemSelected(){
 	//event.srcElement.style.backgroundColor="D0E7FF";
	//event.srcElement.style.cursor = "auto";
}
function setValue(type,id){

	var right = parent.frames['main'].document.getElementById("select2");
	var ids = "";
	var name = "";
	for(var i=0;i<right.length;i++)
	{
		ids = ids + ',' + right.options[i].value;
		name = name + ',' + right.options[i].text;
	}

      var oForm=parent.frames['main'].document.getElementById("form1");
		var go = "stepMemRight.jsp?showdepartment=<%=showdepartment%>&count=<%=count%>&txt_rybh=<%=txt_rybh%>&txt_rymc=<%=txt_rymc%>&type="+type+"&id="+id+"&select2id="+ids+"&select2name="+name;

	  oForm.action=go;
	  oForm.submit();
  }
</script>


</body>

<%
myBean.closeConn();
%>




</html>

⌨️ 快捷键说明

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