  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14239
- 金币
- 2410
- 威望
- 1647
- 贡献
- 1358
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
) }/ a# Z# A. L* A- M- i M1 l c pageencoding="gb2312"
# l' ?4 p' U/ H5 i%>
# _+ F7 j' R9 k4 a4 W* c<style>
4 x4 C" \- h6 ^7 o7 t, b; F3 Q1 ]5 o.f9{ font-size:9pt; }# w' v k! E p J2 z+ F, P
.bgc{ background-color:#aecaf9; color: #0033ff }6 s! S' s3 r3 R6 Y9 m( D* |4 \
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;$ f0 h, h0 G5 ^; t4 }6 _
border-bottom: solid 1px #4e7dc1;
, { R1 i& D& D# u) K border-left: solid 1px #aecaf9;
# h1 F( | Q8 {3 ^, k# V+ X border-right: solid 1px #5679bd;
6 t! L' s/ B$ U# l# H4 P( o padding:1px;
z# J. g+ r; q margin:0px;}
4 D& b/ p/ h! s</style>6 A* c6 m8 h( `: n, Q% v# W
<script language="javascript">9 Y9 ?! L3 D2 V( b2 I- m0 d6 x
<!--
( i+ x. e) T- y7 s( j+ O4 G7 |function rv()
" M4 l1 F4 a) U& A8 _9 i{' P& d# i/ M4 T% T
var val="";
4 V4 t. G5 H' t/ D for(i=0;i<combo_box.list2.length;i++){* n- |; }" b' O) Q' b, ?- n: i
val+=","+combo_box.list2.value;7 c, Q* _# w c& C4 P. b
}
+ S" Q$ ^/ C5 |& M if(val.charat(0)==","){
+ d+ [3 H$ E5 G% a! D# f val=val.substr(1,val.length);
: L+ s$ c" |5 c' _ }
( i, i; I; [5 j9 B% R" ]" p) l9 x; ? opener.form1.frecname.value=val;
9 G: ?9 Q% c3 y9 F! M u" K self.close();2 C: A: Z$ B( B0 _" L4 V- @
}
- ]5 q$ c- y5 B" w) P1 S//-->
7 A. e( x. M/ e# G</script>
8 U- R& E1 A' h- S4 v# r3 S8 M<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
, i4 L8 U- k$ C5 `9 M1 q<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />; K( O0 K" X3 B+ m0 e- b7 V' j
<%
( M( H: z$ g5 d( c5 j- e& _+ y# r cdatasource ds=new cdatasource(); //数据联结bean实例
& k8 ?6 ]+ A: v1 B4 L java.sql.connection conn=ds.getconnection();2 h: `7 t6 ~" Z, R2 F3 Z, D- l
java.sql.statement stmt=null;7 k9 B: v% c, B) g4 B
java.sql.resultset rs=null;' X6 U) h5 M- W" [
cdatacheck dc=new cdatacheck();. U( c; L" S* ]; J4 i, V- o& j7 p
%>. @6 Q7 }. O% _6 f6 D1 `: _
<%
/ E& I5 _: m ]2 zstring 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";( m# L, j* | ?7 a; E0 ]& S" C7 Q
stmt=conn.createstatement();
7 d, ^: o7 N+ p: f2 t" drs=stmt.executequery(sqlu);5 N; W( e/ r K' f. c2 `
%>
7 i1 O; D$ s6 Z/ k& p! ]<script language='javascript'>
# @) X% u9 M- E8 zarr = new array();( ~2 b7 g& W1 s- E: u
<% int temp=0;
8 c! H R; _& d' X5 K- r- e3 Uwhile(rs.next())* P$ N# q( ~) v6 ]+ B7 X' _
{; w1 Z! r A4 g* x$ S8 x
%>1 B% q9 ^/ k( D5 W. _ `: Z8 L. E+ G
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");- t/ g6 f& c @2 e* [4 \% ~
<%7 t( K9 K9 `) ]+ s! Y9 j
temp = temp + 1;6 l* S' t; @! q0 A
}
0 }8 {' c* h! K% i8 }" j# W: w%>7 _! T0 V, t' k6 k" p* W
temp=<%=temp%>;
& A0 r/ [* y6 Q! Tfunction changelocation(id){
/ L7 g1 U" \% X D1 Adocument.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 * u1 X( w) u: b$ Z6 P
var i = 0; 6 c5 j( |! \0 c/ y# ?. g* [0 P o
document.combo_box.city.options[0]=new option('-------','');
x& m- a6 E4 l# O) Hfor(i=0;i<temp;i++){
, i1 l0 f) z+ _2 @, y* t( oif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] ( a- m) ~7 d5 }& @, r
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
5 `8 y* m( @# ^# |8 v* D2 n}
n5 W% m1 C. L: Q}
. n7 y7 O7 S! d% i4 O; P3 W}
4 n8 b! G3 j5 x* k* s/ W. `; p</script>1 T; e6 l# G' a
1 M( X3 q7 e" e& m r. S<form name="combo_box">( @4 |* C, o, m: |) z
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
9 a! A" ]2 ?5 O* ^% o$ v0 m <tr height="24">' t1 `9 {9 _, z+ H& N# V0 p) w7 j
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>' f- V q" m7 Y& y, d9 ^) z
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>! @; N, M8 D7 ^
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>4 l. ^/ ]* W( e* Z( v. Z
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
! ?0 }, [2 l( A1 }, }# n) G </tr>& |1 t9 m$ u# R' f0 [7 [
<tr> ! G( g1 d# N8 J& o8 I+ O5 P+ Z
<td> [" z1 g( Z8 r; e; X( P
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">7 ?" o H0 C1 _1 r
<option value="0">请选择部门 ---></option>+ M% _# ]1 R: Q* [! `! W
<%
, p; @9 |: s% l3 x! l2 \( e string sqld="select * from tdept"; ?2 D% {( k: M. ^' j3 P* Y0 j
stmt=conn.createstatement();
+ I5 K& P6 O% W& ?. o* u6 u. E) Trs=stmt.executequery(sqld);
, d" c& R3 {: ?while(rs.next()); v& f7 x' d$ X5 V# e
{$ T. p, f8 Y* t( t$ s- V
%>$ l1 C V8 I3 A! G
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>* {! n* o( y& ]; n
<%
4 n# i5 K1 V% k" @0 E9 H3 A}
% N# R0 ?+ F. X/ ?9 r$ D. J3 _/ v%> 0 X7 g8 O$ E( D$ S2 x
</select>& Q4 i I4 M+ `2 s* z
</td>: R5 e& \4 ^4 _& x& G
<td>* v' h: i( M( R5 _. ]
<select multiple id=city style="width:150;height:200" class="bgc">6 D1 K6 u& s% J9 y+ s
</select>/ c L* i+ ~* i/ K% K/ m3 C& O# X
</td>
2 t/ E/ U! F6 m0 h* m, R6 G3 N4 ^' l# Z <td nowrap align="center" class="bgc">
5 w$ }( A9 [# E1 a$ A <input type="button" value="<<" class="buttons">6 |: Z* ^; Z3 E* m/ p
<input type="button" value=">>" class="buttons">8 b O3 f2 d8 G8 V$ F" t9 [, n: j
</td>. i j* Q7 X7 s$ U2 I/ ~: j
<td>
1 f& r5 R8 w: j" \ <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
* \9 e4 O1 X: X) w& b8 ? </select>
) t' G% d7 i: t6 D! X9 I</td>9 t) Y4 a, v0 W' c, O
</tr>
/ e1 l9 p" Z" {6 z5 \ <tr class="bgc">
& H" Q8 ^( K! D r <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>
% k& O) R! [& I n8 G: z/ Z </tr>
" A& g( y# N& c1 L, T2 k</table>
8 @0 b- F z+ F+ I2 k. Q</form>" m% ^- Q* H! j' x2 j) Q, K6 U
<script language="javascript">
$ R# e/ R( o! J' \//人名移动4 R: p. T; H# L/ y) @
function move(fbox, tbox) {2 ^/ V" Q( Z! g. M) X
var arrfbox = new array();# k7 s P; H3 h W& _$ I" Y" B8 j
var arrtbox = new array();5 C3 y: y' s( {0 n, q
var arrlookup = new array();7 C# r j! ~- h" \
var i;+ r9 r8 b* x" f( g! @( \7 `
for (i = 0; i < tbox.options.length; i++) {, k/ k; ~% N f# t8 S6 B5 K0 p
arrlookup[tbox.options.text] = tbox.options.value;
1 g, c. w) [' l3 Qarrtbox = tbox.options.text;
6 f( V% H8 C, o) n8 K}6 r7 O- Y) \; P( l
var flength = 0;( S' T: C$ Y% F: u
var tlength = arrtbox.length;
, I# L8 _& A0 j) d* Q( ]8 ^' dfor(i = 0; i < fbox.options.length; i++) {% D, x' J" h2 K1 R
arrlookup[fbox.options.text] = fbox.options.value;
& n4 s5 [$ |0 V4 r% m% D2 q8 Oif (fbox.options.selected && fbox.options.value != "") {, P( {) u1 N, @8 E1 j* q( _" l
arrtbox[tlength] = fbox.options.text;& {% h7 B z# q+ S
tlength++;
6 C: q* o& b5 w# v" `9 C}
$ @4 t6 ~% r0 c+ kelse {2 T* Y3 H" I; C% h0 y$ g1 N* ~- C
arrfbox[flength] = fbox.options.text;$ P( G, S3 R: W5 t
flength++;
$ z" `6 U9 p, l7 |7 _ }
( l) N" S: o) X5 ?3 H}/ g! U: ^% C% x# C! j
arrfbox.sort();; F8 A {- o- o% s, o6 m
arrtbox.sort();
# w+ h5 y1 v9 _
& H G' d5 K& l- X3 ^; ufbox.length = 0;
! s3 M7 w3 ~0 `" T. g& Dtbox.length = 0;; g8 I9 m" V& k- D
var c;
# N# R7 I3 P& D8 x+ E4 m) n( pfor(c = 0; c < arrfbox.length; c++) {3 K: o/ ~% m, X* U! g9 O2 H5 ?
var no = new option();* p; C2 p. Q Q: ^ [, y: D( \5 D7 ~2 o0 U
no.value = arrlookup[arrfbox[c]];
6 ~9 s0 u! `, U$ k, Y0 Ino.text = arrfbox[c];! ]8 c4 x4 S4 l5 Q, v; D
fbox[c] = no;6 J0 V- ~6 D2 g q* b
}; r4 j1 V) Z8 `6 G. H* a
for(c = 0; c < arrtbox.length; c++) {( e7 W. z1 B. ~ B
var no = new option();
* J9 ?7 ]5 y& K V1 C; n$ V1 Kno.value = arrlookup[arrtbox[c]];# C- h) N5 m& s8 v S
no.text = arrtbox[c];) z @! o0 ~/ o2 G# B P! O
tbox[c] = no;, p: w) B0 w/ x' x/ [" d
}
7 V4 |! ]* H, M# ?) G# D) S, L}
1 {8 N5 ?7 a4 j& J</script>; K' M9 ]. k I) b ^; ^2 r
</body>1 e7 a9 U6 t1 M* g) K3 ^' V. f
|
|