|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14329
- 金币
- 2450
- 威望
- 1647
- 贡献
- 1398
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"1 z, D- h3 K$ d L/ C3 Z
c pageencoding="gb2312"4 q# E4 w2 x$ n' l# Q
%>1 `$ o1 h1 d3 y u' X" V7 }( [* k
<style>
$ x4 i7 j7 E* R8 l6 N7 P- p' A, O.f9{ font-size:9pt; }7 q' m) U, S4 g
.bgc{ background-color:#aecaf9; color: #0033ff }
: Z$ e" S! R5 W9 K/ b$ l; q.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;! ?/ z' N% ]) M3 b$ \: C
border-bottom: solid 1px #4e7dc1;# A1 K2 Q8 p6 _7 K! }0 N& e( d
border-left: solid 1px #aecaf9;1 b" [& @5 w( }+ P. ?% g( n8 b
border-right: solid 1px #5679bd;
, {. ?0 b( N- A' k3 W! Q) x/ _% z6 m padding:1px;( D% I6 d/ H$ |2 m# R# P- m
margin:0px;}
. d0 [) v4 H; Y" f</style>
3 ]8 J: E- z |! t, ]2 x6 R<script language="javascript">0 H3 ]1 S1 [+ S: D* B( t
<!--1 U) x Y8 Z$ G
function rv()- g( f: ~# X8 D. X3 c& C3 b
{, U$ W$ |' J, O; |( W/ G; }" C# F
var val="";
$ G; A! F8 \5 R+ `# G for(i=0;i<combo_box.list2.length;i++){
1 @, M' F8 l" T8 j# i val+=","+combo_box.list2.value;
$ q; j5 g9 k7 R) }. f }
- B9 c- L5 Z2 M% O3 l) O if(val.charat(0)==","){
$ d4 Z4 D! A1 u val=val.substr(1,val.length);
# K7 a8 e8 ]+ q4 ~ }- x+ q& z$ R5 t, S" _$ O! \. K( d
opener.form1.frecname.value=val;
& e& A3 x& y8 R9 u, c self.close();
0 n( G8 A+ d3 T5 i u* a7 {}! O" G; e* ^. r0 I* v. R! Q
//-->* b+ ]' j6 p O* y
</script>
+ v: r: B S, w) B5 z<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">5 v8 m6 H' q. |
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />6 `: z2 E; v7 p# h' W, x! N! z0 Q
<%
1 z$ _) k9 x# _, B" H7 r cdatasource ds=new cdatasource(); //数据联结bean实例
/ o- @4 t: }# g+ Z; E1 ?' ]8 _& W* m java.sql.connection conn=ds.getconnection();
$ M1 A5 [4 i4 A' v8 x java.sql.statement stmt=null;
9 n0 z* q0 p, }% v$ z* c# S java.sql.resultset rs=null;, v. x, O0 ?8 r% P( ?+ R( h% q
cdatacheck dc=new cdatacheck();, q% r. K( o- J* R# K [
%>
) |' J" f, X; M+ F6 W+ l<%0 O, u% @" s, C; Q
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";9 \4 P0 k/ I0 ]( Q6 Q* K& i" h- v
stmt=conn.createstatement();
4 a' E! L+ g6 ]; p* Vrs=stmt.executequery(sqlu);
0 A( J/ U+ A) `+ u%>
' d: ?8 T) {' z) R* b0 \<script language='javascript'>% h7 I! _4 s8 ?! F4 r
arr = new array();8 ^% S: U3 E' q1 V
<% int temp=0;
A! s( ]2 b) Ywhile(rs.next()); z8 s0 r. m; M! Q, n
{7 }$ k, I f+ K2 V, B$ ?" I
%>
$ {6 T a+ o: Jarr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
' ?4 h5 R x" m- W/ T7 J' h1 J4 C6 e<%+ q. @ F# h" _) q# G3 u J
temp = temp + 1;1 c1 R0 |' d# V6 k8 u9 o
}$ ]" `% O$ l2 o8 z$ X! U5 d9 @: z7 q9 ~
%>
g) x3 U$ n* C j9 utemp=<%=temp%>;) t9 n. b+ H" U f; U& F2 R7 w
function changelocation(id){ ( r4 Z/ C8 J6 t/ s9 h0 F d
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 " r4 B* T; |6 x; r
var i = 0;
+ Z9 R" r8 w; Z% P/ D5 ~document.combo_box.city.options[0]=new option('-------','');
! d+ l- a3 [6 c! f4 R! m5 {9 M6 R. R$ {for(i=0;i<temp;i++){
! D$ I/ U+ a; p5 dif(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
. c2 D: |( h" X/ b) ^document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); ! H& @8 T# ]0 J! J0 O6 N0 ]
}
f+ w% B7 H; Z) f' G}
' V. s+ U G$ D7 {} 1 _$ h/ n& `% ~# C
</script>* y" N3 x) }6 Y# z8 C
5 F; F6 p; k$ h9 p) u<form name="combo_box">
( m' o: v9 F! _7 o<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
( h, Y( D; M0 L. v <tr height="24">$ t5 S, z! u& ?% [; d
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
2 @' o9 R) Q- s$ @ <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>" s# Z8 X4 Q- J# `: R( ]6 E# a( ]
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
7 {4 D d4 z% y <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>* ~1 h/ j) q$ E9 B1 W& A+ T' C
</tr>0 I, o1 Z3 V4 |) S
<tr> ( e0 ?# Y( x5 W
<td>% d" q: t% r, N! x
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc">' @$ r" u( y P' t5 P3 ^& D
<option value="0">请选择部门 ---></option>! P# n/ D" Y, m0 ]$ C
<%$ K. m1 c: [( `# |8 Z
string sqld="select * from tdept";6 a$ Q- l7 w" ~, [ i; a9 o) Z
stmt=conn.createstatement();
3 f4 o+ G; D# T7 G1 Ers=stmt.executequery(sqld);7 s, m5 I: ?# W, n# [9 w
while(rs.next())
# R& J( T$ W! E$ Z1 Z{5 o7 J c& D! f% \% r: I$ }3 g7 ~
%>! D; l/ _; I/ A. }4 {( n& d
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
7 E& }, J& A: o) J/ t& b<%+ J( D; B+ J/ g y5 S* b9 u
}
7 c0 W4 ^5 G2 K3 }1 s( }: y" W4 Y( a y%> & C, W; p# B1 G$ R; `9 F" \
</select>, g) ]# ~% O/ [) L; U
</td>
, X( n4 {6 D9 r" u% t" ?) c. I <td>7 M9 d/ ^4 x* S* ^' c
<select multiple id=city style="width:150;height:200" class="bgc">
3 p8 g' e& g$ t# H- t </select>5 Z" e! l: F9 I' P' w
</td>* L8 {9 ~* B( X% Q9 r# @
<td nowrap align="center" class="bgc">3 R9 i( n- I1 C0 A. S; y
<input type="button" value="<<" class="buttons">& @, X2 R( x/ G- H+ S, l
<input type="button" value=">>" class="buttons">
1 q& c' d& z9 h5 }2 @' c0 \: {</td>& m( c; E* [% c2 m8 h. F, s/ K1 H% A
<td>
6 s8 q8 R, R$ C; f8 Y( k# @$ k5 M7 f <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">, U% y0 i4 k+ b0 v5 }
</select>! w% M8 v4 F% q+ H
</td>
6 o- a4 l& }, a: P </tr>
5 w8 G; A- Q* x$ f <tr class="bgc"> . v) B, r& e: \) G! |- b: @8 n
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>' e# B! C; f$ ^8 ?% @
</tr>
! p3 J! x8 e+ v# Q( Y7 K</table>
* o5 ^ e& R( E- h) H$ |' A</form>
8 q* t0 k+ O: x1 N<script language="javascript">
' Z% c0 m/ T- p$ T7 O//人名移动
# _& l1 R* F9 w4 Y) V' [; W) O) \5 dfunction move(fbox, tbox) {
9 t ~" E' t/ D7 x) i1 Vvar arrfbox = new array();
( q& e; R( Z- l) [4 l* Kvar arrtbox = new array();1 n l5 }, t: ^0 n" O) B9 }
var arrlookup = new array();
( F9 P; k( h$ e) K4 ]9 gvar i;/ n" [. Y- {) m
for (i = 0; i < tbox.options.length; i++) {7 X7 {- J" i! ?+ @# P5 _. A
arrlookup[tbox.options.text] = tbox.options.value;0 i9 M4 a' O4 L& w% c
arrtbox = tbox.options.text;6 o9 E3 ?. W2 Y n# h9 i
}3 _1 b) e) @6 C% Z7 l+ k8 Z
var flength = 0;
1 o3 q, N: {, I# ovar tlength = arrtbox.length;
) w7 v ]9 ]) j" mfor(i = 0; i < fbox.options.length; i++) {
- v" ~; ]: ]1 [6 o# O) R) u" N$ Harrlookup[fbox.options.text] = fbox.options.value;
! B3 J' ~4 W; Z4 e/ m& cif (fbox.options.selected && fbox.options.value != "") {
4 j- |6 @' l5 x9 y6 U. G' Sarrtbox[tlength] = fbox.options.text;
, A- t, @# H+ O3 {1 ~tlength++;; U" C I2 ?; ]" o% s
}
2 F/ X, l: H- y- p- e: Z& \else {7 V4 M, `6 h4 p$ @4 E- [, `# ~2 h& }
arrfbox[flength] = fbox.options.text;8 \2 R! B2 @$ A ^( S
flength++;
; T' U, X1 e7 z, A1 `, ~4 F+ U4 I }
! k% k, `* I) @' ~0 D- Z}$ W# H( F' y0 U6 d# R* K# F
arrfbox.sort();6 f( B) K+ y$ u: z7 Y) t/ ?
arrtbox.sort();
- q+ @! O0 S& t5 a# p
* w3 G1 S2 [. S8 |; J3 z7 k$ gfbox.length = 0;
7 [" q6 p( H) e$ [- R& Atbox.length = 0;
) s( C4 s: T4 D- s! D2 d i! Vvar c;
8 t7 E' x) l6 e5 y) cfor(c = 0; c < arrfbox.length; c++) {
" w* }! o1 @" ?- a4 |- [var no = new option();
) d( l+ ]& i H2 ^5 f4 c6 L* c2 uno.value = arrlookup[arrfbox[c]];
9 [ K0 y/ j! y4 j2 Eno.text = arrfbox[c];
( H \6 K% k3 x4 |2 m, bfbox[c] = no;' H9 V8 g( v# M# z, \$ T
}
. j2 }- N' H1 D+ }, Ifor(c = 0; c < arrtbox.length; c++) {
/ @6 @9 Q8 T0 b2 h/ Avar no = new option();3 n! s, b$ }( Q3 t3 m
no.value = arrlookup[arrtbox[c]];2 h7 R* B- J& A( S
no.text = arrtbox[c];$ q' X! H; A$ P/ i. S1 h
tbox[c] = no;
, ^/ b K0 w+ x* O }
( Z! O- f- i$ V/ L! g$ H4 z}
/ Z: i, X, n7 H9 `9 ~7 Z- N</script>& ?" o" y0 {. Y* N3 S& i+ |
</body>
* }/ ]/ d5 M, W* G+ l4 W) F0 B# B |
|