  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14247
- 金币
- 2414
- 威望
- 1647
- 贡献
- 1362
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
3 C& G2 a6 k) W( t0 S9 r c pageencoding="gb2312"8 Y4 P( V6 ~, S4 J# V& b0 Y
%>0 S: B" U( M5 Z& F" ?3 a% R
<style>! j/ u5 \7 x% \) G+ b1 |$ P2 G6 {' \
.f9{ font-size:9pt; }! e% Z9 M" `) D. ~! _% c
.bgc{ background-color:#aecaf9; color: #0033ff }
9 l) T8 t( I7 ^( E+ g.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
1 X, r E6 O7 U C0 R border-bottom: solid 1px #4e7dc1;: D# O0 e2 Y! c H$ Z! p
border-left: solid 1px #aecaf9;$ l5 ^$ n+ ]' p; ]# A) t
border-right: solid 1px #5679bd;
: E$ C2 R6 T* q4 _3 g, p padding:1px;1 Z0 R7 L* @ ]# |9 w
margin:0px;}
7 i8 V; C3 Q# L4 @3 \8 p- L</style>5 a5 d5 z6 D1 M2 U: u
<script language="javascript">
2 i/ e9 B& Y8 ~8 I; s2 A A<!--8 {5 J) t( o6 H
function rv(); S7 T& ^# H: x
{
# i; v1 f2 j/ F- d var val="";
- |4 F7 A1 ^! V2 X3 c) e for(i=0;i<combo_box.list2.length;i++){
2 o c: I3 |, h- p! y& G' I val+=","+combo_box.list2.value;
- n& r6 E( `: Q0 M* Z6 |4 e& v }$ K* {/ Q7 ~, t' W+ z# p
if(val.charat(0)==","){" m+ V6 q, d/ i% u" d3 {
val=val.substr(1,val.length);( e( J- c6 s+ f' v; x# O
}
2 s& n2 F0 W/ d3 J) N# e" _5 z opener.form1.frecname.value=val;& _& g9 u- w8 b! U! f
self.close();( m C( d4 K1 I; }' ^0 M
}- P6 l; Q$ |! k
//-->0 ?$ n D4 z* E7 O0 G
</script>( L+ j: c8 e1 S& U
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
, m9 z+ L7 |9 X# F<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />/ b$ B# q$ V" Y- j# Y2 z5 [8 o
<%
. y, ?/ }6 N. t; ` ? cdatasource ds=new cdatasource(); //数据联结bean实例; g7 j/ _% x, b# k3 p h' M8 r' j6 o
java.sql.connection conn=ds.getconnection();
+ F) Q. X& m# H& k3 W5 A6 `0 [) j! N java.sql.statement stmt=null;
9 o6 }) \' ?, Q4 S* P: D0 ^ java.sql.resultset rs=null;
: Z! a8 V) J1 e8 q" m ?$ T3 X% C cdatacheck dc=new cdatacheck();4 {9 n; c3 R Y+ c% L) ?
%>) J! O1 [, G2 _6 Z' G$ f( B
<%) k0 [ V5 P8 k& |& k0 y
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";
6 P U8 a7 i3 T: X8 y. ?stmt=conn.createstatement();
6 N. k; A/ I8 Drs=stmt.executequery(sqlu);
* y# p1 R% q* R3 S5 j; g%>' K9 f0 @) K ^0 e/ F
<script language='javascript'>
2 D9 ~) G% D8 p& Harr = new array();4 H' F" H/ i' j; g* r0 P' s% i7 B
<% int temp=0;7 ^: b2 Z& k2 g3 A/ k; I8 b
while(rs.next())8 B5 p* m' B5 O' r) Z% G
{
/ C7 i* H z% U- W% C/ m%>
0 k) c% h- `3 x6 d# parr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
& Y! T, ]8 {3 m* M: L) j8 M<%
* S9 y2 d9 W" T7 T/ Q8 t% q" i+ a" Gtemp = temp + 1;0 s/ _9 e5 Q' S+ V% ]
}, Y; F! N: t# f0 L
%>
! Y2 s: i. H" v- I& L8 D8 \5 Ytemp=<%=temp%>;% y5 Q5 A+ Z) T
function changelocation(id){
5 @9 D/ |7 o0 d! e( z! ^0 @: hdocument.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 / ^% a: R8 _7 Q8 g! M
var i = 0; ! F0 P5 J- |4 p7 z( e- D& X2 b
document.combo_box.city.options[0]=new option('-------','');
3 t% _/ @8 a3 Y) f, E# zfor(i=0;i<temp;i++){ 2 C1 P; R, b9 ~* E( T5 R
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
( ?+ F5 [& m2 \! E; kdocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); . i" p4 h- u" J4 ^! v
}
) \9 i& X. E# R) H}
L+ A/ s. B3 n" \4 U3 _2 s1 [} 3 L/ \& b! y3 _3 }5 ^! a& v7 A
</script>
* L3 G% C3 S: z
. U7 o1 x' u2 B4 ?, c5 J4 W<form name="combo_box">
/ o$ r% ^+ o( y( w5 R<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
0 z x/ K/ B, b <tr height="24">; x/ i5 L% v3 h2 w& a
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
/ ]1 K4 o7 Y" x- S/ { <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
B& \+ E1 J$ Y9 O <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>/ p% h( D. [" Q
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
8 g* T! c3 e9 J* d0 T </tr>9 [) L5 @' L& U# G7 G
<tr>
6 _7 J+ N/ D( F# x4 c( }* u <td>
6 Z$ X7 u6 A0 U9 j* g <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
7 {3 g* n4 ~& v H; E% X <option value="0">请选择部门 ---></option>9 X8 B7 U& V1 q) [
<%
% @: e5 m& d4 }4 F% E* ~ string sqld="select * from tdept";0 }) ~8 S* j; V! W
stmt=conn.createstatement();; c! u. Q$ q }& B" ] X1 ~$ R- J4 {
rs=stmt.executequery(sqld);* ?% {. `' X8 i- r; F: t) U& ~2 Q
while(rs.next()) V ^, `7 E2 E3 \5 H4 x9 C; R: e
{
/ c f$ p5 X0 u' S, z%>
$ r8 o5 a" _4 E' i. y* E <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
9 y3 M& a. g+ Y1 L+ U<%
0 l8 T$ o# S( @& h0 [- x- w}# R2 ?9 l% R/ A& L/ n i
%>
, |/ b. s! T1 P7 H' ? </select>2 C8 c4 F7 M: J5 g
</td>
6 f O: _9 |" V `/ | <td>
) p- y+ H8 b$ w: s0 r8 C <select multiple id=city style="width:150;height:200" class="bgc">
- _. Q. m0 f1 f2 B </select>: H; Z( C/ M( C6 ~
</td>
* X: g% [8 Q; b _8 r6 \6 ?: a/ L <td nowrap align="center" class="bgc">' T! b8 I& |' S& |: `( [% E
<input type="button" value="<<" class="buttons">7 D$ ?' L R# r9 N
<input type="button" value=">>" class="buttons">
6 G% q: \* f- \0 s; C7 v8 \</td>
. \( V9 {; X' ?) P8 N <td>
3 |+ J; e0 A/ J5 ]" [7 j <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
4 N! M( h) `; p0 W2 R </select>
) `& y1 D9 x7 _+ b( j- d</td>6 x5 L( c& {8 e% X: s
</tr>) A O% r: m! w) [
<tr class="bgc"> & _4 L8 @$ e3 ^! \* x# _- G' N
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>7 z7 ^+ b+ k* h+ o& A
</tr>3 z( b1 V# p- t: y: U( U q
</table>! g5 @# |% ~- y: P6 m
</form>' M1 o( z; n8 q0 ]1 f
<script language="javascript">
1 r2 u) A$ J: p" s//人名移动 w# v. p U& X
function move(fbox, tbox) {! ^5 j4 g+ Y" J0 K
var arrfbox = new array();/ w/ h1 ~4 B# \$ F$ k
var arrtbox = new array();# J+ s, P3 [# x& l
var arrlookup = new array();
4 p# L1 w2 w |: u& D) U; | evar i;0 d9 u% {+ N0 K+ z$ J
for (i = 0; i < tbox.options.length; i++) {+ ^. X/ t& O" O1 f* u* c: I
arrlookup[tbox.options.text] = tbox.options.value;
: w& ?2 I1 |# R# X# n6 Iarrtbox = tbox.options.text;! C6 b1 j4 M" c8 {
}4 P: ]$ I! z1 m8 j) Z
var flength = 0;
r) }' H e4 _var tlength = arrtbox.length;
7 T. ^' |2 y" Ifor(i = 0; i < fbox.options.length; i++) {8 [0 F( J/ J, @" ], N
arrlookup[fbox.options.text] = fbox.options.value;
! } L: T3 N) [3 {. T: Oif (fbox.options.selected && fbox.options.value != "") {3 L+ L. H Z2 `& `% t+ N
arrtbox[tlength] = fbox.options.text;
3 K. J( w5 Y1 y" E$ L' w9 ytlength++;
, m9 A6 X+ e! Y( j+ U* W}
+ z3 R8 M3 H/ _5 @& E! Z* P4 t7 |else {
* W: x/ ~* V' v3 w+ Z" carrfbox[flength] = fbox.options.text;+ F$ S+ h# U' V, W" J# Z
flength++;0 m8 j- U) q% {9 y, c& [/ _. h B0 q
}9 ?. N7 q% D. A3 N' [
}" n, z8 l# z5 O) O* A! p
arrfbox.sort();
! q0 U: O: Y+ V2 w/ earrtbox.sort();, z& A* R9 A3 E4 U
' W2 c1 _2 P& Yfbox.length = 0;
5 q1 l/ r. b) u' X$ _: ~% p7 {tbox.length = 0;
3 R" f7 e [* W4 l* Y f' u$ C4 Kvar c;, Y1 j! M% B+ N' @3 r4 @; v
for(c = 0; c < arrfbox.length; c++) {" p/ k) D) d9 r1 B
var no = new option();
# B$ Y/ j& ^' @, Gno.value = arrlookup[arrfbox[c]];; a! z0 ~& {! T% h) ?0 l
no.text = arrfbox[c];
$ e9 H% |, A' W* G- g c$ Ufbox[c] = no;
) I2 j( [! E- ~}
5 o0 B2 F& B8 _3 o* r9 @9 efor(c = 0; c < arrtbox.length; c++) {
, F* |% r0 V7 Z% p! F' kvar no = new option();. a4 S) Q, a. V9 m7 Q* `+ k# R$ d6 H, {
no.value = arrlookup[arrtbox[c]];0 ~7 d" T# B! _; C
no.text = arrtbox[c];
8 l! N9 R x7 B* P6 q/ ?tbox[c] = no;
$ N; [$ @" H) y; o+ U0 z* I }
/ g2 z6 v, B6 W! U/ f}% z% `# i8 C- r
</script># ~; m& F8 N; C! a! i" k- ~
</body>! |( a) F: N3 I8 E/ r8 T# u
|
|