  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14247
- 金币
- 2414
- 威望
- 1647
- 贡献
- 1362
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
+ p5 A O7 n9 N8 }/ _ c pageencoding="gb2312"
) A. X+ \1 S( b: H%>
0 ^8 i$ V& A# |; ]: Z# a& z6 m) Q<style>
/ H/ l. n. }' q* j) \.f9{ font-size:9pt; }
) T/ q5 Q) D" m.bgc{ background-color:#aecaf9; color: #0033ff }/ n2 f5 J6 K7 o# ? j
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
9 M1 G# D2 K; T( [+ [' m) j0 k border-bottom: solid 1px #4e7dc1;! h# t2 G7 R/ J7 W0 v+ O
border-left: solid 1px #aecaf9;9 {+ M; m: q8 B8 q+ B ?1 }7 p5 |
border-right: solid 1px #5679bd;5 K% d' J/ K" v: e+ f1 e
padding:1px;
' }4 {4 M) q. @) X: P margin:0px;}
( }2 Q& ]+ e6 p9 L' T. Z</style>
5 F" Q u, B( N/ D3 S8 n0 g' @<script language="javascript">
9 M- M- e `4 s+ a! H<!--: `, s, s3 `7 B9 b2 j
function rv()
2 j& E0 N8 G- R0 f0 X{
" k/ o U7 A, U* s* J1 R var val="";/ f1 \& j8 _, {! ]
for(i=0;i<combo_box.list2.length;i++){, B( k1 C" G' H1 e$ k( B
val+=","+combo_box.list2.value;# i( ~. H& E- C! B5 v
}- A; i! P& N# Z% b
if(val.charat(0)==","){! C9 R0 O! @5 E$ D: T4 ~- j$ a
val=val.substr(1,val.length);
1 v. l- n8 `! E6 W }) G, J& @6 M- a, O! }" F& o' u
opener.form1.frecname.value=val;; X: c5 u) R/ `! z
self.close();6 b0 g3 f0 P7 p5 e& x8 Q" [0 ]
}$ t G" Z/ P: Y$ ]: e
//-->: a7 [. `+ Y; A0 S+ w6 i
</script>
, \ j4 I$ {, o" H<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">. F. }! l7 r8 G: j- r, }. @% \" h2 o
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" /># W9 r) [$ V; Q# A% y
<%
' ~ n7 L9 v6 J, S cdatasource ds=new cdatasource(); //数据联结bean实例& y4 O. o- p h! `" s
java.sql.connection conn=ds.getconnection();# M4 s% v& h7 n
java.sql.statement stmt=null;: q& ?7 U. T* `( b s. O
java.sql.resultset rs=null;
: l# V" e) w: _0 v cdatacheck dc=new cdatacheck();( {# H) V% r) m: p& L- U
%>. N9 X/ C$ n! W5 G; v2 [1 n$ i. u
<%
3 s1 E4 z+ W3 R: U" N- |/ ostring 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. {: I1 c" E' k
stmt=conn.createstatement();
: f8 ]; d" B+ i. crs=stmt.executequery(sqlu);" e8 ^: Z' A+ P. i g6 L2 _
%>: |, ]7 o% s, f) N9 i: C: t+ O
<script language='javascript'>
O! ?. ~# S0 g8 L; `arr = new array();
0 t P( l) C5 C* O5 V' F& o<% int temp=0;- D5 N" ^+ X/ [7 ?& g. Z0 j. T1 T
while(rs.next())
7 J3 D+ d! P8 w% p6 _" u6 r{0 l1 _% W+ r9 ^0 ]! v
%>
- q) J9 i: ^4 F- s3 X% A/ zarr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");, H/ L' t- ^/ x. u" k! @) |% \
<%4 {" u! Y7 G" L8 h( m6 M4 V2 _
temp = temp + 1;
, L/ A+ b s' g* R7 @& U}
- T0 w1 S8 b8 e$ l, Y%>
; _( p K# U% u4 @. stemp=<%=temp%>;9 U9 w5 v% `5 L+ O3 a
function changelocation(id){ 4 J. a O. I! D( d, L* V1 S8 n4 x
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 + D# M( Z0 ?0 p& Y( G P; a# D
var i = 0; 6 h& l( j- s+ R* x a: P ^6 |8 c
document.combo_box.city.options[0]=new option('-------','');
8 J! C x8 U8 r( q9 v2 rfor(i=0;i<temp;i++){ ' c7 B2 J' l! J. Z
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] : Y$ u2 J7 a q" x& X% A, J5 S7 `
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); 6 s* g4 f' M3 Y: N
}
. z1 w/ P0 V' l} * q5 k- A9 y, N6 N/ I
}
0 V% m4 \& G6 W/ R/ r/ \, [( w# E/ o</script>7 E/ _0 Y$ Z- o
$ i2 q( S- ^# b; b5 C. U/ `<form name="combo_box">
# Q5 @8 {4 O# y' I( [<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
& J' I" D1 W6 E <tr height="24">9 @3 k. b$ a. a
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
/ X* Y) V9 z; J* a- P6 e$ A <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
7 G+ a5 h) u0 e2 Q# ~ <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
6 R* i0 |9 ]2 R <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>/ h" m0 _; b0 L0 [* K9 p
</tr>2 F8 i( z# x, ^# L3 e4 w
<tr> . B# x9 w O3 I k' i
<td>6 z0 d& C, S+ B2 n; G4 r4 f" f
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">5 y& H( L* S( b) O4 @$ R6 E* v9 G9 @
<option value="0">请选择部门 ---></option>0 Q2 t6 U+ O0 M+ z0 D0 H. A0 h
<%1 M& k/ H( l# S, C" b& \
string sqld="select * from tdept";+ ~% A, ?( L+ z: ~6 z0 h
stmt=conn.createstatement();
$ \ X+ f$ d6 ^rs=stmt.executequery(sqld);3 x u& \! q, T5 s
while(rs.next())
8 z9 a. X2 `; Q4 C b& D9 a{$ d/ _9 X( D( w' g; l% w
%> w/ Z2 G, x) W3 K/ F# G7 [- ?' V
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>8 U6 C; b' z+ l; w) H2 ?
<%) [2 L5 T3 @# \$ C# G( M
}
8 g4 X X4 v( \0 ]+ {. A! L%>
5 z0 C; `8 r) P$ K </select>6 m3 `& }7 u: x* @5 G
</td>9 M1 i2 [; W' H6 X
<td>
' ?3 \3 K8 N# g( Z" y9 ~ <select multiple id=city style="width:150;height:200" class="bgc"># T4 q, _9 p$ Q5 E N
</select>$ K/ O+ \# O, `& T8 i5 O$ F. k
</td>
( q; B8 D1 z3 F+ y <td nowrap align="center" class="bgc">
0 y/ g" q" k9 J2 w7 ]8 o <input type="button" value="<<" class="buttons">
7 Y# _ Q5 R8 Z: P; y$ `- z <input type="button" value=">>" class="buttons">
9 |' K% L1 h5 o+ V</td>8 ]/ ]+ A) l2 P' c
<td>- L( \) r l6 Q7 M7 x# y/ r
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">& e* d4 ?: J3 i4 Y( `: \" z7 S
</select>& }3 Z; i @1 U: @/ D2 c
</td>. @+ o, c3 E9 V& n2 l, z' X
</tr>0 `1 m0 P1 P# f$ V) J, Y T
<tr class="bgc">
# d) ]- ~, S, S' h8 S" I" n: G <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>, S5 h# S' p# y% I. D' ^
</tr>
9 d" v" k1 h% n1 a, L4 }, U</table>
4 t- Z# { s! O& }: s1 a</form>3 W: l8 L4 E4 F5 H. v7 t
<script language="javascript">
* [0 x: a7 q" m( T) T! X//人名移动
3 k$ M' c2 N7 vfunction move(fbox, tbox) {! P, C& a6 b7 q3 E! t
var arrfbox = new array();
; W4 ?- y0 I- ]% {6 U2 svar arrtbox = new array();
: F. T4 B% r9 [9 _) q+ Rvar arrlookup = new array();
% _" B/ \; T3 `) {9 ^; _3 Avar i;
; W. ?' g, G3 Q5 M8 D5 v! [3 g( Xfor (i = 0; i < tbox.options.length; i++) {6 [% h5 m) b- i' W. O1 w
arrlookup[tbox.options.text] = tbox.options.value;
- ~# m6 Y2 b9 Uarrtbox = tbox.options.text;
7 i4 ^' m& ]/ f2 R}; `3 X3 O; L, U; D+ R. m) P
var flength = 0;7 u, ~0 o. s8 q/ m* N
var tlength = arrtbox.length;: x3 p1 l2 v; ^3 ~4 p- a
for(i = 0; i < fbox.options.length; i++) {
8 P% p- S A' E) q# O6 o6 Narrlookup[fbox.options.text] = fbox.options.value;
7 F2 [* V; [) s* G9 L3 ^- h1 lif (fbox.options.selected && fbox.options.value != "") {
* _- X( F9 I( i, Q( S4 Carrtbox[tlength] = fbox.options.text; ?+ X( X& S( e
tlength++;
! |$ U' D$ L1 Z8 @+ {2 P6 s}6 Z; j1 Y" T( g- K! \
else {
! r. V' l8 S; M) X5 i+ Jarrfbox[flength] = fbox.options.text;. }7 N8 U' h' a0 i9 h0 e) B+ a
flength++;$ r0 a. U+ y, L3 X, M, I3 u# [
}
n- X! ]2 I) z! S& I3 c( H( Z}
/ o. R% p7 G9 |5 _2 e' Garrfbox.sort();
. Z7 p8 |- `3 @arrtbox.sort();$ Y( v! J2 K: g+ A V9 b
D) F& j+ Q5 J5 q; H- c: I
fbox.length = 0;
7 F# d6 V ^( F; v% i5 Btbox.length = 0;9 Y( u8 j2 y: D7 w1 W0 m; o
var c;
7 C2 z/ v$ ?' w: }for(c = 0; c < arrfbox.length; c++) {5 _1 M# D& n, R% O1 I; j
var no = new option();! m3 a/ E/ i: e' _
no.value = arrlookup[arrfbox[c]];4 a- ~* ^9 {' r9 u4 B
no.text = arrfbox[c];5 p) } A1 X' T+ Y0 @- m
fbox[c] = no;. i7 A* K: f2 ~8 \
}
: U/ z X5 p% `* q. W9 A" l2 h, `for(c = 0; c < arrtbox.length; c++) {6 R2 q0 L2 c. [' R, B, d
var no = new option();) x$ p$ u* F8 @2 a' W9 k( L
no.value = arrlookup[arrtbox[c]];0 J* C, F9 v7 j: z
no.text = arrtbox[c];
6 O5 I( l5 X t, H; P1 E- \% Ltbox[c] = no;7 W8 n0 D) ]* ~5 y+ j
}
* Y5 c# p- Z& @9 g$ h5 m6 `}
# s; ?' Z `" p* }</script>5 H" x. s& Z% z' D0 [, x3 O4 d9 F
</body>
, ?* A- {( {2 e: w. E1 Z: f |
|