  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14171
- 金币
- 2376
- 威望
- 1647
- 贡献
- 1324
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
9 `3 \+ L" [8 D9 o, H, @+ k; S c pageencoding="gb2312"6 u: P, w* Q) M0 I4 n
%>
& \4 v3 _$ @' Z1 M3 P/ L<style>
8 ~) K c5 U/ z Q1 A& m.f9{ font-size:9pt; }7 s: \- n! J0 r* ]9 `! D
.bgc{ background-color:#aecaf9; color: #0033ff }; Q" }" J. G# k: e1 B
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;' R7 o- S1 S1 i7 c; Q
border-bottom: solid 1px #4e7dc1;
, E# x; S; ^% g# m) I% M border-left: solid 1px #aecaf9;0 E4 d+ k' t' T
border-right: solid 1px #5679bd;
3 M, q( @- U1 b( W; f padding:1px;
* H; @; R9 s% ? margin:0px;}
8 }& z: {$ l! ]0 x& H</style>& ^9 N4 P7 c0 l( T& I: D1 c. v4 x
<script language="javascript">6 d6 B. ^/ h9 @1 {0 X# r
<!--
# S1 T- o1 l5 v q3 {function rv()
" X) h0 r5 { A5 W{
; k8 e% d- O6 M var val="";
5 T) o- P7 R$ _, E! f for(i=0;i<combo_box.list2.length;i++){* K, L% f# c" Y9 z5 w+ S/ ]9 ^$ B
val+=","+combo_box.list2.value;% H/ D* T! j3 B6 `
}
8 d# L1 v8 L0 w$ U; g5 h q) D if(val.charat(0)==","){
( n) ]$ ]; N; l( H( q val=val.substr(1,val.length);5 E% P' D1 |: m* R
}8 s+ Z, G7 g8 R, t
opener.form1.frecname.value=val;, e/ n; q9 Z& g% P& F) _, r. j
self.close();
: L8 X. I' B6 c( i( l: ~}/ C5 K" G# l! N1 P" p- N; z5 Y- I- Y
//-->& P% b, ?9 m7 l& q
</script>, I8 w% u) k& f% k
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> z6 b( z" }6 Y
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />7 Y& E$ w( C; S/ v
<%
& d6 o' z! P5 g0 { cdatasource ds=new cdatasource(); //数据联结bean实例
+ |9 l7 b9 T! e9 u% E( @ java.sql.connection conn=ds.getconnection();
1 j9 o$ C" a7 b& B) p; j1 v java.sql.statement stmt=null;) e3 ~1 f" y/ Z7 a* t* o
java.sql.resultset rs=null;
6 o& ^" a7 x* ]6 W( ^ cdatacheck dc=new cdatacheck();( b3 Y9 M* `, S' ?1 H f8 J0 n
%>+ S+ x5 w; G6 S9 \. \
<%( \3 }- h8 |3 z+ A4 k! j! T' S# N
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";" ^1 d' i' @" T5 g3 N I% @
stmt=conn.createstatement();+ m! ]4 H) Q& Z5 H" \7 k+ b. B4 y7 y
rs=stmt.executequery(sqlu);. X; }" S/ ^0 q; o4 M( A: P: V3 {
%>& h7 ^5 H r% d. E
<script language='javascript'>- P+ f4 w% h4 d( K8 v2 [ S5 i
arr = new array();8 [- ^$ k( |5 S* Q+ }
<% int temp=0;
& z7 _. U$ m) }4 s' d/ f3 rwhile(rs.next())
! F! I) C! W. n1 o{0 T; e# @0 y h h% Q1 R6 B
%>
0 {9 W9 ]) P$ u4 t9 u7 qarr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
% M8 Q; [. g# l, g6 `) i H0 z5 p/ N<%/ `7 e6 y/ `7 Z, X
temp = temp + 1;
( c c( q; X% R% U W- P* y}( }3 w! p [: J8 L
%>. `# {5 P6 a+ y$ B# |" h1 y( u, c
temp=<%=temp%>;# _4 J, k W8 A4 U
function changelocation(id){ 5 d; j# H0 u2 F, D6 b& q" z; k, `: B
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 2 }! U9 j! U( N! u: ^: v$ X
var i = 0; 3 M c5 l. V$ l+ H# H
document.combo_box.city.options[0]=new option('-------',''); ]5 z/ D5 \+ Y* U
for(i=0;i<temp;i++){
( a; M* ?! Z% o) Y: X9 z- p6 Pif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] 2 {) w2 N; D' M6 l- e6 w
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
3 T0 f! [( I, T! d}
4 ^0 p$ q+ o' ~/ @& |} : B% [' w) `% k. j& f6 N
} 3 k" k4 R. y8 S2 ]
</script>
% {2 b! J% o* B3 `3 F. E9 C3 _; L
# w9 I4 q5 e( ~* |! M0 J<form name="combo_box">
) O1 t* g- k& b5 n: ^<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">( F. W- i2 C9 o
<tr height="24">
6 L5 p7 I! ~9 v3 o8 J: E6 L, X7 } <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>& O. `0 Q% V: E, z% z2 @# _6 V$ S
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
4 W) k0 \9 P5 ~9 C9 F8 U1 R <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
9 S' v+ z7 o4 j5 j% i8 b. \" [ <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>' _/ w, g8 ~! K! Y
</tr>7 G$ O3 r k/ `
<tr>
/ h t# r0 d7 m; ` <td>! S% |# O* O& u) X% ?2 l
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">8 k N* m; X" N: Z' d" X+ s
<option value="0">请选择部门 ---></option>
% j- D9 m5 k* l& Z, t9 }<%; F. O6 [ I1 c! H) S7 s3 X
string sqld="select * from tdept";, E$ X% d' A" d' A$ B
stmt=conn.createstatement();
, j; [0 y8 u1 A9 lrs=stmt.executequery(sqld);
, {. S9 j2 r: v: p1 E' E7 u9 Jwhile(rs.next())0 D; [- A7 _1 C7 G" `4 l
{! f# N5 T/ O- M: E& j3 v2 x( ]
%>
+ J, O' o g3 Y% Q2 s. _( o <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>$ e) I0 Z$ F F* ~, N% q
<%9 V. Y9 W+ l& u$ ~& P
}
) a# h4 B0 |- b7 f%> 5 g# s$ s) F" S: t# u: I
</select>
0 |2 n+ g" y7 V: O</td>
- }& h, H' K A4 l/ ~ <td>! _+ r5 j, L4 {# V$ B
<select multiple id=city style="width:150;height:200" class="bgc"># n* g* p$ ` H* b3 I. G4 z( V7 [7 k
</select>
* l" Y2 W' b1 K; C0 ^</td>
% T6 E7 J4 x" P! R- T2 o! M <td nowrap align="center" class="bgc">
' Y- _+ y' v* t <input type="button" value="<<" class="buttons">
& R& i$ \$ |! D% l: ^" B <input type="button" value=">>" class="buttons">4 D1 K8 X* Z; w' k# K7 O3 N' H
</td>( I4 K( I8 ^6 g) q
<td>
( T3 B5 c/ `# j T8 v& S <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
1 M* r8 p" B, X/ k( ]8 O </select>
! @0 M4 A8 j/ L! F/ g</td>! I% m' N+ l' V8 f$ B* F' ]
</tr>
8 |, F+ y# C$ B: ]$ _ <tr class="bgc"> % V" _5 ]) C% k& M' Y. {1 N, A
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>
0 h# W8 S4 `" ^7 I </tr>
6 l _2 a- O& t5 _8 D! R7 L</table>2 [0 \- @4 \& o
</form>' ]4 j: t6 P' O1 s) U& W
<script language="javascript">$ k4 H% q! Q* C. z
//人名移动: Z- c7 n; f) L ~/ n
function move(fbox, tbox) {8 K5 Y% M* R+ q
var arrfbox = new array();; r+ S4 [+ B j7 w& Q4 v4 f. ~
var arrtbox = new array();; c9 ?; c2 d. g' [
var arrlookup = new array();
5 w; |7 @' c, ~9 J" _var i;( s; D* V/ M: R/ Y" {, ?- z B
for (i = 0; i < tbox.options.length; i++) {2 W5 ?7 l' N+ J# ?+ [7 N; U
arrlookup[tbox.options.text] = tbox.options.value;
0 I3 x0 Q, h5 karrtbox = tbox.options.text;
& }" X/ o, ]/ v9 y9 t% ~}4 ~) j3 T2 h( L8 @) J
var flength = 0;
6 D& Y7 e- H; U$ q hvar tlength = arrtbox.length;
# |6 l: O8 ~5 C4 D) w0 ^0 Z% wfor(i = 0; i < fbox.options.length; i++) {
: ?" ]' p# K0 F9 X' @arrlookup[fbox.options.text] = fbox.options.value;
1 _' B8 w, |) B$ x7 lif (fbox.options.selected && fbox.options.value != "") {
2 i6 i6 J# f" M Iarrtbox[tlength] = fbox.options.text;
8 A$ H' i. g, c. K% |# jtlength++;
' ~2 {2 q8 F) F3 P}
" }0 c% A5 D3 Y6 w7 c& telse {7 `* }" y( q7 {' t' @" ^
arrfbox[flength] = fbox.options.text;
+ ]8 M7 b' f- @2 |8 m3 [5 C- fflength++;3 g9 ^. R9 d+ z: g6 ^3 b$ g6 Q/ d6 C
}
' P( X- _- c; ^4 ]% p! r}9 ^8 k/ H! D- k/ F' X+ X/ o) z
arrfbox.sort();
1 l" m0 K( b: ]& [arrtbox.sort();
1 }: z, U$ O* q6 S5 c
7 @8 Q' K! D, r* ^fbox.length = 0;4 V' D# C! Q! F: M
tbox.length = 0;
* F- |. [7 r; ], m0 Y; ^var c;3 q! S/ s, l7 @
for(c = 0; c < arrfbox.length; c++) {3 u; u, _- w# s2 Q
var no = new option();" G1 X2 ?& k$ g( N, G! B& Q
no.value = arrlookup[arrfbox[c]];
( g+ }' V7 _2 \( [no.text = arrfbox[c];1 s: H+ G# V( t/ C6 z) ` d
fbox[c] = no;# h5 x3 D8 H- Y; X
}
! h |% b1 z6 xfor(c = 0; c < arrtbox.length; c++) {% C" O$ \$ X* U, h# O7 h0 K$ [# l! F
var no = new option();4 N% z% S# p0 s1 @9 v9 V: E
no.value = arrlookup[arrtbox[c]];
: _) L# B' |, ~+ D! Z+ Z1 mno.text = arrtbox[c];
3 e( c( i! J% m1 `+ I! z7 Y; Ntbox[c] = no;
7 H6 N m J r2 Q, [: L( Z2 v }
3 B0 H5 w0 @: A6 ?/ ^}
; N& L6 D j: Q! E</script>+ _- L. s" O5 a4 q( I
</body>
. s! L; O; B$ I |
|