|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14329
- 金币
- 2450
- 威望
- 1647
- 贡献
- 1398
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;" A o6 |) l$ v7 L8 y! M. S1 H
c pageencoding="gb2312"
% C9 ?) M3 @# v# G$ t%>2 x( g1 r! _! _' P U4 w) l$ h# Y
<style>
7 \& [" @# U3 N! }. ^. k' j V.f9{ font-size:9pt; }
1 H1 q# k0 e5 p- B" {* D.bgc{ background-color:#aecaf9; color: #0033ff }3 p) u6 p! Z( Z$ h2 T- i7 ~
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
7 c4 q: o* j6 j3 ?* \/ F0 o border-bottom: solid 1px #4e7dc1;
; l) v& R5 k7 m" ? border-left: solid 1px #aecaf9;6 R" q' M) g' Q" k" M" w
border-right: solid 1px #5679bd;9 m9 T) Q- m/ b9 e, w6 T# s
padding:1px;
* [/ |2 n+ ^% n+ F margin:0px;}- Y T$ I# L' A) R
</style>- m9 j& r, X2 w I$ I/ ?0 r# A' l
<script language="javascript">; {' y; o# g) [0 k, I" j+ s; n
<!--
" ^) e* M( c+ t6 @7 Pfunction rv()
" n8 w5 H8 Y! ~! x5 [. u{
& t4 Z( P" Y8 E8 S3 m var val="";* V8 h0 y6 V. F9 Q+ k
for(i=0;i<combo_box.list2.length;i++){: S# K/ X8 _' A! d
val+=","+combo_box.list2.value;8 I& E. s: ~" P' W2 Q* M; b- n1 z
}% l- a& n! ~$ b
if(val.charat(0)==","){4 [# k& `! ?! w3 M/ u/ m; H! W
val=val.substr(1,val.length);
/ x, p' z( W l; c. k# a+ s5 a }
- \7 A# e% V3 `! Z! ^ opener.form1.frecname.value=val;, f6 U/ Y1 R6 W: _, b$ D$ }
self.close();' X4 y" C+ \$ d+ S* z8 ~1 w/ j
}4 p: ?6 d' m3 `0 A. {
//--># o6 z/ V$ v" F1 j2 S0 D8 u
</script>
# N* d$ g# ~2 R8 `; I5 S<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">$ T1 r, ~. h. [) n9 N
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />& r L- n8 G) B8 w8 A
<%
; n( T* u0 X5 {' X' s% c cdatasource ds=new cdatasource(); //数据联结bean实例
2 l0 F Y6 L& [" M2 O/ X/ x6 o" E java.sql.connection conn=ds.getconnection();3 H3 X, V/ e7 N; O, T
java.sql.statement stmt=null;
; T. A; V3 T7 a" ^ java.sql.resultset rs=null;" n& H+ h4 B4 P1 F, d, ^5 |* A
cdatacheck dc=new cdatacheck();
% N7 n/ a; g( K2 d%>
( i6 H* s! A2 r. Y0 K/ z<%: Q! v ?, L) ?4 Z
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";
2 g# S; g# k' ^stmt=conn.createstatement();& e. h" U. u/ Y; B7 l4 M
rs=stmt.executequery(sqlu); x- z' F7 o1 A+ a) L1 _) o
%>& e8 A6 t2 I- N) H& v- Y i4 m a
<script language='javascript'>! l& q2 I+ D, W. B" d" }% F
arr = new array();# @. ]" y2 ^3 R
<% int temp=0;$ x8 h' E: h8 s3 d- l0 y4 `! ^
while(rs.next())! O) X! p8 E$ S* w
{
" u+ I* v8 b4 p! ]%>
" j' \1 \/ g5 ?% marr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");8 O" [& K! X+ e" `8 A- h! ^
<% O: V! u g* {* {# R% l& h
temp = temp + 1;" \( f' v8 U7 M! Z0 E+ ?) _: S1 k6 ]
}
6 O( s3 ?7 D+ X3 |%>1 i; a% X. b0 Z7 Y7 t
temp=<%=temp%>;
2 F. z6 C0 _" T9 f1 L& v. L3 dfunction changelocation(id){ y# @* u3 W8 E. O+ i( z
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 0 I9 {- g3 F' Y9 T, w
var i = 0; 1 R+ d1 G. F) j/ G3 Y
document.combo_box.city.options[0]=new option('-------','');
3 w: n/ E6 V0 z9 H! }3 }for(i=0;i<temp;i++){
x: ~8 ~" M* n# _if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
; {$ \, A3 M u8 ]$ }* q. cdocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); 0 H/ P) W& G# X _7 `: |. }% G
} % ]: {! r. X9 P8 D, p. z
}
/ I" b7 k8 F- I H}
+ i+ q. y$ b! R' d+ p4 o2 I</script>
5 U3 G/ c5 N. j* n" f
0 f& ~- d B# E6 B& Q9 h [5 \, ^<form name="combo_box">
. |( e( y3 {- Y; r<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
. ^% S8 f& b0 \9 H5 M5 y. s <tr height="24">
- o' I+ Q( q6 \* n2 O, t <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
8 v2 a( C3 n/ C( b7 n <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>" L; c8 E. E: w. M Z* c' p' I8 }1 H
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
7 \! g. f u# Y: t; ` K3 [ F* T <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>* f( }8 e3 b! B" ~
</tr>
& W+ O. o: \; k' g <tr>
, x z1 C9 h( c' M ~& F/ h <td>& k# Y7 o4 @2 f9 O' m
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">; h% U" z9 I: S2 V0 V6 W9 r8 h
<option value="0">请选择部门 ---></option>
) d" N; \. B: ~8 J h: b<%# n4 v0 _7 C6 w, R8 @
string sqld="select * from tdept";
" R$ m0 n, G$ y1 e7 N6 p2 {. }stmt=conn.createstatement();
& U# O& O( S6 {' J3 I1 b7 z1 y0 Irs=stmt.executequery(sqld);
3 H$ x" ?4 o( X+ ^" ]; j2 t$ G6 zwhile(rs.next())5 l8 q2 F% a7 d$ \, W
{
! _4 z) k4 }0 X7 J%>$ W8 U% H& C8 [6 w. t9 V
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
3 i1 t$ Z+ K, c) w) _! S) }- w<%1 q/ i1 I' k" L& t* u8 Y3 K
}3 d+ t# b/ O! D6 T* }; {
%> 2 g3 Z! S! {% r2 K: Q/ v& L/ T
</select>
' x0 n6 H) O& O0 q) P q</td>
" {: }* O. i; _ <td>0 v* Z* V4 ~8 l6 N% R
<select multiple id=city style="width:150;height:200" class="bgc">
, T6 S) j! C3 A( W </select>. Q4 R9 i' y [4 N B. Q8 Y. t2 f0 @
</td> A9 @6 a2 d: j" g c1 \- A% _
<td nowrap align="center" class="bgc">
# Q% z7 u- d( o <input type="button" value="<<" class="buttons">
+ N# `# _# Q# n; Q. a* b0 L! c0 q; r2 v <input type="button" value=">>" class="buttons">0 {' {5 G7 _3 ~3 C' j/ _5 X2 K
</td>
* E; ^$ ^/ D( R3 l, Z7 } p9 J <td> z- H2 v# T) ~# |" }: Z6 G) a
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
* e% ]! ~& T, h. U7 b </select>
7 N/ Y2 [3 o( g3 D</td>4 h$ Y% O) [8 f
</tr>
) G7 N$ h& } Q- ]/ ^$ r/ k <tr class="bgc"> ) S: O/ n7 e( I
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>2 h" i" @3 f. x, g
</tr>- ~% u1 o7 F r6 `1 m v
</table>5 z* x% [7 ^! v7 G+ o" q |) a
</form>& r8 U8 U; l8 Y8 x+ `3 P
<script language="javascript">
& a& G; l; S! r4 H! A//人名移动- Y% E0 J/ O: q
function move(fbox, tbox) {
. C" e( n) B7 h+ vvar arrfbox = new array();
9 {6 ]& G- U4 K e2 F7 E& gvar arrtbox = new array();
+ |- D) D# l6 ?! O! mvar arrlookup = new array();+ H( [2 ~! r' v; V
var i;) B4 p# J' @6 F
for (i = 0; i < tbox.options.length; i++) { _6 g% b" x% c
arrlookup[tbox.options.text] = tbox.options.value;0 ` v! R9 C" o/ \8 V2 ~
arrtbox = tbox.options.text;6 r8 c( U! e7 i, Q+ O$ [: V
}
8 _& j9 r' B8 ?- ?var flength = 0;5 H/ x% n. [5 z1 q$ \
var tlength = arrtbox.length;
$ l# O0 N" U1 C: efor(i = 0; i < fbox.options.length; i++) {
- p. X) q* _3 @% {: warrlookup[fbox.options.text] = fbox.options.value;4 l$ e& z$ D3 M+ |" f
if (fbox.options.selected && fbox.options.value != "") {
. F6 w9 _8 W. F- Larrtbox[tlength] = fbox.options.text;# k: |5 D8 c5 Y+ N8 o4 h, ]
tlength++;9 D" k/ V/ r% P
}
5 t: N6 a' X: u Z1 Qelse {
" r* ]/ y8 B f" y- D3 uarrfbox[flength] = fbox.options.text;
" f, j# P* x* M& Z" D8 hflength++;# f5 p! X8 N0 D+ a; f* {
}
& w8 j$ c9 Z1 Q8 h, h" h4 }6 R5 c" [}6 R! ?$ t: c4 R4 l
arrfbox.sort();
H! h+ G0 o1 f9 c0 U- garrtbox.sort();
% C/ l4 `( b e1 B& n K& z0 W! V
- ?3 M8 @& I' A% a: Xfbox.length = 0;% c9 n% s7 D' W" b
tbox.length = 0;6 A1 @7 a8 |2 _. c! ^
var c;
2 G0 E4 I: M! e3 E P& Dfor(c = 0; c < arrfbox.length; c++) {
) T0 ~0 c7 v! s& {var no = new option();
! n$ s$ n8 c- ?! eno.value = arrlookup[arrfbox[c]];% U+ d6 I( [. w* e/ U0 ?+ c. d! h
no.text = arrfbox[c];
4 I- ~ }! _2 ]& G1 v2 I0 Efbox[c] = no;
3 I: m+ l5 J+ b}& ]1 u/ R* Z& |: Y
for(c = 0; c < arrtbox.length; c++) {
, J, x" u( i" C- q5 \- Qvar no = new option();6 m& j) K* y1 T7 D0 H& q3 ?
no.value = arrlookup[arrtbox[c]];
' P1 m+ c& F& v1 p, k. {$ rno.text = arrtbox[c];
# b% ~- i, Q; |3 U9 m) ptbox[c] = no;
& m+ ` B! G8 P }
5 q3 Y( O, x& k0 H, l3 O A/ Z$ h3 `}
6 K6 W( E' T# s3 w</script>
, u' G; M. ^4 x5 D: [3 i C</body>
+ n; c8 Z M% A3 I |
|