  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14249
- 金币
- 2415
- 威望
- 1647
- 贡献
- 1363
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;") s! E3 b- T# `, t v M$ Y
c pageencoding="gb2312"
, ]# Z, d! P( B%>( ?0 [6 @8 J% j) i# f# ], b8 {
<style>6 X i O6 J& P3 Y
.f9{ font-size:9pt; }; E$ N( i6 C( q. U8 }7 W1 {, b1 K
.bgc{ background-color:#aecaf9; color: #0033ff }
8 T8 v- z9 \( E.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;* [5 Z" @) n7 t" ^9 [. N
border-bottom: solid 1px #4e7dc1;
1 @& O" F+ C L" ?# t border-left: solid 1px #aecaf9;
9 `! ~4 f2 N* f: s% G( b2 m border-right: solid 1px #5679bd;% }+ Q a) @- z3 p1 J9 p& R6 ?
padding:1px;# `+ _$ ~& E" B- m. W1 S
margin:0px;}
% K5 p9 B+ W! [9 C* O' ?+ N% f; x</style>
: a# Z+ M" `" m9 g3 b<script language="javascript">1 H/ s6 }: z! O6 ^1 s t- R" E' S# t
<!--
! Q; w. g5 u0 K4 Zfunction rv()% \+ U" w* y- W' ^3 Z
{/ i/ o Q9 E' T9 [+ H: ~" @% r
var val="";
$ A" u' ]9 S1 {5 E8 j for(i=0;i<combo_box.list2.length;i++){
* e( Z9 D) H9 G# Z3 o val+=","+combo_box.list2.value;* H' l! H! k" y, K! d
}" f, c! x" p) n- V
if(val.charat(0)==","){. y+ F* \6 w( v1 Z; j
val=val.substr(1,val.length);
) H6 \+ k+ |0 Q J$ }& A* C }" ^6 C/ {* ]3 T5 Z4 i
opener.form1.frecname.value=val;! H* A$ h8 @8 ^( ~( L( E
self.close();
8 M* q1 F- d: u' B/ u" c4 c}; w5 ^- E9 e% ^0 M
//-->! k0 U! ~3 d* @3 O1 h* r+ h
</script>
- x, r8 R- D2 o' H) b" z! b7 f+ {! \<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
* Y; z. U5 Q/ Y% M<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
' i, {* O, ]2 p+ F" e' C0 ?+ ]<%
2 V# d. [9 c- B. {) y cdatasource ds=new cdatasource(); //数据联结bean实例$ q! j! J: _7 P# W: O8 {
java.sql.connection conn=ds.getconnection();
7 \) D) ~+ A" f1 R java.sql.statement stmt=null;, Q( }! m, G) O/ p8 M
java.sql.resultset rs=null;' x( ~/ W j0 W- u4 Q, C B
cdatacheck dc=new cdatacheck();5 p" w& J. n& m
%>
9 S, O- B/ V% Q; n; q# {/ n9 [% Y<%
3 C7 a2 T2 E- L/ V3 s& E) Wstring 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 K/ m0 X J/ {. L6 }$ Y7 ^7 rstmt=conn.createstatement();
, [% X; Q8 P1 A7 vrs=stmt.executequery(sqlu);
8 _! X: `2 q- K9 h%>4 ^0 P+ J. M2 l
<script language='javascript'>
* O2 ]! T) @7 p9 S, c$ F E( tarr = new array();- I# I& Z# ~& O3 a" R6 ]
<% int temp=0;5 s. Q. K: b! ~+ P6 O% `* z
while(rs.next())
; m' q6 L4 H; \{
& z$ m- Y) G5 j5 X: h* z%>0 c1 s3 E7 E7 l0 d3 w) ~
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
* a' N( S6 }, F1 ?& W- t( D<%% y# S% r1 N7 m3 M
temp = temp + 1;7 A3 e. v, `+ R3 {
}
T% o- F4 @, m7 R4 h6 u%>1 h# H4 d0 k" K7 ^9 c
temp=<%=temp%>;
8 x! ~* c8 w7 n+ T4 ~function changelocation(id){ o) A! c! ]: u; l- l f1 G* N
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
1 [0 h6 R' ]! F' H7 M' V; Vvar i = 0; $ u8 Y( e+ h5 _" [! `& D7 |% ~
document.combo_box.city.options[0]=new option('-------',''); " S; C. _: c! W6 C6 @& W
for(i=0;i<temp;i++){
4 s: s* p% h3 R& ?. h) O7 b2 Fif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] 6 {& F8 ~6 `( L$ R2 Z
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
( b$ S h8 j! K}
' q9 P& F4 g7 k% W0 B} / V. ~* {* `& T6 X! V Z
} ! }" E% {7 R1 s, ^7 l
</script>
# [ U& @5 {: K% N
2 j! Q1 @+ s( q6 J- R% P+ b( |) a<form name="combo_box">
% f; m( N) ^0 R4 \+ B<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
9 y' c" K' P) T* Y/ Z <tr height="24">
$ j2 G7 c; A2 P/ r6 M& `7 v <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
) o& v; ? T, P3 u$ i <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>4 r6 K( |) t. o4 U
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
( V) _; e) }9 `+ n8 z; }8 m' M. B <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
- m9 `$ }! e8 B </tr>
X- L. Q6 B$ B9 z. t" Z D2 `( L <tr> % Y4 h& ^6 \( [6 U# {# [
<td> B' l/ G `& r6 M
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">5 w% B2 Q" M6 O$ r' y, U
<option value="0">请选择部门 ---></option>" B4 i3 w. v% L) @9 z' \
<%- T! f7 x X+ y7 i4 s
string sqld="select * from tdept";
- k Z% |! h, w7 }stmt=conn.createstatement();1 P' e$ a* l a7 Z' w' A
rs=stmt.executequery(sqld);: I3 E! B/ `0 G; d, i
while(rs.next())
3 U; W/ U1 d3 [ [2 U{" z6 q6 G2 q+ J' h5 K1 G
%>
* K7 y. d: R2 ?) w5 t, `8 R n* U <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>- l# A7 i* P+ E- q2 I; X3 o" H
<%7 V! J+ P1 c. D
}
% v5 m2 J2 h, E; `) q+ F/ W0 ~9 v%>
1 N5 w. O& I, a" j+ e1 W6 T </select>
! `7 F$ ^ [4 |/ e</td>! K/ W( ]2 m- D8 ]
<td>
) ]" w# b1 J) \: Z( Y <select multiple id=city style="width:150;height:200" class="bgc">: c0 g0 j9 _9 `) K/ e) s0 S, N5 T
</select>7 X& w: Y; C/ L0 g6 J4 c3 M
</td>
2 z* ]4 D( |2 c0 ~5 K" j% i <td nowrap align="center" class="bgc"># c9 f0 }* X& u3 B. ]) V. ^
<input type="button" value="<<" class="buttons">/ E- d, U3 ^2 G! {. a
<input type="button" value=">>" class="buttons">
9 [1 k* c' W' r) u" V</td># P$ Q3 `7 I6 N2 U5 k
<td>& ?1 t7 ?8 n: L2 y e% H) Q" M
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">6 o* S! D. q4 u9 [2 t0 o
</select>" i8 c& \3 u3 b6 n1 x
</td>8 l8 Z/ D' o( C/ _
</tr>1 O- \+ V$ C" g( g
<tr class="bgc"> ' ~+ t0 x9 e, o& x
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>
; Y3 C# e& f; ]! @# l+ ` </tr>
" ~7 U5 W& t. o) M0 y</table>
; R7 F% g& f) V! g) [</form>! p9 Q- a$ _5 k4 F5 Y+ C8 X
<script language="javascript"> f3 D" t( O3 f. M
//人名移动# N6 ^' w8 t& D) V8 i' l
function move(fbox, tbox) {
' R: S; P0 W1 E6 p% h0 i; Q* }var arrfbox = new array();$ U4 i1 ` F) [( u
var arrtbox = new array();
; h, G; X8 J% d5 e4 _. Tvar arrlookup = new array();
: X, E) n# f5 j( b; W8 kvar i;
/ u3 g) D/ T% K0 r3 c; U' z# mfor (i = 0; i < tbox.options.length; i++) {
1 { }( H& O# v$ a/ J' o& jarrlookup[tbox.options.text] = tbox.options.value;5 i! c- I3 D- q6 H9 H
arrtbox = tbox.options.text;! ~1 c4 W/ C0 a& x9 \
}" A/ `; `( D, }6 A# N* K( S9 a* G
var flength = 0;
" S$ M1 n7 c% s, O; I* avar tlength = arrtbox.length;! t1 E, J0 T6 h+ R
for(i = 0; i < fbox.options.length; i++) {
4 N# m8 J, ~+ s8 a! `+ n8 Marrlookup[fbox.options.text] = fbox.options.value;$ T, L. {. @5 e$ V: j( G# R5 u3 e
if (fbox.options.selected && fbox.options.value != "") {
; ^, d0 y' E) s: P$ C- f8 Yarrtbox[tlength] = fbox.options.text;, C6 m3 M* {0 l( w
tlength++;9 ^3 e' j/ r: w! V ]
}
- Q) E: f" H+ n- S! P; A! kelse {, B' I9 `. ^& ^4 V0 H5 \
arrfbox[flength] = fbox.options.text;3 f8 t) I) T+ S6 N4 I
flength++;
* R( F/ W! z& c. x- r# ^8 S }
: y, u2 F, N" C}/ Z4 z3 D& n( H* D% E+ P
arrfbox.sort();
7 \+ Q( K1 _. O3 N) }arrtbox.sort();
/ |9 K( b# j6 K; q! x {, F
( }5 C) q, `8 M+ N. p2 {) Kfbox.length = 0;" {' q: w4 m. [/ u& A. m W
tbox.length = 0;
3 I* _/ H+ h9 Svar c;, H, w4 Y5 v( B
for(c = 0; c < arrfbox.length; c++) {
: y, \1 M6 v9 ~) ^& Ivar no = new option();
" T) L9 B. a5 J- D! ^: h/ `no.value = arrlookup[arrfbox[c]];
& r- C" O, T: a, n" Kno.text = arrfbox[c];! n6 ~; w; p& \* f+ r3 l
fbox[c] = no;0 T& ]* C/ c7 T( W
}4 z8 d$ A, h0 G3 J
for(c = 0; c < arrtbox.length; c++) {2 r: p9 h9 @, r1 P7 v
var no = new option();
& F3 @; Z3 B& U1 o+ G) ]no.value = arrlookup[arrtbox[c]];
% r% ?) _* r" B: u) q* z& \no.text = arrtbox[c];
! {6 @3 ~. ]: E5 W- wtbox[c] = no;9 Q2 v3 ]* v5 c; m. W3 G1 T+ y) ^
}
& F0 z9 a K2 r; ~( I, x6 g/ `}4 m) }& K' c- S3 b
</script>. g! d- ~7 s( e! T
</body>4 [1 T7 }2 o+ q* c& X3 d! e
|
|