|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14389
- 金币
- 2480
- 威望
- 1647
- 贡献
- 1428
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
2 A. t7 `3 f$ n# V2 E c pageencoding="gb2312"0 p) a, T: V/ o7 Z% M% A) z
%>
; l4 X0 ]( E+ z: N0 J/ j<style>
6 ~) g) r# T- D/ ?. J) T4 \.f9{ font-size:9pt; }0 K5 }# j, H q$ A/ E
.bgc{ background-color:#aecaf9; color: #0033ff }
4 E7 v& d1 F+ {! n$ a.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;- x c1 {: e0 `) O! ^
border-bottom: solid 1px #4e7dc1;7 C `' Q6 z! B- I8 k
border-left: solid 1px #aecaf9;
& j. A. ^+ N+ S2 t* F border-right: solid 1px #5679bd;1 L6 k f0 S- X3 j
padding:1px;1 K5 |8 {% y" J; K8 i3 @3 m
margin:0px;}
9 R+ b# c) B T4 K! q& V; x3 H* R</style>
2 a' B0 l1 b" i6 o* U" B0 h<script language="javascript">
- H( {% m1 d# j6 V, I; ~<!--
) N$ b% [- _7 G2 ]% z% ^function rv()
: ^7 E! c# \; T& h/ [9 R{! o- ~) P& Y8 j0 [% }7 d
var val="";9 T! t% a! f) M T5 K
for(i=0;i<combo_box.list2.length;i++){+ }/ F. I) J/ u. I2 J# {# L4 X8 f4 l
val+=","+combo_box.list2.value;
& r- E8 x: o( F7 K* \ g+ k }. s: c+ V U ~( g& B0 o
if(val.charat(0)==","){
/ F$ e/ ?. n7 _! U. v4 ]) l val=val.substr(1,val.length);
3 }# v" s7 J. o' `/ P }
0 l' c0 @; C$ m& l opener.form1.frecname.value=val;# }8 k* \1 j% N' h
self.close();7 ~+ Q3 X$ }' n! _& l
}. ~2 D1 y1 I2 l( F6 v* Y1 U
//-->! W7 d& x* n% w9 l
</script>
4 J. y1 ]6 `* j: h& k6 s. O<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">& E# X; G$ A3 O" n
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
( G1 Y2 U, P9 E! z' m1 o<%7 \1 a- A8 h8 h0 S
cdatasource ds=new cdatasource(); //数据联结bean实例0 p! E+ B" U! b) _
java.sql.connection conn=ds.getconnection();
: P2 \8 y! l' o0 d4 Y4 h2 B6 G& B; S java.sql.statement stmt=null;( [5 A+ U$ T+ r5 h
java.sql.resultset rs=null;
) J6 r1 S& m" G' u cdatacheck dc=new cdatacheck();
! r6 I) B4 z3 o' x' D6 m, Y%>+ r5 R4 J' e0 K6 U6 s: j& }
<%
6 _# k; Q8 c& K1 R( Wstring 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";
o) k! l$ W# E& Z ystmt=conn.createstatement();$ S w! j' K0 \2 U, k/ }% a
rs=stmt.executequery(sqlu);7 `3 p% `0 ~/ k( O- _
%> h: W& I/ F- S' Y# r
<script language='javascript'>
+ S2 E! R# {5 r+ D+ [arr = new array();3 g; s1 I9 S% X5 n' R+ [' B& z
<% int temp=0;
5 @ l5 t, P3 P. i# a/ ?- j- R( Twhile(rs.next())4 k( R0 z3 c/ a" o% k. Y9 g
{. R, p, N! F% q
%>
- U* x1 o7 J3 B5 ]" k8 h) Carr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
4 b6 Y/ w0 a7 E2 [2 i2 R$ T' |<% W t( a. v' _1 v
temp = temp + 1;+ ]' }2 O( E, C. g& g8 N5 W
}( X# I3 C+ H& y" [& E: V6 R! q5 r
%>
8 a; i7 w- ^+ W# S, i/ stemp=<%=temp%>;
3 j+ A A8 J$ ^function changelocation(id){ & y0 z# @ _& X0 l
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
1 N$ M8 ]/ D5 u& S8 Dvar i = 0;
8 k) `: d! ?8 Q! @document.combo_box.city.options[0]=new option('-------','');
9 q! H. H' i- kfor(i=0;i<temp;i++){ 7 t5 _) v2 I" e' W
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] ! a, G" d3 ~$ {9 ~
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); 3 H1 ?, O8 T3 j7 O
} , l% P7 M6 I0 R$ ~
} 0 \: L% S3 D( f; H" f5 i% P4 v
}
3 q$ q; Q1 T; C0 ^</script>
" ^' S+ T6 b* l' I; x
& O; K& T; R* ~0 c: E<form name="combo_box">" R8 i" P- k. u. n* G( `; c
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
) F3 k7 C+ I. q7 Z i <tr height="24">
! q" n7 f6 M0 z5 v% y( @% ` <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>( u& d2 C9 p$ p' J/ ?/ }
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
0 _0 K/ S0 S8 N1 q0 p$ N <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
$ U, _0 Q/ `6 I8 T( t <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>% w3 [7 s& ? |" V8 _
</tr>& n1 g( f* \& k4 s1 a( i5 B
<tr>
- Z% b+ s8 p. C <td>
[8 P! N, Q* I$ G2 ?+ \9 l <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
5 V% d+ s1 @ N" }* [ <option value="0">请选择部门 ---></option>
% ]2 I2 n% g, |# A7 D h2 m<%
! m, w J& l! ?, O9 Y string sqld="select * from tdept";
4 U. H; t, }7 gstmt=conn.createstatement();
; B$ H, l9 g! d& ]! O! Z+ y1 O3 Trs=stmt.executequery(sqld);
1 t- Y1 [: k1 B4 Kwhile(rs.next())
* B8 _- }. n: }' C2 W' {2 h{* \- ^; X; K3 h5 s# F
%>9 W% y' S+ Q! G& D
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>; ?' S9 B% O. C' |3 J! X
<%' i3 w( ~4 P+ H
}5 x: Y7 N. g' f: h( S
%>
0 {9 J# N! j6 s. u( S5 u </select>' r% K8 [/ N' R5 K% D
</td>
# l) w- ?# I, P( M <td>
8 ~4 {8 {6 i# j. {5 h$ N <select multiple id=city style="width:150;height:200" class="bgc">
; \) z: I) b1 i2 d( s5 j </select>1 F; i5 k8 Y5 y% F; S' f0 d
</td>
% t. Z! v- e5 |" L <td nowrap align="center" class="bgc">0 p( D6 z" @6 L
<input type="button" value="<<" class="buttons">% W5 a+ F2 [8 v! W" X
<input type="button" value=">>" class="buttons">
6 q3 d% R9 b: `' b1 B A- O</td>
/ M4 n* I u. i9 R& j- ~* |3 e2 d <td>
/ c6 h! v8 e, D% @6 k <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
5 w, l6 ^) L1 f. S( K1 ` </select>8 J( _" K* f3 D
</td>; d2 Y4 O/ |/ b% ?3 E
</tr>4 K' i" o% {/ S
<tr class="bgc"> , [. T3 A) \9 y t7 A& f
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>
" i5 m+ L7 u' F/ A$ L% J1 K2 i </tr>7 M4 \, C& ]8 L9 G5 D4 ^" T+ K
</table>
- \* D: \2 L4 ]9 v' A# I</form>
1 ~0 F7 x2 G9 j' b<script language="javascript">
: B" s" y: I( i" S7 J, r L//人名移动
- L) ?9 j( ?" }$ c; |" f4 vfunction move(fbox, tbox) {
/ O. u) }9 J+ N7 Q! Dvar arrfbox = new array();. j" K7 I: i, Q% s3 H
var arrtbox = new array();3 b% C% H% j% Z2 M; u$ `. h7 e8 a# v
var arrlookup = new array();" R7 }7 h/ S' Y6 s: _! P! z
var i;
6 M5 d3 |9 ~3 W4 _4 _for (i = 0; i < tbox.options.length; i++) {
6 \9 c; f4 d) r# zarrlookup[tbox.options.text] = tbox.options.value;
7 @/ C! G1 f- l3 iarrtbox = tbox.options.text;6 y: |5 U3 k) J+ }/ v# Z( P
}2 z. ?) V/ ^7 ?* \
var flength = 0;
' i z- ?4 R2 V5 x8 {2 C7 lvar tlength = arrtbox.length;1 c7 R1 i5 f) A' n1 x" m) _
for(i = 0; i < fbox.options.length; i++) {
' S* @) H1 v; u# m: L- tarrlookup[fbox.options.text] = fbox.options.value;) j* i) r) O% g# X
if (fbox.options.selected && fbox.options.value != "") {
9 {. K* k7 V$ W: M; x, oarrtbox[tlength] = fbox.options.text;! G/ M) M7 k: U9 H7 |+ Y
tlength++;6 [" e0 t& Q9 A9 e) w
}
% e0 Y( z; ~8 U4 q. d9 Velse {, E/ u7 d! Y1 }
arrfbox[flength] = fbox.options.text;% z. n7 ^& ^0 a& w9 D
flength++;
( D, l9 L$ U7 i2 _; m }
+ k7 w: r) e9 D; o% S4 _0 b}1 u) G! b( `' f. n1 w& E
arrfbox.sort();
' o& f% e* Q2 F9 B8 barrtbox.sort();
4 E' m0 M* _! G: ] o+ C7 _. j5 s% {; {6 W
fbox.length = 0;! H: l: s' w$ e8 H8 u
tbox.length = 0;# H6 ~" v3 P7 I( z6 g4 o- g% Y; i
var c;
1 g% f1 F b( ^! F3 R. afor(c = 0; c < arrfbox.length; c++) {2 `7 L5 ^6 ], T
var no = new option();4 w3 v* v0 [: ?% @+ m; A
no.value = arrlookup[arrfbox[c]];# O4 J( A9 c) V( q' m
no.text = arrfbox[c];
8 E J7 s& n: }1 pfbox[c] = no;' f7 @( C @+ f! S- [) c' B" p6 D) x
}5 ^9 X/ i7 D, a. ~ H
for(c = 0; c < arrtbox.length; c++) {/ P+ D' f9 T0 q( P5 ^
var no = new option();" V7 Q$ D( ^7 N* V7 i
no.value = arrlookup[arrtbox[c]];5 d: c% O; P: X( l1 E! _. \
no.text = arrtbox[c];
# R. G$ x% b4 btbox[c] = no;4 H" d- | g7 ~& I+ m9 m# z
}/ j, @2 H8 c# K7 x2 w1 n9 x: I
}: h2 \! A& @! g6 z4 j
</script>
( E( D) D- H) K+ P9 s C</body>' v" R6 d$ W% x$ [
|
|