  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14221
- 金币
- 2401
- 威望
- 1647
- 贡献
- 1349
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"6 [/ o# Z5 A- F% P* D" {
c pageencoding="gb2312"
5 ~! L' ~3 a j* X, w& `4 f/ b3 ?%>
+ {9 T' g: y0 f) f* P& J<style>
+ o3 s9 v4 m" e6 l: C# G! f. ~.f9{ font-size:9pt; }3 g# |8 J5 D, Q0 _2 @' u
.bgc{ background-color:#aecaf9; color: #0033ff }
7 W6 O; q& R. Q5 u" R! \- ^' U.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
+ z& B9 q% z/ Z; w$ }$ ?8 L1 L border-bottom: solid 1px #4e7dc1;; L: a$ c' G" l6 ?! v( {
border-left: solid 1px #aecaf9;
1 [1 ~8 n3 R) H/ S# k; v border-right: solid 1px #5679bd;
) h! U2 ^& _9 x' Q) p padding:1px;5 Z0 ^6 u7 Z/ p( l
margin:0px;}' B$ n$ i& ~& {/ e
</style>
2 `; N/ c0 y% ^4 [( u<script language="javascript">; i U( S7 b. g/ j
<!--2 [) n7 l8 [' W) ~
function rv() I/ A" B$ M6 g- I w( ~
{# y% U1 I9 b9 b3 _
var val="";
/ n, T& c( x, I- L5 K for(i=0;i<combo_box.list2.length;i++){
' W4 A, }% |3 e% R" Q' b+ l8 e val+=","+combo_box.list2.value;
2 u2 F8 Z1 @) j }
2 D1 ]4 ~( F7 [; x5 c: c if(val.charat(0)==","){
5 W2 P5 G2 A" R% @0 O, m ~3 ^" N val=val.substr(1,val.length);
- A- h2 U: x8 L/ P6 Q: j! d }
+ T M/ r, A9 I opener.form1.frecname.value=val;9 u2 u0 O7 D& n t6 X0 J5 l( w3 Y8 t5 N
self.close();! W3 i1 V7 }6 o# [% Q8 _
}
/ c( l; b( s( T8 h$ [# c//-->9 P G% g* P) v1 `2 ~
</script>
3 K3 @7 Z+ j9 G2 J<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
4 @" O! t7 I3 s- E& P2 N2 p2 v+ H5 g<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />( l" U) S p+ F+ R9 Y0 Z* l6 Q; ~! ?
<%
' S5 x; ]9 M2 D# W3 j$ Z7 q cdatasource ds=new cdatasource(); //数据联结bean实例8 ^4 o7 \# Y% U; e+ I4 \& l) T
java.sql.connection conn=ds.getconnection();
, N+ K( B Z8 U( l2 h! {) Q$ S" f" j+ F java.sql.statement stmt=null;! y9 [. {4 z3 o( M; Z0 @
java.sql.resultset rs=null;- g2 O" v' S) {2 y8 b& M
cdatacheck dc=new cdatacheck();
5 |( g6 I8 E6 D8 Q%>
4 h4 {3 D! C: N. a5 t0 T<%
0 ~4 N- K( E5 O5 N" d, h r. D: lstring 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 a- o6 T& @7 Qstmt=conn.createstatement();
- H: p9 U' U6 R, M% `rs=stmt.executequery(sqlu);7 p0 g P1 N# k
%>
, S; u5 o' v' S' p0 j<script language='javascript'>- k* {! K1 \; w) g& B9 H/ G: u
arr = new array();5 y7 j! b& S$ i, A! e; t! a2 O3 A
<% int temp=0;
8 X! T$ ^" C8 U; T7 l2 H( Ewhile(rs.next())
3 C m, k0 s! ^{
! @4 L% L# d$ A+ Q' n. U% Z v1 s%>3 ]! I- W6 M' K; ^4 H% q
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");' H+ `- Q& }1 n' E% C7 h2 ^# G
<%7 i8 m7 O6 e3 ]4 F, v- G# W
temp = temp + 1;# |( J6 T* [, X( S0 {
}# a+ v+ y: y# e3 K( W/ A1 x4 F/ d+ h
%>
+ O' l' J; ]9 Q3 Ltemp=<%=temp%>;* D# r' Z' A& X. h) X7 `
function changelocation(id){
8 w; P! {7 g Y+ V! ^document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 " F. p. s1 {, s% q1 x% v' Q7 [! k
var i = 0; / v- J& v, F; m# D
document.combo_box.city.options[0]=new option('-------','');
# b, [& {* J1 X/ P, J) N* M, \for(i=0;i<temp;i++){
# P- Q8 h: K; ^9 H/ v- W7 vif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] 6 h5 K5 Z7 U) Y/ v* _7 J
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); 7 T! b9 w" C$ D8 C2 j0 O% b9 v
} 1 }6 d1 }0 O7 P" q ?
}
. N' Q; V4 B1 C: X' l} 0 l) C% M8 C+ V
</script># n% F6 A5 V5 {8 g
, o9 r) d" f) ^( b3 D<form name="combo_box">
9 c. ]2 v" h x H+ K$ l7 {<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">( A! j+ Q7 @: S+ o# O% T' p
<tr height="24">
; W. s' i" R+ q$ n; v <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>6 q$ I. B( L. j* _5 r7 {
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
5 } {5 Z, J- V9 q0 P# B <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
6 `& g% U8 O6 K <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
" T: A; p Z8 h8 m </tr>; i* h! [+ O! H4 W' s( C
<tr> - c. c- a3 W1 k. J- f
<td>7 o d- K$ N1 ^% o
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
v# D" v4 S% p& ?6 K5 u6 b <option value="0">请选择部门 ---></option>0 w+ r9 V9 E& f; }1 E. k8 W" ]
<%
* h, ~. }2 l; X string sqld="select * from tdept";7 q) ~1 C4 e# |' Q; f- x
stmt=conn.createstatement();
: R% W7 c C& t3 W Z5 Prs=stmt.executequery(sqld);
# j( J) K, g Ewhile(rs.next())
# z8 f% M3 m8 g. C) s& J5 G- k{
* \; t- R2 r4 l5 N%>
4 e8 P/ H, t" U* [5 i2 a' q <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
& s) q! [0 R* Y/ ^4 u5 C/ T/ X<%% z2 F. y$ X- ?
}
5 i4 Z$ V) K9 ]3 r# u. t) y%>
3 @" K, f9 f& E) z </select>
8 \9 ] P: ?" @5 m( O/ j</td>8 q) ~, D b' j
<td>6 S% O( R, ~$ g6 @
<select multiple id=city style="width:150;height:200" class="bgc">" Q: X# h! z5 m; ?% Y+ U
</select>0 J. M: V, v4 Z; r
</td>2 k4 R+ v) x: Z: ]% Y3 h: S4 w( \' h
<td nowrap align="center" class="bgc">3 L- y2 I% L7 t% X; S; o
<input type="button" value="<<" class="buttons">. B2 J( s. c+ m: C& w2 J
<input type="button" value=">>" class="buttons">
5 b/ f+ |4 g- x! Q% O</td>- P4 V7 i2 k# c. H; \6 f2 {
<td>
. D- G/ Z- ~9 y& P <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
9 Z$ q/ c) Q) N4 c! n; [ </select>
H8 ~* L( m- _% N</td> J; h) ]/ U2 S4 l6 T
</tr># V5 j7 b6 U0 O j+ _6 P
<tr class="bgc">
4 s7 r. U3 _2 w( E m8 s <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>6 `+ p# y( H" h/ h9 N! D
</tr>
6 e4 \& m& ^# H</table>
^3 W4 v) _: G# L+ G</form>
( n# V. Q# F- j<script language="javascript">$ {, E" N8 d" s3 G9 a9 o% f
//人名移动
9 ~2 s7 G0 ~. ufunction move(fbox, tbox) {; _; K* q# t A( f9 _: _) q
var arrfbox = new array();( K: z2 B4 l$ n2 }
var arrtbox = new array();5 {* Y& x2 O6 |! j: ~6 ~& o* h) {6 d
var arrlookup = new array();8 p( f7 W6 v6 J3 }
var i;: D$ y/ [0 N3 H
for (i = 0; i < tbox.options.length; i++) {
1 m1 S2 g* |3 e! }- A7 S% j" tarrlookup[tbox.options.text] = tbox.options.value;
9 Y& l% ]2 i* G! D% [ y" Iarrtbox = tbox.options.text;
w( p* C6 [& c- |6 q}
( A, g1 r5 d9 i, \, K. r& ivar flength = 0;( N* {/ n+ y2 H* W! E
var tlength = arrtbox.length;
4 R9 q# d% b) y& N( D8 \for(i = 0; i < fbox.options.length; i++) {
4 Z6 G9 H$ H9 Q$ F# warrlookup[fbox.options.text] = fbox.options.value;, M' g' P: E- w- @& L$ p- M
if (fbox.options.selected && fbox.options.value != "") {
% F5 Q) N' ?7 }) o" G# Carrtbox[tlength] = fbox.options.text;- q5 n! m/ P) l! t9 b; r' I7 c
tlength++;
5 M# Q8 ` }$ G- k% w, k}/ B o! F8 _1 b
else { d+ H/ {5 w9 v7 u" b$ S9 ]+ K9 }
arrfbox[flength] = fbox.options.text;2 B/ r! R( }* V, U" l
flength++;
+ j3 D7 B+ r) ~: }6 S m; i }
1 T. }' F6 x$ L" v4 f" G}
7 b$ u) p2 U5 c& G# O" e! m' zarrfbox.sort();* \" S- N( R6 v
arrtbox.sort();$ L& p) J. N0 z1 ?) ^. h
. B7 f/ w4 P0 x+ |fbox.length = 0;) s9 G% Y8 J6 Z$ n- t
tbox.length = 0;
8 ~' R' p1 C' D1 J9 |var c;
$ M1 \; T8 N- u6 g/ k# afor(c = 0; c < arrfbox.length; c++) {
^7 @2 M6 R1 o( Y3 _6 t- y; Uvar no = new option();
( k: w* ]+ v, c, ]9 ]8 b0 hno.value = arrlookup[arrfbox[c]];" U* m, y5 B3 o( ^; b$ P; w
no.text = arrfbox[c];) m% W8 C, N4 f" U$ x
fbox[c] = no;# d& G# S/ O2 r
}
+ \! V! q S( M Yfor(c = 0; c < arrtbox.length; c++) {
' R% {/ F* l; k) e) H1 dvar no = new option();
. [; q: h6 a% l: O0 k, I9 Ano.value = arrlookup[arrtbox[c]];3 u# V( M# o J8 n: ^
no.text = arrtbox[c];
# z& ~4 j" D7 S; b) Ztbox[c] = no;
# A0 a" J8 o4 b* ?" E4 b. T5 `/ f }4 n Q' w3 [% m0 J' O2 j5 S Y
}
- s# |( W3 c! Y2 |2 ~9 M* j2 F% v</script>9 b8 R" x n8 s; U5 f" K
</body>
7 L4 U" D9 l0 j2 x9 R |
|