|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14443
- 金币
- 2507
- 威望
- 1647
- 贡献
- 1455
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
9 e$ ]# Q3 W3 }) u! s; N5 v c pageencoding="gb2312". m. `) z6 T- y' e; ?# F. n
%>
0 X q7 ~, Y* l) c- v<style>
! W4 Z7 C7 P- I; j% k% P.f9{ font-size:9pt; }
! e( s3 {! u$ W8 }# \6 `: o" e.bgc{ background-color:#aecaf9; color: #0033ff }
, d# \2 ]' {) q5 @.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
8 R0 y% K2 b, p* p border-bottom: solid 1px #4e7dc1;
3 D( Y6 X( d# R" K' l6 ^6 e border-left: solid 1px #aecaf9;
, }/ \2 o' r9 J3 H- N; J border-right: solid 1px #5679bd;2 ^7 P0 n P* l3 y
padding:1px;
/ l$ }! [. [: ? margin:0px;} J; j" Z. `0 G* v5 R: {$ c
</style>( Z# [* T9 Y" I# s$ R+ t
<script language="javascript">
4 ? J, L3 [1 G( b; K/ p<!--
; Q7 H; ^ F. wfunction rv()$ d8 V+ f4 u% t7 y. e; t( T' E
{
' i2 C0 t) s+ H5 |) e, W var val="";% [( C" w. r/ q( d. \9 B
for(i=0;i<combo_box.list2.length;i++){
7 U1 ?. T* g! Q' K2 R" i val+=","+combo_box.list2.value; O: r+ o& F4 k+ ^2 H' v2 ]1 x
}
6 Q: g4 o$ \8 m+ u if(val.charat(0)==","){3 d& @' [) h, K% s6 F+ ^5 o6 p% i
val=val.substr(1,val.length);9 C+ H5 Q' X9 V) t
}5 `: J. H' B% p
opener.form1.frecname.value=val;$ r) Q' i+ C, c& [: e9 i
self.close();4 M t6 W. `! }; S1 A
}1 ~' L8 K2 K- R: A( H q) ^) A
//-->5 y) a: N. P, Q# |! }6 Q
</script>
1 x1 \5 {. n. K. o+ B<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
) q, u+ @% i5 ]+ ~4 e) _<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
L0 `- @# p8 @) ?% Z4 p5 K5 i: x<%& I7 C l+ ?1 }) Y a6 A
cdatasource ds=new cdatasource(); //数据联结bean实例
3 c6 s) q# A2 k& z0 y. r% U java.sql.connection conn=ds.getconnection();3 J6 E7 V1 ^) L/ k" p+ T' Z
java.sql.statement stmt=null;
7 r i- @( r0 g! ~* V. R' { java.sql.resultset rs=null;
5 V+ x/ \0 W5 t0 I cdatacheck dc=new cdatacheck();2 f* |1 L& L5 v7 b) K- U4 x
%>! s/ K1 n2 e5 m+ ]- s, a0 J. k
<%
4 p7 C8 B* t% ?8 ~. C5 Astring 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";
0 o/ S( B! M m" Ustmt=conn.createstatement();
& Y+ H0 A7 Z0 W. xrs=stmt.executequery(sqlu);4 B' J2 b2 x4 g Z
%>: F% R% q7 M, ?$ ~5 C
<script language='javascript'>5 w7 Q: n" {: v7 m
arr = new array();; a: @$ L+ E0 ~+ [) Q9 A
<% int temp=0;. v8 j$ l4 d( j# P' s5 ~% w
while(rs.next())
% V2 O+ r$ `; ^. p3 _: P{
; ^% }9 |. m2 l& D& K, p' [$ m, t%>, Y [6 G! N+ \6 c
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
3 H! y2 T6 _' c. l5 l<%
, Z; _5 \* D" N6 j, H( K' htemp = temp + 1;
9 w( [- z% P, |4 l$ ]}. n; l# t" E# Z0 a/ d2 b* P
%># e, _( _' y2 h, e, U' `
temp=<%=temp%>;
. d- @9 d X' G0 G, @function changelocation(id){
9 K& i/ Y0 t) u6 b7 Odocument.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
5 s3 \) F" y$ h1 K* l7 n: Mvar i = 0;
# z8 T: V8 R6 O! Bdocument.combo_box.city.options[0]=new option('-------',''); 2 z/ U% f) Y. v5 c& E
for(i=0;i<temp;i++){ 5 [* O& c, V. J
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
" s% o" j0 v- `' qdocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); 2 t: y: s# M, P; N# t- n4 @0 D7 l
} 1 R& `4 V9 G# m; I
}
( J6 o% {% Q: W8 @9 _, |4 `}
( B1 ]& w" R6 R: b</script>
% H1 r; B3 ~5 e* j# t) V+ H: K* d* G. I( V3 b
<form name="combo_box">
7 @ | r% f5 _& t* {/ X7 y<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
, D& h: X2 W; @ <tr height="24">
9 J9 i* G: r6 L9 h( Q7 ]7 P n <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>- ]/ z/ Y: ~) @2 T- i7 ?
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>" ^& W4 p0 W) P0 W3 U; P
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
& k) l6 r, K. \$ b <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>( {" @7 ?. f- \- v0 @% o
</tr>
6 h& g/ p) F* s% I6 s- n <tr>
0 l( X. b' W Z2 p! @7 X <td>! R" [7 }% V' n6 e( w, D
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
8 a8 I g- \9 s3 F& C0 k <option value="0">请选择部门 ---></option>
! ~# M& d% [2 c7 e<%
5 _ ], P% s: k string sqld="select * from tdept";" w/ e" r3 u) X# L6 O b
stmt=conn.createstatement();
* N5 D1 n6 M2 C$ U4 f6 h6 H3 ^rs=stmt.executequery(sqld);4 m; I) @/ {2 U, W# L' v N. f
while(rs.next())1 e7 z5 ~8 F6 S9 O/ s- J6 C: a z
{* Y6 V2 c9 _6 l- o; |- k6 L& K
%>
) ?1 \; d3 c5 d3 N- | <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>0 X3 p# [! x9 R/ h7 A
<%/ A$ s/ w% V' Y9 |+ p5 {
}5 S( M- b) {! N0 l, ?% K% F
%> + \; R% M% q( k, g, ^/ m% K4 R
</select>2 H! L% Z; e' P
</td>2 u0 d! g4 v6 X" `
<td>- _% ~/ n' N/ ] {! p' T4 `
<select multiple id=city style="width:150;height:200" class="bgc">
8 ?4 r5 }, H' D5 V/ J </select>
/ m" c+ G$ \) P7 r% G6 N</td>
4 \/ W# ~! q, O( O <td nowrap align="center" class="bgc">0 S5 `, _5 p8 E6 l' v- _; h( ]
<input type="button" value="<<" class="buttons">
9 A5 o: Y# T3 [- c <input type="button" value=">>" class="buttons">
7 {2 a; S- X" r1 e</td>5 Q* e( u" z3 i) H) t
<td>& ^+ M) g5 G/ M0 J/ d) K L4 a9 x9 `
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">0 H3 e, R/ V) P: R/ q+ M
</select>
- ^# r8 b# r" n/ j$ \</td>' ?$ ]' O1 _3 S- [: [* {! z3 O0 m2 O
</tr>
/ y9 _5 D8 B4 j, ^2 l <tr class="bgc"> - w- ]* d* S* H
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td> Q# t/ V( G# @3 ]5 @! m8 d# C
</tr> E0 x$ \1 x$ l) ^" J$ r3 }/ T
</table>
' g; S1 @% W% A% G n</form>
6 x- `0 D$ Y/ L& `0 {8 Y<script language="javascript">
9 J8 W# P8 C6 i3 \ l z2 }//人名移动
8 ?, k4 r9 ]: r8 }8 h( |% K! T$ i, yfunction move(fbox, tbox) {5 U" L0 f7 a5 E
var arrfbox = new array();
2 f8 P& w e8 P9 ^2 k; T2 v7 t1 Pvar arrtbox = new array();8 O9 h. j" r9 x) o) w! m; p$ ^' R' }, X
var arrlookup = new array();0 c/ z0 m/ H; L" j/ i! z# c- h
var i;/ S: Q, o' Z. g2 {
for (i = 0; i < tbox.options.length; i++) {
( v/ V$ i5 O4 K$ Y t3 farrlookup[tbox.options.text] = tbox.options.value;; N" m$ X, v, F/ ^" y
arrtbox = tbox.options.text;
. n1 V) v8 `" q" U3 s}) N+ ^* v4 a: z# S2 a
var flength = 0;
: |8 f- k2 b/ Zvar tlength = arrtbox.length;4 Q' f+ a2 w5 r9 A( u3 i+ z) _
for(i = 0; i < fbox.options.length; i++) {
' ~ {; C2 N: y' c. earrlookup[fbox.options.text] = fbox.options.value;7 D" ~9 C+ y/ C
if (fbox.options.selected && fbox.options.value != "") {
) Q# |. Y; v4 @1 ?4 f4 a, i+ Qarrtbox[tlength] = fbox.options.text;' z1 h6 s/ k. ~7 c( f4 c1 M
tlength++;
" D+ i, |$ O {% G" N} u' r' r' u- f, u+ e" n! h
else {
2 @; }2 x" [" M2 ~7 N& ]arrfbox[flength] = fbox.options.text;
* x) K- e+ h- p# p! O* r+ Bflength++;
$ |6 Q6 X* J5 Z r1 k. P# h }
}' |! ^- x7 D5 L6 Z8 y}
2 F5 l( c4 W/ n/ Z5 S& ?7 ]* n' ]arrfbox.sort();
1 S' I% O+ i% Z$ z9 h' Q6 iarrtbox.sort();
) [0 M& N1 C h7 f) L# U z. n, j8 A5 p+ M; F. t4 R7 `
fbox.length = 0;
$ \2 i; t/ t8 U, o5 L1 C8 J+ T( Utbox.length = 0; B5 Y2 M; q3 i+ U
var c;- b" `* v6 S$ f
for(c = 0; c < arrfbox.length; c++) {
, N; e0 L# E5 x& C, R/ uvar no = new option();
9 E5 V- I3 u( z. y8 bno.value = arrlookup[arrfbox[c]];
/ y4 B1 d7 S) d8 tno.text = arrfbox[c];# I- P1 ^1 X+ }- h5 }: R
fbox[c] = no;
# L6 V# j. ~9 \8 [- s: o, W}' l; [7 N0 @0 {
for(c = 0; c < arrtbox.length; c++) {: L. p' y( Y7 o+ X3 n' h
var no = new option();" P9 | N1 c7 H9 y7 ^4 Y
no.value = arrlookup[arrtbox[c]];
4 z6 e& L0 R2 F7 @' Z9 {no.text = arrtbox[c];
% R% f- w" m, l) O" \5 Utbox[c] = no;6 Z& D7 o$ W4 x& b
}
( j* W9 @/ {3 l' c1 h% D- y}8 N h4 u/ L+ p
</script>' Q( @" h9 J+ ^! K6 p8 v4 {7 x& s4 J
</body>/ j5 I9 R7 C8 ]$ ]% a: _
|
|