  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14221
- 金币
- 2401
- 威望
- 1647
- 贡献
- 1349
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
2 }2 O: ?4 y8 N% ?1 y4 I# } c pageencoding="gb2312"# {$ a6 _) B/ H( \8 T4 X. e' T M
%>! n# u0 g2 g' o$ [4 J/ C+ {
<style>
8 ?9 _4 k0 m6 Z! C9 [0 \.f9{ font-size:9pt; }) G; v# F$ d+ U5 q% ^
.bgc{ background-color:#aecaf9; color: #0033ff }+ `; ?: _" ?' C+ ~8 b; A
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
2 x$ s) ~2 x. l% l" G7 w3 Y% }) T% z border-bottom: solid 1px #4e7dc1;6 z0 A* P2 T/ `
border-left: solid 1px #aecaf9;, o o- [: t+ j G
border-right: solid 1px #5679bd;8 p9 l$ b& Q7 H3 g
padding:1px;
4 v6 r! [$ U# w margin:0px;}# _* J: D! n, v$ |" T
</style>
( d. `' [2 K- \+ V<script language="javascript">" M" M/ I4 }# ^
<!--
, T ~1 g2 u2 A! p7 d1 J. `, u sfunction rv()
; g+ S) t& P* Z4 g7 y{
% p3 o1 p, c6 z/ g) }" D: M& B+ b1 j var val="";
% q3 u9 P7 P' z) F/ k for(i=0;i<combo_box.list2.length;i++){
& R4 p! r" A, \5 c val+=","+combo_box.list2.value;1 N/ E% U+ t, {& s" x
}
3 e/ Y. e& h" N8 C- D# E if(val.charat(0)==","){
, S: L% V; j3 {) U4 j val=val.substr(1,val.length);( X7 d+ w- o4 Z9 T) Z
}
# T+ T2 v; [5 } opener.form1.frecname.value=val;1 W7 u5 b3 n3 _+ c
self.close();- i( V, l$ z7 C g$ `- m x
}
& x# r8 Y5 s- ~//-->
# c$ r2 T1 f2 C7 ~; o& ]) i$ r& T& ^</script>8 ~" d* `5 s0 ]. a: t- n
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">6 v# _4 h. f, K+ Z
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />" G6 n- A4 B) v8 C9 n5 S6 p9 y
<%
# ?9 \& b' f, ~$ N5 { cdatasource ds=new cdatasource(); //数据联结bean实例, N) z- @9 ^' W% U5 n
java.sql.connection conn=ds.getconnection();$ _" R0 h4 K; q; h; e
java.sql.statement stmt=null;# _5 | \+ E* v; d {
java.sql.resultset rs=null;
( @& E9 F5 M# _0 ?. S5 D# _! e) r cdatacheck dc=new cdatacheck(); q. O5 U0 M% I4 t a
%>
7 e4 |, f) ]1 \4 O- L y* Z8 \; N<%7 I; [! L- t7 o
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";! z, g4 O# u* `! g! c
stmt=conn.createstatement();8 T$ C3 J8 u$ T
rs=stmt.executequery(sqlu);1 E3 w9 d( `2 T! ~) B: g5 w0 e
%>0 C) V/ Z; }: ~% H2 P. m
<script language='javascript'>
: d) ?' Y% ?8 ?& B' u- narr = new array();
$ w! ~' H+ a: o) f2 G6 r& }<% int temp=0;
& Q1 _$ L# n0 b2 a% Twhile(rs.next())
( G" v# g: z- U" V# L P8 a I; X9 a0 b{
* Z0 I' n6 C1 j# v b%>
" B* N ?) N8 D- tarr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");+ n% W8 j3 d; t* ]( u" K
<%* ^2 l& t H3 I4 O4 u
temp = temp + 1;
6 j9 C5 S% a2 x6 b& o}
. ? Q) _1 \# R3 t%>
" ^+ L! d* Y: U% r8 etemp=<%=temp%>;$ G M2 w- W4 b/ i0 ]
function changelocation(id){
, `9 Q0 E$ r' }+ c/ m4 P: m! Ldocument.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
9 I4 h; M+ H& a+ I- h( rvar i = 0; & G* f! F5 Y/ k% o; H
document.combo_box.city.options[0]=new option('-------','');
8 j! R. D5 R- M5 r, S% ` G# efor(i=0;i<temp;i++){
2 o" W+ Z# |( Q0 }7 zif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
' X. f: @% C8 r* Q$ ydocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
" t$ O9 a6 k! v0 d o}
5 ~+ f+ G! i. `9 f2 M) g}
+ u% C$ m8 N, W0 V. j: m( I8 {# k; @9 a}
, Y( X- C+ u) }5 K- l$ {3 _</script>0 k! g0 k( {& }/ A1 e
7 i! \* Y& j8 l4 h" I8 ?<form name="combo_box">
. |) S* u$ }( d% m+ h0 C<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">9 U1 r, g# j9 C
<tr height="24">
1 z8 x- \9 q2 \7 S) { <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
" `7 b; e( P- N# j8 M" M7 g <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
1 p# e& ?% _+ r f: T <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>7 l3 L) E9 [" v' q5 Z B
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>5 J% E) E3 J) I; M0 N" t
</tr>2 |% S6 l3 i# ^% _1 C4 \
<tr> . n$ b& N0 v* S( |
<td>+ W5 }! m" D# ?/ r, B8 {8 v
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">* J4 ~% ]% Z J2 S+ H! O
<option value="0">请选择部门 ---></option>
5 ~- u# a* F: P) a<%; K& z/ y5 G5 j! ?0 j' z% s- S
string sqld="select * from tdept";) |5 f( ~+ ?4 w5 m: C' X
stmt=conn.createstatement();4 L- l; k; x1 ?; E
rs=stmt.executequery(sqld);
$ N6 ?% W6 z9 |1 Bwhile(rs.next())9 p2 ?2 [/ _3 K. ~& @
{
2 V1 F% W& c& D9 U%>" z+ K4 t* p1 F% D7 F) b
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
5 G, A0 Y$ z7 v+ q8 z<%6 G& j; n4 t" N. F: x" l" G4 l
}! w1 M4 `7 E+ M; R3 y$ Z ^) A
%> 5 F' l& T# R7 P) `) s! Z3 `
</select>9 G! ?6 s+ [0 @ b
</td>
0 s! m- T+ t$ ?( A <td>
' m) ^6 L1 C" u/ l* c <select multiple id=city style="width:150;height:200" class="bgc">
# m9 `% j) P# I2 G5 J7 y </select>, E1 Q! `6 G9 ^9 d5 u. o# L7 v1 N4 |: Z
</td>/ Z' e: d7 Z. \: F
<td nowrap align="center" class="bgc">
' R& G# u; u+ I* Y9 v <input type="button" value="<<" class="buttons">0 _( ^. {# m8 ?( m) R0 X
<input type="button" value=">>" class="buttons">
0 n& i: N/ g3 J( B</td>
) Q$ H1 Y% T! d* u2 A <td>+ M+ z% F) K9 v# q* X" X
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">/ u* R: B3 B: J. I
</select>
/ t- v# `9 N m# u- ~9 z: r' }</td>9 ]$ J+ F: W" I+ W+ c! Q
</tr>- b) W) x' T) k4 c s) r& ]
<tr class="bgc">
" a; V( w# V ^+ O2 P6 l: M! y <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>( A) `/ P8 S3 O1 |: n+ }, A
</tr>8 y: H# r% J6 d. P5 a& i
</table>8 Y; e" ]" }' _$ R( I$ @) o$ Y5 g
</form>
# K4 p5 q! O4 H' y0 L; A<script language="javascript">( Q9 |; m, j2 h/ \
//人名移动
* M8 f6 Z( }2 Ofunction move(fbox, tbox) {' |* _7 `( H2 j- G+ X9 x
var arrfbox = new array();( h/ C( _; L" {3 ^
var arrtbox = new array();
9 M6 ^! N( n! T% U; I$ _var arrlookup = new array();" D9 T* O7 \' N- _1 t
var i;5 z. [; h/ y7 p& w, H9 \
for (i = 0; i < tbox.options.length; i++) {
: {- |; u8 `. K& z: Garrlookup[tbox.options.text] = tbox.options.value;! ]+ F! v* r M$ R1 D0 U5 t
arrtbox = tbox.options.text; W& I2 G1 V m! ^
}! G/ o& H5 d# ~ b
var flength = 0;
# J# R0 O }7 v+ k s0 X Xvar tlength = arrtbox.length;# \4 K* Q4 ^# x0 b3 e
for(i = 0; i < fbox.options.length; i++) {
8 x5 m$ I2 ^3 k0 Q% k6 Oarrlookup[fbox.options.text] = fbox.options.value;
: E. z) n2 o$ C9 Z. Zif (fbox.options.selected && fbox.options.value != "") {
) ^% t: H; V S I& t' f marrtbox[tlength] = fbox.options.text;' x5 Z3 u* |8 r" k
tlength++;
! a! @3 }# z% l4 x0 b& K6 \* P}
- W: ^( {6 V9 q; _6 I% ^5 nelse {5 P- c' n. q0 p7 W, C
arrfbox[flength] = fbox.options.text;
" y P2 G. ~2 \0 u2 M0 {, Fflength++;
9 T! e: X1 P8 N- `. a. X }& {8 w+ m. u8 X6 o
}8 k# G, U- Q1 Z; }1 Q+ i
arrfbox.sort();
( L! ]( Z a; Barrtbox.sort();
4 v( V8 G7 j! ^ D( c9 Q" @
/ N: n4 t& h" mfbox.length = 0;
$ X+ a1 o0 C% A9 T8 Wtbox.length = 0;! L* d1 a G0 y W- N9 A
var c;
p9 x& P" _# e. Z, E( Cfor(c = 0; c < arrfbox.length; c++) {- P) O3 l/ t" o9 J+ S. k; j7 U9 b
var no = new option();
K: H8 W4 d5 }! Pno.value = arrlookup[arrfbox[c]];) d! X X6 }' ^
no.text = arrfbox[c];; j% y9 p* k$ M
fbox[c] = no;( R) m4 M# s q: u, |; ?
}1 [; E$ r) s" U1 ^$ L# S. Y9 m
for(c = 0; c < arrtbox.length; c++) {# f7 Z5 [6 D- ~; m' u
var no = new option();- [# O; V! @: y- A# t$ n5 U N
no.value = arrlookup[arrtbox[c]];
7 [. g0 [% `+ X1 }5 x1 z7 l; K3 dno.text = arrtbox[c];
" ^/ A& ]6 a, Q- X' p6 k ptbox[c] = no;5 B( m% {0 l3 X+ D4 l
}
9 k: `' G# U K2 u1 b" }' X}
- Y3 }, z) N( Y/ B</script>
3 v3 h1 r5 n% s# {</body>, h' b2 o/ f' v9 h' x
|
|