|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14351
- 金币
- 2461
- 威望
- 1647
- 贡献
- 1409
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
4 J4 V* {& g! q t c pageencoding="gb2312"7 l8 w8 i# H1 q" ?" z$ i9 P
%>$ Z: f! }! r! X; W$ y8 ?' v/ R. o
<style>
% h5 Y6 B! [) W' E7 C3 {/ b# m.f9{ font-size:9pt; }1 W: u R! t: n8 X
.bgc{ background-color:#aecaf9; color: #0033ff }$ Y+ j7 S( m" X g z3 v
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
% _+ l& E9 n$ V8 w& K border-bottom: solid 1px #4e7dc1;
/ S* e2 q; T/ h. W, w+ q border-left: solid 1px #aecaf9;
8 p+ W) p2 Q% ?7 S9 [' X8 |! E. a border-right: solid 1px #5679bd;
% ^$ Z- R8 E/ ]7 c# Q/ l9 g m padding:1px;; w) B. ?! |2 `
margin:0px;}8 U- u( O w, L' S( f8 Q( M: ]
</style>
! y+ e9 T, x; M1 J% w- [<script language="javascript">
, k9 y$ j4 _" c: B& l% I" U<!--
( N8 S" m6 p! h1 B! f3 t/ a1 hfunction rv()
0 S ^7 P- e' h1 z% Z6 u{7 }; B% u. u9 q6 D
var val="";
7 D5 x) g; e' X' W for(i=0;i<combo_box.list2.length;i++){* v6 Y% @ C7 Y
val+=","+combo_box.list2.value;; N9 ~; F! a( j1 n# J
}) V3 a3 \. d8 o3 Q$ o. I; O0 v
if(val.charat(0)==","){
- m& @8 c+ T) j2 C val=val.substr(1,val.length);
; {; }" M f! [6 Y }
8 ?" n3 n* r! a* {4 q/ J& [/ }8 d. I8 Z# Y opener.form1.frecname.value=val;7 T* D6 Z" E. ]. P
self.close();) E! m0 `; ^5 c
}% E3 O! {$ D2 V. O0 v9 h
//-->
6 Z# B! p) i' u1 O</script>- d/ n. M" W3 Q; S# Y
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">7 D" X3 J j; J; j- j
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
3 J# t* N! P m<%, `7 p, @ h' z. }8 n) |2 @7 Z
cdatasource ds=new cdatasource(); //数据联结bean实例& O4 F6 I& ]- Y: C9 N/ ~" e
java.sql.connection conn=ds.getconnection();
3 ~$ ~. p( }) \$ K. U! _6 X: C$ P java.sql.statement stmt=null;
P0 S& f, e, d" D$ e java.sql.resultset rs=null;9 ]. r, h: o% C& A
cdatacheck dc=new cdatacheck();
5 o5 ~- _; b$ l& j6 |8 f%>, W5 Y: }$ b) h+ h9 J# G. p {
<%
$ P+ M, X1 P7 [4 V- \6 z( l/ U9 istring 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 d7 O8 _4 Z7 ^4 F/ xstmt=conn.createstatement();! H: t Z% D; b$ n
rs=stmt.executequery(sqlu);# s$ ]- Y; r# T7 [0 v; _: m! `
%>; k, M6 i& p" k
<script language='javascript'>
' |" Q/ @% |! [$ z9 k! b7 larr = new array();
7 j5 X$ T( a- B9 x6 n<% int temp=0;* f$ a$ @, a8 ~. M
while(rs.next())
0 ]9 D6 T# k7 h! ~{: V5 h! e7 X$ H$ n2 s
%>
$ h; z$ @8 E3 ^arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
% i- s& _; r0 d6 n5 Y4 w<%
. c. x3 o4 ~* b6 e3 jtemp = temp + 1;( q/ ^2 K' d5 a* |% [- @* a/ ^
}
" w B, k0 s$ E+ \%>% H. K: P( m* m+ v8 T- f' i! X
temp=<%=temp%>;
/ q l4 [$ \6 Q6 R0 b vfunction changelocation(id){ . y2 |6 k" m/ s4 ]* [5 y
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 : T, i1 {9 p d# S
var i = 0;
2 J: r% ^7 v Edocument.combo_box.city.options[0]=new option('-------',''); }6 P3 ~. t/ J" n2 f1 ^6 C1 O
for(i=0;i<temp;i++){ " x6 q6 u( `& F# D' `4 h
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
" z* e3 t, Y/ ]8 e! B! Cdocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
# P+ X6 z3 m9 F" `7 g# G: w2 E3 Z}
9 {: i' n( r7 R2 x} # p; V$ h4 S, f) b/ W+ j1 q
}
3 u0 X z ~3 c% J( I/ f</script>
; Q2 |9 I ]+ |( T
& r; X! G$ j7 U" _<form name="combo_box">
6 B+ s ?: g- o$ F<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">' S2 ^) p1 r( f
<tr height="24"># P7 W3 n `1 k3 E
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
7 b( X! q/ K9 A: x- C <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>8 H$ v O* a {
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>' f& z" w! |3 u) _( H. J; ?
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>8 Z. m8 v4 B' G6 o4 x _ ?
</tr>
9 h3 u; F0 L7 M. D) q <tr>
. ]# n. q: _1 |( G0 o9 k <td>" v# x" y- T' r, |- m2 z
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
* @( ?# e; c1 P0 p: |2 w" E9 Y <option value="0">请选择部门 ---></option>7 D$ c9 N G0 [
<%
8 q4 e6 ^1 N1 y, |( D5 P4 o4 R string sqld="select * from tdept";% E- v! z4 c) {6 I8 }) ]% w3 E* H6 n
stmt=conn.createstatement();
6 M+ g7 w4 D$ B. srs=stmt.executequery(sqld);
+ \0 x, a2 a- \5 X! \while(rs.next())
) {3 x( T3 @' b3 p- G{0 M, H1 R7 M& G; x* P
%>$ q7 p1 E( n+ V/ T
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>( T8 [" R" `1 ]
<%5 n* n* j# @8 y, q, Q6 C
}
$ g$ x$ Y8 Q8 v& L6 c) |! \6 |%> 6 D C4 o+ [0 w. r3 q( p
</select>
: C( N8 Q: c6 N</td>% V* ]9 c! U+ E( v+ }0 m
<td>
9 y2 D' o/ E5 Y& p <select multiple id=city style="width:150;height:200" class="bgc">
% ^0 t& G3 P' ?( h2 g8 o/ w% C3 { </select>2 U. H+ h7 C+ C. L( \" C
</td>' E& b6 M7 n4 j+ |+ C% Q) a
<td nowrap align="center" class="bgc">
+ E2 R% A8 |- x, ]3 U <input type="button" value="<<" class="buttons">* _! ~% m3 w1 a0 b! l: `
<input type="button" value=">>" class="buttons">
) P& m# V" a: K# o2 T</td>6 T1 @9 I; Z( x
<td>
1 Q' C! E4 o) m3 d1 }+ w3 r <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
3 i6 ?3 N6 e7 R </select>
- U7 V+ s5 d& F$ `</td>+ A: O3 ?2 a* j( E* h0 o
</tr>7 x, }# G1 F4 J) A
<tr class="bgc">
! E0 D* ]- ? l9 ^7 l! J <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>& n+ C0 w' O5 d* [
</tr>% ^: b+ f3 s# ^
</table>9 }; c2 s8 |3 h$ t1 \
</form>( ~4 F5 @: N n: _
<script language="javascript">
! k. b b R' |% D//人名移动! L, x! z3 I6 X3 M7 s7 d+ z; p3 J5 u
function move(fbox, tbox) {
+ X3 O1 q, ]* |0 G, b, O% N( ivar arrfbox = new array();& T$ ]) n4 h$ M6 E2 n
var arrtbox = new array();
: B, @2 [$ q% @var arrlookup = new array(); m4 a8 }' q) c& B: Y: M
var i;
6 R0 |. B7 O) \5 m2 T+ F& ]1 b3 sfor (i = 0; i < tbox.options.length; i++) {
. L8 p: o& U3 Z1 _& _, i. @" f( xarrlookup[tbox.options.text] = tbox.options.value; c" y: q3 K+ p! U
arrtbox = tbox.options.text;) {( N, [ u9 U5 u5 A
}0 i- x) D3 [' M. _/ M
var flength = 0;
) ^( H( E* j& C. h/ a* [var tlength = arrtbox.length;. p w$ o: r8 |- F V
for(i = 0; i < fbox.options.length; i++) {( @& ^ O' I, v- `
arrlookup[fbox.options.text] = fbox.options.value;, x0 e5 _; |1 J# T! o7 n5 Y# n! U
if (fbox.options.selected && fbox.options.value != "") {4 T! O; K- T! e; Z+ |1 o& |7 g
arrtbox[tlength] = fbox.options.text;
4 Y3 _' X, [$ R" Z2 ^8 X. {( Xtlength++;& g" C5 H: K: ~. l
}# I) @# G; Q3 ^3 s1 o% t
else {
! i {: e; m2 `3 S: j# N# ?4 Harrfbox[flength] = fbox.options.text;
* p( @' Q% ?& x! ^$ \flength++;
3 w6 A$ r/ \5 l6 ~ }
% R( t. B W' v2 p}3 h- J5 Y/ Y/ c, B6 s* J
arrfbox.sort();
, m3 N/ F6 w6 Q ]9 _3 ~arrtbox.sort();% Y1 u1 x7 }9 _ l. x
# C. b/ }: X+ F5 S- @6 ?) q: ~
fbox.length = 0;, u. D* I6 M3 g8 h
tbox.length = 0;
d% x! _- O( l% Jvar c;/ _( t+ g1 e" h- ~* z5 [/ B7 Y
for(c = 0; c < arrfbox.length; c++) { h _& }! l2 j$ v. f k8 r+ Y: C
var no = new option();/ H P4 f: {& _4 S: i2 Z: t
no.value = arrlookup[arrfbox[c]];$ h& R" O. c: I0 v
no.text = arrfbox[c];, e( {+ L! L, s; K. B# T
fbox[c] = no; J7 `0 V0 d [$ T7 o' e7 Q
}
5 N- j7 W& N) W# Yfor(c = 0; c < arrtbox.length; c++) {3 J' I, z$ p/ j. W' K
var no = new option();6 T2 |- N- u, A
no.value = arrlookup[arrtbox[c]];
$ Y$ ? G" m8 \7 w( w% O+ Bno.text = arrtbox[c];
9 w/ c" n7 F! q( ~+ u# stbox[c] = no;. T; F& \/ D0 m& U" t; k
}
9 G4 A' g' ~# D. D/ K}% C$ F5 v; I+ F
</script>+ o1 M5 x* Q: x" ?+ L
</body>" O2 f8 a5 b4 S+ d. ^( w2 C
|
|