  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14171
- 金币
- 2376
- 威望
- 1647
- 贡献
- 1324
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
8 a5 x: l3 b5 X& I- k c pageencoding="gb2312"! W! _1 ` p4 w% d( c
%>
/ J: a/ N, @: K3 i<style>) K6 T* X$ m5 K' S2 e
.f9{ font-size:9pt; }
1 x3 E! R; M+ u# J* ~7 n5 K* R/ V.bgc{ background-color:#aecaf9; color: #0033ff }
2 M; o. S, @' q.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
9 _/ z, ^# m" ?, `2 v! B border-bottom: solid 1px #4e7dc1;5 @' c: R+ V6 ]" ]! l9 R
border-left: solid 1px #aecaf9;' G4 T. ^+ i, k$ l4 J5 ]+ d
border-right: solid 1px #5679bd;
, T6 @4 F5 S+ m2 [- N1 U# A8 I padding:1px;' P2 Q0 g/ F6 B9 T
margin:0px;}
- W1 V: f3 i6 g9 M+ X/ B</style>
, n& V& t# T, V9 u% ^+ X<script language="javascript">. h- m( r& M, e* D
<!--
5 _/ }6 _3 l' G8 w. jfunction rv()
* `- h% C( l4 m G{
" k1 ?" m! p3 P5 w var val="";
8 @ e; b' J& i% z for(i=0;i<combo_box.list2.length;i++){
/ g# v1 D4 e- W# N val+=","+combo_box.list2.value;
& H' M! f$ Q4 C }9 `" L& W" L9 J1 L9 {
if(val.charat(0)==","){
) z. y, |& A& v) r M( o7 r val=val.substr(1,val.length);
( Q5 e+ s, k0 Y' }, ? }. O# `7 q+ i! }& [0 H+ k
opener.form1.frecname.value=val;
7 a8 T$ e' M( Z. v# a9 o6 Q self.close();
7 r4 }% q6 R9 }) M8 f' b2 J5 B; S}
7 ~+ B# f' L( f# H/ t1 E//-->: H' J. a3 ^* ?5 R
</script>
) n( _3 I J: ?! p2 n<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
2 K j. @: i% c8 \/ Z+ E<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
/ j1 P( i# a1 b; Z8 S<% w* L. H d9 s6 v6 j# m
cdatasource ds=new cdatasource(); //数据联结bean实例( R! j# i& {% C, q7 P0 D/ ^6 B& @
java.sql.connection conn=ds.getconnection();
2 k* k! J- P! Q java.sql.statement stmt=null;
7 V! c2 ?1 Q: ]3 k2 I1 p5 m! l java.sql.resultset rs=null;
; w7 q }% y" T4 g r1 q- l cdatacheck dc=new cdatacheck();
& h" l% G- v3 P( |. f; N%>% q; W' m2 T6 G$ W
<%# g2 I6 F% z h" I/ |" [& Z; ^
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";# P3 l: ` U0 f: r" r% @- A
stmt=conn.createstatement();7 y; e6 k" H. ~9 F; k
rs=stmt.executequery(sqlu);( `" H/ h0 z# I1 v4 o3 D7 i* y
%>
' q+ A W, k$ g0 b" N<script language='javascript'>4 g" m* m/ C7 d7 j
arr = new array();
5 W" ?4 {5 m8 A' x9 n* e<% int temp=0;7 O, {3 K, n) h/ q E) U
while(rs.next())
: j/ T. L. y5 `9 R{8 x( d$ }! \: m! l2 Q* D& J
%>1 b3 j0 V3 d2 |/ i$ t
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");. w8 |/ \8 t& P
<%9 y8 W4 f' I& G; ~0 r
temp = temp + 1;5 m! }" D6 _ l0 l0 n4 D( D
}
( q# ?/ X% X# w+ S+ Y%>
* } A5 K2 |0 Y' N' G! }. utemp=<%=temp%>;
2 P+ c+ K2 B7 I9 m- }function changelocation(id){ 4 B+ P# [8 T. x
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 8 |' P! K g) f( S5 X
var i = 0;
! }5 b0 z( r# _* F4 z+ xdocument.combo_box.city.options[0]=new option('-------','');
- e5 F( I" j2 E8 R2 sfor(i=0;i<temp;i++){ 1 J, s, e5 m/ X; E
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
" W' V. e/ F, F6 F0 @document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
+ |2 v9 n2 {' F5 m3 }* W: T7 |} 6 q2 g1 W% t) f' V/ H: E4 h5 C
}
" k. y2 t5 }4 b4 O- n}
K7 S! m$ x' {</script>& \7 T# O$ ~4 r( T2 m2 s
# V% N9 R: ^6 i
<form name="combo_box">7 o, a! L! z: N# Z n
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">) ~3 y' t* d) L- P- u* a( t/ |
<tr height="24">! r, d8 V) I! Z. ]+ K* y) m8 ~& [7 m# V
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
4 B" G, Z7 K0 a E( S <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
( `! Y3 c2 {& x6 p/ J7 ] <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
* g, V+ R! a) S8 Y" r1 r0 y <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
3 ?0 `) z6 h5 O </tr>
" s) Y" b, ~5 B1 F: f7 [5 P( N" k <tr> " i* q2 F$ s+ m+ ?( M; h4 q
<td>
0 d1 j6 t' a% v8 q5 r' C' @7 d <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
5 E4 _3 O3 _" L <option value="0">请选择部门 ---></option>
+ [8 X6 X* a6 W) ?6 }( o3 r- Y5 d, \<% ^# x- W1 w7 Y
string sqld="select * from tdept";
' D5 b3 ~( ]' @5 s( f/ u, L+ T, ?stmt=conn.createstatement(); E2 B8 o5 K- P" J
rs=stmt.executequery(sqld);
6 P; Z6 \4 n! R3 {$ Dwhile(rs.next())$ ^7 a2 v5 Q( x
{# ]3 K1 u/ U! w
%>6 r- i- @- m" k7 [8 f4 a8 ^
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>' P& ]& _( \8 P. \+ M
<%
, v0 @, v1 Q1 C. s}: o* u h4 p0 S% G
%> # ^9 R+ w9 y# l/ E9 y+ n
</select>
4 M% W1 o m7 d/ q0 q</td>( {5 _7 F) G- e) D e* ~- V
<td>
7 J& P) ~4 E! D1 M' f H* F <select multiple id=city style="width:150;height:200" class="bgc">
E' S+ m, U5 D _" n5 } </select>
2 f7 o. d- [) S</td>( t! B/ p: U+ p1 E; c, p% `
<td nowrap align="center" class="bgc">0 C& F C2 u, @4 u' M( W7 l4 M- y
<input type="button" value="<<" class="buttons">) b6 Z, Y1 a/ I% Q
<input type="button" value=">>" class="buttons">
, z4 f4 T3 ?1 R& N# p</td>
2 d( e( b6 |. d4 V5 r <td>
2 p6 K7 h7 F0 m4 } <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
* r, X0 V4 C% c) Z" L </select>
* d4 w5 e' b, ]/ a# g7 c</td>
- ~+ Q7 p% t$ u* R </tr>
4 ~7 Q* C3 j# R1 _ <tr class="bgc"> 0 J& E1 g3 W4 ?5 t& d
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>
. l) d* J6 U/ x1 k# Z </tr>. w' N; ~% ]' r
</table>' X* y7 o2 \1 c8 t5 X
</form>$ J& @$ f r( ?) ^& T
<script language="javascript">. i# E$ ?& g2 L7 H5 O4 Y
//人名移动) u( X) e4 k0 w) \
function move(fbox, tbox) {
7 n' ^: p+ b2 P8 n, a9 A% s5 hvar arrfbox = new array();9 e' Z Y: l: \+ d: A
var arrtbox = new array();
# {; h& g0 `5 n* X; ~) P9 Tvar arrlookup = new array();. t$ `& E4 B: h* r5 Z. J
var i;3 K& `. g% k9 F
for (i = 0; i < tbox.options.length; i++) {
, @$ m! @) w+ Iarrlookup[tbox.options.text] = tbox.options.value;% V9 N r3 ~# A- ~
arrtbox = tbox.options.text;9 t' E2 j# z( {( M1 r% U
}9 G6 v' C0 b g8 [
var flength = 0;( V' q9 o& z! W9 W
var tlength = arrtbox.length;) s# C2 i% |. C# x8 m0 g X
for(i = 0; i < fbox.options.length; i++) {
) u/ y+ Z; ?9 Farrlookup[fbox.options.text] = fbox.options.value;
( C: X+ i8 w& b p( q. q8 x& [/ }' E, lif (fbox.options.selected && fbox.options.value != "") {
/ }$ o9 ~) r! [/ H# F) Aarrtbox[tlength] = fbox.options.text;/ k" U" N) O$ I0 Q4 B
tlength++;6 m- r1 |0 n6 E+ t
}
+ u2 }5 @ k" ?9 C2 I. gelse {
& T3 ]0 l u0 i$ i; {- j+ R6 r5 @arrfbox[flength] = fbox.options.text;
" d ~1 [ j/ [, @( gflength++;1 `$ @# i( o2 g* K2 L# R
}1 ~/ s1 {, |1 f
}1 L0 B# J Q6 Q8 }
arrfbox.sort();
7 X( Q+ y1 l* D u. b, y$ warrtbox.sort();5 @9 R4 W7 r/ t; t
^& n$ `* c6 ~fbox.length = 0;! r! ^. @! p4 y8 ? A: T$ H* H
tbox.length = 0;
0 S: f- u" h, T+ l( lvar c;
$ h! r! g6 o; U" y7 R% v. Gfor(c = 0; c < arrfbox.length; c++) { n$ z3 |7 t6 g! Z3 E0 z6 W
var no = new option();2 G' i) o/ b* X4 Q9 x" D: o% r
no.value = arrlookup[arrfbox[c]];
& k* ?- ~& e4 ^5 dno.text = arrfbox[c];& X* g0 T" B* k: Q2 |
fbox[c] = no;
5 j+ K2 g/ ?- Q8 |, M- {( z2 B! j}
- s7 r" p" F' Q% k N- {- Efor(c = 0; c < arrtbox.length; c++) {8 ^9 w: G/ l- Y6 h
var no = new option();
2 j5 o( |+ U# M' Z* vno.value = arrlookup[arrtbox[c]];, i! m# K6 J) w8 R
no.text = arrtbox[c];" R( C5 w7 l1 h
tbox[c] = no;
. O1 Y# |1 v. Z6 |% f }
) f, M4 a. q" f) I}
& M) V" s4 R7 W/ C" z+ h% d</script>$ X/ O6 M7 u0 J: A3 R
</body>3 S2 `: c) R0 X4 Z
|
|