|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14369
- 金币
- 2470
- 威望
- 1647
- 贡献
- 1418
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
2 B5 p2 ^5 \; O. {: K c pageencoding="gb2312"8 O9 B( h4 X" v' T; Y8 d
%>
/ {& \! E0 I# h) f<style>
4 u* ?2 Y: [9 r# M% \- {+ Z.f9{ font-size:9pt; }6 z: A' N( @/ y% d8 g
.bgc{ background-color:#aecaf9; color: #0033ff }
! I8 j" r4 B/ ` t.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;6 v+ |7 ^! O2 V6 E) {! \6 H
border-bottom: solid 1px #4e7dc1;, j+ B: d2 u; Y- E- ^$ p1 s3 m
border-left: solid 1px #aecaf9;1 ~8 U4 o, o0 O2 H L' {9 n
border-right: solid 1px #5679bd;
, a8 _& y9 T" V7 _4 T padding:1px;+ j" p& \8 R) Z% u
margin:0px;}( `9 a' c2 k; s; }6 y! y7 r
</style>
9 x( _+ f! S$ B) \* k5 p<script language="javascript">
# ?, {$ P% W7 i7 g0 d# Q) k, _<!--( p: V9 H3 O/ f. p0 a; ~
function rv()$ G$ z. M3 M d! I* U: |
{
% [8 G1 i6 ?& K" f; C H var val="";" }4 F7 l" h/ K, p2 g
for(i=0;i<combo_box.list2.length;i++){
0 ^/ u* C$ n' `7 F val+=","+combo_box.list2.value;" @7 ~+ {% N! D: a( h% k
}" ~7 K% ^# o7 n4 L$ g7 ?2 U) l
if(val.charat(0)==","){
- G% x/ E6 d5 R. S) S3 `, B" D val=val.substr(1,val.length);
" `+ i7 d2 ~8 Y c9 w7 j, j! F }
# E8 U, o% ~0 W% K! e% |8 ^8 |; k opener.form1.frecname.value=val;4 v/ R! z) \) ^1 ~5 @ R. Q
self.close();
2 S6 M6 G! M7 `}
, |2 x. h% {: r8 I7 q4 F5 s//-->* @+ V# p2 q3 w8 ]4 L
</script>. ?' k: I/ k `# E' A
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
0 Z8 a5 l6 O1 [# w% U8 W* @) x4 R<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />8 P- A2 l8 K. E
<%% J- y# L+ X. W! x( e2 H1 T" Y
cdatasource ds=new cdatasource(); //数据联结bean实例
) ~; |, ?2 x5 s java.sql.connection conn=ds.getconnection();
) X, h5 k1 r& Z java.sql.statement stmt=null;+ C. m% c$ K$ d
java.sql.resultset rs=null;+ c: y( L W* R$ `9 L) _' B8 U
cdatacheck dc=new cdatacheck();6 k0 m) o' z9 |
%>, m7 t$ A1 ]* V# U& O# S
<%
7 B: e. O- l4 Y: F/ B* Estring 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";
}8 q5 w) Q( u% {4 _9 Cstmt=conn.createstatement();
2 c: t+ G8 C1 w+ Prs=stmt.executequery(sqlu);- ], _) j3 w8 G: J/ |
%>
( J, x, K. K" d0 z<script language='javascript'>" `7 K0 P" E) r( g$ T+ U1 `7 o: k
arr = new array();
X$ o, @( T+ \( Y8 a# ]) F* x<% int temp=0;
- B w, O4 k) }! rwhile(rs.next())
: i. n# k% ]$ k{
+ J0 ^1 w2 ?1 d2 ? P3 f" a%>
) ?. n. C6 [6 `& ?. s! Parr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");5 D! _# F! B( }+ `5 p8 `. }, f
<%* D+ t/ R5 I) Y( N: Y3 g' R- @
temp = temp + 1;
* V1 L5 B" y) t, a& v}5 D: E' [9 {5 d) d) k1 _% c
%> `9 Y5 }# u4 C, {) u1 @3 h) F
temp=<%=temp%>;% o5 B: i# q0 s7 S
function changelocation(id){ G0 _4 ]& s% C: H* Y3 N
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 0 g- t5 Y. z" h! z
var i = 0;
* Z9 \% [4 y3 W4 m, ^document.combo_box.city.options[0]=new option('-------','');
9 A. b5 E: K3 V# e* v- c: dfor(i=0;i<temp;i++){
0 ^; F V( ?5 h1 f2 N; x9 _5 iif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] : Y1 P' }3 |- l% |
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
& `6 I& x8 I0 R( O! z, q- A}
' E+ n# g; s" r9 F0 e( e} ' e' S- H5 w n: O; @* c" t+ v, r
}
* a7 J* g4 U3 h% T' A7 W</script>
* D6 E9 z4 O% B4 o1 Z* L9 D R3 k1 c7 T) g) v
<form name="combo_box">
7 F9 h1 M4 G' Q( U2 C5 S; T) N<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
* ?9 T3 F, _1 ] <tr height="24">
! W% w. P0 k P9 {: x <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
0 c' Z7 |; ~4 V; H <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
" R, r) U9 y K4 x4 ? <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
% }5 ~* ~9 d2 v( X; z# m <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>$ t! F) o4 W$ t) P
</tr>+ T/ f' ~$ I% K8 [4 P# `
<tr>
) I7 Y# n9 l" j2 M! p4 t <td>; f! w0 Q3 N! W
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">& T3 r3 ?% X- i) {6 `
<option value="0">请选择部门 ---></option>
( p$ A! @, \! |' E! g! v<%
7 k1 X Y1 g6 h" k, c+ `2 [) D string sqld="select * from tdept";6 z. F+ l: d8 l- \) K8 F5 f4 F
stmt=conn.createstatement();
$ z% ~) N0 i) k9 t8 ors=stmt.executequery(sqld);
4 T! L6 Y7 _! B; Z" h" a6 Ywhile(rs.next())2 T a6 D8 ~; d$ ?& u' K
{
* |6 | u: u: R \%>, U6 _* A4 a# [. A' W& F( H/ v
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
% i- w O$ [* F! j<%
: J$ y$ J( F/ {" K8 t' [2 Q}, o- W) Y2 h5 N, h0 A" o& i1 A( A, t
%> ' a: l& U" ~6 u" i* ?7 Y# a
</select>/ J7 E8 Q6 P& e
</td>; |9 E( F0 j. T: \
<td>
$ F' Q! I y) l: ~; a( n <select multiple id=city style="width:150;height:200" class="bgc">- l8 [% Y9 Z& h( i
</select>
* x: y+ k; @4 d+ E; q</td>
1 v U% h3 E$ _8 f% ~ <td nowrap align="center" class="bgc">7 a' e- f7 Z- ?: e! J! k! R
<input type="button" value="<<" class="buttons">
& e# j* @( j6 D1 C- K" k8 a t0 A <input type="button" value=">>" class="buttons">& ?! h* c6 C- K
</td>
3 Q8 z& N' T& ?4 x* h+ z2 q <td>6 T2 k, q( I( I- R
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
* W( t2 j* D! A4 l, u </select>
* V, V0 a7 [) ^. f</td>
! I6 n% j& o5 c* e </tr>
2 v j! b+ [* Z. a( ^9 H <tr class="bgc"> 2 J2 {2 B# M3 H# o, X- Q. n
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>0 R5 _6 Z1 F6 f: I, M3 F8 ]
</tr>& r7 t( s- \6 s
</table>2 o7 ^! R( Y( Q3 k
</form>7 k+ A/ L% V# Y9 V" `' t
<script language="javascript">9 q4 s$ W9 A! C( j2 W; \+ ~5 w& u
//人名移动
) j5 K$ _! O$ X/ |6 ^) {function move(fbox, tbox) {
7 A2 l/ h9 _" ] wvar arrfbox = new array();
% e' v; G1 {2 W* m0 ~ m7 [% v- E7 mvar arrtbox = new array();
4 D; k0 i) c! u2 X/ l* Q# y% pvar arrlookup = new array();
$ A* y* N- q" D& ]; K* x' U7 i2 Gvar i;! o( H% f1 k) d' S
for (i = 0; i < tbox.options.length; i++) {7 E7 _3 J$ U. i D/ d0 V: c; T3 E
arrlookup[tbox.options.text] = tbox.options.value;
% Q3 Q ~% X* X: N5 \arrtbox = tbox.options.text;
7 ?; W1 e& u1 Z- h}- X+ w9 H) T- M5 F1 T
var flength = 0;
5 T9 d7 S# c7 Q8 k u, Hvar tlength = arrtbox.length;$ T8 ~. S4 R- ?2 v1 d9 a
for(i = 0; i < fbox.options.length; i++) {
- e' x! f, l' ]% Z& U4 |2 Z" u carrlookup[fbox.options.text] = fbox.options.value;
& W6 O, M! d, s2 m3 Z8 K: h8 }3 ^if (fbox.options.selected && fbox.options.value != "") {' T; s5 K( g3 R3 q( r, v
arrtbox[tlength] = fbox.options.text;
3 X, R9 f7 }1 `' {2 t1 etlength++;
) ?: N$ \' J$ X5 w1 O}
; j7 q5 k8 [9 |) Gelse {$ F+ @% C8 A/ ]. K
arrfbox[flength] = fbox.options.text;
# F2 P* V0 z, Zflength++;
5 A# H, T% [- M1 k2 {; ]+ N }
1 b# V5 b2 U V( o1 V F" S# P}
0 i$ k9 z) s7 g! J- N8 k& S+ parrfbox.sort();
! t, x) |$ [2 Q. {, I1 F! o$ |arrtbox.sort();
6 C8 I1 y7 }3 n% C1 q) H
1 {$ ~! h' C R# Ofbox.length = 0;
4 u- D7 ^3 k/ f2 N+ Rtbox.length = 0;4 ^! m! X% z2 K+ {8 J3 ?
var c;
3 c d. Q; T9 ~" _! ~8 Y9 a( Pfor(c = 0; c < arrfbox.length; c++) {- j6 K2 W5 B. O
var no = new option();( B4 t1 h% Y* K+ Z. w# h- B
no.value = arrlookup[arrfbox[c]];
8 i6 x9 |4 t/ n5 E0 z( Sno.text = arrfbox[c]; ?, `' R4 ~9 M9 M8 M
fbox[c] = no;
7 p: P- \) B, J. m1 }}" o$ w5 D- s. C0 T
for(c = 0; c < arrtbox.length; c++) {
8 G9 Z) Q+ Z9 a3 K% p8 o2 x# }( vvar no = new option();
+ j S+ ]# @) Z; j4 rno.value = arrlookup[arrtbox[c]];
" t- ?0 f9 b2 T: J, v7 S8 c" Ino.text = arrtbox[c];
a$ ^6 g! Z8 Z5 d5 Ytbox[c] = no;
( y& S, ^; a* P. w. S }" K( _) a. @0 D6 ]0 W1 v- E) o3 S
}; M# J# S2 Y* j- X) q
</script>+ r; F& v0 O( k2 U
</body>: ]/ ~) ]6 G- T* B0 H
|
|