|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14437
- 金币
- 2504
- 威望
- 1647
- 贡献
- 1452
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;" J1 ^- F* U8 H; q! `8 s
c pageencoding="gb2312"4 ]/ B: |! b) C$ F$ f5 s7 g
%>
4 q+ O' Z- w7 l' R<style>! T$ k: U6 f. J( p9 d7 ^ X
.f9{ font-size:9pt; }
9 {9 B" G- x- _& d4 x4 [5 T1 _.bgc{ background-color:#aecaf9; color: #0033ff }
$ P1 G0 l2 Y$ b6 @! n.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
3 f( ^4 f1 K1 ^ border-bottom: solid 1px #4e7dc1;
3 @ t* |; P. C; i+ J' E border-left: solid 1px #aecaf9;
' k1 D0 G- `$ u5 ?3 j2 x7 H1 e+ K border-right: solid 1px #5679bd;8 a- w- w3 x5 T8 z: N
padding:1px;% l6 o0 Z: Z1 F
margin:0px;}" y+ }5 h3 n7 q3 L6 h
</style>4 z2 ~& G3 ^0 G0 \
<script language="javascript">
# B9 A+ K( ^( x/ U: k& B o<!--
8 Q) r% x% B! R$ Y) E \function rv()
; V* A. F. k$ l) l3 c4 f: P1 e{
/ b: t5 ~5 I( ~! C var val="";0 B+ |, c2 h, P3 g
for(i=0;i<combo_box.list2.length;i++){! ?; b+ _2 O$ P& W" @. f: ]
val+=","+combo_box.list2.value;
: G% b4 D- Z" u# j: b }" q# C3 x( d) j: b) ?" V
if(val.charat(0)==","){
/ h1 @& s/ w+ J3 Z8 u3 K val=val.substr(1,val.length);
8 N& |5 f/ k0 t* j# j }6 L0 N {( A. E h* Z7 T
opener.form1.frecname.value=val;, u) s% r% t6 i
self.close();2 Y$ `/ o& i+ A1 d! B9 \6 q
}% x9 W5 \! a. b1 g9 u1 |
//-->3 A1 Y3 C: L J4 w; T" {
</script>$ `4 I2 }7 E% Y9 A6 ]) ?
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">; z& w- a" h0 K2 B9 O
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />8 }$ H4 b% z; c' F
<%) j/ B" I2 s' k2 M; _0 m$ ]5 [" b7 t
cdatasource ds=new cdatasource(); //数据联结bean实例/ F0 L; D& \# q5 i' K7 g1 ]8 X
java.sql.connection conn=ds.getconnection();
' o9 f! W0 J% z( E, j java.sql.statement stmt=null;
! q' f4 w4 H- D% l( M java.sql.resultset rs=null;
3 M: s( e7 h+ w; \" e cdatacheck dc=new cdatacheck();
% V- N9 B% q/ i. F2 w4 t%>' V; @+ C6 @& y9 M1 u' M! l$ ^7 r1 I
<%! I5 q' A9 ~$ Z; F7 n+ J- g; V
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";8 D8 V( q/ p S' K# |' L
stmt=conn.createstatement();
2 j( {# v. P6 O: m* Prs=stmt.executequery(sqlu);' l( y7 {$ {9 ` m
%>6 E6 E- d, a) ^& F' Z; z! ~
<script language='javascript'>, n3 W3 p* R; p! B7 J/ I1 [4 v6 _
arr = new array();5 t; E1 M0 P) M; D/ L2 d7 v
<% int temp=0;( R# k% s9 y1 W9 U0 U* x
while(rs.next())
: \6 o7 j8 F0 E9 x6 t7 a{1 @6 X: r! i* C5 R, w
%>
/ m! E2 C4 ^( v2 m+ `3 g! Aarr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");) b& C5 Q$ q7 @, \' k' |) p
<%
8 P( [6 ]! ?0 utemp = temp + 1;
: Q" j6 y& j F" P. O8 n( C2 ~}
& M5 _; V' l1 t%>
" P1 O1 L2 L6 D, n1 ?2 g9 E( c9 Xtemp=<%=temp%>;
* F1 E; {' n2 E) T, mfunction changelocation(id){ " s$ [! {$ T1 \
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
9 V1 G- F3 |% n2 W+ r- {var i = 0;
8 @0 n c p* Sdocument.combo_box.city.options[0]=new option('-------','');
, e$ D1 r5 B3 d, U4 V' l, Z9 L4 _for(i=0;i<temp;i++){ 6 `) b) o, ^4 O x4 S
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] + K- @2 Q ~6 |8 h3 ?7 ?
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); & T( b. x# m2 h/ ^
} 4 a3 x1 @- T3 z/ H# `
}
; k+ ^# L) u* N} + n5 X2 J" @" d# v: j$ @& b6 \
</script>: I4 R7 H$ u9 |) U: X* M1 u
5 c I* ~8 K- f* n; n3 o" p; A- z
<form name="combo_box">4 ]" W7 s( u. W5 C
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">9 ]" L. t) o/ X+ X+ k/ o
<tr height="24">
5 \ F$ p' I9 q" A+ `9 E <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
& H3 Y( E( U* K2 Q <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
1 W2 C6 w, k/ k! h6 o" s <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>' {" m: K, \: x; P" \! V, ^( a: D
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
0 J: z* X0 Q1 K </tr>" p$ o* C8 h( f. @4 r
<tr>
% B4 ?1 V" V( H e, ?4 e; \; @ <td>
) w' b, m8 j4 d+ Y/ f <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
; \! B+ q% \. g6 f <option value="0">请选择部门 ---></option>
3 _" l! C" A: `- x$ w/ N) }2 U<%
1 s i( C, T# o5 h- @/ Y string sqld="select * from tdept";8 W' G6 G2 u' c# |; K3 d; C$ ]
stmt=conn.createstatement();3 g" [; p2 H: X8 P# o2 c
rs=stmt.executequery(sqld);# ~& d q* F- Y% N9 \( v& e: a
while(rs.next())
4 r" e* ]8 U- Y( b' W6 }{
7 B5 M) Q- y! D7 S. S0 F$ ?%>
4 g2 w/ H1 C& k+ w( `& M! I <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
( W% F! e, Z- R& |* k6 E. `' r+ v<%
3 p/ z6 z: J% p2 s}5 H; @7 B: F( n" j; h6 w. |, Q
%> / Z- q6 O# q5 H( R/ }9 m
</select>
3 \+ u+ X" x/ r, W" U</td>
$ j) ^1 L- u6 _ <td>* r( s* x" Z- r
<select multiple id=city style="width:150;height:200" class="bgc">
& J. Z( v0 S8 }; o# @. t" O) Y$ o1 M$ ^ </select>( s' l7 B2 t1 R h X. f- C
</td>
; Z& T9 p" i" ~/ }2 J5 ]$ L4 U <td nowrap align="center" class="bgc">! J% _: J' G# w% P& t: R. {* z3 ~
<input type="button" value="<<" class="buttons">8 t& K& e: n; v* K& P
<input type="button" value=">>" class="buttons">
- Q0 U9 q7 y. q) [/ k) w</td>
; e# ]- ]. d9 M <td>
) q- H0 Z. V* o. V) j0 n3 q- y( H/ P( x <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
8 i5 k: n( Y1 V9 c! S2 m( R& K </select>
& \3 Y2 h2 W6 G n</td>
+ }1 m, }- g3 }- _. \ </tr>
# a9 h7 v, Z8 r+ ^ K <tr class="bgc"> 2 j; O2 m" h7 ^; b W
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>7 {! c8 q2 M3 t' i$ N7 v" j
</tr>
' j: E1 B2 f$ f$ Q+ s</table>
, a9 O1 m* d7 B+ h</form>
5 U6 j( w1 U0 e5 i<script language="javascript">; ]( Q$ d& T% P- I; Z% C0 O) o
//人名移动 d( v. N* _& |" X" i3 f
function move(fbox, tbox) {( m% U G) q, u4 u( ?2 Z, R
var arrfbox = new array();% i! g9 S& x- N( B3 e
var arrtbox = new array();' j( t& @4 X; n3 p3 N& [3 v
var arrlookup = new array();* N4 l: t' D; a0 o5 d7 t
var i;; j9 Q( ] Y$ t, ?7 o
for (i = 0; i < tbox.options.length; i++) {
- I# S2 p1 F6 T6 h T: S9 Larrlookup[tbox.options.text] = tbox.options.value;
8 j9 A% a0 E {# Varrtbox = tbox.options.text;
* W5 d* ~" ?) y; F, ~}+ ~: u4 f2 l s1 o$ Q( p! u
var flength = 0;
/ S) s& A( ^& \1 r7 G* gvar tlength = arrtbox.length;3 k2 J/ A* i, O7 T. ?0 Y9 P* t
for(i = 0; i < fbox.options.length; i++) {" q- ~& R6 W3 g4 n4 O Z1 c
arrlookup[fbox.options.text] = fbox.options.value;
5 t. \" a, m: g. Mif (fbox.options.selected && fbox.options.value != "") {5 X, \$ h; \9 V
arrtbox[tlength] = fbox.options.text;
5 g& I- x( _* |/ _tlength++;
7 Z* d" `( @+ ?- z- j2 B}# }# X- E! [) V8 g/ \5 d
else {- _5 ?; E) K3 Q+ t9 j( ^5 E
arrfbox[flength] = fbox.options.text;5 D' _2 [2 F0 H1 ?' M3 d+ d1 x
flength++;: ~) y; e, [0 a8 T) K$ W
}
; A! E% J6 ?9 }8 n+ ]( R3 N) E}7 ^# X+ h( Y! w( s# Z, |0 B
arrfbox.sort();1 E$ u6 p: {8 `; U, k: l6 U
arrtbox.sort();4 E. a& \: f! l% Q! ~. A2 M6 ~7 U! L
5 r$ W( v( V3 v! x/ H Tfbox.length = 0;! T( |' h: F# m% y5 y4 ^; E0 v
tbox.length = 0;
5 o. A6 T, h1 S8 f# V+ ^var c;
8 w6 E* Q" k# x& E$ y. Cfor(c = 0; c < arrfbox.length; c++) {
( S2 c: y& T) h. h) Q5 M* Nvar no = new option();
# q- s( X1 C& z7 U: I- y, Y1 fno.value = arrlookup[arrfbox[c]];' G) m5 R. O( O: V- f% \8 C
no.text = arrfbox[c];0 o0 V5 ^) W. X& s% l5 }8 W* c+ V1 ~
fbox[c] = no;+ f/ F/ q+ X4 b+ m# J
}0 Z& U0 P: u3 l
for(c = 0; c < arrtbox.length; c++) {- }# V$ X+ z; b; ~
var no = new option();
5 u1 `* ~, M4 p% ?9 G( d* hno.value = arrlookup[arrtbox[c]];
) D3 O! L u, K5 \- e( ]" U4 A7 c nno.text = arrtbox[c];
/ [0 { t4 q! U( Htbox[c] = no;
" n; r6 e: A) R1 G8 S4 D3 m }
# w. ?2 x: T" C2 N+ d}& l; I0 z* k. z: D
</script>
3 F' ?6 \4 |. a$ e</body>$ v* Q' |6 U( ?) N, V% \
|
|