|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14427
- 金币
- 2499
- 威望
- 1647
- 贡献
- 1447
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"% u9 D% g9 W4 n& k0 y' M! W
c pageencoding="gb2312"1 p0 `* ^+ r1 K. | o
%>
+ B2 ~, W9 U7 I5 }$ c<style>
1 a( ]9 q' ~4 C.f9{ font-size:9pt; }
$ S! U: R* \( G5 X2 X3 m.bgc{ background-color:#aecaf9; color: #0033ff }3 R$ |& X2 R" A8 x0 N! Y, `( y
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
8 G% u$ [9 h+ ` border-bottom: solid 1px #4e7dc1;3 Q* @' E) C0 v3 {5 {9 ?
border-left: solid 1px #aecaf9;
5 S4 J# `9 S/ {6 a/ t1 N9 _5 Q border-right: solid 1px #5679bd;
$ `3 l# M, r/ v9 J padding:1px;1 d: A( J3 t* U& V
margin:0px;}1 N& U: D, `/ B# ~1 B
</style>9 U5 X& d4 v- C- g/ @/ g5 b5 y
<script language="javascript">
. u- m! q$ P" K$ H. `' i3 h<!--
$ I) t4 {4 y) l6 G# cfunction rv()
4 a3 u' v2 R! y8 q{
9 K* P3 Q; J8 J0 m7 N# I: K# Y6 ~ var val="";" _: Y! b$ c4 }0 n: ]% ]
for(i=0;i<combo_box.list2.length;i++){
G2 }" H b0 f! L( v6 Y val+=","+combo_box.list2.value;
" O: k' l. U! s6 ?& [" F( h' d }. a! T: ^/ K6 R* w& r6 h6 |) |
if(val.charat(0)==","){% ?* w& I/ e* ]+ \6 a" Y! E
val=val.substr(1,val.length);7 A; W; q, L3 ~/ B! f- g! I2 Z9 W
}
& Q6 l7 @% T. Z: I% [# `$ G+ I opener.form1.frecname.value=val;9 d/ X( K% c- y' }
self.close();
9 k2 s& `/ j4 `8 p6 M9 A$ w}
% u0 Q7 @! x, h" k s5 {//-->3 K) H2 c: l) O: z
</script>
o, _7 m2 S5 X<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">$ v5 u% @; P% j. m. R Y! M, C
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />! [" e- f p' {; ]' ?
<%
) ]" s. t6 V; P/ p( K# s cdatasource ds=new cdatasource(); //数据联结bean实例- I$ ^( {, o- c% C
java.sql.connection conn=ds.getconnection();
7 }; c U1 f2 F1 Y9 z+ {8 z java.sql.statement stmt=null;: F1 Q5 F; t' A5 E& e8 h
java.sql.resultset rs=null; V( n8 U: C7 |" i' X' l
cdatacheck dc=new cdatacheck();
) J# M( u( a7 R% t3 a7 O# k; X%>' a/ [) |' [( P7 j1 B
<%
' o) C2 G. {- k9 d; y3 { f% _/ ? wstring 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";
3 u2 q5 v) w. R4 n3 L* l4 fstmt=conn.createstatement();* U8 P* ?8 G# _. \
rs=stmt.executequery(sqlu);
3 ~+ M6 D G5 s" u+ U$ E& W/ o& j%>
4 v' w, \9 A# d0 p" y<script language='javascript'>
9 d! G% t9 _. x: U/ Z( qarr = new array();
' a: B7 M7 }( t' _8 Q1 C<% int temp=0;3 F6 c, E0 O& K
while(rs.next())
$ j0 J4 R! E8 p: Z; a: y4 }2 Q{
: X6 v/ N) b) t' D%>9 l! Z# z+ d9 Q- A. o
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");: t6 R& P3 @+ Q: R0 {
<%
) c- o1 X9 W& B9 Jtemp = temp + 1;
, B* j/ J0 ` |; E+ m2 F, {- H8 W}4 L% z6 Y" w7 ?- p/ ~
%>4 w5 u6 x4 G0 J: n
temp=<%=temp%>;
) l! [& C+ a% }3 T* yfunction changelocation(id){
+ x& s1 E# S/ G) tdocument.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 : S5 U3 I! V v! \( n7 r
var i = 0;
, ^; K8 `" B: i" a, {7 _8 D& Ndocument.combo_box.city.options[0]=new option('-------',''); : z5 p9 m# @ c1 c* L2 y6 m
for(i=0;i<temp;i++){
q% A* D+ Q3 zif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
$ x ]( r7 X- Tdocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
! A" h1 J8 h" P3 } Y}
; W6 U2 x( X' j% z} 5 [0 O2 ?2 m. t8 w7 O, Y
}
! |: _7 e/ _% I" y' a</script>
7 p5 R+ S; u! O% w2 _3 `' b2 ?( v" k& V! V$ W; I3 l
<form name="combo_box">( a# l9 Q/ f, ~' X
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">8 G/ @+ w* z! l! |: X
<tr height="24">! J$ o, d! H7 s- p
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
8 L- D3 `' J1 N9 i, T; N% f6 w3 d <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
. c# W. v7 {- }( o0 [9 A <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td># ?, ]5 W; s& ^. y% F+ L
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>, T4 a4 T* h' [2 {- s
</tr>
" a8 u S. i ~) u5 u% V% E* [. f <tr> 9 a( [1 M* h% v: C9 C# P' c
<td>
* h7 c j8 l1 c- S <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
6 c/ \1 a: j/ M <option value="0">请选择部门 ---></option>! V" p, I. i4 D8 k) \
<%
6 w# F* F3 _7 c2 C. @$ i k1 c string sqld="select * from tdept";3 _5 Q3 E7 n3 z" [
stmt=conn.createstatement();0 z) K/ [( f% I3 g2 Z5 Q* k2 b
rs=stmt.executequery(sqld);
$ y4 [& \1 v/ Z6 `% p7 o. h, Swhile(rs.next())
5 t' o# h& o. ~" O2 ?' x9 k, U8 }{
, l1 [0 `) _0 S6 o%>
7 [0 U: B8 f8 D1 o- T <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>9 Q$ F& _/ I, T
<%! `8 l' X# O7 ^/ q: v2 B0 r4 D
}" ?6 V, G1 Q0 r! V2 j" V4 q/ }2 }
%> ! J8 t/ U9 R/ ^2 V; [
</select>
- _: Q0 y ~. M1 @$ N h: k4 ]</td>
* l0 M2 ~ B& v! Y1 [ <td>
7 s0 L5 c. N5 w <select multiple id=city style="width:150;height:200" class="bgc">
( I. f! O* V! Q; A6 u% c </select>: ^6 R. A' v( p2 K, k! J
</td>8 S- |, q8 `" u% H) W% A8 i. F
<td nowrap align="center" class="bgc">3 k: E% h8 S& h
<input type="button" value="<<" class="buttons">& o4 F: U4 u2 E; u' ?! [
<input type="button" value=">>" class="buttons">: J2 J# }+ \: k
</td>! ~2 e1 e7 o3 t3 J
<td>
F( L. L9 ?4 O& P <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">1 t+ |0 ~( t* I6 b0 ]1 }) X! k
</select>) Y8 R1 ?/ l1 P3 M# L
</td>
' W1 M3 K, r5 R </tr>9 B) Z) H7 [0 w* A
<tr class="bgc"> / H- q, w0 A- d6 E- w
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>/ x2 R% f) _$ h! ~- y
</tr>
( b) c2 B. f) y* c4 X</table>! Z, D1 s0 @9 i, E7 A- P
</form>
/ o# Y" w1 R; ~( P<script language="javascript">
3 |, z. G) t& {2 `/ z% v* L//人名移动
' j9 w% J' O8 Ffunction move(fbox, tbox) {2 `7 y* P& F( ^- W1 m/ @- r
var arrfbox = new array();5 }! F. _4 S. m9 q. R3 B
var arrtbox = new array();
! V- s8 U) N9 V5 r. K. D( \var arrlookup = new array();
1 N6 Y! {9 z# C' H8 Pvar i;& e8 h+ G6 x# Z1 `5 ~
for (i = 0; i < tbox.options.length; i++) {% f; B3 ~) i e$ q1 c }5 b# `
arrlookup[tbox.options.text] = tbox.options.value;
* [+ H& |! T8 C; x! y- S; h4 @8 h+ varrtbox = tbox.options.text;/ Q" n- R! V, g0 A
}
& }9 q( I) { r- L- Ovar flength = 0;5 [, S) I" W6 s6 e
var tlength = arrtbox.length;
4 W! Q, a8 F8 R4 D+ Mfor(i = 0; i < fbox.options.length; i++) {# @! X2 O8 V3 E8 I' f! q
arrlookup[fbox.options.text] = fbox.options.value;. N1 ^$ H# y: D3 B* G
if (fbox.options.selected && fbox.options.value != "") {
% T, y4 j5 f+ B7 o" s/ [arrtbox[tlength] = fbox.options.text;
. h. m1 G; m7 t' b+ G( Utlength++;
& v# z/ Q8 [" i# \( R( m' S' D9 w' R}
4 [$ ]* s- o2 V2 f/ W/ Uelse {3 R) s+ K9 D$ |2 [: K5 E
arrfbox[flength] = fbox.options.text;: \. y9 ]4 R$ `+ K
flength++;
/ @! I0 c5 L# r( J% G% M }
6 j. f! H& B+ F0 H0 R}
' _6 }+ n! `- ^) S; l4 {arrfbox.sort();' X. R' I8 }( U7 E
arrtbox.sort();
* ^4 `' ?0 y1 @ J' t5 Y, K( J* r G
fbox.length = 0;6 W0 O( B) d# u7 E! {+ S
tbox.length = 0;( S+ F. e, \% E" }
var c; B3 Z i. q7 B
for(c = 0; c < arrfbox.length; c++) {
% [8 ]/ i6 R9 J" N$ I# k5 rvar no = new option(); `$ G" D3 Q S
no.value = arrlookup[arrfbox[c]];
0 p, x! o D G. e. Kno.text = arrfbox[c];
2 y: b/ e8 y. h( g1 c9 w+ H9 a0 Ifbox[c] = no;2 x* D$ ^& f' J
}3 V; \- t+ \: K* @, p2 X# l+ S9 m
for(c = 0; c < arrtbox.length; c++) {
! j$ D. g6 q6 u6 n! T" V1 E4 |var no = new option();
$ o8 D0 a# I3 r$ c5 y; P1 I" _no.value = arrlookup[arrtbox[c]];
! @ L5 O! i8 b: xno.text = arrtbox[c];4 q% T. h9 z) ?
tbox[c] = no;
) ~& N6 R9 a5 }) W3 t Z; t }
3 I# G. Q; S0 o, N$ Q/ r/ r( r3 y}# g, [, r5 C1 u$ y% H. N2 d# ~# O8 P
</script>: @% N+ j+ A7 ] l
</body>
* x% [. d6 U. `; | i |
|