  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14161
- 金币
- 2371
- 威望
- 1647
- 贡献
- 1319
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;". O e; s( G3 C! v' u1 y; P' j
c pageencoding="gb2312"' A$ ]9 f8 p% Y: H/ k5 \! E
%>
- E! E8 j! B/ u: k( u7 a4 \+ P<style>2 ^" j6 i, m a- H( z6 y5 m
.f9{ font-size:9pt; }: n% x$ |# m" S' n+ u" `4 w
.bgc{ background-color:#aecaf9; color: #0033ff }
0 R7 Y# w- L5 ^7 B N.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;& X# W" Y1 F' Z0 o* D, s
border-bottom: solid 1px #4e7dc1;
9 W% [% ], r: S* X5 g" b) Y: C5 f border-left: solid 1px #aecaf9;% E9 C: a5 a8 V
border-right: solid 1px #5679bd;7 _2 n" n& Q+ b, h" E
padding:1px;
7 y7 G, p3 U: W' [3 u& P margin:0px;}
/ [9 @2 P2 o, J& Z7 T</style>
9 Z3 u! Y0 l7 y+ H: E<script language="javascript">
% N+ i" z9 K! T: y" M7 i$ }, K<!--/ W+ c; ]- K) p- L
function rv()
, ?7 q2 W3 P# D2 F% ^{ l$ M+ q+ U1 m6 I0 q9 o d. R
var val="";
2 R, ^8 r+ q1 ?) c% e$ v for(i=0;i<combo_box.list2.length;i++){+ d6 t) A0 G& Y7 a( L' t- Y
val+=","+combo_box.list2.value;" J7 m0 |% f* ~
}
9 D) a, U1 v+ k* e- O if(val.charat(0)==","){
; Z5 X$ N! t- F" \8 ]7 I- \' V7 r2 f val=val.substr(1,val.length);
# Q- o `: {# q" ]+ _1 w. u6 ~ }
' b6 y) N1 h& F0 u: z opener.form1.frecname.value=val;% V( \) O- Z9 q% j# c$ D$ |
self.close();/ U/ L9 P" W- [! E
}
: r' @0 G) B5 R8 _5 W//-->) U! p3 R, I" ?! D$ b0 ]
</script>/ t5 U( w; F- O& N- F+ c
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
( h' m8 S" l) G+ F+ S<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />/ l; t5 l. B, ?& I
<%: p- k# J7 I0 c0 J4 s/ P
cdatasource ds=new cdatasource(); //数据联结bean实例9 q) K2 b+ A" e% G
java.sql.connection conn=ds.getconnection();5 s9 D5 J+ d* b1 l
java.sql.statement stmt=null;
: f2 T) s8 L# |' r$ x4 I java.sql.resultset rs=null; F; f5 e- K6 b0 I1 e9 x* R2 }
cdatacheck dc=new cdatacheck();
: R% i! k$ ~9 Z* z%>4 V) j8 l2 M6 G T" R+ R0 H
<%
, @9 Y; }* S; ^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";& }7 H6 C( E8 m
stmt=conn.createstatement();. } Y6 H% |9 o) F/ b+ t
rs=stmt.executequery(sqlu);7 q" z9 J7 H* b+ d, W
%>: R- t( c* u9 J$ J
<script language='javascript'>1 C; L9 K9 h* o+ P# o
arr = new array();% g j) c! Z4 ~7 h
<% int temp=0;
2 c7 O* `% B% m2 H4 D2 [9 Pwhile(rs.next())
# I! `* W9 Z$ }4 ^5 o* Y5 U{
- a u- Z- P* ?8 ^. K! d%>5 t0 t; g6 q' t, P6 y Y! d M
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
" K" b- l% Z( B* g2 V l<%; ~6 c5 Y- J3 O; Q8 X4 k7 E0 P
temp = temp + 1; @( [5 a* c( ?8 x& L: N& i- n
}* e A! e2 ~2 a( W) S2 t; V
%>
0 t ^) y( _& Vtemp=<%=temp%>;
4 c) u- o! T" ` V8 ] {# zfunction changelocation(id){ 8 p7 M* h) n* s( c. j
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 / U d8 `' o7 n9 x! F& b
var i = 0;
" |3 {! \7 b* B5 C% S2 ?$ z$ ldocument.combo_box.city.options[0]=new option('-------',''); % `' s T6 E/ X
for(i=0;i<temp;i++){ 2 j0 D# p p4 @5 z4 |& K
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
( U( D/ w3 H2 l3 t& Sdocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
0 o! Y/ [& {: y; w& ^" v. T& G* ~$ r} 3 J# h4 m9 B. `: z, j! h. G) N
} ; n# @4 e$ l* p; g. q6 c& m
} 9 |3 w% j: U/ w+ ]/ P8 s- S2 V
</script>
/ `- y- T. E( l1 a+ O7 f1 U$ A- f2 t! Q- e/ Z/ l% ]: [
<form name="combo_box">$ i1 G4 W( X3 U
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">, z2 m9 S6 a( M, V
<tr height="24">
- _ t1 g4 P/ |. I! T+ Y( S <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>% I5 n) f3 Q7 {* {6 ?; _; S) r$ E# r
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
% Q1 ]7 j& j0 O* E5 _+ } <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>+ |& u1 |- U6 j' s" C$ F$ g2 C, t
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
: C% M. Y% L' ^4 I: g6 S3 Q3 [ </tr>3 H3 s3 p5 B, l& e2 o5 W7 ]
<tr> - |$ g5 P6 U0 w
<td>- O F, s0 P% h9 _' E
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">% c; o( E) A, x" u/ k9 v: [/ B. z
<option value="0">请选择部门 ---></option>: n/ G+ i6 D' i. H/ e7 F, ~3 c
<%- D A) t2 H( @6 U2 _$ X% l* p
string sqld="select * from tdept";8 P/ p4 U) @7 {7 _7 J* Q
stmt=conn.createstatement();: q" L, D, `+ n- r E
rs=stmt.executequery(sqld);7 A4 o0 v9 k4 x% o
while(rs.next())
8 Q5 o* r, X* e! w1 U/ J7 d{# w0 x" ^7 |& @% d
%>
. m% l! D; D7 R( W' h4 W* l <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
+ c3 y3 p& Q6 H" V7 U<%2 V! k4 t! D- R! W5 U
}+ d1 ~. _! `8 L) v
%>
# i: V5 p4 k2 @) Q; | </select>
# {( z& P S$ t$ D</td>5 L% D' V3 |* ^
<td>
$ V4 V% [1 x# `- r2 \ <select multiple id=city style="width:150;height:200" class="bgc">
/ { N! c, I% H# k </select>$ C1 }3 L2 p" S @
</td>- \# s7 A. m3 p" T
<td nowrap align="center" class="bgc">
, D* b9 i9 N; b" _, \ b <input type="button" value="<<" class="buttons">
) i- q0 @! t `% M$ ^ <input type="button" value=">>" class="buttons">( {! l7 L5 d4 ~7 k% D
</td>+ q! v4 @3 Z# f% a% t# X
<td>; s2 k' T# E, o
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc"># l8 V) ^ `; H8 A5 @" q" g
</select>. L+ y. R) }! d w4 ^3 V# H0 w, }
</td>& A, f9 g' z' T, b' [4 d4 V- I
</tr>
; w( A7 {$ r+ V3 P8 |. S* X# C <tr class="bgc"> . }8 O# g' c1 g3 R
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>
8 g9 {; d8 @2 c2 B f- E3 u </tr>
7 s7 T, |7 {8 | E$ i$ v7 z</table>0 p' j- G, [$ P. P0 H; g3 X
</form>% \9 {( z. `+ s- H$ P
<script language="javascript"> j" x, d7 v8 H2 I, o3 d1 V% U
//人名移动- { L$ v+ C6 B. Z
function move(fbox, tbox) {: ?4 j+ b& C, O3 Y
var arrfbox = new array();' f3 `! d5 k$ j% ?
var arrtbox = new array();
* a2 o- F* L$ K* C6 Zvar arrlookup = new array();
7 Q' b& x% d2 f: t# ~var i;
- e' C% e& t: m) o# u5 l% Lfor (i = 0; i < tbox.options.length; i++) {9 B& y0 a J h+ H* Z: N
arrlookup[tbox.options.text] = tbox.options.value;
) A3 O- ]. L9 l+ n3 x! barrtbox = tbox.options.text;+ {; p# s$ n# n, b
}
+ J8 ?4 u& t, o* C& V1 l0 Xvar flength = 0;
9 }6 ?6 X, A; R: S; yvar tlength = arrtbox.length;# Q/ ?- e" j2 e4 z. m
for(i = 0; i < fbox.options.length; i++) {$ n8 l* A$ }8 z: `( H* E6 X
arrlookup[fbox.options.text] = fbox.options.value;/ [* _( R `: T5 f+ h7 x
if (fbox.options.selected && fbox.options.value != "") {* Q1 `! j# R7 T G b9 z/ |5 r9 A
arrtbox[tlength] = fbox.options.text;
' Q) @6 W2 ]) Jtlength++;* s1 o; d8 C# S* @; {+ K
}
$ ?) P! N7 o, G5 B, G% `5 J- S' Eelse {( t7 i8 x- p, U( k' {1 q
arrfbox[flength] = fbox.options.text;
, V/ T8 C3 I( H- O: Q! `$ s$ pflength++;
- T1 ~; {1 I5 ` \: A+ {: T }
4 P& O% m' v. m6 A9 F/ _}% w& x, x3 d9 u }5 |# C) ]
arrfbox.sort();
9 W1 V; q) y$ ^. E% {' ?arrtbox.sort();
7 Q2 `3 @' K+ @* ~- z
6 u+ e" Y) h) Xfbox.length = 0;* _5 o7 Q2 G3 U) S% `
tbox.length = 0;# q6 m+ l+ f( W$ u0 p
var c;$ Z T4 S9 R, j, t
for(c = 0; c < arrfbox.length; c++) {
" T. |8 q% Q8 J# D5 }7 |& Wvar no = new option();$ u9 P. T( X! f; a `% U6 Y0 Q
no.value = arrlookup[arrfbox[c]];+ v$ P' f4 y- x
no.text = arrfbox[c];6 m* e) ~1 y- h! _3 D/ l5 q5 l; N n
fbox[c] = no; E; [+ Z1 C1 W5 }- @
}+ k# p! Q e: h0 V8 o4 A, ^
for(c = 0; c < arrtbox.length; c++) {
8 R! B( @1 q( pvar no = new option();' Q/ q7 c) r: t8 x4 }$ C1 M
no.value = arrlookup[arrtbox[c]];/ v* ^% S. I5 x9 r1 V9 o
no.text = arrtbox[c];/ ^; I* F0 X! b# q" W& X
tbox[c] = no;
; | a. i* G. ^ }: ?* j1 k& k3 P4 L+ b* O+ {3 @! f
}( A- ?0 y4 z2 }6 o. {' V
</script>- I3 W4 ?9 d4 c. T
</body>
$ d8 S; A! K8 ]/ e$ J |
|