|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14389
- 金币
- 2480
- 威望
- 1647
- 贡献
- 1428
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
7 h7 Y. N- p# b! q c pageencoding="gb2312"6 w$ L7 B% W' l' o7 t
%>5 Z1 I: ^8 ~& i6 O3 U
<style>/ u' M8 M* t2 {; k( x/ i/ |! `3 b9 w! g
.f9{ font-size:9pt; }9 g1 N9 e2 q, l
.bgc{ background-color:#aecaf9; color: #0033ff }" m' W/ x! _ |- Z, k
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;" g6 b% v7 G9 ~/ e. E' \
border-bottom: solid 1px #4e7dc1;
8 T( `; S+ V' N" d) I border-left: solid 1px #aecaf9;+ l5 K: o! P* x$ ^* \
border-right: solid 1px #5679bd;
3 N7 c) p% R: H y2 A- Z0 g+ K padding:1px;. j( _ w- |1 U3 R! t
margin:0px;}+ c- {+ Z- {% c* [
</style>0 A, w `* F& l# B4 x" ]
<script language="javascript">
# H% a8 X( Y6 _0 T o& o<!--2 N9 s) A' |2 [
function rv()
7 q7 X: i0 k4 ^/ o- h{2 \/ m) U; M: I! e. f5 e. {. j
var val="";
( W* u9 R! j% M l: C9 c for(i=0;i<combo_box.list2.length;i++){
3 P$ i A# }2 _0 b: g val+=","+combo_box.list2.value;
% a. r; V: e4 o' ~5 P6 B }6 P. S( K. [! ]4 O
if(val.charat(0)==","){
# B% E2 k4 s- q# G; l val=val.substr(1,val.length);
* y* R0 l% [" b8 N% | }4 T8 p, ]. M# t9 }) E
opener.form1.frecname.value=val;
- P$ Z8 I& V' J; x$ D+ X! w self.close();# R2 h5 Y( G1 r8 t+ e5 e
}) ?4 B* {4 o! Z) G
//-->9 b1 e4 Q0 l/ A4 `) Q4 c
</script>8 m4 v6 e Z) M; i
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">2 C h, |5 u, N4 a( u& T* Y# p
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
- m s6 n" ^* i<%
4 P3 h J( F. D' \ cdatasource ds=new cdatasource(); //数据联结bean实例7 R6 J& z" y! m
java.sql.connection conn=ds.getconnection();( U/ N& V5 Y# U$ u4 b) O. ^/ X$ U$ s' h% S
java.sql.statement stmt=null;( C" R9 R5 j* a) q
java.sql.resultset rs=null;/ B1 n) F/ [. k* V7 |) }- l; _
cdatacheck dc=new cdatacheck();& A; x0 _: y+ W& s2 p8 O" L
%>* u: [! S' G X3 m1 u- \& `
<%; m( `$ y: j$ A. ~; ^3 y
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";
/ G# r. g$ s# ~3 _stmt=conn.createstatement();- Y! y" }7 F) K; \) x
rs=stmt.executequery(sqlu);
( u$ T" G1 t( B! ^* s" f%>. \$ o. l& v! `
<script language='javascript'>3 Y; }' r% z) g3 |
arr = new array();2 K8 v' {" d4 E+ R
<% int temp=0;
8 [0 `" j, a- C- g+ {" Nwhile(rs.next())) j% R9 M# ?% U* [" v$ ^
{2 U4 f n) Z }
%>9 @8 o/ c3 l/ \5 J* Z& `
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
2 C3 [4 x6 ?; X/ j- l3 _<%/ g3 h! n' g+ t' {
temp = temp + 1;9 U; K7 q6 q( \4 |( i1 ?+ s7 V. L
}9 R# O6 n. D7 E+ Z8 Z W5 D
%>4 x8 [) j, G6 a# [! y; [) _. V6 y
temp=<%=temp%>;4 m" m! X- D9 c& l
function changelocation(id){
6 n& D/ X% |8 x2 m( X0 ]document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 , S# g- |& I7 ^/ J1 m
var i = 0;
& T* S9 n2 z6 |4 t8 C K; Qdocument.combo_box.city.options[0]=new option('-------',''); , G# ^7 d7 N Y4 d+ `
for(i=0;i<temp;i++){
* [, @: b" {/ \1 {( Cif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] 0 g- O; o% n' s5 ` _
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
8 l7 w" b1 A' x; }. J) i, I) H! D} 4 C+ ^; x3 z' e" d: |
}
0 K5 |# U6 y; z4 E} ! _3 N7 I( c# ^) V1 x4 L- t9 Q
</script>, `7 f" d1 i: f0 M' |; }: I
/ I( L) U, d _, D& d% I1 I<form name="combo_box">( m3 L2 j" A$ X+ L# q
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
3 k# e$ @6 K2 W0 e# Y" ~, Z <tr height="24">
' p+ p# |0 W4 M9 _ <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>- |7 K3 O; K4 a' L! \- s* g1 X
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
% C |9 H" z6 C4 }; N <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>0 {4 C8 h& x9 t, I9 N9 g2 R- L
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
1 {2 B" g# y8 v8 I7 d </tr>
8 b5 H) V2 _6 Z! l0 u <tr> ) Y6 g% [! e, T- ~- k$ Y4 w
<td>
* X0 W% |9 y$ h- I3 ^. }7 \ ~' F2 u <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">+ B% \6 t( m6 D
<option value="0">请选择部门 ---></option> M6 y& `, j8 ? d, Y) g
<%$ c4 D- x& l" a$ ~
string sqld="select * from tdept";
6 E6 M; B" f1 v& @+ y. Z2 X5 }" kstmt=conn.createstatement();' o5 ^. H" ~/ j* b# i) v' ~
rs=stmt.executequery(sqld);# s/ V# G, K: F, M! l( y/ ]
while(rs.next())/ m/ g& `/ v) K. [4 a( n2 N" p0 t
{% C% C+ {) S% Q, O5 Z( p" ~2 I
%>
) w! _4 A' w& Q6 J3 L5 a3 r9 S1 n <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>" `! h. X1 P" z4 @! F3 Z: ]
<%
9 w, p8 B7 T6 E3 B/ Q. O- x}
, N7 @! C3 z8 W( _' l2 j1 F%>
5 F2 ^( O3 x6 }0 _: K+ V8 N. i </select>
9 ^: x e( Z# x; M0 d</td>& K$ r' d& c' i& m
<td>
: h+ _5 ~( y+ `# I4 U) K) e% O <select multiple id=city style="width:150;height:200" class="bgc">
) j! }2 t* Z, G8 M0 y </select>+ n+ m& x: ^. z+ i) g9 r0 y) V
</td>
/ }4 v" z$ O7 y <td nowrap align="center" class="bgc">
) [8 a! f5 `( j; T8 f( t0 I <input type="button" value="<<" class="buttons">; P3 j, s9 @/ X% g+ O! E# e
<input type="button" value=">>" class="buttons">8 m1 [9 v8 L. k# V+ \
</td>
2 f) ~" ?$ S) t& _* C <td>" F V$ H. i% r+ k/ ~
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
; h2 l( w7 s& h J* ?9 ] </select>, R5 e/ b; F8 C& C: r' s
</td> ]2 H, n# o9 v! c; v
</tr>
9 G( z! \3 \; v <tr class="bgc">
3 p# G8 S: h4 v <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>
0 @; g3 P' m8 e7 R0 F2 l% H </tr>
4 I. |$ Q# z- T! [</table>; Z3 F# f$ a5 w3 ~1 I% o O
</form>& y& W+ v0 \% j6 o/ B: i9 X
<script language="javascript">
1 H! O4 E0 [( v2 p8 H" }6 m, V- ?//人名移动9 V5 p0 D2 d1 M
function move(fbox, tbox) {1 |2 ~% f& U+ n3 i, F( w" e1 `
var arrfbox = new array();
0 K9 O) \ r {var arrtbox = new array();9 k% y! j6 s5 X: U, i' G
var arrlookup = new array();+ i$ |# F5 g N: z9 a1 x
var i;; W$ g& @" Q" c& F
for (i = 0; i < tbox.options.length; i++) {/ \% V9 [+ N* e7 ]
arrlookup[tbox.options.text] = tbox.options.value;) K3 u' g! S( |/ D, u$ E
arrtbox = tbox.options.text;
; }( {8 A' h% T# ]* g& V}# b1 O' j: T. k' n# [; \
var flength = 0;
- T4 ~$ Z# p E, R' mvar tlength = arrtbox.length;
6 l( L2 N* W' S4 w% O: Bfor(i = 0; i < fbox.options.length; i++) {. Y( C3 W4 W; h
arrlookup[fbox.options.text] = fbox.options.value;; ~$ d) ^1 F5 @' x( b
if (fbox.options.selected && fbox.options.value != "") {' I8 J- f3 s6 N# J* ] U
arrtbox[tlength] = fbox.options.text;
; J% o8 F8 P: m" Y' [) k1 h/ Ktlength++;
5 s3 X5 Y+ D& c* w# Z. m0 H- }}0 ]2 b0 M, ^3 K- ~, w
else {
9 g1 G+ N. f u7 d6 ]' X) iarrfbox[flength] = fbox.options.text;& Y3 t9 c6 a+ F/ l8 K) H
flength++;9 ~; y" M9 A8 X2 d8 K+ F
}
4 ?7 ~. M) ]; t/ d& L}
' Z8 Y5 Y9 L) |arrfbox.sort();
$ t( ]' W8 ` ]& V. X& Z$ [arrtbox.sort();
: ~, R/ d3 @" W7 a: @) K8 K
/ u# w- o; M2 B2 k$ ^6 C& i gfbox.length = 0;3 G$ S4 r) D* P- V3 L% z0 v
tbox.length = 0;! t1 [. P3 _5 k I0 m+ \
var c;5 V/ Z0 `8 W# u- g( q) G
for(c = 0; c < arrfbox.length; c++) {+ \& |$ S# ^) G
var no = new option(); k% G- t3 B- p( Y. ^1 {) ^
no.value = arrlookup[arrfbox[c]]; \; b" E* S- J+ l( D
no.text = arrfbox[c];
, w/ K; Z, I4 q, Zfbox[c] = no;2 _" m( z, V& _+ J! z
}
" n. _0 `, S. P8 U( hfor(c = 0; c < arrtbox.length; c++) {! \2 l- A+ {4 d0 r( h1 p& G, t
var no = new option();: u, r0 `& j' m6 z2 t
no.value = arrlookup[arrtbox[c]];
# t Y& f; D2 [/ Zno.text = arrtbox[c];
7 N, o5 G# r' `4 U% N- V5 Stbox[c] = no;
/ P6 } e( O4 a% ^) }0 o* [ }
0 m8 W- w- [' _/ Z) m5 w0 f}
; s' w1 W* }: z</script>
' @! B, ^# }: x2 K' y</body>
8 y5 ]$ P! z0 A/ r5 R, ]* w |
|