|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14403
- 金币
- 2487
- 威望
- 1647
- 贡献
- 1435
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
4 ]& N, k: u' W c pageencoding="gb2312"
' i3 l2 I& E0 K2 ?%>
j' |$ G: L/ R5 U6 J1 J* W<style>0 R! x1 `: t0 Q/ o: }
.f9{ font-size:9pt; }
% Z9 K7 d: V1 G# g# c.bgc{ background-color:#aecaf9; color: #0033ff }
0 Q) O6 ], K) z/ z: ~.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;/ ?. X0 \7 X2 ^) q" r8 u
border-bottom: solid 1px #4e7dc1;
6 D. ^( K) l5 R( `4 o. Z border-left: solid 1px #aecaf9;
0 r- q+ \9 @9 y border-right: solid 1px #5679bd;
- k5 d# V' h& l padding:1px;; e+ }; R! a) b1 f% Q
margin:0px;}
h8 a' W+ b; m) s3 ~' a# s</style>
$ ~7 \3 Y- T4 w+ ^2 h: Y5 e5 s<script language="javascript">
: v9 ~; Z' K5 d" U( Y( J' u<!--3 y! k$ A# D' ?" M1 C
function rv()
* w$ U! Y* _& {0 J7 V1 Q* a! h& _{
; [" |! l6 ]4 }4 `& G var val="";' `1 _- P4 ]; e( A( F& y* m" e$ N
for(i=0;i<combo_box.list2.length;i++){7 p8 x! [/ s( F: ]6 O- e6 Z
val+=","+combo_box.list2.value;5 R$ A/ F# }; C8 e% p# R
}) ^/ s# v) \( g- ?. R/ H
if(val.charat(0)==","){$ |. u5 {" k4 }/ P3 P
val=val.substr(1,val.length);; m# S& u! C/ a
}
; r/ b( |( H& Z# w opener.form1.frecname.value=val;6 x7 P) X$ F0 G' ]. O
self.close();1 ]0 J. x2 o. V
}, e% W/ a W; E9 n) l7 E( Y
//-->- d9 _, ]& c9 [/ j! a( H: s7 |
</script>
5 L& U# @& o0 X: L- m<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">8 o8 D1 [5 S4 h( K5 D$ T$ E
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
% \2 j# M: A( u+ y8 h+ s, B, }: H<%
5 W, k9 h3 o+ W4 S l7 p cdatasource ds=new cdatasource(); //数据联结bean实例$ q4 ~' E$ K# c& _* v
java.sql.connection conn=ds.getconnection();3 x* f+ b6 Y9 P9 Y3 S! E
java.sql.statement stmt=null; q {7 {7 Q% g- p4 w' S: V
java.sql.resultset rs=null;
; |* s; v9 E( T- B( I& V3 O* a cdatacheck dc=new cdatacheck();
4 e% s8 ^6 @" s: V$ i; ?/ W%>
: W$ A) d: G2 \9 s* _3 ` f& Q<%& [* Z6 i+ ^4 ~
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";
' E; C+ H& }- z3 H$ G Ostmt=conn.createstatement();
- L4 D N& W7 P, D; P( Z# vrs=stmt.executequery(sqlu);
3 e( k3 T+ |3 E%>
, t: t4 ?7 _. D2 W* u5 B( Y<script language='javascript'>+ d- G* v) G5 ^5 J3 S: |
arr = new array();9 {3 @& \9 f6 @5 ~2 Q+ B% f/ O
<% int temp=0;+ o. i7 a* J1 x7 i+ U# }
while(rs.next())/ ^# |5 H2 d0 r6 R& B& N
{1 P. |% L# d% I. l
%>; a# L- e: k" I5 S
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");- |* D9 N3 {! j) y+ X
<%* c; P# @, b& Y- K
temp = temp + 1;
/ Y. q. t) ~& j) g# B4 d}" }% W! M K" X: p+ X
%>
* _! t A8 X L' P6 J0 d1 Btemp=<%=temp%>;
7 a0 R4 O8 e: S0 D) Rfunction changelocation(id){ / C9 S3 ]' R. d* z
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
' t1 V0 P4 A# V0 V" M/ kvar i = 0; 8 G% u4 j. k0 j
document.combo_box.city.options[0]=new option('-------',''); 4 x5 h# R. r& L, Y
for(i=0;i<temp;i++){
' z6 I4 M3 F! K! ?& D# bif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] ! }% B8 G: q$ }' a! Z+ D, X( g
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
) @, Z. z0 Z( h% [" j}
3 D/ [ E2 p5 [4 a0 \. U; x5 \}
1 k4 e8 c* Q9 j/ @/ ^, g0 O, e}
. E; ?2 Q2 J- l4 S3 v3 O- W" S+ t/ I</script>
# r5 N' @) k y9 X5 l5 I% \0 |+ D: O, f# g
<form name="combo_box">+ v, D. t5 Q8 v6 P: e R7 n
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
& ?5 z1 [- W0 i. J- k ?. t! ^ <tr height="24"># t; w: ^8 I( n- H7 [
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td># t: `5 C6 t5 q! ^- {4 b- ?
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
; {* w5 c4 Z+ T3 X <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
. p, I, j6 j0 m2 T% q/ P/ { <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
, d, X+ c9 a) D& ]- R </tr>/ }- \* ]$ G8 Z* O" r
<tr>
. q `" `4 I3 H1 ?; | <td>
. o/ j. l& C3 T' B% n! i- j <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
# q7 V" d8 j6 d+ Q <option value="0">请选择部门 ---></option>1 p& N5 z- M, e' _) H" n/ {
<%
7 |; g7 T2 i. |4 S6 ?& n7 p! P! k string sqld="select * from tdept";0 U+ Z* P0 I [. C! ~. C
stmt=conn.createstatement();% Q7 V) Z3 j# s3 T
rs=stmt.executequery(sqld); p0 w7 x4 F, h4 @* ]7 }0 s( g: o
while(rs.next())
/ C. H3 b0 v$ w3 ]' l/ M- N: I{; H) S$ G' k) ]# S! X
%>
( F' ~- n3 i- n7 n <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>2 O/ i0 _; r6 N4 k+ O! r( i9 c
<%# a1 L# X$ p- E) T, n
}. F9 k, J; i7 O
%>
7 Q8 h* p# T: z' u: R# H* d4 L </select>
2 T6 h2 i# E' ^) I4 E) B+ k, ~</td>
/ N+ t- b# U t( o5 m# { <td> i+ n* \6 A9 e& m
<select multiple id=city style="width:150;height:200" class="bgc">/ D! w+ _1 B) M6 N. r
</select> c2 X, p+ r' ]: f! v
</td>
) p; ]8 X6 K$ \, s <td nowrap align="center" class="bgc">
! i( N% x1 j+ {4 W- d) V9 S! v; h <input type="button" value="<<" class="buttons">
; a4 q7 f* S9 X0 Y <input type="button" value=">>" class="buttons">
1 S) p6 s' o6 L</td>$ @: B& N+ n/ Y1 S2 I
<td>- A' r$ n) a! t1 x
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">2 X9 d, u h2 A3 d
</select>
7 V- e, ?& R u l$ X' I</td># ^' B5 M4 N2 l% d& Q
</tr>" \, w, a4 D& U5 v' t
<tr class="bgc">
0 j; z5 B% Y* h: n2 w <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>
6 H2 {! X- d9 X </tr>
6 M W3 W) p) f2 Q4 b3 u4 S</table>4 ]& e6 X! r: U" v/ ]9 n
</form>" X! V, {' W9 O5 L" ?" N; i
<script language="javascript">, |. z# V" C* q
//人名移动1 ] M% X) R' l* o, c( e
function move(fbox, tbox) {
9 B$ t9 I. d+ Q. J# M% [7 M0 jvar arrfbox = new array();
+ M9 `8 }/ f' P8 B3 s3 H0 u) cvar arrtbox = new array();1 X; B4 K& H2 N
var arrlookup = new array();/ E6 ?2 a; K/ q/ _# m5 p$ Q4 R
var i;
6 d4 N4 _6 `5 }- g/ efor (i = 0; i < tbox.options.length; i++) {: b8 t1 y- F! w6 O* N3 q5 C b
arrlookup[tbox.options.text] = tbox.options.value;
7 }) H. i( E. q5 Carrtbox = tbox.options.text;: y9 a. ?, B' @9 P& m, i
}
' n0 o' f1 C9 C* a2 {9 e# ~var flength = 0;3 _6 N6 T) ^/ [5 A& `
var tlength = arrtbox.length;
% u5 U7 W" R8 `- ^. Q/ G7 x/ ffor(i = 0; i < fbox.options.length; i++) {7 t; X% O7 o+ k1 z; M
arrlookup[fbox.options.text] = fbox.options.value;1 T' n4 b1 p$ f7 M- c1 E
if (fbox.options.selected && fbox.options.value != "") {. W H0 Q, [/ f
arrtbox[tlength] = fbox.options.text;
+ ~. |* H8 V, b: htlength++;8 [& X* u0 Q4 X! k) {3 R7 C
}
0 Z2 E% o- }" m% _3 A- Belse {0 t; O- a1 W L
arrfbox[flength] = fbox.options.text;. q1 E6 r9 K; n+ u/ O& r# d
flength++;
8 x' K8 a* a/ |; c }* b6 C2 F$ G$ M. u( r0 G1 ?8 e& x
}
; i, K a' ~; Z# i. ?. u- [arrfbox.sort();9 a# m* a, X$ o5 B1 }# Y4 S
arrtbox.sort();
p4 x. J; Y6 ^, y0 [8 b) j+ a6 y3 ?' B; w" I. v" t& [( a
fbox.length = 0;+ u3 p2 |0 M1 P7 ^
tbox.length = 0;- r: R* I" G. l9 `7 P9 Q1 t
var c;
: v9 }& c2 ]# V) g7 Y5 n+ xfor(c = 0; c < arrfbox.length; c++) {
6 ^; U* X$ d g# Lvar no = new option();
6 W/ z9 S- d# |& x/ H# H2 nno.value = arrlookup[arrfbox[c]];
+ o# N: t/ d# S @1 V/ }& lno.text = arrfbox[c];
5 Q/ h/ E( _% _$ Nfbox[c] = no;# _7 Y1 N) `: Q. h- x
}0 i+ r3 l4 K# w' F' B- V
for(c = 0; c < arrtbox.length; c++) {
$ }' n, Q" }& f9 r kvar no = new option();/ n0 S2 E0 K9 N% F" Y- f* D
no.value = arrlookup[arrtbox[c]];
/ E& B" t* E k4 ~no.text = arrtbox[c];
6 o1 ~$ p# P H: Ktbox[c] = no;
, s7 t% [% _/ L$ J/ {9 T9 A6 r+ V }. i X' H7 Z; T
}
T2 d p; d+ w7 s' T" T/ [</script>
0 @& w8 ]$ ^' [9 K1 i</body>9 }/ I+ X" n6 _
|
|