  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14191
- 金币
- 2386
- 威望
- 1647
- 贡献
- 1334
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"* P- ~3 X+ U( }+ P7 _7 A, `1 N
c pageencoding="gb2312"* Z' M- [+ l- i) E6 m
%>
0 Q: B }' s6 u* J* z<style>$ F- p! @' }3 N" X* M) _' [0 S$ i8 I
.f9{ font-size:9pt; }) \) G& T3 m) c; d4 q
.bgc{ background-color:#aecaf9; color: #0033ff }
( F* ]8 A4 `. F) D" u6 O0 N2 n.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
# z3 W z9 l3 Y0 {/ g# C border-bottom: solid 1px #4e7dc1;9 b% d$ P; o! j5 r$ s4 J% c
border-left: solid 1px #aecaf9;; Z g' X% j: C' w% Y4 b
border-right: solid 1px #5679bd;
6 H: v/ g) u# T% W( _! t; T padding:1px;" \( R+ ~- i4 ]! T+ g+ u+ G
margin:0px;}1 S3 E, w" a" _
</style>
& o4 m# i! ?) x" o4 z<script language="javascript">& y1 ?" R( n6 U) r6 U7 U; s
<!--( J0 C8 t! p! B
function rv()
' R: [! c( o4 B% b+ b K{
. Z# c2 s/ `# M6 q4 _+ V$ S8 F var val="";
; `+ p6 S+ S) P: [3 q B for(i=0;i<combo_box.list2.length;i++){! M; A- H9 q/ N5 {8 n- c' u% w
val+=","+combo_box.list2.value;4 k: P1 Z+ J0 G! F; V- T" Y3 F& S
}
: A G5 h& r9 d+ ?% Y if(val.charat(0)==","){ F8 W* M8 P9 D5 M
val=val.substr(1,val.length);7 E8 b) b% R% l9 `7 s6 R; j
}
. P; R' f: s' N. a( z0 _ opener.form1.frecname.value=val;
: h$ _6 l6 o! n2 H9 y* q self.close();5 W" M; g j4 Z5 M/ C* j$ M0 O
}
# B- h5 r9 Z' O$ ~//-->
9 k; c" C0 P5 W* k3 t- [2 l/ f4 q</script>
% Y7 ?& ?$ L$ N5 Y8 T<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
: J. ], R; L( {% _<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />1 c3 ?! R- B/ ]' _2 U
<%
3 [; w% Y; g6 A/ k5 J, C cdatasource ds=new cdatasource(); //数据联结bean实例
9 s5 _0 Z' q: X java.sql.connection conn=ds.getconnection();: l8 R' g: h& H2 f( k
java.sql.statement stmt=null;/ Z5 ?6 z" Y. a$ q2 \
java.sql.resultset rs=null;& Q/ N7 V' A/ U8 y7 Z
cdatacheck dc=new cdatacheck();. c/ N0 r) h& \3 G2 U
%>8 H Q2 k6 [5 [" `; e7 {
<%
0 B3 O1 _+ V% v# X* Hstring 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";: B6 _: C/ R+ G$ g. _
stmt=conn.createstatement();8 ~$ i; Y; Z7 Y/ ]
rs=stmt.executequery(sqlu);
0 D5 t8 ~; q8 L6 i" H- {, m%>$ x; U) q5 _5 M: \: U, T4 m5 V5 u
<script language='javascript'>
' W2 ?% }2 q) G2 p/ varr = new array();
1 V, c1 R( q2 E8 Y' \<% int temp=0;
. r; E! o G/ p# w. F+ F2 |) Ewhile(rs.next())
0 y) H2 x8 l$ H5 U{
- l+ o/ j& J/ X5 p- O( n/ v8 n& V. e8 Q%>7 M. {; f, S( Z; c
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");, o2 t }/ L& _ c
<%
0 U- _: ?, L' M& S) A- ^+ g# \temp = temp + 1; q: A& F2 G/ k# `# ]$ a. s
}
/ F r5 r3 A* i3 R. K: r& }" ?5 J%>; n3 k! ~/ O" M, `
temp=<%=temp%>;1 R, G% a% W8 {8 b9 b U
function changelocation(id){ 0 j3 q% |& N8 p7 G/ z1 }0 w1 l
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 - v0 k9 Z6 I8 p6 Q' X- [
var i = 0;
/ |- [9 L: J' Pdocument.combo_box.city.options[0]=new option('-------',''); : J: f2 E& [; V4 B; |
for(i=0;i<temp;i++){
) y3 ^' H& ]2 C9 Wif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] 3 a f$ P9 f" P7 A0 z$ h
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); u. U, a0 S- g# O
} . U8 \5 X9 X( S6 Y3 \4 @
} 3 v. ] h2 g' ^% q1 q
} 6 A# b7 @; e9 v
</script>
" ?* p6 i8 c0 x3 H. _; ?) i; v9 Z
<form name="combo_box">
; x/ N0 {7 {5 p0 m' ^; Z. N: @<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">' ^8 F5 X; i; m" H
<tr height="24">
1 m5 ~, {( _ \% b+ Z <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>- f& F3 t0 h. @, Y
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>+ O8 W* q8 I/ G5 y" E. G
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>( Z5 d' n8 n1 i0 k( q1 r" m! t
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>( C7 V9 Q) I: s3 q1 X3 L
</tr>; D& m# o, I0 Q/ M- W! M
<tr> 8 S$ K4 A7 _4 ]+ v7 F( I% c: C7 ?
<td>* ?3 K/ y+ G1 ~" I: \
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">% \) ~. u: @" ~* D$ D
<option value="0">请选择部门 ---></option>. e2 j0 x( Q, n4 e) E
<%
6 e! C1 E. m; Z/ ~ string sqld="select * from tdept";% ~7 f0 C9 u; w ~
stmt=conn.createstatement();) n% x4 n: f0 y1 y
rs=stmt.executequery(sqld);% l6 _6 c( K z4 L9 z* b; @
while(rs.next())
c: D4 G$ u) I1 j. {; v{4 u0 Z4 h, u& W; ?/ A3 R- j2 S
%>
7 e) U C2 h( ?. e" ?+ o <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>9 K0 ]) j6 c# D3 M X
<%- T! y8 z! F6 F. r5 G, K/ L
}
3 m; D! S0 E% V& w# w/ b3 w3 a& B%>
; h' s" @4 a/ j' e+ j1 Z </select>
) [# G3 L1 l& `; U0 T</td>6 ?( u8 j( O& @9 ^1 b/ Z' W- w
<td> \, Z8 p7 x K) D
<select multiple id=city style="width:150;height:200" class="bgc">4 x" l5 B/ }; |2 u( t7 T0 E! i
</select>7 h) N2 J2 Y6 x6 d5 ? A
</td>' ^* w1 k. B/ {/ J! J
<td nowrap align="center" class="bgc">3 P" @3 D+ l* n# v. K P7 [* J
<input type="button" value="<<" class="buttons">5 ]; w1 u" |' Z6 ]$ b" J- s5 N0 m W
<input type="button" value=">>" class="buttons"># y' \1 Y7 _% V% g
</td>- ^% G' R- q9 d# R
<td>. X5 U; d5 X$ a6 A* x3 w" x
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
, V4 @( `! X. l$ U2 k% Y* t </select>) q3 h1 C4 ]( s
</td>7 ^% B7 d/ T1 R" M$ M4 W* B+ L
</tr>
m0 M- }0 |; [$ B( m: R; M- p2 Y <tr class="bgc"> 7 Y. L7 H2 I z4 X- T
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>! L* _9 o$ J( R. Y: h/ H3 C" T: a! q1 I
</tr>
' G5 X! P9 w2 I2 h3 O7 f</table>- E6 C4 @* w& p2 Y" U+ _( z
</form>: o# Z' h9 W" w6 \" F$ b$ ^
<script language="javascript">. h( i- j) V( Y( k
//人名移动
2 T) L) n" I3 k1 Tfunction move(fbox, tbox) {* R! V! R- K/ o" `/ {
var arrfbox = new array();
1 Y! k/ l9 R: N. f$ ?var arrtbox = new array();
" l$ ?. s* v$ Evar arrlookup = new array();- @2 B7 q2 k2 y" K2 n6 N
var i;+ f V/ R) I Y- c& G
for (i = 0; i < tbox.options.length; i++) {
9 @, s0 ] E6 f& s* xarrlookup[tbox.options.text] = tbox.options.value;
0 g5 m3 ]+ M& m+ p4 f# earrtbox = tbox.options.text;! a- ^, X+ W) d; U
}) G9 {1 p2 B) }/ I7 t
var flength = 0;
. s' t: T' ^: @, a" {var tlength = arrtbox.length;3 G1 M# g7 o6 P5 j; F& g6 r
for(i = 0; i < fbox.options.length; i++) {4 G' ^2 A6 i% ]! r/ j$ i
arrlookup[fbox.options.text] = fbox.options.value;9 T+ }9 ]8 z+ a$ {: h. ~
if (fbox.options.selected && fbox.options.value != "") {
& f! G! a" }. X [+ Q7 ?1 ~arrtbox[tlength] = fbox.options.text;3 O. a2 e$ n/ I, Q: q$ F, ~
tlength++;
4 x6 m! V2 N7 o& H* L; @ i}
+ F: ]/ P* _; [5 b8 N7 @else {
- G! j- n, U9 f+ l4 Farrfbox[flength] = fbox.options.text;* N% n0 t0 U2 N. ]* U! D7 O4 o
flength++;1 z+ K& f: M: Z6 h* P4 N
}
: d: ^' \' j; v q* N5 g}/ D3 ^: Z }, e! |
arrfbox.sort();
6 G8 E; L- Z4 Z( v, { n parrtbox.sort();
: ]9 v% k2 s- ?3 b& U+ |0 V$ L
* o" g. o. U6 O3 jfbox.length = 0;
p6 f% \. b; S) l" U6 ^% Btbox.length = 0;& `/ z2 W$ a' K2 r$ ~
var c;) q% @/ ]* _# h4 ~ Q
for(c = 0; c < arrfbox.length; c++) {' Y ^- x6 j# F+ c( ^) f; D! ~6 L
var no = new option();
# W9 K y! L4 Q* W uno.value = arrlookup[arrfbox[c]];
8 z1 U6 e' |, w# \) ~no.text = arrfbox[c];* C' E# R {" m" e- L9 I
fbox[c] = no;
' v$ N/ e+ N5 X/ a9 A0 D) q0 C+ u3 k}+ {/ ?. s% t/ f' g
for(c = 0; c < arrtbox.length; c++) {& B0 _2 O' N+ x% ~3 g
var no = new option();4 ^0 G0 S* o( d6 J) F) i2 _3 \
no.value = arrlookup[arrtbox[c]];4 p8 t9 Y( {' N4 P4 j
no.text = arrtbox[c];' F! r) R& L5 w! K
tbox[c] = no;
/ p6 ` d* P4 z6 B }
) e" I- c) }$ q1 h; Z$ \}
% O8 n" Y& U/ ^" O8 x0 b Q( r2 u" b</script>
/ ^' z: h" ^! \+ |7 A1 q</body>
$ D1 q. W. F1 W* [+ S' w0 Q |
|