|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14443
- 金币
- 2507
- 威望
- 1647
- 贡献
- 1455
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
5 P6 B) r% r3 L8 D9 U c pageencoding="gb2312"
: @- y$ Q- D n& ]%>3 g; c/ n3 Q$ [* f' n
<style>- l; ~+ a$ j/ z- o6 |4 ]- R8 p# k
.f9{ font-size:9pt; }5 w5 B. }: H( D' [- V
.bgc{ background-color:#aecaf9; color: #0033ff }
! J7 ^8 l/ |/ M5 \.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
$ y$ W8 Y5 G: j" h3 P" R- [ border-bottom: solid 1px #4e7dc1;: W) H8 k. K" {/ \, L
border-left: solid 1px #aecaf9;; S2 G% k1 b' m# X7 h+ b
border-right: solid 1px #5679bd;
" A# z: s- i+ C; Z4 ]( G2 j padding:1px;7 \& D4 i: t) B3 U1 G
margin:0px;}
5 ^: l; Y) F5 T# G/ S</style>
" u+ F5 |8 z7 Y0 D+ H$ A<script language="javascript">
8 v0 F" }$ g( I+ l2 D2 x<!--
4 w4 m* ^8 V' k4 y) qfunction rv()' h3 x# r7 V9 t6 p' t2 _
{: l6 M f3 }8 g# n; w+ f) ]# `7 E
var val="";2 G* Y+ K. A4 Y5 v5 R3 |( I$ ^% W4 \
for(i=0;i<combo_box.list2.length;i++){
0 \: U! ~1 l* ?: F: O( } val+=","+combo_box.list2.value;' A! ^( N* l& S# E' E
}2 Q4 Y4 T" j9 l- d
if(val.charat(0)==","){
( r4 ?' h1 F: d$ [+ n( s1 [3 M val=val.substr(1,val.length);' l9 C% S! N, |' d7 X* q
}
$ `! R9 j4 b3 l opener.form1.frecname.value=val;
6 E8 J# r; O' K4 V self.close();7 G& [' c# u/ M( @ h$ L
}( p* A) q; f& P: G' B5 w; r7 s
//-->- M Q; l6 H/ ?5 y% A( g
</script>
6 \2 W3 e. f( p<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
& y0 T3 h( I% }+ H+ R<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
) `& [+ h$ S3 c) [8 X<%
5 ~1 m" Q2 v j) c6 n cdatasource ds=new cdatasource(); //数据联结bean实例
, q& D9 v) Q6 f, }1 K5 j java.sql.connection conn=ds.getconnection();
! ]% _2 T5 J0 t& ~ java.sql.statement stmt=null;
! e4 a6 u& a! | java.sql.resultset rs=null;
8 I5 F5 E& `* p% {8 ^; g* D' A7 ^ cdatacheck dc=new cdatacheck();
! ^5 ~% S2 T9 t3 B# L%>+ t2 X; g" I. f2 U! I: K
<%
5 m+ P# a. G, kstring 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";
5 |9 A9 i& k( `6 ?) l3 k# k2 Jstmt=conn.createstatement();: J0 |& s' p' v% x; ~+ g
rs=stmt.executequery(sqlu);" B. M2 e; r% @8 c# h6 X1 C
%>
. R9 q: p0 R- W+ L* b<script language='javascript'>
" T# C. m! V. S- I4 T3 l3 m/ Parr = new array();( M: j6 G9 o% y4 H# ]6 e
<% int temp=0;, A- Q8 ^! | e% s2 G; P9 N
while(rs.next())2 T- I+ l& B5 V# g
{. q7 m$ E' [$ }3 k5 `7 P; l4 @
%>8 L; X. l. U# c2 I. p& R8 I+ [
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");) c; {+ `( s1 e* o1 [
<%
" G; o \. Z. P5 ?$ c+ [8 ~temp = temp + 1;1 |/ o( |9 p% o* ?8 b' U4 f0 L
}
' ]/ {* O f( V6 ~& \7 x%>
0 y* N% J. H; Ltemp=<%=temp%>;
1 Y1 E* d0 |% a# c7 J* }function changelocation(id){ ( u2 Y4 D- M1 P2 t4 \; A
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
/ C2 N: M t; c, X9 w$ Nvar i = 0;
L* A: ^0 O* `0 @: m' E5 ]" ndocument.combo_box.city.options[0]=new option('-------','');
" y/ t: W/ ]. U# E: ]/ qfor(i=0;i<temp;i++){ 9 o( ~: {9 n, i5 Z/ N
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
" f( `* M3 U5 f- P/ n1 D7 t `document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
. v1 k% P& z- m$ h' L}
( ^3 b, F3 ?! n' T6 c2 p* X6 L/ l z}
8 ]4 S0 k8 k5 e; Q} " B% V$ f9 e' ]0 e
</script>
' w, `- P( V0 [" r! y3 S. l0 y, }( w! X5 q' }! v' `. m
<form name="combo_box">. Y2 s6 D) W: c+ O' i4 S- ~- f+ z' z" H
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
( e- b- j* L( R6 j# D1 z <tr height="24">
4 n% g3 ]( r, ]6 Q; D' M <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>2 P$ @9 \; u, O: j& S
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
% t0 s0 X |7 B4 ]* p* @ <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
* u: r3 z7 I* D; Q% F <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td># Q1 K/ r1 f c; a0 k/ E' O$ b3 v( o# ?7 n
</tr>) k1 A$ S8 g7 d! f
<tr> ( q! O- E' b1 k6 W! x7 I
<td>
; L0 p' F2 c- ?6 f/ B5 C8 g <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">" Z9 ]0 _& r/ p
<option value="0">请选择部门 ---></option>. D( F' r+ a9 d$ g. D2 p
<%) D2 g: W3 D5 C+ y9 \% K
string sqld="select * from tdept";: g7 Y9 T1 J4 Z5 Z- s
stmt=conn.createstatement();, Z; }" X! b+ N- F( a
rs=stmt.executequery(sqld);5 n3 k+ @6 u/ K( d
while(rs.next())
$ X- ^% Q! h1 v) J- d' q{
9 P- V6 u) [2 W%>
5 P, u( h% K( ?2 i0 {# }- U7 R* r <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>' @+ C8 l! E; p# {8 }) b0 G+ `
<%1 K6 ~% ? {2 ~# G- o* @
}
$ J5 U% h8 g6 D. E+ [9 z%>
$ `6 T2 d8 Z( [' O5 E5 S </select>
& i ~: H# T7 B* s- ]; u- L* U</td>
6 ?' {' T9 z3 }1 v1 {; J4 b; c <td>+ Q% O$ P* {( X ^- L
<select multiple id=city style="width:150;height:200" class="bgc">
& M1 p, a5 K8 R; D" b </select>
/ A; ?/ f1 X0 | p</td>
5 H3 @6 F( M! }3 ` <td nowrap align="center" class="bgc">
8 |) h# [1 P2 p <input type="button" value="<<" class="buttons">
' o( \. a3 K" x% \8 s <input type="button" value=">>" class="buttons">- M1 X- k0 s) ^( u# K
</td>
: u, z, k r h) i- Z <td># [- \2 a) t% {6 o+ q
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">3 E6 a I9 M0 ^
</select>/ `7 t. I/ R' t( r i2 }
</td>
% k2 |: h8 M3 _6 o* X: q, c </tr>- T. C# C! E# `+ }% e1 O% G: P
<tr class="bgc">
% x; N3 T& j5 w; |; s0 z6 V# Q8 J <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>
1 |3 V# t: G0 ~8 {+ U5 h0 M </tr>
* q0 G( V2 r1 g+ `* M* H</table>
+ y1 D4 T) U0 o8 A& I# Z3 K</form>1 K. Q: B& M, c# T8 s
<script language="javascript">
% M3 _4 B% R4 Z/ S* K! W//人名移动. v7 F V8 I0 \: \ Q
function move(fbox, tbox) {
9 Z/ ]. h0 _+ ?. h7 o1 Tvar arrfbox = new array();( a+ b/ g# x! X5 E; a3 S8 x% c
var arrtbox = new array();+ B6 I4 E0 A7 e! i2 }) w; |( t
var arrlookup = new array();2 ~7 N+ `- v. d; |) T; A# [2 b# w9 H
var i;
4 w! \& U: d- ~* tfor (i = 0; i < tbox.options.length; i++) {
3 `( n: e$ l' D: @4 X" Narrlookup[tbox.options.text] = tbox.options.value;6 ~' \8 A! Y7 D; b: _) R
arrtbox = tbox.options.text;
0 j$ w7 X/ A+ y/ k6 B# e}
" U$ p- R. y z, k# evar flength = 0;* G: `& e; L& q. p' a& E
var tlength = arrtbox.length;
* x+ m8 q& E6 T y" z! Jfor(i = 0; i < fbox.options.length; i++) {* _. h; Q& Q% W1 r
arrlookup[fbox.options.text] = fbox.options.value;/ W$ m3 w' I. O% u# R' V$ [: O8 d% W4 j
if (fbox.options.selected && fbox.options.value != "") {
: _0 E3 T: @* T/ t8 z* q j7 darrtbox[tlength] = fbox.options.text;, [9 v: v+ s9 K
tlength++;
6 j# x# C6 B' g}
! h! y" v4 i; `) w5 L: P& @6 aelse {
7 e) x, f1 K2 @arrfbox[flength] = fbox.options.text;. H2 c7 m& J' A) ^
flength++;0 E# e4 k* x; X
}. P, x" _. V8 g z9 ~& x* k
}+ E8 {- F; C- |* Q7 v
arrfbox.sort();. c9 I: u0 G$ u3 b4 H
arrtbox.sort();- ?3 |3 k7 Z& V
/ J) g: U: F4 L4 j6 S- W1 N5 Qfbox.length = 0;
! u$ r, T' T% P- R; f( Vtbox.length = 0;, g, L5 O+ U6 d1 M
var c;3 l- o7 V- ^ A( d5 Q" t; e3 ~
for(c = 0; c < arrfbox.length; c++) {( _4 Z6 f& M' V$ c- ?' [& ~5 x
var no = new option();" a t* P. ^ A- t% F& n+ n
no.value = arrlookup[arrfbox[c]];; I! w% _4 s+ B+ A0 @* C; S0 W9 G
no.text = arrfbox[c];4 d$ A- v" |. r8 T6 @% C6 m# F
fbox[c] = no;# o' N2 v$ u9 y( g
}
7 M4 x s! f+ ~$ R* d7 T" A/ z; \for(c = 0; c < arrtbox.length; c++) {% c4 J+ m! ^$ ?' D# T/ v3 k
var no = new option();0 I) V0 J1 m! A6 r: _0 c" E, _6 S
no.value = arrlookup[arrtbox[c]];
$ c/ h& f k* ?. a5 d/ n0 Hno.text = arrtbox[c];) u- R$ c: {! X1 t. o
tbox[c] = no;
6 K" m* b9 _: B) z: G \, N }
* l4 \% |9 K. Y' f- |) H4 J( t}
: E" A7 C `2 u6 v</script>3 f4 \" c" {$ o r8 d" i
</body>; ~- D/ n2 E" i/ a. z
|
|