  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14247
- 金币
- 2414
- 威望
- 1647
- 贡献
- 1362
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
9 E& B: Q5 m7 j6 }2 @0 H c pageencoding="gb2312"3 D V4 J9 a( I. m" J
%>
! d. @1 B) K- H9 G* \: Y<style>
: ^. u: `0 b% Z! f.f9{ font-size:9pt; }
! f' n- \$ _; K" _.bgc{ background-color:#aecaf9; color: #0033ff }5 o9 ?4 ]' V1 ^( r# o7 V( M: X
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;" E* |* c1 @5 ?; W
border-bottom: solid 1px #4e7dc1;( ^, _: G5 }/ `
border-left: solid 1px #aecaf9;. f6 w2 e9 i4 Q1 X. u) @; ?
border-right: solid 1px #5679bd;
2 ]! z* }6 @3 y1 M padding:1px;7 e; P2 l: f' X( g* }
margin:0px;}# S5 Y# F5 J# o/ A
</style>
; V$ {6 F3 x5 x/ |' A; k<script language="javascript">9 P- I: S! J# `) w
<!--* Y+ f C \- x7 r: |
function rv()# n( l; T) O/ Z2 t
{
9 D; o& ?" l" q: G( |, Z var val="";, H0 R7 ^- o5 {+ U/ N0 Z
for(i=0;i<combo_box.list2.length;i++){/ h# T4 z) E/ K5 f: n( Q
val+=","+combo_box.list2.value;1 W% D# z& w' |1 \2 Y. `4 N( N/ D5 Z5 `
}- Y; h3 y1 k" z
if(val.charat(0)==","){; {7 {' q" _# }0 y/ ]
val=val.substr(1,val.length);+ I5 E! Z0 g% T/ k
}
2 J1 M: D& T7 v7 {$ M opener.form1.frecname.value=val;
5 \: E3 p. z* g- W' L self.close();
% P- q M% V, u5 R ?6 H}
) z2 o8 `4 {! Y" ?9 N//-->8 b; s: g2 e4 Z2 M$ g
</script>6 {- v0 g( S9 t8 \0 A
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
$ A H4 c3 U, |. _- d( Z<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
" w$ A- x/ `$ S! S/ ]9 E9 ?<%
! Y1 [5 a$ ~: o' M; c8 P1 a cdatasource ds=new cdatasource(); //数据联结bean实例- b1 s, [7 `5 `# p
java.sql.connection conn=ds.getconnection();
) i: w3 W/ g$ h& O java.sql.statement stmt=null;& }6 s) W4 m+ A( S' h' \
java.sql.resultset rs=null;
0 l. g: `2 n1 h# u( r8 C; ~7 ]) L* D cdatacheck dc=new cdatacheck();
, [9 e% r+ V4 S) O2 |' Z/ w%>& `' Z2 m9 g1 f' L/ i$ B6 p
<%
4 b+ `- ]/ s4 p P, ]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";
; K' e) C0 A- p" |- }8 istmt=conn.createstatement();
8 g5 h \4 O: Q+ T8 Ars=stmt.executequery(sqlu);: j/ y* q$ T/ w% x
%>
( j7 g# j' g1 Z<script language='javascript'>
) K* e7 V' c1 s1 _' Z, |$ Yarr = new array();
: i. e. i! r, Z+ A% J1 e0 V3 P6 x<% int temp=0;# n) n7 k2 V& ^* \- d
while(rs.next())
8 }/ i7 l( d, ?2 `* h{- C9 [# t) w' c: N
%>
) m3 c* T N6 b( [2 Harr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");- F- g% B4 Q6 J2 J
<%
- k% T; p! t' O4 ?' g `temp = temp + 1;
2 l& a/ |4 y( l) H# l6 T4 \}$ f! d8 k ~6 x5 G6 ?/ s
%>$ _# d% B: ^9 B9 U/ h$ {# H
temp=<%=temp%>;
3 [5 P& m; R4 l$ `" j0 Q$ s3 vfunction changelocation(id){ , J% s8 C b3 d/ y% {# D
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
: |1 {4 x8 i) B" y. n1 E; x! vvar i = 0;
* z; }; {; W1 L5 x4 b! Q& }document.combo_box.city.options[0]=new option('-------','');
' v0 o9 l8 w; ~3 p9 ^; efor(i=0;i<temp;i++){ * e( E# \! P9 \3 R, E h
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] {- V( P5 p# c' Z/ K. E
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); ; ]( A, a# S: K) q5 d
}
- O$ z8 T' ]) M; t}
- r: b! z# {5 X: J+ f- b V: p} , M9 t0 T7 b) {0 J& e
</script>
( K6 e: s) K9 W% m2 `( i# z0 ?' c+ E1 L" ^# ~4 v
<form name="combo_box">
4 R: {+ j# U$ G4 Q- q- M5 d<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">% [5 Q# H" M1 b. P6 B, W
<tr height="24">" g7 |& @$ L6 q( p- ~( F0 X h Y
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>& Z5 P' D! `2 M9 _
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
+ T8 V+ ^+ l+ Q <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>2 b0 e2 V* k0 i( H' ?+ _1 s9 G
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td> y3 x9 e* E" g! @+ Z
</tr>
, J8 r5 S$ x7 ~; C <tr>
" i B Z( I! D+ ?8 _3 Y" o <td>
: {: c5 v8 q8 W" W$ M P% E: L <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">8 \9 W7 u, }+ G. k' C; U
<option value="0">请选择部门 ---></option>
$ Q x3 m7 ?( A. x<%* T9 H1 q/ a0 V
string sqld="select * from tdept";) m/ z( G0 T; B V
stmt=conn.createstatement();
, S. I" L; }+ U! Ors=stmt.executequery(sqld);. Y3 H$ t$ g; ?" k
while(rs.next())3 I3 X: S f) v7 H/ `
{
6 h& P. z0 Q" W6 V# p# i3 w; M%>$ B% l6 }( n, K
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>/ m" ?6 O: s1 r, ~
<%% w+ }+ u8 ~4 G. L. t2 e
}$ K+ H0 `9 K( R( o$ G p m5 N
%> 5 A O$ M, F/ F& t, n3 @; U$ ^
</select># J. I4 J6 ^2 ]% p& |# l. i
</td>
4 z3 J6 D* A$ t' u+ p <td>
; Z, G. P( @% I2 s6 q: I" C" x! [ <select multiple id=city style="width:150;height:200" class="bgc">, W" B; x3 P: M; e+ y& G
</select>
; E6 N( s/ W: m+ J: C" L6 y8 y</td>
4 M. e$ F$ v0 e' Y <td nowrap align="center" class="bgc">4 M: q: `, q: @. H7 F2 Z% ?
<input type="button" value="<<" class="buttons">
) p: q& [7 ~0 v k/ ?2 D <input type="button" value=">>" class="buttons">0 O1 _' H1 p9 O
</td>
4 T- q/ H7 x# d6 {0 E, L <td>( f7 `5 V0 q) d: r# ~8 t7 H2 e" l, h/ N
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">5 R% Z+ d; n' x2 l H2 O2 l5 l# U
</select>* w1 `% P& z2 G, C5 m% E
</td>9 j+ R. X6 w! l8 b& ]2 y2 @
</tr>! q2 B4 `5 H/ y2 T& Q2 |, |
<tr class="bgc"> " L3 k3 ~1 S8 g5 D
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>; n+ j; R* k/ N* I2 E0 }- o; J6 h
</tr>, |. U1 @$ j9 U
</table>( J; F8 I; N( i3 m4 D A# S
</form>. v! R H1 L% G( b$ z1 Q9 T
<script language="javascript">5 ^4 }. t7 |2 `! [) `% n3 Y
//人名移动
* J8 E. l1 E1 @9 T3 Yfunction move(fbox, tbox) {
* E( ?5 j$ l* F% j8 |: @! S( u; jvar arrfbox = new array();
* y' l2 J% u, \5 R* U* wvar arrtbox = new array();
/ ~+ F. l$ U; [- y! v% u' ~" yvar arrlookup = new array();
% s/ o8 W/ V+ w4 x- m2 T" dvar i;
' O1 v! O2 o( ^5 Q3 efor (i = 0; i < tbox.options.length; i++) {/ w: |$ S0 e: S0 l
arrlookup[tbox.options.text] = tbox.options.value;1 G" k4 ^: E# H$ j
arrtbox = tbox.options.text;
& I! y+ U3 y; M# ?}3 [- k' h6 E m- B( [
var flength = 0;
, n# \2 N1 `$ }% kvar tlength = arrtbox.length;/ C. d0 {- i: G7 I; F! D0 X" {
for(i = 0; i < fbox.options.length; i++) {1 |* k9 T K2 e& l
arrlookup[fbox.options.text] = fbox.options.value;3 Y6 P4 [0 y9 q3 z
if (fbox.options.selected && fbox.options.value != "") {
5 x c2 @& `+ { Farrtbox[tlength] = fbox.options.text;" B/ ^0 M1 W5 C# B! ]& v! H/ Q! Y+ ^7 U
tlength++;
" F/ G& R" b0 _0 ?- I}" B7 l$ i2 h; S. y
else {9 b* G& j7 G5 R0 k
arrfbox[flength] = fbox.options.text;
5 i" Y( p' t4 r/ L+ eflength++;
2 {2 H# |8 p. m* e8 a& E6 W }
) Q. _$ k# Q. |9 I% m}
8 ^( M) h$ x; }6 Karrfbox.sort();
7 X1 q5 A* S; I& O! varrtbox.sort();0 E$ Z5 I/ Z1 V3 b
k% Z9 X; O/ E. D, W
fbox.length = 0;
# B: H, ?+ F- o" i+ gtbox.length = 0;
9 p% S( E4 g# Dvar c;$ H+ `: e. A2 o) t& N4 I0 n/ H
for(c = 0; c < arrfbox.length; c++) {
% s* v2 h3 J1 Wvar no = new option();
. ?: ~) Y/ R3 D( tno.value = arrlookup[arrfbox[c]];
+ }% C) b$ w: M# K, |% j1 eno.text = arrfbox[c];2 A5 B& Z7 b( x' k" W ] \: \# N$ G
fbox[c] = no;
9 q8 O) x( m8 S: q# u* j! o}& f, A/ |3 S6 e" G! {: e$ M* ~
for(c = 0; c < arrtbox.length; c++) {
% D; `4 b& y" c8 J" B9 zvar no = new option();3 M; C' @9 R8 r
no.value = arrlookup[arrtbox[c]];
x0 L: K4 [/ Mno.text = arrtbox[c];
1 T8 }& _) g# Q* K5 Z8 Stbox[c] = no;
+ g' J& X/ g- X# q }! T9 H* n x4 P; g
}- V0 C4 A$ p% B: |/ `1 u8 m& X h# c
</script>
: k4 e2 W: k0 e5 z1 O# L</body>
2 g8 W0 Z0 c. B6 \' Y |
|