  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14221
- 金币
- 2401
- 威望
- 1647
- 贡献
- 1349
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
& C- L6 v5 d6 d& w) G$ ^; ^ c pageencoding="gb2312"
- v5 U* N: ?' n4 w) Z- u* t%>( `7 M2 T& H+ C* i: t4 N
<style>
1 X9 x w: M. f.f9{ font-size:9pt; }" I8 d3 e/ I4 ]: i! F
.bgc{ background-color:#aecaf9; color: #0033ff }1 P% U' c! S$ N6 C
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;. C8 s* ^, w7 k$ q; o
border-bottom: solid 1px #4e7dc1;
0 n( P9 `( a" c! ~, U6 w' f- X border-left: solid 1px #aecaf9;
4 ?8 w* ~# y8 C1 }! h border-right: solid 1px #5679bd;/ E( p0 r$ l& }$ M( p' B
padding:1px;2 X5 d: L+ A% [5 O. x* I$ a
margin:0px;}% w. y6 v' [6 `# l! y& f' k5 K
</style>1 L% L' T4 `( `3 s2 s; n! T
<script language="javascript">8 ^) s6 D+ Y. ?; c2 x" w
<!--6 D5 b, V& W. J2 k- Y. K8 S- |- X2 P
function rv()
8 T& o4 x. ?2 ]: @- g) K{
9 o- P( Z7 m3 q" } var val="";
# B7 m6 S: t) }! s$ W; k8 R' L, E for(i=0;i<combo_box.list2.length;i++){8 O' A. Z. f- a a: W* `: _
val+=","+combo_box.list2.value;
2 ^1 d4 V* P/ x3 E M c }! G2 ~. v/ W# p3 T# I) F) ~0 @' c( }2 c
if(val.charat(0)==","){) c" z" V. C6 Q4 E2 ?2 Z
val=val.substr(1,val.length);
7 j7 Q0 v) }' |+ s3 V } C8 A/ \/ h& P
opener.form1.frecname.value=val;6 x x0 _5 |7 x- R2 X
self.close();
3 {) H* V0 N+ v* y$ S1 n6 h}
' I% e% u; t6 j: O8 o2 e//-->2 {3 w; S( l9 r3 ]4 P: d
</script>
' R% |+ j0 X$ o/ B: ]<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
" Z/ J. N7 V" `/ k. v- {9 M. Q) ^<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
" {, N- C" x. {# J7 m, _ c% u<%
* M: k, x* ]' H+ G3 m' B cdatasource ds=new cdatasource(); //数据联结bean实例
! m8 e) M1 P# p java.sql.connection conn=ds.getconnection();
4 C+ {5 G* u. l9 [7 W java.sql.statement stmt=null;3 P. X# p1 H# J- q$ Q6 d; `% W
java.sql.resultset rs=null;0 ^+ z d( ]8 ]) R/ l& G
cdatacheck dc=new cdatacheck();4 W2 L- `$ \7 A% D1 \! s/ T6 @
%>
* z+ x" n5 o2 q9 W( y; v3 E<%
3 @ w% _ W$ i! i9 i/ @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";# r+ W6 ?& [# Y6 {5 g
stmt=conn.createstatement();
; \: m- k3 T6 W f H0 Y* |5 Zrs=stmt.executequery(sqlu);* ~& r0 X4 V" F- [: S s2 \
%>, C8 Q' j o$ v0 u/ I4 y
<script language='javascript'>
5 f* e3 [ P9 @0 Harr = new array();
/ ]' |. o, i/ z4 s) T4 _<% int temp=0;. |( D/ A" u6 W/ j5 R T7 ]3 y
while(rs.next())
- B5 r* c0 n% y) n# F" Y{% N+ Q* x& T B; ]5 d1 k
%>
* ~. a. U! n. O# ~( \arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
1 Q9 p4 D# P* P" S4 Y<%, ~( I, q3 ^0 L) T
temp = temp + 1;
6 x; J: B7 v1 M; k3 R% C}
$ [7 _8 A* Z T0 [8 b! ~%>2 C/ {2 P+ ^. `; W7 P8 d% d
temp=<%=temp%>;
$ C% Q5 B6 |, Y) Mfunction changelocation(id){ ) s0 O- w, s1 B0 i
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 + D% F5 d3 W8 H* Y
var i = 0;
( l% q! d( O" Z4 Edocument.combo_box.city.options[0]=new option('-------',''); - E% n+ a# {, i
for(i=0;i<temp;i++){
4 P G" E' u( V% Z6 [9 ^1 iif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] ' F) g1 Y- ?* D
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); 5 Z! W, k: X2 v/ C
}
8 t, W4 C( d: i5 O' R) |8 D! ?; F}
3 \* e1 F+ }5 E2 a}
' M9 N7 f3 x7 x- C/ n! R</script>: h% }' l% \/ Z5 p) b6 F( _
8 Z$ Q$ c( ] I3 _! q S
<form name="combo_box">4 L" L. y/ Y& U9 \& G3 ?# @/ h- Z
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">/ l. G. {) E% f( W
<tr height="24">
7 {. ^1 X( x% e; R- [! C" ~ <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
; F1 D( I. F( Z, H( }; e0 [ <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
# W( `3 \# t0 e) z/ [( { <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
% k& E" ~* u; T& B" z8 H <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
+ n$ l! O' r) F8 E0 N- f </tr>
7 w' X2 `/ v" B5 r' k3 y <tr> 5 u {( @% l. Q0 u' H0 z
<td>- E% `; ?* T/ W* h4 O6 D
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">1 d# r& @: d/ Q6 K: i
<option value="0">请选择部门 ---></option>
) T1 _ {6 j* h" D \<%7 G, ~9 d: ^1 B# S" }
string sqld="select * from tdept";
}7 z3 ~! Z! @: |1 estmt=conn.createstatement();
6 M* h" Y& ]9 ors=stmt.executequery(sqld);5 A. ]3 I% a# e% q1 ^0 W, Q: g
while(rs.next())
* X; X' G- i2 x m3 {7 [4 p( M{/ Z, J% X$ A" f
%>/ d, y/ n+ _* v9 v/ O8 H) u& Q
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>) ~' ^6 ~$ ?( a# i, v: ~8 B
<%; P2 q7 ]$ z1 `% y
}
1 h7 H; [. F; J6 D( U: {. O/ L% t%> 5 w, d8 q' z" ^ @: {
</select>& I, r, k8 [0 ?; ^ q: k7 R0 [5 O
</td># j- ~8 n8 B3 j4 ~- _
<td> ^ {6 [3 y* S1 R: [
<select multiple id=city style="width:150;height:200" class="bgc">
0 w# b! Q6 Z3 ^/ E </select>
. ]# M4 z) a8 k+ C. f+ j) v1 d</td>
7 @( F/ {7 i8 j <td nowrap align="center" class="bgc">/ \2 O) b: f @6 ~* A4 N% Y. y
<input type="button" value="<<" class="buttons">5 n7 U. ~9 m: V$ v# V+ d) _# X3 N9 O
<input type="button" value=">>" class="buttons">
# Y; A1 D' n9 m' r</td>
# r. @" T/ r1 F <td>/ g8 \* Z! z& r4 V* S0 a) s9 x2 t
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
\- ^% `. ]4 W5 ]* Z3 W+ r </select>
! `; z5 g6 }7 c3 z$ E</td>& d# d4 g+ @3 v: a
</tr>6 \. Y% `' O: K+ B5 N8 H3 H
<tr class="bgc">
8 X' ]# s o( s4 q <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>$ w X* R' u f3 N9 Y
</tr>; v+ Y8 v4 ~6 O9 d
</table>
/ F, T* k/ L$ C- L6 o( L$ ^</form>0 t( O2 f/ \- E) i9 s8 a+ M. J
<script language="javascript">+ Q, F8 F+ M1 _6 E
//人名移动- X: X* |( i+ n7 R
function move(fbox, tbox) {6 s- [+ C2 v7 t$ J: a( v
var arrfbox = new array();
* Z: r) m+ m4 L& Svar arrtbox = new array();
" u9 x' [, j+ Y; V4 f3 p7 vvar arrlookup = new array();
6 c6 g$ g0 g% a% x! R5 Mvar i;6 H3 w* {# w! C% q
for (i = 0; i < tbox.options.length; i++) {
: j/ u6 G6 b# s2 K/ ^arrlookup[tbox.options.text] = tbox.options.value;5 X% @* ~1 p4 [* Q9 }3 ?5 x0 T4 A
arrtbox = tbox.options.text;# r0 Y/ c$ ^% {4 Z: l/ M
}; J; {' | h2 E! \# n4 N# D
var flength = 0;
$ L& Q4 w+ h- j7 \3 u7 cvar tlength = arrtbox.length;
( y7 ^% Q6 C0 P2 I- _+ xfor(i = 0; i < fbox.options.length; i++) {0 D$ H* F: _0 J2 Q) Y2 d9 \! z0 {- [
arrlookup[fbox.options.text] = fbox.options.value;
; F. o9 N9 V/ \6 ^& ^8 P- q3 s/ d7 y/ rif (fbox.options.selected && fbox.options.value != "") {9 ?9 E4 g, U. c
arrtbox[tlength] = fbox.options.text;
6 Q$ `8 Q' V/ O# @# btlength++;
}3 T/ t& p1 X' X0 N- V}
4 I8 `% {' T# jelse {
8 a: ?" ?3 E c5 K+ rarrfbox[flength] = fbox.options.text;! A) ]8 F* z* q# ~- n, o
flength++;
! E% e& y5 |# c }4 O3 L! k8 {: Z" q! [
}: }5 @1 b' D/ ?- ]3 T
arrfbox.sort();) b c7 v. u& M& y; x
arrtbox.sort();! Z6 Y1 E9 N# \8 ^7 l: `
/ V' e4 N* Q3 i8 S, j2 V
fbox.length = 0;3 `$ v0 U+ `3 T0 x- C2 g7 A; O
tbox.length = 0;0 |% R& ?4 L/ y# [; W9 G" {( k2 V, ?
var c;
# j5 G# H8 u( S9 Mfor(c = 0; c < arrfbox.length; c++) {
9 h$ x3 E' a" l# D6 {, cvar no = new option();( x! L! |. k6 k- s& q6 C5 R4 E8 X3 m
no.value = arrlookup[arrfbox[c]];- N j# ~( L6 p5 ^ z
no.text = arrfbox[c];
L" ?# ]# _, vfbox[c] = no;
/ y' L+ S+ }$ [2 t$ s0 _6 m7 U}
2 q; t7 t2 r0 o" y9 wfor(c = 0; c < arrtbox.length; c++) {
6 o) i4 _, ~$ h4 G! b- [ A0 j7 xvar no = new option();+ U: [2 u. h5 |) C- E; i
no.value = arrlookup[arrtbox[c]];8 r- S. g! A8 F. t$ {
no.text = arrtbox[c];
! P( ]! l8 M$ R- @0 C* o+ ^8 Wtbox[c] = no;8 y7 M" [$ J! G- C
}! e0 g7 u# l1 U- Z" [, M) K0 x5 b
}
5 o# S3 d/ J8 {</script>
, d5 a$ `6 s/ P$ i</body>$ C7 ^8 m- r+ K* U
|
|