  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14159
- 金币
- 2370
- 威望
- 1647
- 贡献
- 1318
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"3 h7 G" ~% y, k$ ~+ P9 w
c pageencoding="gb2312"
7 n4 |+ O. I+ c%>: {" M% n) Q( t3 c' `& T) x% N
<style>/ J0 D, i# {" Z7 @" B
.f9{ font-size:9pt; }
' W1 D" R' M. |# o.bgc{ background-color:#aecaf9; color: #0033ff }
- j' p( G; _) F. i7 j% v" G.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;0 M4 I% V3 E( m! g% ?+ e
border-bottom: solid 1px #4e7dc1;
3 j _ l j$ D8 R border-left: solid 1px #aecaf9;. |1 A, X. ~+ [9 G0 z) v
border-right: solid 1px #5679bd;# E I4 S( ~( _0 _8 R. z y
padding:1px;
: J! g" N2 y+ D- f# f3 \( w" t margin:0px;}
+ K5 h$ P7 q0 `- z2 }* A5 ~' R</style>! ~+ f2 H! V; F j1 R
<script language="javascript"> R6 u! u( o# }2 r8 \% k' w. D7 N
<!--: B n8 t( k4 J8 G% Z
function rv()
, g# Y0 {" p. X; l5 W M w7 `{+ \( Y) F( O. a/ P. e, j* Z
var val="";
( B: b. i' w, j& z& d$ } for(i=0;i<combo_box.list2.length;i++){9 Q3 R0 j3 x6 n' m2 n1 G1 r$ H
val+=","+combo_box.list2.value;
- `7 b1 j1 [3 K- ~% m }
: d$ A: l$ |3 Q) n$ `8 W if(val.charat(0)==","){2 n8 q/ d+ Y+ b0 G: j, B
val=val.substr(1,val.length);: ]) K* m' X$ d' U9 `' ~
}0 i% h1 L/ ^* K! A; M' ^& G
opener.form1.frecname.value=val;
. l; i n- n* V/ ]. l: k7 a: G self.close();
0 G2 P* W( w1 z. N8 n- j V}
+ U U( Z5 {. G* E) A! ^1 ]4 i. l. |# |//-->% e$ r0 ?: _# D" }1 f' j
</script># O+ V* } T2 Q
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">- s+ r' v( N: o0 h+ k% u
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />( G3 J- U2 T5 C+ s1 c' G
<%
; C& ^! {0 S5 X: r, Z& t9 A cdatasource ds=new cdatasource(); //数据联结bean实例5 P- i* G4 w: R1 V! ^7 B
java.sql.connection conn=ds.getconnection();/ K9 b: G; Z9 v1 M7 U
java.sql.statement stmt=null;
) ^) j; N2 G" ?3 y* u: c java.sql.resultset rs=null;- q6 m; E# U1 u& a2 D% y
cdatacheck dc=new cdatacheck();
/ B i Y1 n! G5 U( a; Y) z+ F2 F%>" n& o- J' e: c: A
<%5 P0 a [3 o/ U) P% J: T; u
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";
# `- J7 y5 F r) u$ s# _stmt=conn.createstatement();
: \5 z" _. j) S2 ?2 irs=stmt.executequery(sqlu);/ a: k( m3 p L% E8 F& r
%>
' v2 n, C4 @8 K+ R' E<script language='javascript'>
* t" T- e! N# z5 r" T5 h( yarr = new array();+ t7 {- N" r9 V
<% int temp=0;
) u, C* N% }; B+ X, U. p) `while(rs.next())+ V. s3 [+ u n1 t( J
{# N8 L2 g0 d! v1 U' q ?
%>6 c( S0 i# R3 p6 S) l# W
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
8 f g3 C6 B) C, P1 p1 q4 g<%
" e! |' E2 |1 I4 |/ X5 k& ctemp = temp + 1;! M) G5 y' K, h1 A
}
" w8 K3 ]- N; t( |%>! Q% ^7 |2 G5 y/ b6 g1 c
temp=<%=temp%>;% @7 ?) H& b) B
function changelocation(id){
% B/ W( S9 V4 ~+ K! |document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 4 v5 F" ~9 E* ?# J# Z2 Y0 I- j
var i = 0;
( _( a. T* y6 O0 z3 |document.combo_box.city.options[0]=new option('-------','');
4 \! v4 h/ h0 o* E ~for(i=0;i<temp;i++){ * o2 r: B: D# }
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
; O# P1 h3 g! z+ I9 j; c& \document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); 1 i U' w& I* C e1 s
}
+ r2 z7 E6 M1 u}
3 d4 L. S5 h$ Z# m( ?! B3 c}
7 I, s' I8 @; z5 A0 o) f; o</script>3 S+ c* K) O( O5 e
$ u6 r2 {' o' f5 Z! M) u9 @! k<form name="combo_box">+ e; g9 {' w9 H* s T
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
! d( |3 l+ i$ x1 P; Y <tr height="24">) {/ i. r0 K9 j/ r
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>8 x- |. p, [& X! m p( g3 q
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>; i7 y7 k$ b+ x' j
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>/ X0 V: i- K1 O- t6 Q$ o- b
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
% M) O3 p" O1 g1 I2 {. G </tr>
6 I7 G5 n: h4 e! t, B2 T0 E S5 T <tr> W+ i1 f8 Y# k1 o+ y
<td>) w' }9 @# R$ k+ m
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
% A) `) y, c9 J <option value="0">请选择部门 ---></option>6 ^* j; Q$ v% o2 O; j! Y
<%
$ v9 A$ U" _% O3 V! l, o; U string sqld="select * from tdept";% ~2 s( G/ V: C
stmt=conn.createstatement();
. h7 I1 y% F, f0 Z# mrs=stmt.executequery(sqld);
- P: R0 p1 }6 p$ n4 E' y9 wwhile(rs.next())
( u( K$ r. W6 Y+ v" k4 n{
7 g# O0 d' J2 N# C* p%> c3 b. ]& {5 H
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>$ o# [! Y, R2 _- n& k+ \
<%9 U5 | N0 K/ R# w" M1 Z
}8 t8 Y# G" U4 ^5 r% W
%> 0 t+ V* Q4 d4 O y( @, K3 i
</select>
7 i* R' t, E& U, U) Y! w</td>
/ K% p0 X" W# E% q- N <td>* A, q6 X: H* D
<select multiple id=city style="width:150;height:200" class="bgc">7 Z# }4 A/ X3 n4 h9 ^+ Z- g
</select>! y: R! h$ O% {& I9 ~8 G, F
</td>
# }/ i6 V, T* A8 ~" ~9 P <td nowrap align="center" class="bgc">: D* W4 Z' n/ \- G; V6 U: r: H
<input type="button" value="<<" class="buttons">) \# M3 s& f; s% V8 H8 ~
<input type="button" value=">>" class="buttons">
; c. Z9 V: ?9 @/ d! x; G3 s</td>
5 q) {; R/ M% B k8 f; b, F7 q <td>
$ O6 j" }& j9 ~0 l <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">) q8 _6 }, V" s8 P# r* f" e
</select>
% ?8 P$ B7 H* ^4 i* h</td>
8 Y9 n( ?) H0 q: B0 f </tr>
1 h: @" i" @- [" v" c, Z <tr class="bgc"> - A5 D* U- K4 R
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>
) p' x( ?8 z% B0 F* [0 Y7 C" E5 p; }3 v </tr>$ r2 |5 ?, ~9 B& }" T* W7 O
</table>( O3 e# Q1 h+ O+ i/ n8 d5 M
</form>1 @5 A- I; i* k2 v
<script language="javascript">
/ k' Y, `. l! A$ ]+ e//人名移动
& H8 H% O+ k+ ^* W9 Nfunction move(fbox, tbox) {: n2 [' n( _/ D
var arrfbox = new array();4 E" f- T1 x: ]# s3 M0 F F0 [3 X5 U7 B
var arrtbox = new array();: \4 G O8 G1 r5 F' H
var arrlookup = new array();% f. s* f2 I& o5 a- o4 g7 @
var i;1 O" E: d0 y; f) ]- L& c) ?2 Y
for (i = 0; i < tbox.options.length; i++) {1 t8 M+ X/ f: B) g# ?
arrlookup[tbox.options.text] = tbox.options.value;% n# _9 b" C, A" b! l& j" v
arrtbox = tbox.options.text;
( l& k0 z0 Z+ g# [2 H1 s}: o/ s, D% B8 u6 }
var flength = 0;/ K! G3 x4 M$ I5 T; R w
var tlength = arrtbox.length;
+ G. B; G9 e+ |3 H. l* o; G- |; ^1 ~for(i = 0; i < fbox.options.length; i++) {
1 D/ h9 M8 A- w, T8 farrlookup[fbox.options.text] = fbox.options.value;
3 D x7 `9 |2 ^4 h* L! T4 Hif (fbox.options.selected && fbox.options.value != "") {
, j" a' \& t- \% p! `% harrtbox[tlength] = fbox.options.text;2 h: M1 `! I2 H7 _7 F: ^
tlength++;5 @# B, l) r7 v# F! L# R
} k7 `* p* I( N8 s2 u
else {
( T3 N& b* E4 darrfbox[flength] = fbox.options.text;, Z* v& y) {3 T% M# ~# G, R7 B
flength++;
; r5 \& `' b6 i1 n. N6 ^. L x }: Q4 F4 [- d5 @& D
}; P1 h; Y1 C6 K5 g0 \1 I; `
arrfbox.sort();
. v( |! I# B* R' c3 Aarrtbox.sort();
# t2 g ~0 T+ x/ r4 Z6 t! H- _7 ] Y- L/ T# }% D3 ]6 m( V5 W
fbox.length = 0;
! c N2 { P: K: G" {% Ptbox.length = 0;$ ^3 @! c; K( q& k7 T
var c;: X1 V( P9 Z" G' r1 I
for(c = 0; c < arrfbox.length; c++) {% g5 m! F2 T+ b" i$ e
var no = new option();
$ ]9 m7 r4 q( i: z3 l) sno.value = arrlookup[arrfbox[c]];
9 k1 o0 l8 |7 wno.text = arrfbox[c];
3 M! t7 R4 l/ |. U. q- U! J. Z- Bfbox[c] = no;1 z& @8 y' {+ `0 U
}: r3 `7 V( Y, C+ ^8 F& [4 H& k% p" X) E
for(c = 0; c < arrtbox.length; c++) {
, \- ]+ @0 B0 N) `0 o9 G/ fvar no = new option();4 \- i; {( I+ f/ x6 o
no.value = arrlookup[arrtbox[c]];4 u3 }6 U; \3 x2 Q2 ]9 i# n% I
no.text = arrtbox[c];. t8 B k: @3 x
tbox[c] = no;
- l- w: D- U( I" E- C& d, F }+ |/ U% U# R& b; d$ b$ D, w
}
4 ?, `# Y% o* z% z' ]3 b</script>
* ]3 W6 O6 g) ?1 D</body>
4 ^8 } Y4 W- z( | z& m |
|