|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14389
- 金币
- 2480
- 威望
- 1647
- 贡献
- 1428
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
6 x; |; [7 O+ @3 m1 I c pageencoding="gb2312"
8 k* c2 g1 v! Y* j! y%>4 [9 h: ]9 U* t. m$ s! D
<style>
1 l3 T$ k+ x4 ]/ N.f9{ font-size:9pt; }& X _% U* Z6 y
.bgc{ background-color:#aecaf9; color: #0033ff } ^+ L( @5 \. k' E5 k) C' k8 x) O
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
3 ]7 T& _6 A9 ]! c0 {* ~ border-bottom: solid 1px #4e7dc1;
' m; Q" z b+ p' L) g% a9 y border-left: solid 1px #aecaf9;
$ b7 {/ c! I1 q5 U border-right: solid 1px #5679bd;
$ W3 w, n+ [1 [5 N3 l9 P padding:1px;0 r3 _2 C1 `2 E7 ~7 c' A7 Y
margin:0px;}. }0 j/ ?, l# P7 A( f0 P! v3 C5 `
</style>( G+ n3 E0 a+ s8 ?( ~7 n
<script language="javascript">
! r, g( d3 C2 p! J. t5 e<!--7 i2 \- E7 Y- ~, R
function rv()
0 L5 N. P& G+ F0 z. {( n{
& C+ l2 T7 A$ t& {+ S2 a* } var val="";1 T& E- ~0 _( T) L# ]- y
for(i=0;i<combo_box.list2.length;i++){
3 p$ M" P* V. h+ Z val+=","+combo_box.list2.value;
3 h! e# U) M+ g" c! I3 i* T }
1 H! Y3 I; s d3 B: O/ h# u5 Y if(val.charat(0)==","){
! C2 @2 Z. C) n val=val.substr(1,val.length);
* a( ^0 t+ B! H( V }4 J( T( P s3 U+ E4 h+ e) x
opener.form1.frecname.value=val;+ {2 H) N& d4 y- v' m
self.close();
/ o B3 [; P4 Z! G$ [% N3 g; c}
3 D1 P2 J- W) \/ k1 b. T+ w: r, t//-->) m0 P7 ~% n9 _( T% y8 {
</script>/ Y1 |+ f$ @' _+ ^
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
h% }! X) s+ s( t+ A( W# j<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />2 w3 p: | `& \1 _
<%2 m( \9 U. k; @' Y
cdatasource ds=new cdatasource(); //数据联结bean实例9 J. Z: [& S' H) ]
java.sql.connection conn=ds.getconnection();3 P9 {# t2 c3 c+ s- K
java.sql.statement stmt=null;
: ^5 @2 J2 h% v java.sql.resultset rs=null;
8 ?$ t( l; Y) C3 _5 n8 J: L; y cdatacheck dc=new cdatacheck();* k) S2 c0 l2 }5 P. t
%>
5 {6 d' M0 i; @<%
; \% v' C8 F/ Q% Lstring 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";
: i! _* C* \, `. x2 l1 Cstmt=conn.createstatement();( g8 Z* E7 ]0 ^2 d: e" d
rs=stmt.executequery(sqlu);
6 F+ t O7 S) d4 S; F%>
4 o, u+ X4 l7 O8 N<script language='javascript'>) \' B$ l s+ s
arr = new array();6 b# X% A3 k. |' K, x
<% int temp=0;% }4 \* q$ C8 u8 G3 O, c
while(rs.next())
) _) r, L( ~ _ G4 r3 b' T{
3 Z0 o# o2 `" \( q' V+ r%>
& o6 j2 e% R4 parr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");/ |- ]& g7 }7 t& w! O) T# a% Q
<%7 r1 n9 T; Z' I, m& Y
temp = temp + 1;
: S0 b. Q$ B3 I. O. i/ n2 p3 M+ Z}
& F+ f+ g: I; t/ G0 a%>$ |9 ^2 B6 E1 m$ @
temp=<%=temp%>;
: {" U$ X8 j3 L# a) F g1 {function changelocation(id){
5 u9 x, h X7 U: rdocument.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 ; Z; @( J; a# W6 ^7 F7 h
var i = 0; - ~& G8 n# e8 J2 V
document.combo_box.city.options[0]=new option('-------','');
2 T) u, P# @* @6 o" ^$ g$ ^for(i=0;i<temp;i++){
$ n: R& Y2 t4 r" H0 hif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] 2 i: W: o4 U, L+ e6 x
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); - W4 Z. |+ G' `6 E0 @
} * j' ^/ M( q& t( P L7 Z5 S5 X0 N
}
0 A+ G' ^: }+ Y+ s0 L" X5 X8 x} 6 D0 V. n6 e7 Q2 c2 V# L
</script>
: T: @$ h" B* X' U {! v' M: J* {1 `8 k4 }4 C& b9 y3 G2 c& m
<form name="combo_box">
( ~, ^ M. p! s7 T; E3 ~<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
( K7 L/ R$ k" y6 l <tr height="24">5 Z2 _1 h" ?6 i% X
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
8 a8 }1 l) }$ o' o2 T0 } <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
& y+ C/ J2 u: }/ b1 c: c7 [ <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>- a5 {. t. [% ~$ v- J' ? u$ O% m, f& a
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>" v( ~( q3 x) |& t( l) J/ O% L1 E
</tr>/ J) E# a& C5 v7 Q* L7 K$ t- P( i
<tr>
( P: t- P- y+ I. A3 o+ @' o <td>4 I( x, W4 {9 D A" q) L
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
' ^$ b7 [0 J! Z; g6 d Z <option value="0">请选择部门 ---></option>
$ e( M% M. w6 b; X9 E<%3 H! g4 n( u! p
string sqld="select * from tdept";0 m6 i" {7 o5 h3 B
stmt=conn.createstatement();
; {1 U+ K- s, i7 T. Hrs=stmt.executequery(sqld);
2 { v, Y' `5 r* O' `while(rs.next())
5 p! _& O/ B0 z: F# z3 Q5 r/ t{1 z0 W/ c* V/ t, \. [1 u& h/ Q
%>
# |1 U/ m+ L: M, P5 N6 |" z( a <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>4 i& m: Q0 I% i- y% c5 ?
<%
, v) P/ v8 e! C}
3 B& O$ P) H6 q) w' J3 U1 V) ]- B, K%> 6 r! t- l/ o4 h1 H( `' j
</select>1 x# ?0 v- `, Z+ I4 @5 ?
</td>$ \( n7 e2 R% G& L
<td>+ s4 o$ b5 X% s5 i" p/ d' [7 o
<select multiple id=city style="width:150;height:200" class="bgc">& m9 o8 L1 ?* S4 A% F9 V5 k
</select>* p& ^7 E% I0 Z% z/ k
</td>
9 e O- H2 h& t- ?, K2 L0 Y- g6 [9 T <td nowrap align="center" class="bgc">
, p; O4 |, A2 W, | u; ` <input type="button" value="<<" class="buttons">4 L3 Q5 \" S- M T, t+ X
<input type="button" value=">>" class="buttons">* M2 h' w2 Z5 |( y9 o
</td>" n' B7 r6 _9 C
<td>
7 v( h5 [" |' Q <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
3 `9 M: v5 q0 f7 w# b+ m8 _ </select>
* P$ N- o8 p& |3 c6 F2 J" m. O</td>5 l0 @ S5 v, N9 Q8 \0 W5 a9 [7 N
</tr>
4 V3 j! Y3 Z1 O+ C <tr class="bgc"> 3 b& }* H u* L6 b0 y
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>0 D8 S8 y% o& O: G: m
</tr>
& e6 y& Q+ t2 f5 `/ n</table>& f; g+ W9 M# g# n- j2 R \
</form>
2 t: t0 O1 B4 S) P& k<script language="javascript">
" ^7 e5 X) I$ z# i//人名移动
1 j7 O0 h$ Y1 i2 F1 Bfunction move(fbox, tbox) {
: }0 \7 ?3 q/ Avar arrfbox = new array();7 ~& A6 |+ h+ T
var arrtbox = new array();' h6 u" w( p" L# i8 A F4 d
var arrlookup = new array();
+ F* U$ B4 N% Dvar i;
) Q+ j2 @ s& r" F6 R% ofor (i = 0; i < tbox.options.length; i++) {/ \/ {+ v$ H/ S7 o: Q% T
arrlookup[tbox.options.text] = tbox.options.value;
( Z" p# `( g$ {2 Marrtbox = tbox.options.text;
# c$ r; l/ Y0 y}4 d" w" b) P X8 K( u
var flength = 0;
$ Y* t0 ?2 O$ k0 t- K. pvar tlength = arrtbox.length;' B& C" h- H. F, b" e
for(i = 0; i < fbox.options.length; i++) {
! |# h9 B$ Z1 B6 ?$ M+ P5 |arrlookup[fbox.options.text] = fbox.options.value;
4 V; c) Q G, B) C8 n7 Vif (fbox.options.selected && fbox.options.value != "") {1 W5 [ l# f. J
arrtbox[tlength] = fbox.options.text;
' q5 ]/ M: Z1 A1 Qtlength++;
/ w6 B/ ]4 l7 w/ n, ^0 q6 o}
: k& B% n# w( r2 [3 selse {# i6 j( y7 p, H7 R0 z$ c( ~
arrfbox[flength] = fbox.options.text;
% U! U Q6 t7 E5 gflength++;5 S" j- ?7 P$ y8 s9 c8 Q
}
- L& B+ Y8 k" k/ ?/ a( j6 _" @! R* {}
) f6 t% F" p8 u/ Farrfbox.sort();
+ b' k' F% p6 y' [3 D& u8 x5 jarrtbox.sort();
O" {+ p, e; J
+ G3 \. R' e1 q0 \/ q4 yfbox.length = 0;
+ k+ B. a+ N( n& L" }' }4 E+ ~tbox.length = 0;2 X" n4 u2 L. H4 I: ~, N
var c;
$ x" I# Y! m$ Z; T# tfor(c = 0; c < arrfbox.length; c++) {, k* x- T: Z7 `" ?; S3 K
var no = new option();/ D: H5 D$ \% S! }8 {% }8 e% V
no.value = arrlookup[arrfbox[c]];
6 f. m& S* |* P- {no.text = arrfbox[c];! C$ T& k2 z3 z% P" j' D9 v
fbox[c] = no;/ [# z) N; q( P( z8 g
}
, n5 Z( y: B* afor(c = 0; c < arrtbox.length; c++) {$ q' b* `6 {+ x, G
var no = new option();5 N2 S' }" l7 |/ E/ T. ^' _: j0 ~ I
no.value = arrlookup[arrtbox[c]];6 B2 }* k6 J1 R ~9 N( Y
no.text = arrtbox[c];
0 o* f! W$ {; a2 g; B% T$ F# etbox[c] = no;- J+ f: S* Y! x! f' c9 ^. t
}
5 ^3 p% `) X4 |% x, z}. z+ t$ D, _6 O2 G
</script>. I# {7 ]" N" q, m2 W) n3 v
</body>- @( C2 Z6 _6 X; G$ u
|
|