  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14191
- 金币
- 2386
- 威望
- 1647
- 贡献
- 1334
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;": h1 }9 @, F C1 o, h
c pageencoding="gb2312"
+ L% R/ b) D. Q' [' z5 Y0 z1 r1 l%>
2 h8 W1 o0 d" [6 n$ p<style>
' o2 l- Z i5 I! f4 m6 W; w.f9{ font-size:9pt; }9 z1 f+ \( ~3 F; Q
.bgc{ background-color:#aecaf9; color: #0033ff }! h3 c; u0 v& i, d
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;' u. h, W5 V0 g6 k9 [, \
border-bottom: solid 1px #4e7dc1;) W l8 t3 g! S7 `8 B
border-left: solid 1px #aecaf9;
. d8 Q6 K7 _- N- `" q border-right: solid 1px #5679bd;
- Q% t# |& ]9 W/ @) x' P$ G padding:1px;% L8 t; a2 B% @! ?; E* v) `4 L
margin:0px;}
4 v' ]7 s9 a" Q5 {. f</style>
% c, S+ ~ M: d$ x( ~; k1 t/ f<script language="javascript">
8 Z5 D% d, O( [<!--2 \; d+ K; ~+ B, a% v
function rv()
/ {* S; w, o. n1 K, R- V; S( d3 q{
2 \7 }# Q( x" a5 `! ` var val="";
( z k( Q! I/ h& I; r0 A. K/ ] for(i=0;i<combo_box.list2.length;i++){2 |4 e' j/ I+ }) r; r
val+=","+combo_box.list2.value;5 w5 X' z' Y7 }' z0 f0 }5 t
}! y/ [, C9 }9 j; g% i/ |2 C9 a
if(val.charat(0)==","){- M7 U1 h/ A9 O- d
val=val.substr(1,val.length);/ ^4 f: L, W8 d: i. N
}
: ]- ]/ M. N/ _6 `2 b- K: [ opener.form1.frecname.value=val;; Z* H( S( f7 l$ F- k" a. H, U
self.close();3 `# Y- Q g5 ?& `6 x* U% H
}) @% T& c' O- I% u
//-->! C& b' D# N. v
</script>
( v6 F0 g' R) T% ~% y$ D/ V<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
% |4 U+ F) T9 h, }' u8 p0 n7 }<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />* k- L8 k1 j4 Q9 V) S! p( ? |$ W
<%
( B' {; l& T8 C9 P4 U2 l: o cdatasource ds=new cdatasource(); //数据联结bean实例/ l! [9 I5 f* j( U& d% O
java.sql.connection conn=ds.getconnection();& `" c! Z) q/ r0 j3 h5 d% {$ e8 `
java.sql.statement stmt=null; Q2 G& K" J5 T0 k
java.sql.resultset rs=null;
5 A7 q" N+ N t1 ]* L! [' P cdatacheck dc=new cdatacheck();+ Y+ ]+ X M/ n; r8 y( {. d9 o
%>+ a: @; x- L7 k
<%( j' V @" y0 j. C# j; k j6 y- O
string sqlu="select t1.fno, t1.fname, t2.fname as fdept from tuser t1 left outer join tdept t2 on t1.fdept = t2.fno order by t2.fname";+ i6 x- j" y. l9 h' c; G5 a0 f' _7 |( I1 f
stmt=conn.createstatement();
# j" N# N$ Q8 Xrs=stmt.executequery(sqlu);) c2 U( S" M; ?/ g& T
%>
r2 ~% y, ~: s9 o i: m! m9 j<script language='javascript'>
3 b1 B% W: N$ r* @5 M; Parr = new array();# y2 c4 N- p3 k, @8 P+ C, T
<% int temp=0;( V* X/ H/ h: g5 V+ M" W ~8 E
while(rs.next())
1 r# i5 T) i3 j6 \- A4 `3 m" B{" e# |+ [4 t. {; O: _
%>4 i5 U1 ^0 T/ A \
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");. f6 _- `2 t' L7 \& I
<%" q4 y8 O( D4 T+ [: ?9 F
temp = temp + 1;% T- y) i. t8 N5 R7 q
}
1 G# V$ }1 W9 I%>" b% y9 N% P7 b2 e5 ]) A9 y% X
temp=<%=temp%>;6 y) K( L, F- y- _
function changelocation(id){ & M, O, r5 S \/ R! b; ^0 Q
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 5 U- O, |" ~/ y; T8 f
var i = 0; $ B! A. O! }. J, P) y) D' q
document.combo_box.city.options[0]=new option('-------',''); : V, [/ ~$ {7 e& K
for(i=0;i<temp;i++){
) [5 f6 d+ i9 Z( G: _2 vif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] h1 |) S/ V& ?) s p& {3 m/ m
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); 2 h! r( _- } R* \2 v! S
}
9 A1 x0 g& ]# C8 c}
3 r0 ]) ?0 w" h3 c2 Q} }4 v) f% z7 Y; k- P, m, ~. S
</script>; h% Q+ E4 W9 V! T3 ~
; A( m9 c4 l: f( L' T- A<form name="combo_box">6 R' {0 x" q0 B+ g) t7 w4 n4 Z
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">1 P4 N- z2 K5 g E, ~: a! G3 Z
<tr height="24">! f5 l) v5 i# r$ J. r
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>) Q+ Q& f# F' j' s- d
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>; t1 g3 y9 Y9 Q1 b$ i z
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
2 V; n5 b1 w2 u <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
; X5 |( o$ a6 m0 a" p& d </tr>
# ?, X$ m) y8 Q6 ` <tr>
8 {) i4 `6 V) _% Z* J; R' z <td>1 q0 H7 }( L4 N3 E
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
7 E8 R) Y# M5 i8 B0 @+ h8 H <option value="0">请选择部门 ---></option>
) r1 s2 U1 g& ^<%2 {! I5 I& f- P- o2 t1 x6 ~* ^9 j
string sqld="select * from tdept";" G; r) _+ _* q4 g
stmt=conn.createstatement();/ a+ `" x7 U: E" E! K; ~: Y
rs=stmt.executequery(sqld);
' l R3 p3 {$ k+ a% E4 q) T/ r' o# Cwhile(rs.next())
- r% Z3 \+ B& a/ D& s! e( B' [{
) f+ J. }0 J- W) Q. D8 T) B%>& K3 S2 N" S; \& l/ e/ |
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>& p( t: W& m3 x4 u, N6 s, H+ A
<%
9 p4 ]0 K* J7 \$ }+ Q}
# U4 v3 b3 o1 i( [ b) n4 a6 S%> ; v( K1 U4 C! _1 F, Y- Y
</select>
) L4 j2 f. k( M/ [- Z9 V" C</td> ?! l. L( D* Z6 n
<td># K& ~" F4 L* [/ W
<select multiple id=city style="width:150;height:200" class="bgc">3 J8 N/ }* P( M6 H+ j$ u
</select>
7 J+ o% S0 N9 [/ m! o- t3 a H</td>
/ C& I! P2 M: N& b+ T; X; } <td nowrap align="center" class="bgc">5 s' n8 e" b. a* I v
<input type="button" value="<<" class="buttons">0 F5 L% Z4 I9 B
<input type="button" value=">>" class="buttons">
0 a1 J% T6 S W5 J* {; f* V" E0 f</td>) ]+ r+ n; |. \1 ~. J% _
<td>: g+ H z8 i" ]$ y) Y3 S) d+ v
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
5 t) j! c. _$ Z2 I" ~ </select>: `- h1 h: g% ]1 t8 e/ y- p
</td>' |' w% _* Y: m. g: Y1 O
</tr>
( H! v; A4 E$ I% Y <tr class="bgc"> & m) K9 a9 `* v& o) R9 D
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>
, H) y% X$ L* @& k, i f: k a% D </tr>
' P% \% g7 z/ b% r</table>
9 ]- a. ]* p# n6 O+ i2 S</form>- t* F0 R( X+ q/ A8 d1 [
<script language="javascript">
) i" T" s9 h3 d5 q; C//人名移动
, `8 Y0 R7 X4 u4 M. vfunction move(fbox, tbox) {4 |: E2 f4 [+ ^6 |
var arrfbox = new array();8 E8 _- _- b! s# S4 d) }* [
var arrtbox = new array();
, g# g1 q8 }6 B" |var arrlookup = new array();* m* }$ S& d2 v0 |# E
var i;: J; Q( |# B/ U) m
for (i = 0; i < tbox.options.length; i++) {6 z S7 \/ G) v( f
arrlookup[tbox.options.text] = tbox.options.value;* | n! \1 p b" Z0 @1 ]( x* Y$ X
arrtbox = tbox.options.text;
) \' ?/ v8 g, p9 w5 M( n, f# X}( p- T0 L* @/ y% A
var flength = 0;
# ?7 Z0 C A2 ?; Q5 b& P1 zvar tlength = arrtbox.length;
, W+ t/ I$ [' e# K0 O6 y( qfor(i = 0; i < fbox.options.length; i++) {
" P! O" V: N3 J8 I6 o, P# s5 Q3 ]arrlookup[fbox.options.text] = fbox.options.value;4 B' [6 U8 `+ W H
if (fbox.options.selected && fbox.options.value != "") {
8 Z) @! V& s& W$ t4 y& K: I+ Marrtbox[tlength] = fbox.options.text;
# q3 Z1 R: x* S: ptlength++;
' v: S4 H- e7 F2 Z5 e( ?}2 a$ r. @" h. V0 b! D# `
else {) t+ z3 C# W+ o }
arrfbox[flength] = fbox.options.text;
O" \' `0 Y/ N7 x+ bflength++;+ ` ?# P3 k; u
}( q3 j# n/ u& }. d! d5 U+ L( u3 P
}$ ~" g% X; D Z* Y$ t( o' v
arrfbox.sort();- O/ y0 d% d+ D2 n% f& I
arrtbox.sort();
8 w. X4 S \' J' W4 ^' M, I1 ]8 L
fbox.length = 0;
: a0 h6 k1 z; |+ F! [+ |5 e0 W0 Etbox.length = 0;% t/ c- o) p" V3 ^. n
var c;* Z2 [" d8 b; Q; e& b% m. Y$ e$ `' d
for(c = 0; c < arrfbox.length; c++) {
' j: d, _" V: j9 w' f$ @$ bvar no = new option();
6 J9 r. w1 A/ ^ J2 Ono.value = arrlookup[arrfbox[c]];& `" S# b1 G! i. o
no.text = arrfbox[c];
5 q) ^& G/ L" o) pfbox[c] = no;5 p5 k# A v. s, W( E
}
3 _ B' G4 V- r) C/ {- z7 x7 Wfor(c = 0; c < arrtbox.length; c++) {& g: N1 h1 ?9 j1 B; T
var no = new option();
3 m% r/ R* ~ B, S6 ?) Qno.value = arrlookup[arrtbox[c]];
+ K A8 v) b0 y3 G4 ~; fno.text = arrtbox[c];5 N' Z1 m. _0 o' W4 R
tbox[c] = no;
: N1 N1 R0 y7 n; q }
3 U1 `/ [& V) S; o4 b. i: t% z8 |}
" ~7 g0 v y3 e6 g- q$ h1 _, V</script>$ L" }5 j$ k% Z$ N
</body>' G0 X7 b4 o2 q# [* P3 ^
|
|