|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14387
- 金币
- 2479
- 威望
- 1647
- 贡献
- 1427
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
. B3 ?! A1 t" M0 `& q, ]1 x( S5 m- \ c pageencoding="gb2312"0 P u6 m+ e" m( ?% b& g* D9 _
%>: ^& |( O6 e# x/ h9 h4 y% `
<style>
4 `7 M# [5 ]4 J5 {6 d.f9{ font-size:9pt; }
L/ @8 f L6 A* O6 l/ b.bgc{ background-color:#aecaf9; color: #0033ff }& o& w& q9 n( [. I
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
. l o9 _2 F) z3 b: S/ Z. ?7 i border-bottom: solid 1px #4e7dc1;
* O2 Y4 l4 ~/ @& | border-left: solid 1px #aecaf9;
& ?4 L5 k1 L# x* \: Z. g border-right: solid 1px #5679bd;
, j2 f8 f" \$ x8 I" k padding:1px;
: z/ k( i ]: f9 E w t1 ~" \$ i margin:0px;}% z8 d3 _4 b% g& d, A
</style>9 ?5 `& O8 @3 i! Y3 J
<script language="javascript">
e# l# O& q7 ?, ?2 r x; U9 X<!--* }( e- D5 O+ R8 r9 b
function rv(): N. |1 Y- G( @- r# E
{
7 L& j, j; L( C. i% l( W var val=""; o i9 G" F& P" v/ w4 c
for(i=0;i<combo_box.list2.length;i++){, T1 P( l. D+ I3 K
val+=","+combo_box.list2.value;- k- B. n& b! s i
}! c- Z9 o; l, I/ A/ M+ T1 u
if(val.charat(0)==","){8 }/ L' O$ m x, o$ U4 G4 R1 O
val=val.substr(1,val.length);
, u0 a/ { H, n# l( b) T+ H }
: j& ^, h( N7 K. v, P/ K# M* v opener.form1.frecname.value=val;0 ^7 E& I. G$ U; M6 j+ c
self.close();
+ `! ^& j3 _2 g$ a* u! A, s}
: t) T4 r2 Y* j//-->: \ w3 i+ N& m9 A) y
</script>
. u& A, b4 D# M<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">9 p" o! x$ X" V, _+ E+ h* J8 }& o
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />( T$ Z3 A/ d1 _: F) H( e
<%
8 K; u/ R. Z$ t N6 X cdatasource ds=new cdatasource(); //数据联结bean实例( R3 z( @, W) w: v; M1 n
java.sql.connection conn=ds.getconnection();" q5 f( @6 g _3 q, e
java.sql.statement stmt=null;
: f) H) l, O0 k( x: d; { java.sql.resultset rs=null;
& I: I- ~4 g+ R" y/ [ cdatacheck dc=new cdatacheck();! A' d0 |7 n$ u, b9 }
%>
* P( Q- m2 @$ s<%
- F, \* f5 x) ~+ {) a4 ^3 f6 S2 y7 Vstring 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";
2 j/ v- X& n, T/ L* Pstmt=conn.createstatement();
+ b' C9 ]3 o% o9 V2 ars=stmt.executequery(sqlu);" [9 _1 M( o7 z. D! O
%>6 ]6 x& r' m( p+ x7 i
<script language='javascript'>
: B% N: v# q7 `) Z0 v+ B( qarr = new array();% P+ h' u# a9 i; g) A- i
<% int temp=0;/ O M3 k. E$ U* g! d
while(rs.next())& _- ^/ _7 i! o8 |5 m, V% E( _
{
7 G/ {$ q7 F; l3 P4 Y) H%>$ g4 S y4 {/ R
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");' K W. A2 S; k5 i# G! z. v; r
<%
$ S/ J5 t# \& ^8 W# x7 J' y- T; I( Ftemp = temp + 1;
1 S7 B: y) M0 `" t7 B; c5 F}) p2 m. R. T! g& h
%>
# X1 `; V3 k, v( Ptemp=<%=temp%>;7 R5 b% a( Z% o$ l6 |" u6 \1 d# o
function changelocation(id){ ) o3 N n$ h+ |1 @3 V
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
* W1 l( ^. {" V, C( I: t7 avar i = 0; & L1 X, l. I& E2 c4 `0 J/ J
document.combo_box.city.options[0]=new option('-------',''); - m7 B1 V+ K9 ]. ?+ r
for(i=0;i<temp;i++){ 4 z" ^7 j! H4 o6 V7 v! n
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
) ~; I% N0 I) g& @0 P4 Gdocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
# j% t2 P! v" _ n}
8 f: w% m: I7 V) |9 i& t2 c} + W; b' t+ `$ J; O# B) m
}
7 h1 g( L6 m0 n0 t4 Z$ Y</script>
( _# m" i# e3 ^
& w+ C. L3 `6 J3 C$ M3 i# v: Q<form name="combo_box">
" C. e' z0 t: H: c3 E8 u<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
. B7 x) r: Y4 E" q <tr height="24">
. @. H2 T/ l% M+ d% [/ x8 w) w <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
7 Z8 E( J/ j4 T- J2 d# e% [ <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td># C# T/ l( ?4 o( z& O6 J0 I7 J
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
: E6 P& @0 G2 k4 r! C <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
9 W+ }6 E# I I7 U8 ^, d9 j: O </tr>
5 y. a8 n1 O5 Y+ O! K1 C5 ~/ q <tr> 1 [+ T4 b4 f3 _' y
<td>
; Y2 ?% Z& s) Z" j* h% J$ O <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">! N9 F) a4 V# p
<option value="0">请选择部门 ---></option>/ u8 Q: J8 d: J( L
<%9 a; Q: g% L, K! H, L7 y2 {8 r: i
string sqld="select * from tdept";
. q9 h2 D6 A4 B( i* L3 m) ^stmt=conn.createstatement();
$ Q: ?8 u) _/ r/ e5 [% z) Drs=stmt.executequery(sqld);# s1 T/ p h6 Y, @9 L7 k
while(rs.next())
4 V6 u" h! r& X{
3 ?7 k" G* z3 u. w0 e1 D& G1 c%>
" a. W4 H1 T( j e, h$ e <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
6 e* _2 G* Z( P& \6 }<%+ _8 Y Z. Y, e3 ? E
}
3 |/ m( D2 O# c/ W; A%> ! s2 S5 u ?% O7 X4 S: m
</select>" {! h e( s" }/ T4 k
</td>2 \; X# f- G5 p. u5 C
<td>3 H/ _; P, J& n1 X
<select multiple id=city style="width:150;height:200" class="bgc">
$ G& i! o. |, o) w& C' g& k1 D/ q# L </select>7 ]* l; T: S& U( C! ~1 U
</td>
7 C# o( \, F/ g! j0 A <td nowrap align="center" class="bgc">
2 [1 u2 B: p8 e% f <input type="button" value="<<" class="buttons">
* U9 O! d$ k% A& H2 }- e <input type="button" value=">>" class="buttons">; {8 \) D+ s/ n2 o
</td>1 [8 d' h1 w% s$ l& a: z3 x
<td>
) H2 R, c& |1 x& [! Z <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
0 p8 c1 r" P% V0 z, Z </select>
- _. c& O7 T; x" S3 i( p i</td>
" R/ f0 |' F; t* B1 |7 g$ i </tr>
$ \1 `4 \% u, J <tr class="bgc"> j# U$ n. |& ]3 J" C+ {
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>- N/ f+ L. H' x' {( m9 c0 `
</tr>
% Z0 y, l" `8 w: B& U" a2 V; h</table>
9 F( ?2 j$ L- ]* K: D* Y</form>, t8 ^7 z; Q; m8 l, p; D" {* `% r2 W
<script language="javascript">6 A) \, ^* K3 e$ k! f0 e
//人名移动( `/ U- K% f9 P$ y
function move(fbox, tbox) {* G5 [* \$ K; ^; x
var arrfbox = new array();% U" U0 ^" W/ W$ N# M* c. ]" q
var arrtbox = new array();
$ d1 I7 f/ d; H/ ?! ]# M9 _$ Bvar arrlookup = new array();
/ R4 s( e. @. {$ M9 `3 jvar i;
) O! w4 f" ~0 k5 u) ~for (i = 0; i < tbox.options.length; i++) {
6 i+ l7 \/ Q1 t8 }arrlookup[tbox.options.text] = tbox.options.value;' t# `% }) o0 l" v" c4 t
arrtbox = tbox.options.text;
! h& e4 w: X8 t}( W/ ]* ~* L# o3 d9 K
var flength = 0;
$ e2 X2 r9 _8 }8 D: cvar tlength = arrtbox.length;5 } Q% N8 C9 o4 }0 r1 s7 l/ F3 P
for(i = 0; i < fbox.options.length; i++) {
3 Y K+ G7 L( T9 f& K! L9 }) darrlookup[fbox.options.text] = fbox.options.value;; ?6 }; y4 L2 t+ X& X8 g$ c
if (fbox.options.selected && fbox.options.value != "") {! V- K0 ^! u+ @
arrtbox[tlength] = fbox.options.text;
7 R( X+ y K3 t" utlength++;
9 m+ p; Q; ?9 Y4 T4 I7 O0 v5 J}
]8 H3 M' y* y1 s$ _; L3 selse {6 q$ J( M: \. s, f
arrfbox[flength] = fbox.options.text;
- A/ A6 y& s" h1 Yflength++; J. u; b% M) j
}
4 O2 ^ f- c2 s% w# R: T% K}
9 @3 H! ?, h6 p; Oarrfbox.sort();
- m" G! J6 n/ }# R; s7 {! Marrtbox.sort();2 p) j; C% n3 V
; [. y( Q3 v! s, a0 ^; _
fbox.length = 0;' B( @# n) X7 |# ~" r
tbox.length = 0;0 X. m: p7 s/ F! H
var c;
[/ a. c' a/ _ y' p9 cfor(c = 0; c < arrfbox.length; c++) {+ R( T q+ n1 K( ^+ H
var no = new option();! U- f+ _! N" r0 i) M
no.value = arrlookup[arrfbox[c]];) M1 d& u' @. @* Y- q, E) k( |
no.text = arrfbox[c];
& ?: n+ Q7 P: k. Q5 n) `7 v) rfbox[c] = no;4 A; y+ H* n( m; e+ e9 b X5 m
}5 Q/ K) X, ^. r. s6 t
for(c = 0; c < arrtbox.length; c++) { t+ i" s, m4 ?: x" ^
var no = new option();
" G0 Y) e% ?% u& J& W# Pno.value = arrlookup[arrtbox[c]];
8 R$ p1 R" T& L |1 u3 ano.text = arrtbox[c];
" c) }8 `3 y% W( h% i* f& n! k1 atbox[c] = no;
6 L5 ]7 M. A- _* [- x }/ {+ _' t# {5 b4 D% C$ l
}# k l9 r( M# u
</script>" C- }0 I' ~' H5 {, ]
</body>
6 x3 i/ t* r/ |. y8 I2 p |
|