  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14221
- 金币
- 2401
- 威望
- 1647
- 贡献
- 1349
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
# Q! P' b8 ?1 U! ]1 ~ c pageencoding="gb2312"
* N" L2 h" {0 e" d9 x s9 M%>% k: Z1 W* z) o n
<style>, w3 U5 _: E& x6 S, O3 n
.f9{ font-size:9pt; }
8 M8 y2 Q! d* \# \1 A- E" a.bgc{ background-color:#aecaf9; color: #0033ff }1 j0 D/ Y+ S& p
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
( t2 L0 u* {/ C* i6 A border-bottom: solid 1px #4e7dc1;
( j) F' p! [; H6 i+ C1 X border-left: solid 1px #aecaf9;
! h& \) e) n0 r" M border-right: solid 1px #5679bd;
A: k$ R8 a6 g4 t padding:1px;; K7 ^0 H) h) \" [* x P3 X
margin:0px;}
+ w) S& n! `, T( k' L4 u</style>
- d! h5 _. F1 q6 r<script language="javascript">
- f% R- U8 f+ H5 p7 R<!--3 q( _( _; D a: v
function rv()
9 F5 O) ?7 \$ M- V5 v{
, w, B+ d% T- \+ Z- j' B6 i9 f var val="";
& b; W( ~3 c7 }2 x7 V3 Z for(i=0;i<combo_box.list2.length;i++){) g% j% Q) |2 a+ I; M% O' E
val+=","+combo_box.list2.value;. L: L5 n, z+ D# J2 ~5 N
}
7 j# b6 `# v. \4 p' p9 Q( T: |+ ? if(val.charat(0)==","){
4 w. C0 U! J8 Q F% v; { val=val.substr(1,val.length);$ X, t/ L4 P: i" |& A+ ~* z
}8 g8 E& o3 r' u- l8 b3 c) U% ^- t( G
opener.form1.frecname.value=val;
' e. a$ n) o: P3 t% J! B+ P self.close();# g; W" m% |& Z
}
) p0 n( `3 z/ W7 n5 Z( ~//-->) m! X/ T7 }& C1 D: l! ]
</script>
! o0 O! k4 K3 U<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
0 q1 W1 p) ^* F- h<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
' [% B: [$ i1 @9 k* L V3 g0 q o<%5 s$ r/ t. s: G7 s4 ~3 h7 I4 Z
cdatasource ds=new cdatasource(); //数据联结bean实例
0 W5 [: \: {3 @% Z& G java.sql.connection conn=ds.getconnection();* j& g. J5 f# R/ W9 q
java.sql.statement stmt=null;
3 L# F& R& q* I) [- v. B java.sql.resultset rs=null;
: ?4 Q0 `9 ?: g; x6 a* L cdatacheck dc=new cdatacheck();' [$ j5 G, T0 I9 J* a [ t
%>1 ~2 P6 o+ K! ~3 V1 A1 Q+ j3 b" Y' P
<%& Z; ~& A/ i9 `8 h( l6 I% m
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";- \ E, Z/ u! ^4 x3 ?6 ^
stmt=conn.createstatement();
7 ~6 o8 U! T" ~' o" Y* yrs=stmt.executequery(sqlu);
+ C& D, G! w: p$ N/ u%>& X1 z9 l" H' k
<script language='javascript'>
1 A* m' S- P+ L/ iarr = new array();# \" [8 R- o4 t+ {! \
<% int temp=0;
+ `; m5 u# s- q1 ~while(rs.next())
7 f4 C5 v% P% N& D{
, P5 ?) R! e+ b0 x- w+ r0 v3 M! A%>
% ~! @* ? K4 d& A, c# U9 I* Iarr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
( Q9 ?! r2 H" G8 `<%
/ m2 l* {' _ n5 r! Y$ btemp = temp + 1;
5 ?$ |9 u9 i# }& K}# q$ E$ K z7 `. O5 t. _& |& I
%>
- x- z$ @# e1 Q* R( Ttemp=<%=temp%>;" G8 b3 z" X5 g& y
function changelocation(id){
% Z n* m+ _9 _, R: Z! `5 |/ Tdocument.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
' ^# h ?# O L; k2 Tvar i = 0; 5 `% H6 x# B y# ]) Y
document.combo_box.city.options[0]=new option('-------','');
& R$ |9 G, S! l4 Yfor(i=0;i<temp;i++){
8 Q$ p5 C# e% G0 i5 j- pif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] , Y, j$ _3 {% s& B
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
4 e7 e0 z' ^4 h4 i% k! p: s} , x( S O0 Z, M1 W9 r
} ; ~, j$ N% t" n4 K& U/ q
} ( E0 M( C- J. `* y; @7 b
</script>; L/ G1 V, V& v5 B* g |. T
, V' x6 b+ }0 @8 q
<form name="combo_box">
9 y p* @" l5 K/ G' K X/ i<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
9 n9 Q7 y( m6 h, P <tr height="24">: ^/ l% r, U8 p- C; O3 E8 ` g" \
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
8 _$ b! y4 @6 P& Y/ Z. `) O <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td># `: N, o7 L* B9 x4 G# p& s
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>$ `5 |4 @* ~$ {9 w' H4 y
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
0 w2 n8 G e* D' u7 Q </tr>
$ R' ~ V: Q" s% s' b <tr> 0 L7 l/ W R! f* @
<td>! i& z# Z; F& y3 ^0 v( l
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">+ ]$ H$ D$ q/ K" @( J5 X. e2 Y
<option value="0">请选择部门 ---></option>
6 g$ s3 C3 r: l Z$ N4 S; b: X2 {! S; h<%
5 C4 l4 {& R2 p- S string sqld="select * from tdept";4 z' X9 ]* Y( U9 L2 d# l/ N; {
stmt=conn.createstatement();
+ g) ]7 p9 u% p. E3 Y$ y8 D8 u$ W7 Irs=stmt.executequery(sqld);) D# }' q1 ?# u" z$ ~! p
while(rs.next())
# e2 G8 [2 t+ Z{: j- p( q$ K* N9 ?& @
%>5 s- s, r% j7 V- O1 t' ]
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
$ o7 r) A6 Q, N' T7 r% ?. V( Y<%7 y0 t; X6 a& e# ?1 g, a$ |
}. Z5 M1 N ]( X: o9 J* k% z
%>
! V7 d$ z: l- ]/ n/ C3 F' p </select>
) n I4 I5 @( o3 I7 _, I</td>3 v0 U f0 {; Q
<td>4 l: ^+ U4 v9 W
<select multiple id=city style="width:150;height:200" class="bgc">+ D7 b7 s h1 r# w% J
</select> A0 Z) \' \# R! W
</td>
6 ], O% F+ E- P; X <td nowrap align="center" class="bgc">, m3 d: k7 \$ N3 c$ s3 Q0 M
<input type="button" value="<<" class="buttons">
/ U) v( s# C- j, j/ Z: q) d, [ <input type="button" value=">>" class="buttons">
% O# _4 j# d, J. u</td>
! h6 B( H7 u5 R2 J2 v0 c! A, {1 R <td>
7 }" Q D9 ]4 Q- ^ <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">5 w1 L& A1 j5 ?& g2 c
</select>& S6 {% S: f- B) {+ @
</td>
+ Q% }- U7 @6 P8 G& }: ]+ }8 ] </tr>& |8 q, Z v+ S
<tr class="bgc">
, S& Z/ s: W- M7 n5 M) \( A <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>. o, ] M ]- l. w0 ^
</tr>
0 F T; L( \3 c U% }% x1 F</table>
. s6 h( G& q/ N# l5 j$ @</form>
' G; A6 h8 a0 N* v! \. ~" f0 Q<script language="javascript">" H- D# [4 F' E/ D8 n/ r
//人名移动
/ F& H7 M' X* n8 ?/ I+ Xfunction move(fbox, tbox) {
: |- [) \8 B: L) ~: Rvar arrfbox = new array();
4 q* }9 o b0 l. K- F9 @* ]" X4 ~var arrtbox = new array();
! ~! \/ C+ }+ n# {* P' Y( T, xvar arrlookup = new array();
) C' E( T \, Kvar i;
: F- A C, k" E. y! w/ Ffor (i = 0; i < tbox.options.length; i++) {: A; f+ G$ s( K' p t9 A
arrlookup[tbox.options.text] = tbox.options.value;
' L- o# C- l, W+ d2 n! P4 X; Narrtbox = tbox.options.text;
9 z$ F+ k* L6 S/ ]) d}
0 K7 ]& J/ {, J. G4 ?/ }- }var flength = 0;) `( |3 z1 ?) ?
var tlength = arrtbox.length;
7 t6 m* f! }$ v# r8 {for(i = 0; i < fbox.options.length; i++) {
0 r. M* Q2 Y0 r5 l; b6 e" Yarrlookup[fbox.options.text] = fbox.options.value;
1 L# z$ N4 o3 v( Q* m5 Dif (fbox.options.selected && fbox.options.value != "") {) n, G9 S& M+ k, h$ K# C
arrtbox[tlength] = fbox.options.text;
/ h2 T6 b O$ X* I& utlength++;& e3 Q) f- y# ?6 U9 {
}" ]4 Q( r8 W1 n" n7 T' L! C3 E5 h
else {/ S! i; m( u/ d- A
arrfbox[flength] = fbox.options.text;
* ^! r2 c1 w& \% U5 r K3 Vflength++;
3 a! f6 { U2 t3 `0 W9 `) N3 n5 H9 @ }, q, k: ?9 y7 I! I# \
}
j2 s! i9 x7 ^5 Y4 N% aarrfbox.sort();
( Z: H0 N, `8 o; [' Z/ Larrtbox.sort();( O8 G+ D* K' k
! R- C$ f3 X( Tfbox.length = 0;
8 z! G2 s" N b8 ?# b% l" i4 }tbox.length = 0;
7 |9 v, ^% `5 \ K* R: o0 Q, [+ Dvar c;: W$ m$ X2 {; ~6 M6 y& t! F# `
for(c = 0; c < arrfbox.length; c++) {1 Q6 d( T- v4 n( W* |
var no = new option();' n1 c0 ^. M0 L
no.value = arrlookup[arrfbox[c]];
2 J' X p& H' p3 xno.text = arrfbox[c];7 U) ^ s0 Y) n- ^$ q3 O( m
fbox[c] = no;
' o- @" Q" H: x7 q}
% H0 F( q, N5 o; e5 Ufor(c = 0; c < arrtbox.length; c++) {8 E# V0 \, }. N9 M9 n3 ]
var no = new option();
2 ]( o6 i2 E7 [6 X, L5 Y% Vno.value = arrlookup[arrtbox[c]];
& ~& F. S: T/ F6 tno.text = arrtbox[c];% u! A# Y/ b( _) h# j; J. @! ] M
tbox[c] = no;
1 L/ d, ]* V5 N3 Q }
/ F7 v) E+ j! P7 H7 Y! i! Z: s, a% v}
" ^; w0 {( z" F1 Y6 z ?</script>1 ^+ @6 h7 r9 X0 z J$ D4 `
</body>
W( r e% U3 C0 ^) f6 X |
|