|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14389
- 金币
- 2480
- 威望
- 1647
- 贡献
- 1428
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
$ C L' P2 ^# D# A c pageencoding="gb2312"
+ }: g4 u' T8 R( [9 ^/ j4 o%>
+ ]5 P0 \- H4 W7 {7 Q+ ~<style>$ j7 J% Q$ {- h- k( K
.f9{ font-size:9pt; }) D5 u0 i# I0 Z8 ~
.bgc{ background-color:#aecaf9; color: #0033ff } A1 }4 f( n; k$ W
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
% X' x# ?" U, N! i0 Q# p border-bottom: solid 1px #4e7dc1;
3 q# T6 o- N) P1 H$ K+ X, ~% w border-left: solid 1px #aecaf9;2 X% t4 H4 j% I8 K: `
border-right: solid 1px #5679bd;" E. H8 q- ]: c2 p. V( V
padding:1px;- L; @+ K$ F1 f
margin:0px;}1 B" n) C, ]( R: v! v
</style>
* \5 t2 s& |" N! `7 w2 S9 r! h<script language="javascript">
O0 r/ k$ q# b( m<!--
% }. `& l- F$ _1 b' n( O' S; dfunction rv()
7 ?7 p! l7 \2 J" v{$ ?# C K! n5 L& `2 L
var val="";& S* Q( {2 r) Z1 ~1 [
for(i=0;i<combo_box.list2.length;i++){! _% U0 W8 J# q) _6 n+ F
val+=","+combo_box.list2.value;
% S1 d/ X; v; q3 ^ }
9 D0 f. s! R/ ~5 Q# w% p& n2 ] if(val.charat(0)==","){/ f+ v0 o9 Y' t! o% T
val=val.substr(1,val.length);
; k9 H( T2 O9 M, N }5 _& M. i2 q: x3 f& B" N3 ^
opener.form1.frecname.value=val;( ~5 P L2 B. I/ O
self.close();
4 D* ~1 q# V! N! k5 V8 ?}/ n- Y/ H' v8 N6 X
//-->3 ]% ~6 _) J( P! N# W
</script>) i" E( f" `) Y9 ?& u$ \: X/ n
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
0 `. {& ?( Y1 f5 u8 _0 |* g' s<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />3 z& d9 C. F8 i4 D8 _( K- Y, [
<%# m5 H) Q# P! I7 w. s
cdatasource ds=new cdatasource(); //数据联结bean实例
8 v! p; Q# Y' S; }0 J java.sql.connection conn=ds.getconnection();- P+ h' T* Q3 u- p
java.sql.statement stmt=null;3 z: X# \0 D Y& [+ Q( Q
java.sql.resultset rs=null;
6 V8 Y! P1 \) q9 i cdatacheck dc=new cdatacheck();. ]5 T2 g5 T% x8 }& L0 M6 |
%>
( ?; C3 N1 C) B& F<%5 S& v4 T8 ?. T5 H$ i* 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";
; }2 @9 h' \$ n( d) s' v R! mstmt=conn.createstatement();
; p7 I4 U* m6 F0 t: p6 crs=stmt.executequery(sqlu);
W% e9 [ g0 \7 f' o%>' {3 T: j5 V& E( N3 K3 A# w
<script language='javascript'>
& R+ i0 e" ]& a0 R9 R/ warr = new array();3 |- M' j' K. n. ]8 e; H' G
<% int temp=0;0 ]; |/ j1 a5 w2 F
while(rs.next()): N/ [8 d* s( [
{
" }# ]3 X" `: k/ |%>
6 F! t/ Q* K( U3 X! Zarr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");( _/ N6 I( _: O0 |2 Z
<%
% o$ V3 N. B' F* mtemp = temp + 1;
; ~8 k0 A6 c( {* X' G}
5 C) y9 K) [8 E( q. z, D%>
7 J5 q! j* O: p/ h* Otemp=<%=temp%>;
" x% I) |" W s; O8 L' H: Efunction changelocation(id){ + K4 ?# T+ Y5 P& J) J
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 , W6 Q! E$ b( u: ] C
var i = 0;
$ H4 u/ R! ]! m& W4 idocument.combo_box.city.options[0]=new option('-------',''); ( l; i! p$ W; \" Q
for(i=0;i<temp;i++){
( i3 L* }7 t' ^! h' d9 i E7 h+ @8 s: fif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] ! T; U' ?( l6 n3 p' R" r- o
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
) @/ F0 \7 V4 K/ L}
- a0 X5 f( q9 i, x) g. r/ _' j& |}
& o* Y2 N' k A/ T}
' ~# P/ ^8 [& ]. R @' V</script>
" U+ P6 `* q5 F- v5 Z# f$ }9 ] x) |0 G5 V- E D+ e3 R% s
<form name="combo_box">
$ @; |0 d- J, A3 h<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">1 L( T; `: e0 `+ ?
<tr height="24">
; R* W b" _2 r1 m# @* [ <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>2 g/ e. o0 x5 V0 z
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
2 V6 @( F8 o1 o <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>& d M0 h$ T. D P) k( U2 l0 ^
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>: q* Q4 u% S% S+ y+ a2 j% a6 A- ^
</tr>' I! T& O2 ~5 I
<tr> 2 x4 V7 y$ e% z! I9 d! X; E4 Z
<td>
& v$ R; K! W6 s N <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
/ t! r- G9 C( |4 w4 \* N) A <option value="0">请选择部门 ---></option>
- E# V/ N' N. k3 G" H& {* v( Z. Q<%( T d3 E: ~3 c8 u2 Z2 G; ~ F
string sqld="select * from tdept";9 C% [% D# C$ K$ z/ V9 X
stmt=conn.createstatement();
9 h% l% H" A2 jrs=stmt.executequery(sqld);
# N2 Y2 P! e; h4 t4 p" Twhile(rs.next())
$ u1 F. p x! J! o9 P# Y{ i( t! M2 z9 O7 L
%>
# Q; O5 K# A; b- j$ k <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
3 I; `& ?9 G8 ?' k1 X0 q<%
9 F+ M( M9 G/ d" ?2 E9 Z0 ~# t}
" \) g5 ^/ w! m%>
2 s2 Y+ e. d) b1 k+ h </select>7 E) P. P4 U" ?; {. m8 O! X
</td>2 z* _1 `$ D$ J D5 J
<td>! ^( z: l( p& p* s3 k, _- n
<select multiple id=city style="width:150;height:200" class="bgc">
$ \) d5 e1 M* h M4 A+ U# S9 w </select>) R* C& ~+ i& X
</td>
; Z% y) t; { C5 y# d0 i <td nowrap align="center" class="bgc">( {# e. `1 I: @ t$ i% O+ I, A
<input type="button" value="<<" class="buttons">
$ y4 y3 B3 c$ H- l; k/ G3 m7 o( c <input type="button" value=">>" class="buttons">
b; m' w/ G8 m9 K, g</td>
$ v N0 n5 u; A3 ? <td>9 b9 }( W4 N0 J& Q3 }" G$ h
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
0 d$ W) v/ R3 j: z O0 f7 a, j </select>
9 T$ V2 |6 S2 a# \ |" D) h</td> H# ]5 h \/ s6 c
</tr>. T+ g, \5 a7 O9 Z5 V6 p: Y
<tr class="bgc">
0 k% G( d3 p# M( n8 K <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>; @* A1 |% h+ J1 A8 X
</tr>
& M1 G" H! ^1 B% o! M+ r</table>
' T' w6 W; c9 G! o* a' \, `</form>+ N. K) D3 ^' O, X# I+ y/ v) ], F
<script language="javascript">+ M8 S6 Z$ z) T; f1 _5 E# v# M
//人名移动
7 ^0 o4 S9 s. T9 q! G! mfunction move(fbox, tbox) {4 C" d* G& A. R1 ?8 E- s
var arrfbox = new array();! X& q5 }' \9 ?
var arrtbox = new array();$ A" ]% ^0 j( ~& t1 t
var arrlookup = new array();1 v% `; w* R2 G' C! ?, g$ C0 `
var i;* X8 A. ]& Y6 P/ t6 W3 `
for (i = 0; i < tbox.options.length; i++) {" G5 _2 M# d. l# v- c
arrlookup[tbox.options.text] = tbox.options.value;) C" C- p/ y) m! W! m
arrtbox = tbox.options.text;7 W" I% x6 E/ h+ S
}* z- I3 V! l9 q5 J, V, E; b
var flength = 0;9 _' [( Q; J9 e' `$ T1 |
var tlength = arrtbox.length;1 R w0 \2 y# E4 g9 W3 o
for(i = 0; i < fbox.options.length; i++) {: @- K0 u. }' |8 b
arrlookup[fbox.options.text] = fbox.options.value;0 Q8 `* r* v K! Z* Y5 C5 P" P
if (fbox.options.selected && fbox.options.value != "") {
- x4 o W' @1 x3 Uarrtbox[tlength] = fbox.options.text;1 b+ R: K5 [3 }9 m+ E" a
tlength++;" ]5 ^ j! R% C- b/ X: K( v1 m, c
}
% L5 j* \7 O0 melse {
4 u3 {5 E7 R: S" i2 ~' p$ b8 ?: }arrfbox[flength] = fbox.options.text;# l5 K: n M/ |( h4 \) u9 \8 N
flength++;
: z; \7 Z4 c: m" {6 S }
$ V) }9 n% r7 i2 c% P1 b; j5 }}. [4 O2 @' ?8 I, \ r2 F2 _
arrfbox.sort();
3 E e! z" n- \ H; carrtbox.sort();, l' @+ F6 J& t$ u J- F0 }
: z8 K; ~$ N: ~9 afbox.length = 0;/ t% Y3 m9 u5 n( f! R
tbox.length = 0;$ }' a7 D0 \5 ~& D3 C& C
var c;
3 T# p5 U; H1 s/ z# e3 Hfor(c = 0; c < arrfbox.length; c++) {% F+ N, w; i0 f& Z
var no = new option();$ \+ g* y$ X" K$ Q. D
no.value = arrlookup[arrfbox[c]];
5 ~( C) k6 Q% T) wno.text = arrfbox[c];
# w; y; q% \, @" I1 m. h' t, i+ Y3 Lfbox[c] = no;3 Y% o+ Q) Y. m) G8 W5 C
}/ \( _" e7 J4 C. x
for(c = 0; c < arrtbox.length; c++) {3 q1 j4 i( x* ?/ N6 K0 G# T* ]
var no = new option();( ~- U2 K+ U$ p) u9 E7 T; ]
no.value = arrlookup[arrtbox[c]];
% d2 U% Z2 v t: }no.text = arrtbox[c];+ G( U/ }4 k+ r% P: k- O
tbox[c] = no;. m/ g! W7 a3 L% ~
}
0 r. l9 [) K2 [}
# l" Q+ z% v9 ]# I% O# m</script>0 f# `4 S% ~4 L
</body>: s4 o6 M& K+ h3 i( g1 y5 [
|
|