  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14221
- 金币
- 2401
- 威望
- 1647
- 贡献
- 1349
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
; t( A, D/ J- G* R# Q8 k' _ c pageencoding="gb2312". h" [5 @2 O0 W0 t( h
%>
& A0 P% q7 Q% r$ T6 A<style>
+ u* g% m5 p$ Z* V- J% e3 h/ s; m Y.f9{ font-size:9pt; }! \; t/ g0 B) |/ f5 R2 n1 E {
.bgc{ background-color:#aecaf9; color: #0033ff }
' ~* j+ a1 X) |: B.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
1 W& h1 u9 r$ C border-bottom: solid 1px #4e7dc1;5 {$ O) g6 L1 E. ?6 i
border-left: solid 1px #aecaf9;
( o- e1 h* C1 X" }( S border-right: solid 1px #5679bd;5 r+ n5 I1 h3 `" ]: C* y8 C, y
padding:1px;2 q! N1 C9 e: X8 Q; H0 ]+ J' _
margin:0px;}+ e1 _, h1 s: _* M0 P4 O7 W D. _
</style>
# ]) w+ i1 F4 `$ Y9 M5 f& p: l& g<script language="javascript">% T& ?0 Z- c$ t6 O9 h: X
<!--0 `5 @, W' g: c2 ?6 n" r# S
function rv()5 r T- D5 r$ y& i2 r8 |; ]! I
{3 b d% z9 w( K. G( @
var val="";. ?$ D: M. ^( E. b. `& [% _% r9 h
for(i=0;i<combo_box.list2.length;i++){
$ ?- P7 f( G# }7 X val+=","+combo_box.list2.value;
% Z# O/ h, |' e: ]8 J }
; Y5 w$ ]* @" { p/ U% T if(val.charat(0)==","){
# G' Q! m$ \) y) ]' F- a( S0 F3 c val=val.substr(1,val.length);
& A; q: ^6 u# S7 i. @0 x4 d) g }
) R2 m( i+ u) C F+ X2 g% w( Z opener.form1.frecname.value=val;
$ R$ c7 d) u# S7 N self.close();8 ?( X6 _6 ^$ F9 [
}
* C3 W- H7 t6 w5 {3 J8 J. M, }( a//-->) |% \7 s1 R4 l
</script>
# ^5 v% f) v# l. Z<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
0 V0 ~( A B# ]& r+ I<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" /> ]; L! m {- a2 \& E9 o6 H
<%0 _+ b1 X% Y/ V- K0 W, _( _
cdatasource ds=new cdatasource(); //数据联结bean实例( U7 ^; P+ B8 P" f; `% }
java.sql.connection conn=ds.getconnection();- T7 w: y, ^$ W# [; L2 X7 K4 k
java.sql.statement stmt=null;
/ Z: o3 x7 T2 I, W" p java.sql.resultset rs=null;! L C( Q: Q" _' i) ~
cdatacheck dc=new cdatacheck();
s6 S4 i1 g& V2 l%>
- d* x) h- D0 E8 m3 z6 G! C<%
9 w, N4 ^3 S$ ^# Y* ?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";
7 z* ^% J+ ?$ T" W+ F% Y' {stmt=conn.createstatement();0 a9 G7 J7 G2 q: j
rs=stmt.executequery(sqlu);
# J% y/ T d2 U" ]. n%>) J4 }5 P( w7 v7 D7 b
<script language='javascript'>
& @- H+ i3 X# J# x( J4 Darr = new array();) i9 @7 }; u# n, `1 g
<% int temp=0;2 U) g" d, f. ^
while(rs.next())
2 y0 Y: @( ]% P7 X& p9 B) h{
M4 M) M' {& ]2 v4 a%>7 T, L# X, j* c+ Y* o
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
( H; k B! N8 W$ U& C6 E<% \& \& {5 \# a( a
temp = temp + 1;
% y8 N+ c/ z- V. L# r3 s}3 K# R0 Y" a9 E9 L
%>
9 R- r; M2 z4 G8 m3 Ntemp=<%=temp%>;3 {+ A" K8 q) }0 ]) `4 e
function changelocation(id){
7 k l" `8 _2 d6 T+ pdocument.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
6 t, f# O. Y4 _" Vvar i = 0;
, i) E0 c+ j3 |% vdocument.combo_box.city.options[0]=new option('-------','');
. K/ P T6 t! b: y) I% j3 tfor(i=0;i<temp;i++){ ; S5 a5 C4 m1 k
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] : D/ z* [5 D" Y- M
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); 2 |) {& H+ n' T
}
, Y" ^1 f4 _% v) T}
1 m+ E _# [* M! E} 9 \( X3 m. K4 x7 [
</script>
* j" e/ I# a5 u) @ d+ V \) B/ s5 V* i7 P
<form name="combo_box">
$ d3 @1 p# u! Z0 o1 k<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">: y1 G' M& s( D1 e
<tr height="24">4 e8 A$ G9 @0 H, _
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
* c- T" O( ~: `- d! _2 X" ^ <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
$ d0 ^! _; F% M <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
3 w P" D9 }5 V" e$ V7 f <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>2 Q. o5 {/ A' H' t
</tr>
7 g( R8 Z3 _$ c5 Z' h( E <tr>
+ _/ D- e2 k1 O H# G3 A; p <td>
; Q) l8 y- j$ e1 v2 u3 m5 h+ k+ L <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
' o" y& u( M4 ^& Z( |) M/ G# I <option value="0">请选择部门 ---></option>
0 C% ?) o1 h$ s# e9 p# z<%
' V$ i9 j( }0 m' X& h- c string sqld="select * from tdept";
, V. y: l0 o7 A( q1 K* A$ R) Hstmt=conn.createstatement(); h0 s! T* L) q; D2 @3 [2 y
rs=stmt.executequery(sqld);, ?- J4 U- ~% u
while(rs.next())9 p& y" E, ~' T* O4 u- \7 g
{7 g2 {7 W- L/ r- }- r* Z6 G6 S$ G
%>
, q& s' i7 z7 E. {* } <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option> S. [2 V5 L5 E( {; |: x
<%
' \: d8 b$ X0 V}
( ^& D* y3 _. n9 e) G7 A( ~) T6 B%>
9 i" C2 o/ y j# H( j </select>/ d% y8 c+ K' E! v8 U
</td>
4 |2 ^8 P1 a- t3 L6 ~$ T <td>
7 i6 J( n# N8 m' f/ p <select multiple id=city style="width:150;height:200" class="bgc">3 D n S* e4 C, q$ z2 S) f# M: _2 ?- O+ _
</select>
7 x0 X0 m* ^& B8 v0 ^3 R</td>
* ]' ?! u7 g5 c5 G" A4 O <td nowrap align="center" class="bgc">+ c ?/ p9 h u+ q/ C
<input type="button" value="<<" class="buttons">( G9 C, c; V- V/ y# b+ ?" T0 e
<input type="button" value=">>" class="buttons">
7 E, U. S9 f3 L" g$ q* i' t</td>+ m1 g- F$ s- _' p6 a# K
<td>
8 n! {. z! x% F1 g <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">- `$ H' E; `, \, T( r2 G1 ?# T
</select>
0 T2 V& p. R2 `3 X8 \! C</td>
8 @0 B$ ^. v2 j' ? </tr>
: a# a5 d* e4 { <tr class="bgc"> , _& a; R2 N' k
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>9 `; H, x( _0 O& E; t( A
</tr>) [* F' g( O/ i! m$ K
</table>$ [# y) \0 Z: f4 L
</form>& b9 X$ j$ S S4 ?( p7 U- u, A
<script language="javascript">( g: d m4 ?3 |) F/ M8 n$ v
//人名移动$ [6 ~4 b+ W0 k4 ^( D M" i
function move(fbox, tbox) {
4 q" o; o: s' G. W# kvar arrfbox = new array();! Y9 ~/ x$ K( @9 N; z
var arrtbox = new array();9 }2 E/ v2 Y; y7 A
var arrlookup = new array();7 X" v; f1 n5 ?+ d1 R5 F
var i;, L' e5 O4 p3 f
for (i = 0; i < tbox.options.length; i++) {* P! J" Y# y. K% N4 G5 v
arrlookup[tbox.options.text] = tbox.options.value;
, x. T4 U% n; f% n0 w2 xarrtbox = tbox.options.text;
! l/ a' p5 p8 H. z' ?- `}9 v3 k6 ?5 p9 P- p( v2 F7 m
var flength = 0;
9 n$ L; C. {8 j: I: q% dvar tlength = arrtbox.length;
6 Q. v; d6 r+ u3 M3 F7 x" xfor(i = 0; i < fbox.options.length; i++) {4 v. w% U: n: k9 i8 _; W5 e
arrlookup[fbox.options.text] = fbox.options.value;
4 \4 s4 \ T% Aif (fbox.options.selected && fbox.options.value != "") {' X" z _+ C; R7 h% |! K
arrtbox[tlength] = fbox.options.text;
# f4 r' |& {* U6 S. `0 I4 T8 Q$ Gtlength++;$ ?: C- R0 B0 j9 p( }: A: {2 j
}, \1 a2 e- M! h
else {" R! S' k% t( u0 {- \
arrfbox[flength] = fbox.options.text;
: \( g1 _4 a0 | L: @: ^flength++;
0 R" D: R, w1 y" m7 @& d }
7 | K6 C$ ]$ L: e) v}( q5 n% Y' b( u; ?- m4 g
arrfbox.sort();
f5 j+ H, q& W% v6 uarrtbox.sort();
+ W) d4 t4 }: }& q6 d
; F5 ^% f- O$ h+ f6 yfbox.length = 0;/ P8 a9 L u' m5 `2 c' ~
tbox.length = 0;+ I P% ~. G! l; r3 I8 H; S4 t0 @
var c;/ s7 M# L5 f: W0 P/ G
for(c = 0; c < arrfbox.length; c++) {
% `1 R# [# W% {, |3 }2 s; E. b' Ivar no = new option();
+ W4 F: }* I1 K4 H' H# ^6 w: ?no.value = arrlookup[arrfbox[c]];- [$ h) G f1 N: Y: @* K5 l9 s. N
no.text = arrfbox[c];; G! |5 s* x! M) d- h5 \
fbox[c] = no;( C4 G9 Z4 E2 Z* r6 y3 T
}0 L1 \2 Z7 b/ t3 n7 {3 n" n
for(c = 0; c < arrtbox.length; c++) {
6 y( g) M" c" l T& s) fvar no = new option();
z; \3 g; B- T; ?1 Y; Ono.value = arrlookup[arrtbox[c]];
! } ^) u3 u1 \* j( N" H! lno.text = arrtbox[c];
% G9 v7 r0 h; Gtbox[c] = no;
4 o4 V6 j& I) y+ j& F5 H& ^4 _4 k& C$ { }# U+ e' g* ? _) F( H; z _1 S* e) O
}1 }1 a5 J: N) n& T& R. d0 A
</script>, Q, _- B2 |$ V. h
</body>
* U; i4 z2 J7 e# L( C' b9 N" ^$ l/ p |
|