  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14153
- 金币
- 2367
- 威望
- 1647
- 贡献
- 1315
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"5 }0 b- }8 o7 o5 x' m& x
c pageencoding="gb2312"# A2 D5 t8 l6 r) u3 @5 i2 ^5 v
%>
" D- X+ Z% [" E<style>
; p+ p. ^) \8 `; K/ W+ L.f9{ font-size:9pt; }9 s1 x! d* z. k4 P; H6 M' U
.bgc{ background-color:#aecaf9; color: #0033ff }
) u" U, Y2 d" Q0 G8 R2 B m.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;. u- R2 {: _8 M4 w
border-bottom: solid 1px #4e7dc1;# d- ~1 j+ G! P! V4 T
border-left: solid 1px #aecaf9;! _3 w) [& V( Y6 |& M3 v
border-right: solid 1px #5679bd;- R6 r+ Q' c _. H! z
padding:1px;
* F6 d' `3 K& ?' k2 s margin:0px;}" C9 c& Q6 ~% E# A) J5 p
</style> S5 T) ]5 m9 |* q* s
<script language="javascript">" N4 m# o! [, \9 X' Z; ^
<!-- q' @% x! O- P
function rv()% B% w8 h8 b7 p' |0 Y
{$ H5 [, A) `/ ]0 \, {
var val="";4 M2 j' P/ J! H/ Q/ k, A
for(i=0;i<combo_box.list2.length;i++){
7 n) I1 M M& L. h/ ~) s: H val+=","+combo_box.list2.value;
8 c3 K8 V% h9 ~5 [ }
# G% k0 ]: x/ {# [ if(val.charat(0)==","){
. U$ f9 I. Q$ X0 J2 \- i9 z+ J val=val.substr(1,val.length);
* H1 l, W0 {1 O1 u: N4 ? }5 L i' m( e/ Z6 `9 `/ U6 o( A
opener.form1.frecname.value=val;* v2 d( U; z7 |5 E: T# q) T
self.close();: I: [: i7 j% w0 X; E2 {
}
( J( ^' S3 Z3 a" T% u5 Q0 o5 O//-->9 S7 ~) o1 k( u( p2 A0 e
</script>' Z$ _8 Y+ q7 l: j
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
4 G) {! z X2 ~+ t' s( Q<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />9 q8 B8 V. X+ } h2 v
<%2 |# A. Q, \( Q* ?' P {. `4 Y
cdatasource ds=new cdatasource(); //数据联结bean实例
2 w# Q+ P) B6 s1 } java.sql.connection conn=ds.getconnection();# q. {" p: f" E! } c- k# A
java.sql.statement stmt=null; t& M5 Z, B; o' m8 [
java.sql.resultset rs=null;- R/ i" T, _2 Y( n7 y
cdatacheck dc=new cdatacheck();
+ f) i D' ?/ K Y F- R& M* o% o# ]%>: R- F7 s6 C, @3 p- z9 A
<%
[& {9 p1 ?9 |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";% v o( @! j' N. `
stmt=conn.createstatement();
F: j8 s0 q8 ~, Trs=stmt.executequery(sqlu);5 T3 K' O. ?" r
%>0 D; o1 z; M& d2 ^) v
<script language='javascript'>
; N9 {/ z/ v) e# tarr = new array();
6 s- M$ H3 S! F3 P+ ?( k<% int temp=0;
" G4 d W. S* q" X& k5 q; Iwhile(rs.next())
! I+ W# C) h" j `: m# L{0 j8 c" w. s' ~0 I b
%>
z: v! G7 e2 x* ?5 K& Harr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");1 X5 {/ Q8 r# |' |# C
<%
/ L. ~8 f7 k8 t: Ytemp = temp + 1;
3 E6 Z3 b, S- u}
# m6 @ p- z' ?' w+ N, e; X%>
% I) A# \0 Z4 }temp=<%=temp%>;1 N3 K1 ~6 F1 h5 I4 A8 T' H+ q! g
function changelocation(id){
' ?) }/ c) R. v9 f2 J5 b0 h/ Wdocument.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 ) y4 K! g# T# X3 Q5 N
var i = 0; . z8 i& m. E: y; l# g
document.combo_box.city.options[0]=new option('-------','');
' [2 }2 ^0 j' ^4 Y/ n: Jfor(i=0;i<temp;i++){ 5 P8 V5 p8 U& y+ O$ s4 k
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
+ g8 n, }/ B& F$ D, jdocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); " c7 }! I! d- K6 U
} 8 l T* j, k X; O# e$ u
} 9 O& [) R9 `; d
} - P8 c9 D3 A/ g& v9 S( s& M) A8 F
</script>
) `* P/ ^' J' X! W/ _$ `' [
4 W1 N! h& M4 k$ W8 @9 p<form name="combo_box">0 J# b; v0 H& j/ R1 S& ^
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">" \6 i- i6 w6 p" }7 o9 ?+ |
<tr height="24">$ {) ?5 U; z* h
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>. v4 q. B9 \' m6 d/ c6 S5 {6 r
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
v2 v1 q9 b" P1 o \ <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>: S) V" W2 e9 J; J1 x, g6 x1 _
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
# n/ h5 y5 \4 q& S0 C Q </tr>
% m4 K& V) N* r: e4 F <tr>
# r7 Z1 g' m5 x `! P- ] <td>' N4 n- [ p6 k# P" r5 R# S( w3 ]
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">; K* k. z8 e& I7 z/ m7 a
<option value="0">请选择部门 ---></option>
P4 m. t9 L2 r<%. b+ N/ R7 r, v6 |; R+ V5 F
string sqld="select * from tdept";
8 c; a, a; w/ Z$ ~2 hstmt=conn.createstatement();
! H1 M1 a; b+ w1 ^rs=stmt.executequery(sqld);
/ ]4 |- L ]1 t1 h7 m, Pwhile(rs.next()). s! q W( z: V! s
{
+ J3 f8 f7 a3 x%>6 d& ~7 W+ m& T
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
; E8 U" n b- ?) N7 t<%! `/ b( O l/ ^- H5 {
}' c9 m% ~. W( [
%> : r. A! e( B# \8 S: s
</select>
) C; ~$ r$ q& i. l0 e</td>
/ h! {+ {- M$ m# H <td>
0 j$ t/ y% \8 ]$ y <select multiple id=city style="width:150;height:200" class="bgc">1 U! g. n9 ?& D: M
</select>0 F+ I# L& R: q4 S; t. r
</td>7 a: L, O. L5 a) |% }% A& u
<td nowrap align="center" class="bgc">3 Q" F g7 c9 e# @, c' l
<input type="button" value="<<" class="buttons">; k! s) S, i# u, g1 P4 J
<input type="button" value=">>" class="buttons">
4 U0 N' h5 |% z3 P0 q</td>
1 ? u- p4 \8 k- W <td>
3 w2 d' X- A2 r5 C, b <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">* K" K1 b0 ]# j# g# V
</select>
8 M+ h5 O! \; p, ]4 Q! t p% t1 p; f</td>
4 {- e; C0 b+ ]; b8 G </tr>8 L0 M; ]9 D% P+ f
<tr class="bgc">
' _1 v% k* i% c0 [0 A <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>1 p- b" |3 a/ D4 ^ {4 P
</tr>
5 n9 n: j2 U4 Q8 S$ G5 D Z3 j</table>
% ^1 q4 z4 e; {; P6 _( f</form>
) @% u. m5 h. F+ K4 N4 R, i<script language="javascript">
) v" O- l0 Q8 G/ q8 x. `% q! n//人名移动
0 u, I7 i2 V) T i' Ofunction move(fbox, tbox) {
/ n# e# m' C4 p' z4 c, Rvar arrfbox = new array();
# N* ^& }! I# V( {var arrtbox = new array();
9 G/ ~. k }8 m+ J3 Nvar arrlookup = new array();
, j5 U7 S# Q& k. o) b# [% qvar i;
8 C H& K C9 `( D& P( m. hfor (i = 0; i < tbox.options.length; i++) {) J; P( Q4 @7 A: y! B$ v3 I# ^
arrlookup[tbox.options.text] = tbox.options.value;
1 W) ~$ m+ S( y- i% l9 m+ C: t: parrtbox = tbox.options.text;
! [. z: R8 J( ~}1 C/ C6 G7 _( |9 n" {; q
var flength = 0;% g3 L& y1 e6 Z0 ?. A8 c: k* t5 P
var tlength = arrtbox.length;
$ D$ q' G1 X2 ^1 m' ~$ o: V; _" Xfor(i = 0; i < fbox.options.length; i++) {
6 ^. I2 V0 _! h! Rarrlookup[fbox.options.text] = fbox.options.value;
* a# j$ V9 {: B4 }1 A7 }3 K& Cif (fbox.options.selected && fbox.options.value != "") {9 n# y( |" B' y4 P# E: q" d# S1 L
arrtbox[tlength] = fbox.options.text;
( D1 {0 f$ A$ qtlength++;
% U) V1 p3 T+ P4 n% P& D}$ n7 V, L8 Q* J% z1 F
else {) `+ |5 l- Q( t0 `2 U
arrfbox[flength] = fbox.options.text;
" F! F# @1 [# ?1 x" ?" ?$ }flength++;
- E2 @* H4 Y6 m( T" n x: a }# B+ f- @# O& g
}; H7 z4 R. `/ X( X; f
arrfbox.sort();
3 ^+ m, L, h, Xarrtbox.sort();
: p, J0 J0 U+ A2 `, a }: G5 ^, y
) b8 b8 E* m( h/ r$ Ufbox.length = 0;
" Y% v8 y+ D. Y' o8 mtbox.length = 0;
( k+ f/ T# v/ S, ^2 ?# Yvar c;
6 M6 y9 o/ c$ J) n) s6 }, Hfor(c = 0; c < arrfbox.length; c++) {1 A( r5 ? z, N# |
var no = new option();
( a. p Q+ q/ L% u! \9 I5 ]no.value = arrlookup[arrfbox[c]]; g* q6 ?* R3 w+ c, B8 ^
no.text = arrfbox[c];" f/ `, W9 {: n% b/ N6 g
fbox[c] = no;/ j4 |' n4 x9 Y+ \0 v. p- \# O
}& n E; g" U' i, k5 P1 O6 |
for(c = 0; c < arrtbox.length; c++) {. o b& K/ u3 k/ w& i
var no = new option();& w; ?. l( n) X+ u) c( f$ E
no.value = arrlookup[arrtbox[c]];
* e0 v7 \2 I K2 D! L( bno.text = arrtbox[c];: N: T8 P8 v O) v+ c W; D
tbox[c] = no;" i+ v; B; f2 j3 h Z
}: G" h$ X' ~8 {
}
, j. {4 N% B: n) ]! c</script>
5 [- H7 h) C, u) y0 q2 v</body>
$ @. \$ a1 O5 @0 h |
|