|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14413
- 金币
- 2492
- 威望
- 1647
- 贡献
- 1440
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"3 H6 G0 g4 ?3 l% w
c pageencoding="gb2312"
8 {* x- t; i2 N4 e1 p%>
+ s1 j: D3 ]) A* E<style>9 a! U9 a! B* a
.f9{ font-size:9pt; }
! y# Z1 o5 u8 q; B+ ?+ |! E.bgc{ background-color:#aecaf9; color: #0033ff }; `/ h$ ^8 F& W4 t6 ` N! x
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;
! I% [; p6 o. {3 ]/ m border-bottom: solid 1px #4e7dc1;
& {& @5 E) V+ s4 d+ e border-left: solid 1px #aecaf9;
2 {# g4 Y, a( I5 R border-right: solid 1px #5679bd;" ]/ }) P- k$ k0 q. o
padding:1px;, _" s4 Z4 ^4 Q2 }. Z( v
margin:0px;}9 _. ]" X% A# u
</style>0 V4 S; j1 C5 }- q, m1 ^8 i8 \
<script language="javascript">: K/ g+ j, S/ L% P5 M* Z" X. @" D# j
<!--
* R- m2 e0 X( Z: Y% O1 R+ dfunction rv()2 u: G# u" ]" A! w. \
{
' z- ]' N- T8 ~; y2 T var val="";1 k3 S! y5 q- E! B7 J3 S
for(i=0;i<combo_box.list2.length;i++){
7 b( f8 A& \# j/ ? val+=","+combo_box.list2.value;1 W" D" _ v, V4 O& T* w
}8 Q# Q! W( E2 v" U4 f
if(val.charat(0)==","){
. l8 I+ n% C8 n! a# G# v8 S7 A) E$ W val=val.substr(1,val.length);
) K- o/ z5 |! J) x0 C" ` }
8 T6 N1 D" q) B' j# y+ ~1 | opener.form1.frecname.value=val;
- y/ f! e& D$ n, I; L5 q# i self.close();% i& j! q6 e- U# N
}
9 E1 b8 ]8 t$ R2 h//-->- p; n/ F4 ^7 g; H9 ]* g. ~
</script>% h: j( u. G! `9 a y/ L' e) o
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">7 ~. i9 @! A t4 }3 b
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
' c0 v3 K! K' Q6 D7 X<%
) T! h& h/ a' r- z! p$ A cdatasource ds=new cdatasource(); //数据联结bean实例1 h: x! @+ b& P0 J% i- O. i
java.sql.connection conn=ds.getconnection();- f: G* | J- M, |8 [0 l5 y
java.sql.statement stmt=null;
* B$ f j8 T! s java.sql.resultset rs=null;
$ a6 z( c: d- L! H' M cdatacheck dc=new cdatacheck();1 z$ V0 L9 Q0 z, r
%>$ _$ _7 z' v. m4 f) x$ G. W5 o9 F
<%
0 P; H, R G0 F0 \% ^9 j/ {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";
?5 q$ o. Y, P0 rstmt=conn.createstatement();4 S5 R4 d% i5 @
rs=stmt.executequery(sqlu);
/ @3 W0 Y/ j" g1 s1 [- o# }%>& ]- x7 f8 n2 M4 b2 K4 C7 b. [
<script language='javascript'>
( R/ m0 _, a7 farr = new array();8 n; B2 N# u1 `; H
<% int temp=0;1 {4 [% r. S8 w' e' O
while(rs.next())4 h+ B6 d3 O. S7 t, }; d( c' R
{
( ]! p/ F) t6 ` Y%>
6 K" U$ t; n; q: ~1 w1 H8 \arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
7 }8 z) x+ n- ]2 B) l<%" U8 L$ n: ]* |
temp = temp + 1;9 V2 E _9 J& t0 h, M) ]6 R
}
# {: @8 i( R3 ?2 R k. r- R%># }* @1 ]( E* P4 r5 s! V& `. O
temp=<%=temp%>;- r1 s" w3 C. U8 p# L
function changelocation(id){
6 E, E, s$ x' S9 U9 u9 X% Udocument.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始 : ]) ^9 w3 g; h& n% v! } x
var i = 0; , [' g, R2 ?2 {& c7 K" R
document.combo_box.city.options[0]=new option('-------','');
' I" J% G2 e% q" h- Kfor(i=0;i<temp;i++){ 8 v/ E, M- |5 v b7 r, J$ `
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] , m7 r& A! s/ y% u% g1 @
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); / m0 J) f3 K, c! V! R$ ~
}
- w, M& r8 M4 [}
7 I9 c7 ^8 _! `6 p3 Z}
3 Z$ H( ~1 U% b: e" \! H# D</script>
8 e8 Q b/ e# ~1 v f. G1 Z( Y9 Q7 i4 P6 n& b: Y. j1 @
<form name="combo_box">
- c+ P: ~5 |. W$ T h<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">
8 X, R* T/ d1 x+ T1 ? <tr height="24">
g( \ ?; s' C9 ~8 s- v. x9 J <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>: n' b8 U* g- P; v' d6 }( A P5 |/ V
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
. o) b7 G9 u/ Y" u& B4 K# U <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>% }. R3 Q- ?% K
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
* l, W; A! n" d/ Z6 |, S6 _5 B2 y </tr>: m7 v* k6 B' w
<tr> + I$ s+ o9 s3 E- U
<td>
, b! @: X" v- Z3 J$ \+ X <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
: v& M& w. B* B: n7 R+ d <option value="0">请选择部门 ---></option>
& k% L- T X3 f" Z<%
3 y" L* S* w2 |0 K$ o9 K string sqld="select * from tdept";% f u8 M8 U0 }' L. M
stmt=conn.createstatement();
' w1 Q# \3 c, ~( ]rs=stmt.executequery(sqld);
! C; m$ D8 @- L, l+ {6 qwhile(rs.next())
7 f" M! F3 ~+ t; k' W* |{4 V3 _9 `; Z3 T) t$ j3 L
%>$ ]4 \( N h/ L- B# C& s' `9 V
<option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>" i# |5 Z9 [- E
<%) _) l$ [2 _( u
}9 m( J7 ]# A* l; ~( R
%>
, v) g, x" [6 h# o </select>3 |: U% Z, q# t
</td>
: Y# f, Z# Q7 [4 t <td>. s5 }. e: g1 C& U8 J! s4 j
<select multiple id=city style="width:150;height:200" class="bgc">
; c6 w7 k! J# t" N+ }! n" E </select>7 Y- [0 b" i( k9 M
</td>
?9 {. S2 L/ Z& _# E' w5 q <td nowrap align="center" class="bgc">
! ~9 B6 p7 |! ^' [ <input type="button" value="<<" class="buttons">
6 {' J- R! v2 ^ <input type="button" value=">>" class="buttons">5 }; T3 V/ \" T0 X! k3 t$ C2 L: }
</td> h9 w3 s: \/ E2 S: V; w7 ]5 A
<td>
5 V; }3 P5 J, {; A0 @: v7 _ <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
/ p8 S' o0 b6 G! [. l6 b </select>
; ^. ?7 P3 b" I" _! ]9 ]" T! @</td>7 x3 {3 Y# ^$ e6 Y" H1 y
</tr>% T$ S8 a/ r4 e" e* d" ?1 E. T7 f+ g
<tr class="bgc"> . t8 M6 }0 F" L- R6 v, `# M% |+ |
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>- u' ~$ Q! Z' S0 E3 J9 S
</tr>
" {8 d+ `, r% [' |* f</table>
; n8 M j+ q# F- G% P5 i</form>" d9 D/ z- ]5 n6 U
<script language="javascript">
: Q. E2 V" q- G' I9 i/ b) }& G1 }//人名移动
& V6 e: u+ B' u( @8 |function move(fbox, tbox) {0 [( L: Q1 ^7 _: \% F& M1 f. R
var arrfbox = new array();
# n6 A6 z* I) u% {2 X( g- avar arrtbox = new array();
% U, R/ o$ K7 F1 w( Y3 ?: Svar arrlookup = new array();
% w5 p5 J+ F) w" |var i;
7 l( i3 O$ A; U/ C9 ifor (i = 0; i < tbox.options.length; i++) {
' k, \2 P) I, qarrlookup[tbox.options.text] = tbox.options.value;& P2 {2 |/ i( z; y% f
arrtbox = tbox.options.text;
/ u: P! Y& M+ _* j$ e}
; K6 O- v5 `8 s# H( @ Rvar flength = 0;/ @+ B3 o! ~6 F. a; {. Q
var tlength = arrtbox.length;
0 A- _5 }$ T" Z, Hfor(i = 0; i < fbox.options.length; i++) {
/ \8 Q4 l$ C- B6 I/ Q5 Earrlookup[fbox.options.text] = fbox.options.value;5 n, r2 T* q* `
if (fbox.options.selected && fbox.options.value != "") {
6 d/ B) s: R0 D, _' _" [7 warrtbox[tlength] = fbox.options.text;6 Y; l. p, U0 m$ S7 @$ |7 m# J
tlength++;& i" u2 R3 d; j
}+ ~/ d2 H2 L. Z$ \5 |. `* n
else {2 p0 k- O( x: p, B* z7 S4 l
arrfbox[flength] = fbox.options.text;# j0 }4 m" e, Y! T' j3 f8 y* k0 e
flength++;7 C5 m/ d) J+ x2 L
}
! F* E% V6 [2 b7 [6 d0 B7 H# U R3 l}
3 |/ t2 a8 D4 k) K; {+ |arrfbox.sort();
+ q$ I, t( S i X5 Sarrtbox.sort();2 C, @7 a& Z1 d
6 F. x8 m# i% T. r; L2 ]
fbox.length = 0;
* \; \( U* I1 G* Qtbox.length = 0;) g8 e+ @" d7 x1 ]7 T0 R" V
var c;3 E8 u; b: C( U
for(c = 0; c < arrfbox.length; c++) {, D/ \' V9 O" g+ i7 G
var no = new option();
$ X7 A8 ?3 E2 x8 N1 F- Zno.value = arrlookup[arrfbox[c]];
4 n5 Q+ N6 Z; X0 k I4 l4 qno.text = arrfbox[c];6 l1 A6 r/ p9 V7 B: j( t7 v' l
fbox[c] = no;5 p) O4 Y) @+ L4 i2 R- C! m
}7 j$ v; x& d& C4 g; }& h& j
for(c = 0; c < arrtbox.length; c++) {
7 q4 e& |: Z2 A( Ovar no = new option();4 o; f- K8 K* d0 E2 a# i3 h
no.value = arrlookup[arrtbox[c]];- U- W4 W, E* Q/ q/ o2 c
no.text = arrtbox[c];# w" n4 V$ {3 `, v5 |% h
tbox[c] = no;
* P, d) t0 u" U c, S) ]9 t( Y, } }
$ ~1 J/ k1 G( K, j& Y4 t}
# W# H. M% R* p</script>
8 ?. J* u6 b6 [$ s' B/ `</body>7 t% R: t9 @. A5 J8 j7 |1 e
|
|