|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14479
- 金币
- 2525
- 威望
- 1647
- 贡献
- 1473
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
6 n# N- d5 @1 o, m* J; O c pageencoding="gb2312"
1 l/ x# B6 B: I- S# J3 s4 F0 _%>
; z C3 T8 ]4 L. `<style>! B$ }" ?5 E/ }; S3 S' \' G& W
.f9{ font-size:9pt; }+ K2 }; D4 r( m" f
.bgc{ background-color:#aecaf9; color: #0033ff }( ^( F" s7 ]# }) G6 @5 Z2 x
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
# C( x% h4 j N# x4 Q/ y6 z) \( J/ f border-bottom: solid 1px #4e7dc1;
8 u) ^, Z- v" y+ t& K, J7 I$ X: ` border-left: solid 1px #aecaf9;
Z: r7 E3 r, l1 A& x2 E8 z border-right: solid 1px #5679bd;0 V: f+ G2 q* v5 K$ m* C
padding:1px;) C$ Y+ c3 I; z( F
margin:0px;}2 w# r" L& ?# c; F4 z# j# M. }
</style>1 ^( Z" j* \" L3 Y4 T2 m0 v* P8 B8 \
<script language="javascript">) K) c( w; J G/ r, J- ^
<!--
2 b$ E% ~5 m) R3 h$ P0 gfunction rv()
3 i1 B- I) i3 D2 @/ v( q0 N{
" ]& z5 T/ p+ ^0 d' g var val="";
8 B3 N% m& v: K6 u for(i=0;i<combo_box.list2.length;i++){
( B F6 p2 U8 T$ E/ S val+=","+combo_box.list2.value;
3 b3 q% T: N1 Q8 J% P$ j9 g }
) w/ V) s2 z4 X% H) ]6 J if(val.charat(0)==","){
+ a- V& q- q1 r, J val=val.substr(1,val.length);
( s; F! R( p4 E' W; A }
2 D) s2 y! J" I5 N2 O& B, S9 E opener.form1.frecname.value=val;0 d% J) K+ y2 _9 h
self.close();
, c" B) J. F* m* z0 |}# X6 ?$ ~) Q% ~. q& d( V- K
//-->+ {4 t7 M8 r6 a1 f+ U" ^0 l7 c
</script>4 d U# L; N6 H4 ^) g
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
# ~$ c' S. `" x2 T# |' K4 x<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />- F& N( _# U8 _& s1 R
<% n9 i3 w& d, m( Y! D, q
cdatasource ds=new cdatasource(); //数据联结bean实例# p8 F* Z- k3 K. D
java.sql.connection conn=ds.getconnection();
* H& m7 `: I$ o% w: I java.sql.statement stmt=null;9 Z$ z9 k( o" M9 @/ ^; K4 U
java.sql.resultset rs=null;- S6 @; K6 `+ I, ?# g. W- v
cdatacheck dc=new cdatacheck();- A( l* ~4 L% n! M
%>
2 r! t( r4 G! |6 A<%
5 D% Q/ y9 x* f$ Pstring 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 p! f/ |+ G; R/ b) C0 J% E
stmt=conn.createstatement();; V! ] k& C, I: v- ^
rs=stmt.executequery(sqlu);4 g0 K/ A; P$ k8 g8 ]! i+ [
%>
; J% c* Q) u) q<script language='javascript'>- G8 L4 x" k) @8 E0 R% t* `- f
arr = new array();- ~1 R# i8 P- B8 y% B5 u
<% int temp=0;! X; d& t$ k% q4 ^% b
while(rs.next())* |) I( j* S& _" a
{; g0 t! u- y1 @3 ]- }1 ^5 S
%>
9 u& Z+ e3 K6 D5 B# R! x: \6 O; Q Jarr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
) M& V1 ]8 K$ P3 u1 Y7 `<%2 k: ^- D/ s: }0 W
temp = temp + 1;/ J# j; \/ ]$ b! }
} g1 b" }3 {5 R# o( \
%>
% a8 a4 C& _4 ^temp=<%=temp%>;
5 u+ E" J/ O' p1 dfunction changelocation(id){ 8 ^- k7 j6 l# q; O: Z
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 5 Z) E3 R( F/ x2 q8 y4 L& l+ E" V
var i = 0;
+ M7 k0 @3 c+ pdocument.combo_box.city.options[0]=new option('-------',''); $ P6 _# n8 E/ f; G! Z6 B
for(i=0;i<temp;i++){ 4 H4 a& C5 g$ h! |
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] 6 {4 Y; V; l3 g; b3 O' |5 G
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
# d9 [5 n7 j2 Z2 U) X6 g} # I% O$ Q/ J) c6 f
}
2 C# l' ?4 I: c: i} 5 p O- m" k0 v
</script>1 g* T) b9 r. s- p! n4 F" q
$ I I% W; l* H7 P' \2 p<form name="combo_box">1 d5 P& ] ?/ O$ o* K0 Z/ P d
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">7 Z, y/ M+ |/ j4 q
<tr height="24">% i& x+ S$ K5 k% f8 v5 ~! r) I7 y
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>5 z2 D/ t% q y
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
7 F$ b) i& ?, T9 [$ `/ \9 B7 H <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>$ T7 I7 [; A9 ]) _- b' Y/ y1 E
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
% b) j' K4 X! _( J </tr> Q0 f0 |, o% h. \' m/ I
<tr> 0 j T4 a- S0 E5 U
<td>9 {( W- ^% w3 g! F" E* B
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
+ I- R; K& V1 K$ y( a2 Y$ o$ _% B <option value="0">请选择部门 ---></option>
+ h1 ~" i9 ^7 n8 B<%
: e9 H3 L0 w- N3 Y0 O y, R string sqld="select * from tdept"; D- t f$ ?5 \7 j' L! W- ~
stmt=conn.createstatement();" L$ _& Y: `" b! _
rs=stmt.executequery(sqld);( i$ Z. N6 j3 b# k9 }- b
while(rs.next())) N6 ^ |* k0 y6 b! W$ ?
{
; }; H4 R+ [6 u k# n* U$ @%>& x( N7 t5 Y) Y: d) k( l( H
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>3 p+ k2 j5 v0 x+ E
<%. q1 P. D$ `( P' H
}
0 u" K0 B; I6 n" A%> % C% s, J# P1 o5 y: |
</select>
7 y0 R8 p+ I/ m1 C' b1 Y</td>
; h7 s4 Z) D2 B% Y" ~2 o <td>
1 V8 a. ~, j+ l$ i. M. I <select multiple id=city style="width:150;height:200" class="bgc">
5 n! ~7 G9 ~: E9 g </select>) D$ N" y. j0 F" t U* `
</td>' j" R* u: @3 e3 k5 M% `, u
<td nowrap align="center" class="bgc">
+ z7 D K( |, k <input type="button" value="<<" class="buttons">- O3 ]) l6 D; W' ]& b$ \
<input type="button" value=">>" class="buttons">: m8 G: r, s* j4 v' b
</td>
* Y7 _! W+ f( Z' S1 c B <td>, l8 Z& U2 S# z( p
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">& [+ w$ [% e: }" F" l2 ?) K
</select>6 w! A7 ]. y* Y+ Z6 ?+ M
</td>
1 T! q0 z' c1 o4 _. h </tr>/ }' r% G8 k" m, P& }
<tr class="bgc">
7 P& U. U' d$ L: }- X <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>
# x7 a0 W9 s- p+ a% T/ Q </tr># F/ b+ z% a1 ]& I
</table>1 f, V' q& W! S( {7 x4 @
</form>$ V( G$ s; C9 c' W0 U( y
<script language="javascript">- @2 ? S0 F7 w
//人名移动1 q9 x) }* B' ]/ W" ^4 r: d+ D
function move(fbox, tbox) {
& M; ?8 `: u# W: R1 kvar arrfbox = new array();) c2 M4 X+ E* ^! F# M( t' y* c1 {
var arrtbox = new array();- Y* o9 Q2 {6 j( t# E" S" r
var arrlookup = new array();
) t: X! E6 g5 y+ N9 N9 wvar i;
0 K0 |; E/ W5 [' A. X6 `9 j8 ?for (i = 0; i < tbox.options.length; i++) {
5 [4 k1 p9 r2 d jarrlookup[tbox.options.text] = tbox.options.value;
2 c( u$ S4 E$ W4 ?& p( `arrtbox = tbox.options.text;
8 X( I# r: E, N; Q8 _) P}, y: M; [3 K' f2 L
var flength = 0;
/ m! K1 Y- j+ p+ |3 uvar tlength = arrtbox.length;
# [% A$ P( Y/ rfor(i = 0; i < fbox.options.length; i++) {) v2 n- v. S: Q, ]
arrlookup[fbox.options.text] = fbox.options.value;! q: Y$ I2 Q7 q7 s/ X6 m4 A
if (fbox.options.selected && fbox.options.value != "") {+ T* N2 R8 {0 y' l9 X8 r
arrtbox[tlength] = fbox.options.text;
( H2 T% [0 _% y. A7 E( A/ E, X% ~tlength++;) U1 V# {( R7 N8 a
}; A8 g* X4 ]# ]% K1 F9 g% ?) B
else {
# k0 i. I& g: }4 q- h$ [arrfbox[flength] = fbox.options.text;1 |. |4 U: N: j/ g: X% w
flength++;
& Q$ w8 Y( B U& W6 e# ]( P; Y }: E; V* {6 H/ K r
}- ^- K' d* {/ f& A7 F5 ?
arrfbox.sort();3 o2 @, h7 c6 d
arrtbox.sort(); K! ?6 Y% F$ W! l) A& g @
; I& b r7 E5 U! {, Yfbox.length = 0;6 N$ R1 U: m7 Y' M- Z* S
tbox.length = 0;$ X$ |" k8 R5 U3 C
var c;5 i+ _4 k" }, `* @6 E, _1 `
for(c = 0; c < arrfbox.length; c++) {
) j9 x* f# q# F+ r+ Y/ F: Jvar no = new option(); T- s/ k$ p! l" y% i! ~9 N
no.value = arrlookup[arrfbox[c]];
/ f" {- \$ }2 D8 Sno.text = arrfbox[c];
5 X% Z( v- B# ^8 _fbox[c] = no;
8 @$ T; P: T* \1 Y0 j- y8 G}2 P$ s0 n2 Y( r1 b$ @9 E2 C
for(c = 0; c < arrtbox.length; c++) {' ?. [9 T& d9 ?# }( e- C
var no = new option();
1 O. c" R1 x% e: j7 Cno.value = arrlookup[arrtbox[c]];% J3 i; b; Z1 `7 b4 ]
no.text = arrtbox[c];; A5 E# l o* W- d# D
tbox[c] = no;
9 g* o- ~; z* X! W+ c1 |% i }
6 i) Q' s' q, m}
. w/ Z3 w) p' g9 M. K& a</script>" S }7 M8 e4 {* P
</body>- N- J+ b7 F n' a6 z* H
|
|