  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14191
- 金币
- 2386
- 威望
- 1647
- 贡献
- 1334
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
; k5 b$ t! G1 G: p6 s7 i) B c pageencoding="gb2312"& L* Q" r, \2 t: ?4 ]: D: V& {+ {! m
%>, g7 Q6 w; k4 C* V" S8 W. }
<style>
c" u& }6 a$ E- Y# V6 ?0 D.f9{ font-size:9pt; }2 ]) V4 Z, ]# P9 s5 a3 p, G {
.bgc{ background-color:#aecaf9; color: #0033ff }
6 T5 W2 P" b4 a" ?9 x.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;5 P1 m+ X4 a8 ^: \9 u: C
border-bottom: solid 1px #4e7dc1;0 n; z" f1 Q, Q
border-left: solid 1px #aecaf9;+ e8 I J7 q! \( ?
border-right: solid 1px #5679bd;" l- z9 t6 q1 F& f' O
padding:1px;6 {) k2 t* g! z. }
margin:0px;}- m8 I0 U9 l0 D: c
</style> ~. M- j7 }/ {% Y6 a2 t( x
<script language="javascript">
) b; F& U+ H" ]; _<!-- z" u) ]6 `- { f
function rv()0 d( a) V3 ]5 k; g) f" h
{
8 a7 N4 O$ E+ Z8 M' I var val="";
! a3 [- n6 T$ E0 m9 K for(i=0;i<combo_box.list2.length;i++){
0 K6 Y/ D1 A+ A/ a val+=","+combo_box.list2.value;
: w0 N1 \4 d* A0 n }& T7 i [( F3 N7 E) @/ C
if(val.charat(0)==","){
! j- H/ }- I; u val=val.substr(1,val.length);
5 U( G. K& k# o( z- e( R. ~/ ` }# u: l9 q \2 ^8 `8 i6 \, s
opener.form1.frecname.value=val;: I# n h- d7 _5 ]1 ]0 I- e; ~- M: @
self.close();9 r. I; R7 g# S$ v
}- s: }; \$ K6 d) E+ `* y6 _
//-->: D& a6 z( C* K2 V
</script>
& v1 d" E { J9 Z$ ]3 `# e<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">5 R8 i# l* t- H8 ^# v
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
! o0 c3 f6 X1 [: M* z. C<%0 E# W1 F% V% j
cdatasource ds=new cdatasource(); //数据联结bean实例
5 { B3 {5 j# y2 ]# N/ {0 j. ] java.sql.connection conn=ds.getconnection();& t* M" @$ h1 k" K
java.sql.statement stmt=null;/ X- |1 ^$ K% q
java.sql.resultset rs=null;
1 [' t, s/ u, G. C h cdatacheck dc=new cdatacheck();3 D3 R ~! q, V. u9 Y. s! o5 v
%>
/ i1 U5 c ]9 S) x- }3 H4 p6 ]/ ]<%
+ n+ X/ h' `6 q, c; ostring 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";
/ L" h5 x+ T3 P4 G. B3 [stmt=conn.createstatement();9 w6 ~7 O; r* l+ A, b2 r/ h3 n& m( w8 t
rs=stmt.executequery(sqlu);. u' c3 U3 {) E) ^% D
%>
' U3 _% |& x9 @) r& h( Z5 F<script language='javascript'>& }- U; f2 T' p6 S% h0 A4 Q
arr = new array();
/ j' A2 O+ q( K, w) ~- _; @" k T<% int temp=0;
3 H, Z$ N3 c1 W# Z* i6 Y. V awhile(rs.next())
/ A. H8 V6 c- w% Z. ? K+ B4 _{
4 ~( ~/ P3 o$ ~1 z$ X0 n%>2 t) T+ u8 b/ r* I/ E
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
9 b. F1 s7 @6 U6 ]1 |1 e<% D, H+ a7 Z0 A E
temp = temp + 1;) ^5 X! v9 c; F! V' k/ i) M7 v
}
, B, c0 u. s& U" G0 U%>8 r2 `+ g) l- e3 X9 _) b
temp=<%=temp%>;
! ] r" @+ V- e8 T/ I) ~function changelocation(id){ / ?7 R' Q7 t. D0 s* D4 K% B
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
+ G0 [: s- L1 s: G' \var i = 0;
, Z$ V$ Z( J+ R( i" [- s0 s6 n* Idocument.combo_box.city.options[0]=new option('-------','');
/ M* P% K Q2 T/ o, r5 L" Q- qfor(i=0;i<temp;i++){ 8 f+ ]- @, p3 `* D% c
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
& S5 ~4 I1 o6 ?* m1 E! _8 J9 h4 k/ p" adocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
& t% |& r9 |" Q: a$ e} 9 T+ d s% J4 y7 ?7 P2 ~ y
} 1 ]# O+ v2 ^. r3 m% `; l, _6 `
} , X- M. E/ y7 _# u: H c
</script>
6 ?; D0 w7 F, l
1 h p4 H& \7 j& m& z<form name="combo_box">0 u# a3 @2 N$ }' F$ |
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">$ _) N) {9 O% N0 |3 k" _
<tr height="24">
1 X% H/ [( e @# q <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>% N' n3 A3 X# \9 N* E. E
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>4 A! B) O, |8 o* @9 L& P! B/ J/ n
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>2 p9 A- G$ t& w. I' i8 x( J6 s
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
% h8 _$ n( ~. m1 o% J" j </tr>7 k: _6 S% |: n7 \, v5 f- A3 l
<tr>
3 l9 A9 b7 v4 k* b# t <td>
* U z' D4 W9 k3 a( j <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">7 N* c8 F! C0 H r
<option value="0">请选择部门 ---></option>
; H f" r, \ J( c+ Y! V4 \<%4 q' v8 Q) C; i3 `! K- _$ w
string sqld="select * from tdept";# T2 v% X6 H5 a+ J; o% A4 N
stmt=conn.createstatement();" O, T7 T7 T1 R! }% z; y n3 R& c
rs=stmt.executequery(sqld);
* e$ h5 F5 z" _' r, `% L1 Pwhile(rs.next())
& n8 e9 ?" t; h# j{
- w' m7 q# Y* H$ d, e%>* J! A# ]* k9 ~; x7 S; o% l3 [' r
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>5 v I" u; E j/ ?) J; |. ?$ }( P
<%
* y4 B) t0 l: d}, k X; N4 U5 T6 N! c
%>
' h/ @! x( }3 z6 I4 _* H </select>/ J" u; H* h g" c8 l8 y) ?5 R8 `
</td>5 B% t5 z$ O, Z$ w) i# ]# `1 i
<td>
: C4 i. s% A! C5 y <select multiple id=city style="width:150;height:200" class="bgc">
/ c( X5 M6 _4 J$ S: w. V0 m$ K4 t </select>
, K5 J; ~: N1 T" Q- @# e$ b</td>
+ ~# N5 F" W2 n <td nowrap align="center" class="bgc">
4 J V$ ~" e5 H$ l9 M <input type="button" value="<<" class="buttons">
8 Z" i5 t( B3 ]+ f: i2 E% ^/ c" j <input type="button" value=">>" class="buttons"> ~1 ?* e, N% V& c
</td>9 j: R9 h C' T+ q |5 P6 x; @
<td>; t- P. R9 \$ g! H
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">9 G# m/ a/ W( { i9 j6 W
</select>
8 @: V4 V) n( I' y% m2 M0 o6 d</td>! f5 m+ i: s- P* u
</tr>6 A! u/ i5 {; q+ @
<tr class="bgc"> 5 [8 } m8 p- O w. e5 ~
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>7 Q) ]" i) @4 b
</tr>5 ^% b0 v7 S# m U
</table>
& M: i7 e2 N" [6 H8 l P</form>
7 x' F8 M0 ?0 q7 i- i9 f$ h<script language="javascript">; q; n8 u( C x3 U# T+ B
//人名移动* M& P8 e6 {: z" K
function move(fbox, tbox) {+ o- C# i& H- A, b
var arrfbox = new array();
& z9 K* V& A0 Z, b/ N. a* fvar arrtbox = new array();
/ X$ ~; f! B5 d: O) d- {0 J! Q, Uvar arrlookup = new array();
: W, o( x5 U x: ?+ @( F3 Svar i;% W9 X @5 `( _7 T2 ]) G. I
for (i = 0; i < tbox.options.length; i++) {/ R7 c$ L( ?$ l
arrlookup[tbox.options.text] = tbox.options.value;
S1 A4 o' o% O" {% K! \6 B" Rarrtbox = tbox.options.text;
) `# U" q/ y! C1 ^}
- U; w& [8 J2 g7 E. o8 f* r Rvar flength = 0;
* l d1 d' C& g# d* j5 ^, j/ Mvar tlength = arrtbox.length;, C$ m9 [& x; K; i" m' n0 e
for(i = 0; i < fbox.options.length; i++) {8 M* I# V' w- y# x6 l0 |3 m! g" `$ ]
arrlookup[fbox.options.text] = fbox.options.value;
$ _- T% I) t% n: |if (fbox.options.selected && fbox.options.value != "") {
# U% @ a- g. w2 Parrtbox[tlength] = fbox.options.text;" ]6 A5 k# |8 d7 k; ]! P& f6 v
tlength++;; ~! D9 [$ s8 S" H; R/ M. U5 E! K
}8 \: t# O9 ]5 W4 {0 k% t* A
else {! d( j" \8 D' u6 ^ d1 ?
arrfbox[flength] = fbox.options.text;
8 f- J9 J% B8 D2 `% Jflength++;9 n2 ?# A2 Z, S$ Z; |+ x
}
& H; t5 }0 c8 F! y8 u, K}
1 X: t3 Z, n, q; p6 N8 Oarrfbox.sort();2 W6 P3 ~% h7 n8 j. P, C
arrtbox.sort();8 f6 d9 m1 p( B7 C# d" W5 ^
6 X' @3 X, e2 O3 cfbox.length = 0;6 ] N/ \% P( }% S$ v
tbox.length = 0;1 r2 D. [/ v! Y
var c;
2 Y C5 I r) C: v+ ?for(c = 0; c < arrfbox.length; c++) {) J& I- P6 s% |
var no = new option();
) ~) G- U) b0 v6 ?) Qno.value = arrlookup[arrfbox[c]];
: K4 c% @; b5 g5 N4 Ino.text = arrfbox[c];: Q0 L4 r$ G/ e7 t' w0 l1 `" n& F
fbox[c] = no;
0 X- f }2 A- h* W; F/ m7 A}3 ^3 t3 ]( k+ B& @) }/ S. ]7 h
for(c = 0; c < arrtbox.length; c++) {
9 `. A# t, r1 Z* I6 A" Pvar no = new option();
6 P" @; z* A1 v! Y! S1 jno.value = arrlookup[arrtbox[c]];8 R4 z! @6 ?; ]+ I- @8 x
no.text = arrtbox[c];
% {) z/ r3 Q" ]. y, [tbox[c] = no;
5 h' g4 Z+ R% ? }7 N& p: h$ N7 w) b' ?
}' r# q5 _6 |8 p1 y+ P
</script># I# }5 d6 _. |( c1 {( }" s
</body>2 H- L8 B$ {' h c" f- T
|
|