  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14221
- 金币
- 2401
- 威望
- 1647
- 贡献
- 1349
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
1 r) i6 `& Q6 x9 N$ N8 G. A2 B c pageencoding="gb2312"
% l z0 e! ~" F5 i%>
) ?4 o& v5 Z* d# e0 }4 ~4 A# n<style>' p/ [/ }0 q8 `' j( y
.f9{ font-size:9pt; }" a8 p6 e* Z" v1 G. K4 _
.bgc{ background-color:#aecaf9; color: #0033ff }
4 }( }& D6 i- j8 w( @. y% [.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;% {/ W" A: R; ~- _: m+ W
border-bottom: solid 1px #4e7dc1;
/ J3 w, d" i9 u% @+ o0 Y0 I border-left: solid 1px #aecaf9;% I: d0 {; m$ n4 e6 z8 c
border-right: solid 1px #5679bd;
" R' W, w, z. t8 v padding:1px;
/ Y7 j1 ^/ Z7 X. d" z5 N) c margin:0px;}, T0 I* g' @1 H7 A- \
</style>( ^8 \& m. s- K) U. L- I
<script language="javascript">
i' H7 k6 X9 ?1 J" T' u1 P; G<!--
& F h8 \; a! J! Q; h4 ]- ?! n8 Wfunction rv()! W' C5 |/ A1 b
{
/ e7 J( {8 Y+ ]- c- M var val="";' i1 W2 y- {' W# A7 S& }
for(i=0;i<combo_box.list2.length;i++){
# Y+ Y/ a+ }7 Z' N! J- L val+=","+combo_box.list2.value;
9 x( L% f7 w' K3 k! h1 n4 o0 t }
$ ` y) z8 d! X3 Z) x4 } if(val.charat(0)==","){3 l+ x( M# T' s; o
val=val.substr(1,val.length);% K# P+ `7 I" a3 s7 k$ U9 n
}2 H! M# u! s) f5 x( W
opener.form1.frecname.value=val;
8 R @4 [! F( G# D self.close();6 D; ]8 A3 [) X3 L! Z) ]/ p
}
- K/ m, N( C, R) f! b+ L, r//-->
5 W7 v, L! v9 O% f3 z4 [</script>, k1 y; d7 g6 z) n
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
) {" G" R" z: n<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />: j, C% v7 G$ y+ b
<%5 [/ P/ U# l6 _ r% l
cdatasource ds=new cdatasource(); //数据联结bean实例- v6 A6 J8 a0 m
java.sql.connection conn=ds.getconnection();
q: ?8 X0 q0 a Y5 j java.sql.statement stmt=null;
7 S6 x, U$ H6 D t java.sql.resultset rs=null;- d2 f3 g, }9 B, A8 i: z1 E7 W, Q
cdatacheck dc=new cdatacheck();! M: `6 ~$ H6 O
%>8 e% t v& d( A
<%
. K5 H3 [' S9 ?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 V V/ y/ a9 Z. b" \. O
stmt=conn.createstatement();
1 J. ?) ~, V: r; \% j. O, }* K( @4 irs=stmt.executequery(sqlu);9 Q& Q; b% d4 A3 p/ a; `( e
%>6 { a, o8 E. p( k9 p! U G* b
<script language='javascript'>
" S* t1 u- ^0 k. m" Aarr = new array();
+ D$ V( N: Z* u- ^; D5 ]<% int temp=0;" s2 J9 }; R# G- Y, ? h
while(rs.next())! ^/ ~; ~4 q( J+ `8 O
{( K1 _% o) e! p( h7 ]3 u
%>7 e# D: R o/ y! s) a# X
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");( `) O: Z4 O0 i) D8 L
<%
6 G a9 E* F" otemp = temp + 1;/ j+ r5 u( G4 t0 H# N
}+ w2 @# B7 Q8 B P' L: v
%>
$ P* Q, u+ N* |9 H- |5 Ttemp=<%=temp%>;
7 I" ~7 j/ A% o* X( a* B. F: d% X1 |function changelocation(id){
; a; f+ N; W. h o7 }document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 ( S+ j: [- [+ F; f
var i = 0;
/ ?1 G- z+ N" ]2 Xdocument.combo_box.city.options[0]=new option('-------','');
3 |/ `; n, [5 z! D/ ?for(i=0;i<temp;i++){
8 z0 b, v) [! @5 ^if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
" V+ y* ^: f% J: g* \: fdocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
! F# }4 P- }+ U9 V8 e} 1 O8 {! w1 [8 ^2 {1 s
}
& y( ?& t5 J* f$ N& B}
7 S) e3 Y7 ~: m/ G, e</script>4 z9 \& k V6 F9 u
7 D: ^1 o) z7 T+ v# C4 ~& J<form name="combo_box">
- B8 j3 Z- N8 L" ]' n3 [) v<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">& Q7 p1 ^, g5 U# M
<tr height="24">6 g1 K3 c' d$ i; {# j
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
, `3 ?) X! d+ U9 _% C7 H' d <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
/ f# A3 g" J7 B; K5 P6 z <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td> ]/ K3 q: ~$ i# D* f9 {2 l Z
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>; \& w0 x; _5 R' S# j. _" p
</tr>! ~( X) G; R" A" R8 B
<tr> - V! f- U9 E& t' m5 Q q8 ^* F& r
<td>
J f/ K% a4 y1 z# K <select multiple id=prov name="prov" style="width:150;height:200" class="bgc"> K# i8 \: g7 |/ X4 f; ]
<option value="0">请选择部门 ---></option>1 y& F3 l% `0 G- u) Q. x( T3 z
<%
( ~, r) {! ^5 I3 B- k string sqld="select * from tdept";
1 F3 n0 e/ |; S, i, U: j0 l* N# R8 Xstmt=conn.createstatement(); b$ q$ D# ?/ u6 x/ A' e6 ]
rs=stmt.executequery(sqld);# P) k, Z9 \/ D7 X5 k
while(rs.next())1 n; R2 A/ @% i4 j3 r9 v) y5 k- X5 q) y6 \
{' _& G6 ~$ Q2 f! X" Q1 H4 Z
%>- g/ r- x3 ]$ R# F; ^( F7 S y
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
# f) e$ K: e! I2 B8 Q8 H& D<%
# _$ `2 ?" k, t+ }8 z1 e}
9 `5 |' }+ B: w& c%> 9 [& N7 _7 `( p8 F% d+ E3 T
</select>& c3 Y4 B- {' w4 r7 U9 f+ A
</td>6 v7 j( K C" }( u4 v# a% m
<td>' w! a, \4 r: S b# ]$ U. e5 {/ J
<select multiple id=city style="width:150;height:200" class="bgc">4 b# f' N1 _: m% T4 e# W/ P
</select>
7 h- w& F' [8 d4 e6 |</td>, |! X/ S9 n9 b% P; R5 [% d* r
<td nowrap align="center" class="bgc">
. P. f- I$ u, n) A5 ] <input type="button" value="<<" class="buttons">
( A$ O m$ D0 Z$ }5 A, p <input type="button" value=">>" class="buttons">
: w- |: y9 B) I( A* S& U" e</td>5 B7 P! X8 }7 M0 X% c. m
<td>
3 p" m; v- t6 V$ v1 m; h- W <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">& F" X0 R* B- t5 p% E
</select>" L1 \. ^5 A" l' D- G
</td>8 j6 ]' j8 W, a3 S- E$ M8 d% B# ?
</tr>$ e" x- |, d# k- T1 ]
<tr class="bgc"> # }2 ~9 s( i/ Q. O% [/ Q
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>2 J$ a7 |1 v) }6 o; K! v, F: H
</tr>
" a( A+ _: q# u% K; ]+ _2 w* @- P A</table>
% {6 @; ]5 N& |! X \3 j* I+ P. D</form>, l @3 M) u& m; \# v2 Q# E
<script language="javascript">+ I7 q( L% \# ^& |7 e" |3 i( M
//人名移动
% Z [# W# B7 S. P9 B& [6 ~function move(fbox, tbox) {
7 A( ^0 l& _- Y* S; gvar arrfbox = new array();% {2 R7 L* d7 C7 e. I3 V! t
var arrtbox = new array();+ x/ w* ]# A2 m3 v3 T( P9 s4 b
var arrlookup = new array();
+ j3 B- d/ w) ^var i;
' F& [) d2 z: [& P1 T2 gfor (i = 0; i < tbox.options.length; i++) {
; G' \" ?# q- G2 n2 c {$ S q3 parrlookup[tbox.options.text] = tbox.options.value;
' ~) o5 w0 Z& s8 Narrtbox = tbox.options.text;+ m+ n9 G9 D- c; H1 Y$ M: `( V+ {) _
}7 p) ?7 H' E6 k: ~+ {' x
var flength = 0;7 ~' z/ a0 h& m! y# P% j! o! l1 U
var tlength = arrtbox.length;2 v: U! j( M9 C$ ^" |0 b
for(i = 0; i < fbox.options.length; i++) {
/ u: A# ?5 @) ^9 u1 q( a6 carrlookup[fbox.options.text] = fbox.options.value;
; ]7 c8 @" H, oif (fbox.options.selected && fbox.options.value != "") {
3 p+ k2 u' R+ Q y) Jarrtbox[tlength] = fbox.options.text;# F4 ]' r' U1 k4 n3 f1 h5 ?
tlength++;, B8 V, b% x: E. G: |
}1 O! f; `3 G0 _* @* q
else {
# W5 P: r9 W7 L- U% T: ~0 ?! Karrfbox[flength] = fbox.options.text;) n/ h' a( }" t; r5 w! R2 F
flength++;( [9 T. u( P! z, |1 F2 D5 k' x
}9 k- C' ?6 y ? a% W8 v% j% ?
}1 X. j/ r. x4 Q
arrfbox.sort();
" | o0 |0 z1 A* }9 Narrtbox.sort();/ y3 L4 ^4 e( l: Q
! k8 x; f8 k8 H2 y* Z
fbox.length = 0;
$ q# D( \+ X, w" d* @tbox.length = 0;
6 u, n" B" Z( y/ l7 n" bvar c;- g) J; k" u9 H1 a: u
for(c = 0; c < arrfbox.length; c++) {
. E6 a! L5 o4 h2 l" wvar no = new option();9 B# ?% n) Z3 G3 Q3 M3 k2 _8 G
no.value = arrlookup[arrfbox[c]];4 _$ Z$ T- O5 f
no.text = arrfbox[c];7 @5 p$ ]- }+ [) }+ K; q' m- t! c
fbox[c] = no;: z3 N4 s5 q/ b, p; t
}/ H' w4 E) l. U" e
for(c = 0; c < arrtbox.length; c++) {# |+ {* H+ |, |- ~) v
var no = new option();* ~* |$ [2 a) h3 E% [
no.value = arrlookup[arrtbox[c]];; }# k/ b2 B! k3 p y" [) C% ]
no.text = arrtbox[c];
# G/ @/ q+ j4 Z4 @) Vtbox[c] = no;
; S( \" G4 y+ c- b }. t; G' N( O4 |! C/ w& j$ R
}
7 S) d# d k3 I$ W {) U2 U</script>5 e3 k( n; \* J- s! r# R; e
</body>
" x- K7 i% ~) V; v/ ] |
|