  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14195
- 金币
- 2388
- 威望
- 1647
- 贡献
- 1336
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"2 |% R7 x( V: H& D# w3 W; k) i7 l
c pageencoding="gb2312"
4 _: [. b& y7 s. T%>3 o2 g1 S% x7 H1 a& p
<style>
+ l( D3 l7 ]9 A* J.f9{ font-size:9pt; } f0 ^; K, Q; `7 D
.bgc{ background-color:#aecaf9; color: #0033ff }. |# t+ w6 J R7 e: J* v
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;: M; `% ?( h. m$ F# N3 m
border-bottom: solid 1px #4e7dc1;8 x/ v/ p2 M8 I0 g9 ^
border-left: solid 1px #aecaf9;
. N3 `! R& O2 r' j% c7 y border-right: solid 1px #5679bd;
0 D) q! e, x0 V padding:1px;
* `; `' A9 E3 G: u margin:0px;}( d& z- K" Y# [ g
</style>
6 i7 K( \( W) R$ Y1 a/ ~<script language="javascript">
* t M" _6 }7 n# m<!--$ K2 D. g7 I* h" l
function rv()
; c2 J, i4 i# [{' M- r. S/ Y7 c( W! U2 M/ s% {* A
var val="";
, J' p( p, \7 y+ r8 D for(i=0;i<combo_box.list2.length;i++){ n8 h6 b* S% o# I
val+=","+combo_box.list2.value;
5 A! H* N( r! K" M }' O. C- N) k) p
if(val.charat(0)==","){
' _; Y9 f4 e L! q3 |; [ val=val.substr(1,val.length);
; z% ]3 a5 [/ E% x( R }
6 ~9 f5 N8 z! c2 v+ _# U1 E opener.form1.frecname.value=val;# M& j- q. q3 R, y4 Q9 f4 Y- K! a
self.close();
8 r9 M9 Z1 d' c* i( W* k}7 N1 O5 p7 e1 Y# r9 {: k
//-->6 K" Q% R3 [7 P) m3 n
</script>
6 x; q, z4 E2 u9 y5 S( ^1 G5 J<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">% Q3 C2 ]: k9 i' b5 j3 q$ y
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
8 b: v3 {/ @. g- y3 R8 I<%
5 V' o" Q$ T, K+ N4 k& s cdatasource ds=new cdatasource(); //数据联结bean实例0 R& [; n, {% T* y- o$ z* I/ t
java.sql.connection conn=ds.getconnection();* |# y/ N. j" C/ `
java.sql.statement stmt=null;
( m" g2 A" k# F7 t. H java.sql.resultset rs=null;0 c+ \: F7 t9 k. [( F4 a
cdatacheck dc=new cdatacheck();* `* y- R: Q. H' e4 K s& a. |
%>
, z3 O2 v5 R( p( w6 e<%7 o1 B- Z. q& u% j- r8 E3 s
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";
; B0 m, v: F( ^+ G- N1 j; hstmt=conn.createstatement();8 {: N: u4 G' j) u$ b5 W* O
rs=stmt.executequery(sqlu);) f2 Z& J& d1 Y
%>
$ W" e9 u, ?2 W: C- S<script language='javascript'>
4 h. U; U9 v1 ^) D4 u3 q( larr = new array();5 L# x+ `. t7 q; T0 Q4 N, [4 g4 F
<% int temp=0;- f3 [! S0 d: R- U* Y
while(rs.next())& U/ M+ J; @: ]. D4 C+ W2 P
{
- I7 R* V4 c4 D( r3 r0 n5 _%>
" a5 z3 g) g# O: O% a! warr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");+ Z) Z* O2 X8 [- g& N4 \
<%
+ W F8 |1 X x4 N- e: c. ptemp = temp + 1;) P- p3 N9 K2 N( g% v' ]& F2 l
}5 M0 V8 @: G8 I* H; ? b
%>
+ t. I& E& `; v& _6 W7 Ttemp=<%=temp%>;7 a6 p. p2 J" p% F& C/ @, Z1 y
function changelocation(id){ ) Y7 | U- }+ e! _( m
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 4 {! G* F5 }( H
var i = 0;
0 e$ Z3 _0 M2 k% `document.combo_box.city.options[0]=new option('-------',''); " o7 i* c9 |+ V1 ]5 k
for(i=0;i<temp;i++){
3 z" g* U, _9 V: o" ]4 {* cif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
* W$ U2 i' a8 u5 |4 [( Bdocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
! S; y9 r3 S; S% [7 n3 y, l$ t} 3 b, ^. m5 {1 X% k+ B: m
} 5 \5 ~! H7 }1 s7 K3 S$ e1 i( L* y
} ; y5 n7 g& V4 E8 @
</script>" Z# ^; u! J: B( a! ~8 @
$ r8 C9 b9 _# I5 }! C: R<form name="combo_box">
& x: G( ^2 F9 g7 I& Y* ^, y1 ]<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">" t( c6 I$ k8 k4 E0 b1 J. ^/ X
<tr height="24">- K+ W$ I+ P, U! R# P
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
' [* I: P% b: ?4 X& K* v <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>0 L! x: l8 T; Y6 B, M) i
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
: A4 X* W) H7 @0 H# |% ?/ Q <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>/ D7 C" F! U% ]; E( s
</tr>: q! `) @( h, `2 w
<tr>
3 }! {& {, M) h& G' l2 |/ A <td> O* f" N' ]" p, V
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
. y% J9 p1 N7 I3 | <option value="0">请选择部门 ---></option>
7 P3 P' [9 W1 j4 {$ T<%
) P- X1 A. ?6 x2 } string sqld="select * from tdept";
7 v4 z5 V2 ~* I- hstmt=conn.createstatement(); y! c$ O& F+ ]% y
rs=stmt.executequery(sqld);
8 Q1 m' C9 c) ?/ c9 Qwhile(rs.next())
R& @6 Y& U- b# R( b$ |. f{4 W. S/ s8 y$ @3 H& t
%>: U+ R9 B6 [& F. C; H$ h; I
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>" L% ]* H0 v$ E5 y6 P9 p. q
<%
8 r, e t t( ?6 Z}
R. r+ l+ a6 g1 v* x%> $ @0 \! U/ R: a% W7 p6 ~
</select>
. W5 K2 I6 z6 r</td>
1 u1 [2 n+ |4 _, R, d <td>+ f7 _+ s- n* `; \! ?
<select multiple id=city style="width:150;height:200" class="bgc">
. v2 D$ w( d- M3 M% C </select>) l2 S% U8 C" f% |
</td>
6 {% J# o% H! P: J <td nowrap align="center" class="bgc">/ `- }9 L+ p$ h' h/ l
<input type="button" value="<<" class="buttons">- n' C1 q7 b5 E; Z- U
<input type="button" value=">>" class="buttons">
9 v8 I2 l+ }- H$ E2 Q5 P/ f</td>
, r1 T& D. N& B" a. x <td>4 M* w" M. l) w; }2 m/ r
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">, _+ j+ j# B# b* ~0 N4 M
</select>
8 b' e8 k) m2 ^8 Z- X' G</td> b& W) V$ r) K5 j
</tr>: g( X! L( E. p; G4 n
<tr class="bgc"> : ]3 j6 D4 g: n
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>0 j( G$ T) p# l& E+ ^
</tr>& H( w% e2 S% g
</table>; s# w) D4 D" Q4 A$ a
</form>/ D$ r0 W6 y7 S* N; q6 ?1 B
<script language="javascript">
2 V5 ~+ g& [* H' H+ {6 j4 T* U' ?3 Z//人名移动$ l# z+ o& j+ e1 D- [0 X" U( d
function move(fbox, tbox) {
+ j9 I0 @7 ~; y2 d4 O- w- U! [4 qvar arrfbox = new array();
* z- O0 t9 O# O. ^9 t4 Y) o! Kvar arrtbox = new array();) Z3 ~* E4 I) O# P3 j& L
var arrlookup = new array();
. g; A r9 @, v' B- D, a( xvar i;+ y( v0 V) e3 s! f
for (i = 0; i < tbox.options.length; i++) {
`0 A, p5 Z: Karrlookup[tbox.options.text] = tbox.options.value;+ [2 v6 x0 F4 m
arrtbox = tbox.options.text;
. t$ t7 l0 u! Q; Y" i* D- A}6 ?* E9 s: L: Y) r. o2 g- ]. F
var flength = 0;5 z1 B0 V! ^' s* ^$ k+ @
var tlength = arrtbox.length;
: J- k1 h& q% B3 Z4 R; B. zfor(i = 0; i < fbox.options.length; i++) {
9 f* s3 M+ U/ Y. z! @2 v1 Barrlookup[fbox.options.text] = fbox.options.value;
2 ~, O3 a3 l. _1 k3 s, Yif (fbox.options.selected && fbox.options.value != "") {8 D, \9 U# _! ]1 O
arrtbox[tlength] = fbox.options.text;- u8 m0 g0 ]0 F
tlength++;( }6 i6 e$ D& Q& s! P. p
}
& X* u3 E1 G/ s# K4 y7 {3 ?9 v p, pelse {& ~0 N; I7 E; m3 x
arrfbox[flength] = fbox.options.text;
: ], x4 g" T" v! G) t+ dflength++;& z$ v: U; }9 Z) I; h6 O
}
) C5 D1 r3 Z4 w( W) N2 e3 H}
. E; A2 g7 T5 N- b9 S# e1 Karrfbox.sort();
) m @ P1 m- }' W! \% k2 karrtbox.sort();
: }3 y* U+ G7 @1 U% |3 Q
! S4 C% y" W+ m7 t. z2 ?) nfbox.length = 0;
9 o& @3 M5 C3 p/ i- x* mtbox.length = 0;, M K& Q# c9 B: E* N4 F, d
var c;
3 S! H2 R R ^/ I8 S& [for(c = 0; c < arrfbox.length; c++) {
& [- v+ m7 n& l3 f9 k) `var no = new option(); a' Z8 ]/ Z! ?& }& F$ ?3 ~- q
no.value = arrlookup[arrfbox[c]];- ] l1 V( p& R( g' j/ K
no.text = arrfbox[c];
. w0 @5 ~3 u+ G1 b' Afbox[c] = no;
9 g) q4 P' z d [1 [" c}; e) j. q0 G" w, l$ i1 z3 G
for(c = 0; c < arrtbox.length; c++) {
0 s0 \1 X& d, K3 X7 {var no = new option();9 Q4 w; _: N1 D5 d0 y! }; b
no.value = arrlookup[arrtbox[c]];5 h( u7 T' V! {- [- o
no.text = arrtbox[c];" j, E& G- e8 M4 U0 m
tbox[c] = no;
, `1 a \/ z( N3 z' t( a: T }9 E+ F! Q0 E6 B9 a, ]
}& N& } W$ l! H) t7 P
</script>
: D6 P) T4 u a% P5 j</body>
* T+ D7 q- q: N% b i f2 C |
|