|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14391
- 金币
- 2481
- 威望
- 1647
- 贡献
- 1429
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;", {1 `' ~$ ]- S9 e
c pageencoding="gb2312"
2 ~0 w; `3 i0 f5 z# Q3 o/ ^) P6 k4 W%>
1 {& ?6 v7 `$ h1 \+ {- \5 h1 z; G<style>
& _; v: v& t' A( d; y' {.f9{ font-size:9pt; }) J' Z+ Y3 {" W U
.bgc{ background-color:#aecaf9; color: #0033ff }. ]% Y) G. K' o) {2 k( z% B
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;/ D, K3 P" ^. `5 X
border-bottom: solid 1px #4e7dc1;
9 z% e1 E+ K% v- u& F( y" J3 w border-left: solid 1px #aecaf9;4 \, e/ Y, i6 N2 ?8 a* ^) a# e! K# F5 Q
border-right: solid 1px #5679bd;
/ J. F8 h2 a% I3 U+ j padding:1px;* _$ B3 l: n$ ~* L, v1 s
margin:0px;}
) ^4 N: c# @( ^4 x. F% E0 K: o</style>2 \8 @' g7 K) t9 S# E- @ u1 P
<script language="javascript">
% a% a- A' j% W<!--" `8 i f/ J8 G: f4 w& I& B
function rv()
4 C& S# x9 h4 Q1 B# k0 ?{
1 M) M& l r6 e) f var val="";7 q' ~+ L1 X9 [
for(i=0;i<combo_box.list2.length;i++){) V4 j* T* r# p8 H
val+=","+combo_box.list2.value;
# q8 ~9 Z, S3 O; n+ K" ? }
6 a- K' U5 I3 r1 {' z+ Y& {' e- |; ~ if(val.charat(0)==","){
5 S6 j1 \2 j7 i0 H0 Q5 ` val=val.substr(1,val.length);& z* P3 u5 l& q9 a _, s
}1 p, _2 }4 d [! y
opener.form1.frecname.value=val;) p! u- w! q, F$ n2 L8 R* z
self.close();
" @4 O( ~ q7 f+ `' O2 `# O1 U}
6 @% I& _. |+ s! \//-->
# s+ i! l$ N$ ~) k7 z</script>
. y2 s* a8 K" L) @4 G" H5 p<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
1 c. { c( ~3 f; _* D* H: s% t, O<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
$ _) W0 b/ J8 _8 ^/ c<%3 b: V0 U8 L+ n' k6 A
cdatasource ds=new cdatasource(); //数据联结bean实例' w; v5 Y4 p3 D# X3 Z4 n
java.sql.connection conn=ds.getconnection();
: x( |* ~- e' I, r- g java.sql.statement stmt=null;
+ x8 H( X) e9 W2 G$ p' B8 q java.sql.resultset rs=null;% Z3 d1 `! {5 S8 S- |7 i
cdatacheck dc=new cdatacheck();
" L) T- Y5 K( o; b%>. W/ z! X' {$ a
<%
$ r$ V. \* x7 g4 q" \& Astring 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 r; j \3 x4 Z$ M# {stmt=conn.createstatement();
1 D3 S ?) b/ w `rs=stmt.executequery(sqlu);9 y* W! ^9 L2 [" \$ Y
%>
& J4 M/ Q$ q' }1 n<script language='javascript'>8 e+ X2 w1 [& O5 W' B% }- O
arr = new array();8 Y# y: ~3 C& Q/ b8 _7 ^
<% int temp=0;
5 B: @8 P0 ?& W/ @$ g, \while(rs.next())
8 Y g" E# S) L0 m/ |8 D" V1 L{! K$ d1 g+ G e9 ]& y
%>
q' c6 o. _, Z% F- ~1 J+ h6 `arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
2 K* V Z; _3 a" _6 r4 Y<%% J0 g) B* i) A [! Y$ Q
temp = temp + 1;) O$ Q! l7 Y9 t& @ j/ Z) G
}
" O' u" h7 C; w1 D: R%># P+ Y. r) T1 m
temp=<%=temp%>;
" l4 r$ ^: h) Y* Z- Zfunction changelocation(id){
! {4 `8 ~+ d; f5 Idocument.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 + B F9 f, ^0 }' S6 q' P
var i = 0; ; @; K! z' {/ U* \: H
document.combo_box.city.options[0]=new option('-------',''); ( n" s' Z# f* O& R/ A( x6 T$ l( c
for(i=0;i<temp;i++){ ) C7 N$ p. Y( }3 w
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
9 E r/ b7 A& g" x3 P* [/ jdocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); ) e! {" E: O/ [$ `9 c
}
; |, `" r7 L Q}
4 C9 E6 v1 y! g2 `0 d- `+ u2 u& }}
- t+ w% h" Z0 a1 o+ \</script>, `4 F( @1 E% Q0 ?; }1 x; U7 s
5 j. ^' E8 p: k! S- i9 S. l<form name="combo_box">
; `6 J" A* v# Z" J9 ^<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">) c; o7 ?# `; u# H2 Q! w0 O6 L* Z
<tr height="24">2 A6 F) L7 u9 o4 J6 s3 x3 }% O: S* R8 r
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
; ~1 } e5 b' n/ L$ o8 D <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
# O) @( ?7 e( }* | <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>+ n2 B/ c* S3 k% }2 g) x! S
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>& t, r$ p( D7 e$ p% E
</tr>% u: C3 w5 z" D# D, _3 \$ K3 g, F
<tr>
7 s- Z+ h$ Z9 T: b) [7 X <td>; P+ L/ c6 ^% j$ M
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">. T7 B$ l- _7 ]7 I0 D E
<option value="0">请选择部门 ---></option>: e# t4 x2 h* y$ x
<%
& E4 U: X T# T string sqld="select * from tdept";
5 M) y$ s9 o6 c5 [ F3 b; L4 Cstmt=conn.createstatement();
) r3 T& b3 s9 D0 D* Drs=stmt.executequery(sqld);2 U3 k/ I5 r. G1 {: t; K
while(rs.next())
2 m$ I& e, ` S0 h8 a5 S4 f{' ~0 V( w$ @3 s
%>
3 S( v/ _0 ~ ?. N( X( _7 q <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>5 d3 h- |5 \ `) c$ G: `3 e
<%
" w" T! h, F, E& Q}
0 m; F, R9 D4 f. @& P%> ) | D3 h/ `! u1 E0 o' ^7 Z) Y
</select>
& `* C8 L2 u3 u/ t7 J; h</td> Q1 |3 V" u- [4 M" c6 `+ P* k1 {
<td>9 M! r9 |8 T1 t9 ]
<select multiple id=city style="width:150;height:200" class="bgc">
: }3 G8 F$ e7 [8 r; a6 u </select>1 m9 E0 t4 o0 \
</td>
/ d$ x( G0 z: z3 u0 v. F <td nowrap align="center" class="bgc">
+ @+ [/ `- P* T! v0 T) g) K6 O <input type="button" value="<<" class="buttons">
$ g$ ?; T( m0 x <input type="button" value=">>" class="buttons">
* {4 K3 f- t) T4 q) w0 A0 P</td>/ v8 ^. g' `: f' v" [! l
<td>
5 g. n9 d, _; e* |4 t* H3 ?: ^( B6 Y <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
; V# M U2 w" ]' |) _: N </select>! r. ?* ?. u1 S+ A2 l6 l3 {( c
</td>
' Y5 O5 V1 e' ?" W) z. Y" Q1 M </tr>
' S& }5 v. v* ]9 c <tr class="bgc"> e9 V1 ?$ N! V& m; C2 |# [0 M4 r
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>8 s% E# k' z+ F7 l r
</tr>' y5 c% N0 H6 w$ R% r
</table>, ^/ Z+ a1 E, A/ m4 ~
</form>
+ ]8 b: e5 @. H) H<script language="javascript">
5 k, ^, Y# e2 b+ q6 h//人名移动
; K8 T, J5 g. }" k. zfunction move(fbox, tbox) {( T1 _( z# ~2 Q0 {# Y' S% G
var arrfbox = new array();( u6 J- ?' J- h/ c8 H/ ~
var arrtbox = new array();4 Q2 B: }/ H- l1 h& E
var arrlookup = new array();& P) U: i/ }7 H/ X
var i;
: V$ a1 X* J1 V$ Bfor (i = 0; i < tbox.options.length; i++) {
& D4 ~9 a4 ?9 s" B0 o+ Oarrlookup[tbox.options.text] = tbox.options.value; t% ~+ Q, M- B: \1 [, k# i
arrtbox = tbox.options.text;
7 t8 v- ^& W( O; \}9 Z& h$ z0 E5 B% [" I5 h: L
var flength = 0;
# r7 }3 C1 x3 i& g$ o: g. U2 Pvar tlength = arrtbox.length;
: D! s1 f" l7 X5 W( g3 J9 o/ B) [$ [! Vfor(i = 0; i < fbox.options.length; i++) {
* Z% u) C1 O% k2 Aarrlookup[fbox.options.text] = fbox.options.value;
3 j8 ^0 y/ y% h2 w: a" U" tif (fbox.options.selected && fbox.options.value != "") {
! a; J9 w4 u. D- M+ g/ @' parrtbox[tlength] = fbox.options.text;$ }/ v0 {; r/ W& ?
tlength++;
. Z- t, s2 w5 c, l}: ?1 i# ~ U9 Q7 r
else {6 {! ~# t# S, c3 c: r: b
arrfbox[flength] = fbox.options.text;. i0 `7 `' ~, [3 R$ N
flength++;. e* L+ f, F5 O* J' c9 L( j" S
}7 |) v. D; S9 m( U' p6 L
}& ~, y. `: w" I
arrfbox.sort();
- ^6 c: I2 M& r( z* M0 M) ^) Varrtbox.sort();" _3 i2 l6 D N0 d
4 G" `& m5 ~9 Q( Z
fbox.length = 0;
5 y* t0 z1 F; N/ k2 F( T5 F2 A6 Ntbox.length = 0;
& }- I4 r+ `8 W L3 kvar c;; B5 W7 B2 i- {3 @" T+ |
for(c = 0; c < arrfbox.length; c++) {
! P/ Q2 N0 H5 H3 y7 r" ~var no = new option();1 ~/ B/ o3 h9 {5 Q/ _6 _0 x
no.value = arrlookup[arrfbox[c]];
% t! M R: k; j3 b& k, fno.text = arrfbox[c];/ u' c8 S8 k; Z# ]% j* {) y0 n
fbox[c] = no;
7 k" Z4 I$ s9 a- x}4 v# m; F; |3 R5 [5 S
for(c = 0; c < arrtbox.length; c++) {
/ F6 U; }& D4 ` ivar no = new option();8 I$ {7 | V) f/ k- ?
no.value = arrlookup[arrtbox[c]];
5 ^+ c: ?9 K& [1 K/ S8 ^ c" mno.text = arrtbox[c];" ^$ z ]8 Z9 r, Z6 l; a
tbox[c] = no;
& ^0 u: x% y- S# E8 } }+ U' Y0 D; O8 f0 O4 N1 o' e' t
}1 n+ I+ F/ G, T( ?
</script>
% O6 [( V1 {5 x* t* N2 h</body>$ F5 \+ g! Z- p6 ~( J
|
|