|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14323
- 金币
- 2447
- 威望
- 1647
- 贡献
- 1395
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
7 \( L x) x5 B6 a5 N c pageencoding="gb2312"
! Q/ Z E) H. `+ U6 F9 i%>3 a4 S( b" o, \) a ~2 x }6 E& i
<style>: ]& }- H8 f W# E8 W
.f9{ font-size:9pt; }2 n7 b9 L8 H* b1 @% _, h K& v
.bgc{ background-color:#aecaf9; color: #0033ff }
0 C3 W: k' m+ k; |: T& H" G.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;6 K" a* s6 S8 l
border-bottom: solid 1px #4e7dc1;' D( x9 Y# N1 q
border-left: solid 1px #aecaf9;) M) K! s- Y4 C% \
border-right: solid 1px #5679bd;
" R+ f5 Y; ]0 n3 B+ Q padding:1px;4 h+ q8 H! N- N" W. I0 q
margin:0px;}& x- b( M% J* Q+ I
</style>% v* p/ {7 W# j4 Q
<script language="javascript">
' ^4 g7 M/ t2 r<!--! z7 Q# O) [6 B9 ?, e/ {& _
function rv()% R. B. f3 I1 l8 X
{
" W( P' V8 s* i4 e var val="";4 X4 i) a, H9 |2 Y
for(i=0;i<combo_box.list2.length;i++){* w" U7 t: [% P
val+=","+combo_box.list2.value;' C2 ?8 i" n5 Z$ O' g
}2 G0 ?1 G$ I$ v5 z
if(val.charat(0)==","){, |8 E4 I) r ]7 Y) @7 j
val=val.substr(1,val.length);
$ {: [- {, A' _, r }+ ? v3 k u& V7 R! ^$ i8 L" `
opener.form1.frecname.value=val;8 C( p9 j9 A8 i* d
self.close();
5 \% u) s. t+ @6 j+ d0 |! J5 C}& ?9 l" G, v; B1 x) I( i
//-->4 y7 e; W1 S3 @! A- \
</script>
' H8 {" l4 {+ M h! e# n4 g<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">' l Z2 b4 D1 a& F9 ?- f
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
3 H: S/ u1 b" G# W6 W; j<%) M4 u1 f1 A. H6 P* Q9 z0 U1 g7 @" o
cdatasource ds=new cdatasource(); //数据联结bean实例# X4 \* w. g/ o
java.sql.connection conn=ds.getconnection();
& `# u: m0 p0 Y: G8 V; t1 M java.sql.statement stmt=null;" A0 y3 ]4 t: ^! `2 {
java.sql.resultset rs=null;& h; v- f I4 n4 ^5 G/ r2 }
cdatacheck dc=new cdatacheck();6 y/ c6 O1 ]% T9 Q; M, B% R
%>
; v* ]1 f; R7 a @- Q<%. s. t! B! y3 Q+ j
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";* O# J8 K" h3 q) D: d& X
stmt=conn.createstatement();
1 |+ b* ]* w( K, q6 O# nrs=stmt.executequery(sqlu);: n5 Y$ u! P0 D; {" g6 ^
%>
4 J- y( S: k X, o<script language='javascript'>; s$ M% l( p9 t! [5 |5 ?- Z' s7 b' `
arr = new array();8 i7 Y8 L! s3 j5 C4 b
<% int temp=0;
, \1 V( `" N; p% F- y- Ywhile(rs.next())" x+ o8 R a% n' q6 G# q7 z4 F
{
# F5 w# o5 V4 I%>
5 \: c; V8 f' q t4 T4 varr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
, M t0 g v1 D: p' R X2 X& {2 X<%
$ E+ b k8 |) p) K4 S$ Etemp = temp + 1;( U. z# H- z; t1 g0 F* T1 b8 J; b& C
}+ \* `) M) T, H: o, W2 r
%>
1 s+ L1 H, a$ v/ Y- Rtemp=<%=temp%>;
2 v" A. w" T! K, hfunction changelocation(id){ " S7 E* C6 }$ b& K2 i: \/ c# y: G
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
8 {; y y& y6 z, B zvar i = 0;
8 M$ e n. V8 I, Ndocument.combo_box.city.options[0]=new option('-------','');
7 }% M! d! `1 j" t5 Efor(i=0;i<temp;i++){
7 p0 u q$ G$ N$ e) w5 r) cif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
) b; \9 ?; }3 rdocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); ' A$ G7 l! |7 P6 E- b" [2 p
}
- n4 H3 l$ M6 l' ~- @) A4 V} / t) }$ D4 A8 _$ v2 C
}
( K2 A. v. I X; @ p, N/ F</script>
! x0 ~0 Z0 V5 L! e4 _9 I2 j! y% A1 P
<form name="combo_box">
1 \) D7 M% T7 E" Y<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
/ C* J7 R4 s+ ?+ [# P; c3 [ <tr height="24">( B- c* {& k0 E& U
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>& w: a" s6 Q: R4 k3 a* g
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>6 [5 Y. v e4 T5 G! m% V4 B# u
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
0 ~7 I6 q8 M5 s- ^ <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>* W/ F4 o+ I4 V2 m
</tr>
; ^- \# T7 m; S <tr> , n& k* M w1 W
<td>
h! L2 L4 Y# O4 n! m7 x4 B* G <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">/ V& [% J/ v* F
<option value="0">请选择部门 ---></option>" `; f! S0 g# n5 `" W" C
<%5 o& p, z T7 `
string sqld="select * from tdept";. @! O6 {% Y: V/ \
stmt=conn.createstatement();
- U3 `& z2 H# S7 z/ g2 n- d- O& P. drs=stmt.executequery(sqld);
+ l+ C) H' \4 b+ C; C" u1 |& |+ nwhile(rs.next())
5 F, Q) x* q( j4 V: W% } P; L! G9 W, _{
3 K/ u$ |- H9 c k0 n) p7 k%>7 O& B" Q: l5 t* I9 T( H# _! H" R
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
( z" W* L7 c9 G1 j5 J3 l& ~6 S<%# U% k0 b) n- r2 ]
}4 K% A6 ~+ A0 A7 S4 a
%>
4 v6 W5 m3 s* s( _9 b: L </select>
, B! c% k$ |1 M m* w' }</td>1 k" Q0 R' I3 ^! |% d
<td>0 t# N K. |9 G' h
<select multiple id=city style="width:150;height:200" class="bgc">7 ^+ T ^- W( u) X. V: \; Y
</select>. O6 K( s: A' l+ q! ?2 }: z% L
</td>
; l- i: }0 c2 `7 H <td nowrap align="center" class="bgc">
4 L* G, r. l3 g. ]4 R) p <input type="button" value="<<" class="buttons">
/ `" S1 d* m& X# ] <input type="button" value=">>" class="buttons">
4 \$ Z! J2 R% o" Y& {1 x</td>& x; C1 e8 Q( V& {
<td>* O) |8 J3 M1 b6 d5 P! R
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
/ E2 p8 F& P6 n* w, {$ M </select>4 x3 F5 }: i8 I/ o' M. z
</td>
6 K) X7 W5 Y! o5 ?. h </tr>1 x+ ^ B/ u; {
<tr class="bgc">
: b" [7 d, h" F: N! {& s7 z <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>: z% f' F9 _+ ~' x* Z
</tr>) t" t% ^8 x+ J. o- T) n
</table>6 {4 z2 ~0 s4 U( S1 p, F3 v8 [) h1 E8 _
</form>
; M0 _0 l* v; R9 z5 n& T1 s& V<script language="javascript">
/ P/ h* k# s$ W; T//人名移动) u, Z( S8 q/ g' Q2 q' R$ X; u
function move(fbox, tbox) {0 }* [8 C) d6 z8 W9 q9 W. g
var arrfbox = new array();
/ F2 `/ |; Y3 Q. v! ]var arrtbox = new array();
6 J6 L9 M7 Z% h6 Z7 Mvar arrlookup = new array();7 C4 g, i& S$ |0 a( b
var i;
9 t( t# j) y3 V8 M) y) l" b) J( yfor (i = 0; i < tbox.options.length; i++) {, ]; a4 w! A4 K
arrlookup[tbox.options.text] = tbox.options.value;. q7 v: d* B- a2 C2 |4 L M2 D
arrtbox = tbox.options.text;3 k) e$ S0 A9 H/ o
}
1 u' N. ?2 X: M. Tvar flength = 0;
( z# e6 G1 B& cvar tlength = arrtbox.length;
* r' H# e' T- M& `for(i = 0; i < fbox.options.length; i++) {
# O5 u) X: G, R3 x6 x6 I8 q: jarrlookup[fbox.options.text] = fbox.options.value;
0 l( _: O9 `- v& T0 b2 t2 mif (fbox.options.selected && fbox.options.value != "") {/ H) d# L! R- [6 r4 n
arrtbox[tlength] = fbox.options.text;
; d6 E# q: {' J: |tlength++;- F8 P# k- \5 P, T9 Y
}
* |, ^' U, Z, N! ?0 F7 felse {% k- {" J( m+ Q7 B# b6 i3 x; `' t3 M
arrfbox[flength] = fbox.options.text;- h9 P; I0 ^. S; v5 F
flength++;
( b2 i- A' ^/ y. u* E6 U, t; | }: j3 r- ^* B8 _$ O
}
1 B! q5 c+ ^9 Z! A$ b7 `/ t* ~- z& g, g0 @arrfbox.sort();
- Q6 r5 r" @, y( x8 s: L7 L! E" f% P, ^arrtbox.sort();
+ v0 g- k8 q0 n$ w/ L
Y$ e; b7 b% W7 rfbox.length = 0;
' k( \/ d5 c% _2 vtbox.length = 0;/ t2 G: u* {# X1 U
var c;, E+ s& P9 D: o! c! C
for(c = 0; c < arrfbox.length; c++) {, F4 x& _' v, M, F
var no = new option();) N* E& I3 Z) d7 O2 e3 `9 [
no.value = arrlookup[arrfbox[c]];
/ f3 I; w6 V+ O: |9 ? V6 v- Sno.text = arrfbox[c];! U* J- a5 e& W% g4 s b
fbox[c] = no;9 j6 H1 a) u4 u" k, m% D* H& |
} |& }/ ^! o/ M
for(c = 0; c < arrtbox.length; c++) {+ N- c/ s5 A6 L5 }1 Q, z
var no = new option();
2 Z; J2 R X- \! @! N6 x1 Sno.value = arrlookup[arrtbox[c]];/ G- O t) U% Y% [8 N
no.text = arrtbox[c];- r2 H: p* n, L1 D% O3 d
tbox[c] = no;8 h% ~ l3 c# [) n# o1 B5 \
} @! i7 T; c' x2 Y5 ^' \2 z2 y2 ^
}
* p5 i% A& }; g( F. i</script>
, A2 O! k# ]; D) q# ~0 d0 k</body>
; t% b# f9 @( W U |
|