<%@ page import="java.util.Date,yava.fileapp.*,java.sql.*;"
contentType="text/html;charset=GB2312" pageEncoding="GB2312"
%>
<스타일>
.f9{ 글꼴 크기:9pt; }
.bgc{ 배경색:#AECAF9; 색상: #0033FF }
.buttons{글꼴군:Arial; 글꼴 크기:13px; 글꼴 두께:굵게; 배경색:#6796E4; 색상: 흰색; 테두리 상단: 단색 2px #AACAFB;
테두리 하단: 단색 1px #4E7DC1;
테두리 왼쪽: 단색 1px #AECAF9;
테두리 오른쪽: 단색 1px #5679BD;
패딩:1px;
여백:0px;}
</style>
<SCRIPT LANGUAGE="자바스크립트">
<!--
함수 rv()
{
var 발="";
for(i=0;i<combo_box.list2.length;i++){
val+=","+combo_box.list2[i].value;
}
if(val.charAt(0)==","){
val=val.substr(1,val.length);
}
opener.form1.frecname.value=val;
self.close();
}
//-->
</SCRIPT>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<jsp:useBean id="user" range="session" class="yava.fileapp.UserBean" />
<%
CDataSource ds=new CDataSource(); //数据联结Bean实例
java.sql.Connection conn=ds.getConnection();
java.sql.Statement stmt=null;
java.sql.ResultSet rs=null;
CDataCheck dc=new CDataCheck();
%>
<%
String sqlu="SELECT t1.fno, t1.fname, t2.fname AS fdept FROM tuser t1 LEFT OUTER JOIN TDept t2 ON t1.fdept = t2.fno 순서는 t2.fname";
stmt=conn.createStatement();
rs=stmt.executeQuery(sqlu);
%>
<스크립트 언어='자바스크립트'>
arr = 새로운 배열();
<% int 온도=0;
동안(rs.next())
{
%>
arr[<%=temp%>]=new Array("<%=rs.getString("fname")%>","<%=rs.getString("fdept")%>");
<%
온도 = 온도 + 1;
}
%>
온도=<%=온도%>;
함수 ChangeLocation(id){
document.combo_box.city.length=0; //初始化第2级菜单의 속도, 下标从0开始
var 나는 = 0;
document.combo_box.city.options[0]=new Option('-------','');
for(i=0;i<temp;i++){
if(arr[i][1]==id){//如果상수, 证明은 2级里面有输入第1级组织的子集,arr[总数目][부门]
document.combo_box.city.options[document.combo_box.city.length] = new Option(arr[i][0], arr[i][0]);
}
}
}
</script>
<양식 이름="combo_box">
<table border="0" cellpacing="0" cellpadding="0" height="210" width="59">
<tr 높이="24">
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>부서选择</font></td>
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>인명选择</font></td>
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>광고</font></td>
</tr>
<tr>
<TD>
<select multiple id=prov name="prov" onchange="ChangeLocation(combo_box.prov.options[combo_box.prov.selectedIndex].text);" 스타일="너비:150;높이:200" 클래스="bgc">
<옵션 값="0">请选择부门 ---></option>
<%
문자열 sqld="SELECT * FROM tdept";
stmt=conn.createStatement();
rs=stmt.executeQuery(sqld);
동안(rs.next())
{
%>
<option name="<%=rs.getString("fno")%>"><%=rs.getString("fname")%></option>
<%
}
%>
</select>
</td>
<TD>
<여러 ID=도시 스타일 선택="너비:150;높이:200" 클래스="bgc">
</select>
</td>
<td 이제 랩 align="center" class="bgc">
<input type="button" onClick="move(this.form.list2,this.form.city)" value="<<" class="buttons">
<input type="button" onClick="move(this.form.city,this.form.list2)" value=">>" class="buttons">
</td>
<TD>
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
</select>
</td>
</tr>
<tr 클래스="bgc">
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" onclick="rv();"></td >
</tr>
</table>
</form>
<스크립트 언어="자바스크립트">
// 유명인사
함수 이동(fbox, tbox) {
var arrFbox = 새로운 배열();
var arrTbox = 새로운 배열();
var arrLookup = new Array();
var i;
for (i = 0; i < tbox.options.length; i++) {
arrLookup[tbox.options[i].text] = tbox.options[i].value;
arrTbox[i] = tbox.options[i].text;
}
var f길이 = 0;
var tLength = arrTbox.length;
for(i = 0; i < fbox.options.length; i++) {
arrLookup[fbox.options[i].text] = fbox.options[i].value;
if (fbox.options[i].selected && fbox.options[i].value != "") {
arrTbox[tLength] = fbox.options[i].text;
길이++;
}
또 다른 {
arrFbox[fLength] = fbox.options[i].text;
f길이++;
}
}
arrFbox.sort();
arrTbox.sort();
fbox.length = 0;
tbox.length = 0;
var c;
for(c = 0; c < arrFbox.length; c++) {
var no = new Option();
no.value = arrLookup[arrFbox[c]];
no.text = arrFbox[c];
fbox[c] = 아니요;
}
for(c = 0; c < arrTbox.length; c++) {
var no = new Option();
no.value = arrLookup[arrTbox[c]];
no.text = arrTbox[c];
tbox[c] = 아니요;
}
}
</script>
</body>