|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14389
- 金币
- 2480
- 威望
- 1647
- 贡献
- 1428
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
. E5 l( M1 j! l3 t c pageencoding="gb2312") B, B% F' S: A% F* X
%>( R5 ^- B6 O- B `# h$ @8 i5 [
<style>* Z: j9 y; ?( l% j
.f9{ font-size:9pt; }
2 I+ y) \ ]8 y3 R% P' ^.bgc{ background-color:#aecaf9; color: #0033ff }
7 p' q+ C$ S2 L' Z/ j: s.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
* ]3 R7 S% c. M% q border-bottom: solid 1px #4e7dc1; l# k; a* X N) ], a4 F. s
border-left: solid 1px #aecaf9;
8 a5 D/ b/ k# | border-right: solid 1px #5679bd;
/ v+ J7 b) S- {6 n: Y3 [" C padding:1px;9 b" {( I4 S- `, o
margin:0px;}" O: t, a7 w2 z6 G2 e9 ]
</style>9 \; c/ B) s' `0 i( p8 |
<script language="javascript">
n' a& E. t- Y: D<!--
( u4 d% {& E" q0 Z' Tfunction rv()
. D2 `: c% H8 P* k{
3 b, z3 K0 J. A0 w* E6 O% D, q var val="";1 e, j: `9 B0 o- [3 J
for(i=0;i<combo_box.list2.length;i++){
( ~/ m2 R( r* m f+ Y val+=","+combo_box.list2.value;; K: a5 I8 E R
}
( W' L+ R+ Q/ ^3 u9 l, l if(val.charat(0)==","){
/ W% Y& p) i/ Z9 ^* X5 [4 p a% Y val=val.substr(1,val.length);
8 z- u0 j I) }2 z3 {7 ~) k% i9 T7 l }6 E: T. G* c- i+ R& P9 x
opener.form1.frecname.value=val;6 Z+ H: j2 J# C' {6 n7 Z+ ]
self.close();5 E7 t' L$ d* O, ^6 j9 p
}- Z7 u9 q& j$ b# }8 V" n
//-->. \* q N9 s. n c$ z0 P) V: g
</script>
& P a' n9 v* ]4 I! Q0 _) x# w<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
" V2 J2 }8 |$ r! i: b<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
( x. d0 W% M$ J- S s. n<% V! d- f- o+ F. r- X0 L4 V7 z
cdatasource ds=new cdatasource(); //数据联结bean实例6 h2 h7 `0 X+ F7 g+ m0 m4 y
java.sql.connection conn=ds.getconnection();# F& l( `4 @& k" z6 C
java.sql.statement stmt=null;- l- d. ]2 _' d" N8 Q
java.sql.resultset rs=null;# ^$ ~ _2 U' `4 Q. p5 i2 L' g/ L
cdatacheck dc=new cdatacheck();# s6 d* w7 u f
%>
# d, u8 V' e. q5 N9 g7 W<%( o8 w- R$ D; h: p
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";3 e5 J8 n- ~ p( k2 J n
stmt=conn.createstatement();
2 \$ p& G6 w& b5 E! i' D: k7 Mrs=stmt.executequery(sqlu);
9 u3 D- v, ]* B6 Y%>
7 J$ M* |: {2 I2 F& h<script language='javascript'>
{" f. o4 p# ]8 P6 R4 }arr = new array();
% v. B+ Z; d' ^: G2 X<% int temp=0;
3 k, g3 [3 g2 z+ K- Ewhile(rs.next())5 F0 r0 f& c! M
{$ [! {. t' q, i2 M+ `5 ]+ s. h
%>6 y5 z" ?/ W9 ?+ ]8 p2 c( R
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");) J0 X' S. G4 Q. `- z
<%
9 m! F, n& y( {/ G! r0 G9 ltemp = temp + 1;
6 `8 @9 Y! Z Y; B% z5 @' m* j}. n; a4 H3 A+ ^( o3 w
%>: U+ `3 k. ^. E
temp=<%=temp%>; c ^3 v1 h1 e
function changelocation(id){
+ r' T$ C* Z# l( `. [document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 # g- Q% U" d" ~) I& d! D# R. Q
var i = 0; $ g% z& r8 a0 Z% I% q
document.combo_box.city.options[0]=new option('-------','');
, F: T3 x& M9 d/ Ifor(i=0;i<temp;i++){
. |3 S; F5 Y" p( v4 v) N9 |. sif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] # K7 L% z9 E5 N) j, S. U
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); 9 C0 k$ m. M7 h. n" A& G ~
} 6 W4 u& t0 w* W$ y
} # \. F$ z/ H: V7 H
} # }- G- t: L, U9 s. Q% Z. S: o
</script>
& G1 \4 x; |9 z) f. u1 H/ h+ ?) `" U6 Z) \/ p) d9 i. D$ @
<form name="combo_box">- m6 C% p% ?, ]
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
1 c* l& t% z: v2 p <tr height="24">0 d" H4 w+ W7 s* d6 p) }3 q+ ^
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
' d) R$ h j! R <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>+ `$ l) @8 [8 |5 `/ q9 G
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>9 I/ ]) x0 d6 N$ L+ Z
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>8 n, Q ] a( M7 W$ {
</tr>/ _% J: Y+ h3 [9 i `
<tr> ; k% s* W4 _) j& w2 `# m# ^' Y
<td>
! L8 ]; `/ s! @3 z& E8 {/ |& p$ P8 t <select multiple id=prov name="prov" style="width:150;height:200" class="bgc"># R: m4 o0 B' l6 I; j: {
<option value="0">请选择部门 ---></option>
; g( t# n) n8 c( @( f5 v9 ]& G<%. Q. U0 ], ^8 h
string sqld="select * from tdept";8 f" q6 y9 g, O
stmt=conn.createstatement();
* Y5 a- `( D* M5 U$ Urs=stmt.executequery(sqld);; E5 y; q+ g6 m3 }5 X! ~ _
while(rs.next())
, ^7 g w5 j: H{
$ U2 Z# ^* ~% g; l4 @+ j%>
7 p' n- O5 f, i <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
6 d( r8 l) b6 p/ A* b<%
& ^+ X w1 e- \! J}
2 v8 C1 v: X. o! n%> 0 B8 v+ s& B9 P) g4 X- a4 p
</select>0 a: v+ j1 @7 {' ~, v- C% q
</td> b' d0 B/ L9 o
<td>
+ i* \: z* d& ^5 [8 d+ V <select multiple id=city style="width:150;height:200" class="bgc">0 I! A& E& Y( a5 l
</select>
' @: [& y8 S, R& }</td>2 [. a: |9 n" a' U+ M& o
<td nowrap align="center" class="bgc">
$ q5 ~: k5 r& G+ d3 n1 H <input type="button" value="<<" class="buttons">
1 g- {4 I6 l' q% C6 b7 O <input type="button" value=">>" class="buttons">8 V5 c; ^/ C2 B" Z& @
</td>. F4 o+ s" W! U' i" D, B* @
<td>- }: Z( {8 F8 |0 x
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">0 C( ]2 y3 n: n+ V G \
</select>9 v/ |# a0 \' r/ G4 T a4 k2 x
</td>
3 T+ M7 |! c! I- f7 U) i </tr>3 }5 z' m6 D- W
<tr class="bgc"> N8 s" X v( g* i" B( u; t
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>/ C/ [# X7 A7 [2 E6 f
</tr>- k, ]8 U) y x& x' C) G& r
</table>
/ Q" d" ?) i g, v</form>( K" S' h, [- M0 L0 O
<script language="javascript">
# k' a2 P6 A1 C ~: T//人名移动
% f8 T- K" o( B7 g. kfunction move(fbox, tbox) {
8 I% h! u/ d/ t- u: W$ u, Q ovar arrfbox = new array();( B0 p& w6 I8 f/ X$ w5 }, C
var arrtbox = new array();, a$ s0 U7 @# t8 D$ A9 o
var arrlookup = new array();7 d7 q- D; d) _
var i;' F6 Y* L) q1 S Z! A- z5 \
for (i = 0; i < tbox.options.length; i++) {
/ F, A: @: u) \4 v1 G0 rarrlookup[tbox.options.text] = tbox.options.value;0 v/ ]/ U. @- E# |
arrtbox = tbox.options.text;
; k6 G/ I- I7 J' j}
: l6 z# C0 k6 m; x- P/ Z# Dvar flength = 0;
. S6 G' z$ n$ o6 t* h; @* Avar tlength = arrtbox.length;. G* y7 v. d; c4 M) Z0 }
for(i = 0; i < fbox.options.length; i++) {
$ i( L& a9 w$ x4 G& F4 X- T0 g D% Garrlookup[fbox.options.text] = fbox.options.value;; K! Y- H* v0 h
if (fbox.options.selected && fbox.options.value != "") {
: Y4 e: b% `6 x. \) }! r& j2 Garrtbox[tlength] = fbox.options.text;
: @( c4 ^4 r4 ]* a Htlength++;
: n g$ E& b* ?( q+ O3 U/ b}3 d2 l! n N4 o0 v: l
else {3 ?: t6 e/ k7 N! d4 A' ^( j
arrfbox[flength] = fbox.options.text;
" ^* i: m5 M( ?( ]2 j) ]* t2 `flength++;4 }3 v. G" V+ c5 h+ ~, P7 t$ z
}$ e+ q+ h2 H7 h l T+ a6 H {, v
}
% `( U; ?9 k3 m, L1 Harrfbox.sort();
$ U( [1 _9 S& H+ i w. i1 Y2 Oarrtbox.sort();
: d/ M, C3 |2 J0 Y6 `( E7 q% o& L
: _2 f7 P8 d5 m6 n% q2 y3 Dfbox.length = 0;
/ w; M2 @+ N0 z# H& Atbox.length = 0;( V; p/ C8 R' o7 J K9 V
var c;
1 w, W1 C% R* P2 q0 K8 B W# `) }for(c = 0; c < arrfbox.length; c++) {. `! D4 w7 A* [ G2 q
var no = new option();
) ~1 S( S" r1 }! D9 @6 ^' {no.value = arrlookup[arrfbox[c]];
5 `/ r G% I1 E$ J) rno.text = arrfbox[c];9 _; s' C+ p. X5 s
fbox[c] = no;
. b# a) w0 H; D+ h: R$ N' T- u}
& t P I% B: B4 i+ I: K, Q- Efor(c = 0; c < arrtbox.length; c++) {, e# M% a# ?9 H
var no = new option();; v1 F; _# X/ L: q
no.value = arrlookup[arrtbox[c]];
& {# A( L% T$ X6 s4 ^no.text = arrtbox[c];7 V/ P6 c: u2 n7 I
tbox[c] = no;& Z) i% ]8 d7 n/ u" Y
}' }$ c8 U: ]9 Z+ Z0 \& q
}0 V% Q% z! A4 ~' S G" _# d
</script>
8 o0 U( V! f6 X C& |: ~" P1 T7 Q# J</body>8 _) j1 u3 q/ ^7 [, Q; f4 ?
|
|