  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14195
- 金币
- 2388
- 威望
- 1647
- 贡献
- 1336
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
3 q' c+ t0 B+ s* { c pageencoding="gb2312"+ F' k; H4 \7 T" K! R' I2 ^( ]1 V3 j( {
%>
% L/ `" J3 u" B \. h! g<style>; w0 K% w; M' L
.f9{ font-size:9pt; }
3 T- r) I: z. A, e1 e0 b.bgc{ background-color:#aecaf9; color: #0033ff }9 z d! O" @: K% \, R
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;' T1 n/ l" ?: a
border-bottom: solid 1px #4e7dc1;
! U9 E$ b$ L. { N0 x border-left: solid 1px #aecaf9;4 @, g( n2 _5 A/ l+ V
border-right: solid 1px #5679bd;
% d% k& f# l8 D% o, T$ b" k5 p padding:1px;
: x7 h1 F: @- A/ M2 [7 W: w margin:0px;}
2 _# `4 C1 f* o; j+ d; U6 y5 w</style>
# y, w) u4 X! t* J2 f$ L$ U+ k: Y0 S<script language="javascript">5 \5 @/ N1 o% F7 ?5 z5 k
<!--
; O( E5 q* Y# W5 Z9 Y ^function rv()
$ o. L( R' ~* ^2 j# s{
1 M4 m5 v1 X: D! e, r; W* A% ~" W! E var val="";
% z' X5 R7 K, }/ R* n' ]' G" ] for(i=0;i<combo_box.list2.length;i++){
}( h% |; k, J9 n+ W# f val+=","+combo_box.list2.value;
. X) p2 z3 d- i0 `5 p" @ }7 D& |3 p- Q5 e: \8 Q" f6 x
if(val.charat(0)==","){
2 F6 a- n% p- S2 P/ ? val=val.substr(1,val.length);8 ~- X5 Q7 b/ _$ p/ O
}- [; c: r/ L, d
opener.form1.frecname.value=val;
) `. V& i, H7 v R) ] self.close();
( G# n8 T5 u- m* E+ H4 a l: C}
: S5 ^2 l3 V; m! X# E# p+ g- v//-->
5 R) d% {$ B+ r</script>
2 o, U6 G& v0 r* U: H# [<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">( s* x2 U7 w, l0 F; q$ `
<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />, b% e( Y$ X+ `
<%
. _( h# H3 u1 d4 l2 ` cdatasource ds=new cdatasource(); //数据联结bean实例# D0 z( `5 p. C" n* C) m: Z
java.sql.connection conn=ds.getconnection();
+ V% p( E' c( u' N2 y: g( z9 ^- _ a java.sql.statement stmt=null;
9 v1 O0 P3 M' b; u java.sql.resultset rs=null;
8 I8 E H& r6 S# F/ s' X cdatacheck dc=new cdatacheck();3 O' V6 a' b% }1 \9 ?' Q+ T
%>
0 d# d* Q) R& d<%% ~% w& J9 X2 Q0 M
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";
+ z% J3 s: m$ l* @) [% \stmt=conn.createstatement();; v' ^* [, J' x
rs=stmt.executequery(sqlu);
% K" G! J7 j# |%> {1 j5 p% M5 e9 f, u8 p: K9 w
<script language='javascript'>2 `7 a/ h7 x# ]
arr = new array();
+ s7 A* y' w6 |1 E: B* \# V<% int temp=0;2 ^' ^% |- [6 V p% H# R
while(rs.next())7 b' M& a/ t1 D3 I& c+ \
{
/ j- A5 ?! E% [! ]% M6 C%>
2 _7 _6 _ u; O9 V6 c% q# Zarr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");
8 |* ^8 T0 }, Y7 o+ R1 e<%
* Z5 c1 j, ~. G" Mtemp = temp + 1;, F$ N) D$ `) ]7 g
}
3 B5 I$ k% g2 D4 P; B& @%>/ r$ ?! T f& b- ^4 s
temp=<%=temp%>;4 y6 Y3 Z; m8 ^0 B q3 q
function changelocation(id){
. d% Y/ ~) \, `% O, K$ x9 Cdocument.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
i/ c7 L- a9 J9 nvar i = 0; * }' }: e2 r! i% N1 Z) M
document.combo_box.city.options[0]=new option('-------',''); ; i( \5 T$ H: b$ P
for(i=0;i<temp;i++){ / q0 g. D) S2 M/ V9 U8 c6 z, u
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门] " W* q/ X" ]2 K7 l2 ?
document.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]); / I, k( J5 @3 L( e6 {/ j G
} # `8 u* I$ a8 S5 e* Z
}
" W7 Y3 t! s2 S& D+ p' e}
. ^4 P+ Y. r q1 w" Q3 n1 q& i</script>( k1 e% l7 {) r: `( i6 l+ {
: O6 j" P. h# P* D) A$ f& m
<form name="combo_box">3 ^8 ~1 K8 p) A
<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">- `) l: z$ r# Y5 T$ c( ~+ O
<tr height="24">
4 X+ k. h5 O% w* r: d1 l <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
/ y: [ A' y+ F* | <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
6 I4 W K: F: d' j6 b0 D <td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
5 w1 `4 H6 Z' T# K8 G <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
; X1 ^5 G- F9 y1 E </tr>
: n" \$ q4 W6 q X+ @ <tr> H0 _0 K5 Q- U |/ x/ q! e% R
<td>
- e& M1 I- Y+ ~7 T: _! k) b( p <select multiple id=prov name="prov" style="width:150;height:200" class="bgc">
8 [) {' v, s9 k0 B' w' F <option value="0">请选择部门 ---></option>7 @' Q: W4 h3 l: h
<%
S# x0 h' ~4 u+ E* ^; a1 N string sqld="select * from tdept";
6 e" m& ~7 x' w. e+ S4 ?. d4 C; {7 Ustmt=conn.createstatement();
8 y* S: q1 j* l8 irs=stmt.executequery(sqld);
8 N4 u) B1 ?/ x% ^- f# [while(rs.next())6 V) z( b! d1 m. p; _: c' S! V
{3 |/ ~) q' M5 C. D
%>
8 E2 c/ v& j; ]: v3 n1 |; ] <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
) X6 t8 c6 K; t9 t<%
3 \" ^+ c8 k6 M8 v L7 j9 u}
9 o0 q5 V% Y& a' w, `# J' x%>
6 P, U# |1 K" J& m </select>
- u8 }) K/ U( N</td>' |) C8 ?1 l6 C7 T
<td>" V6 B4 Y# P, u1 ~, `& f. N( ~
<select multiple id=city style="width:150;height:200" class="bgc">% ~0 m5 g$ u% m
</select>
9 D( t. ]4 B! P' O9 {</td>
/ @# p& |) ^# T& E- L, C <td nowrap align="center" class="bgc">
. N0 l Q# W7 r; ^6 b <input type="button" value="<<" class="buttons">/ o4 n$ `. m) a' A
<input type="button" value=">>" class="buttons">
3 w( n+ `0 r% v) d: Y N2 F$ F</td>
2 N& N6 R7 W1 b8 \, `( b" H <td>1 ?- K3 S4 l) U3 v" e; I4 t, V
<select multiple size="10" name="list2" style="width:150;height:200" class="bgc">
7 _; j/ [8 I* | </select>
9 c% S8 y6 o, J+ I( A' \</td>2 B0 }" c4 |4 ~( I* a1 D
</tr>7 p' K" V# T3 c/ M; V( o$ F
<tr class="bgc">
& y6 f! V$ B% t7 h$ ] <td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>$ V5 F B9 @/ o; D5 @* _9 k
</tr>& _) E: |( m2 ~. b& h/ D
</table>
& R4 H$ _1 M- _! P" s</form>
% U: H) Y8 m$ a) ]8 p<script language="javascript">
6 x; b6 X x2 S9 n! n2 K//人名移动8 U3 F3 O2 X+ a( |: W
function move(fbox, tbox) {
3 h; r+ |5 R- |+ y/ l+ e+ i `var arrfbox = new array();
& q. o! y2 a% `: g, \var arrtbox = new array();8 Y# x) \# V% H
var arrlookup = new array();
: L9 ], q, k# @7 Z; Nvar i;8 K1 l" U9 n2 Q
for (i = 0; i < tbox.options.length; i++) {
8 {4 L; i& t3 W& Y" Farrlookup[tbox.options.text] = tbox.options.value;
3 U' l$ c$ U% b. E& V6 Xarrtbox = tbox.options.text;
' L6 n/ N& t8 k! }}" p/ K4 A J/ o: O
var flength = 0;
0 q! N- w( i1 W( B. ~1 I/ ivar tlength = arrtbox.length;
+ [$ j" |1 g4 `' I+ |7 tfor(i = 0; i < fbox.options.length; i++) {: p. R/ `7 E8 b; }: y6 Q
arrlookup[fbox.options.text] = fbox.options.value;
; S# C& Q) H' J1 c& Aif (fbox.options.selected && fbox.options.value != "") {
. l% m- D- j% P- t& o. {- B/ Xarrtbox[tlength] = fbox.options.text;2 n3 d5 n' @5 Z+ V- P$ r. ~
tlength++;+ u% P& ^3 ^8 p, r! n; @
}
3 S- u1 q1 r: C9 }. i' W, nelse {
% m$ o/ z# O# r; [! garrfbox[flength] = fbox.options.text;/ V0 [$ f1 q, Y, L3 Y
flength++;3 d. z1 Q" R$ q. K
}
+ l" n1 U6 v, E; Q3 v}
8 x) Y w) M" |arrfbox.sort();
: Y7 P& B n) \5 w% Uarrtbox.sort();5 r, ?2 X' ~6 x; s! ~1 }4 c9 j$ w
8 m$ }' c" g2 s# J( J# ]2 vfbox.length = 0;$ _+ G5 V: @: m0 T5 t* g
tbox.length = 0;! u( c9 A& E' V6 [ f& w
var c;% [5 \6 ^! z9 @ e2 G4 n1 }$ X5 l* J1 ]
for(c = 0; c < arrfbox.length; c++) {
1 {/ ~* i: J+ }5 L9 m& L, a' V$ xvar no = new option();$ D+ ^1 a# w5 s
no.value = arrlookup[arrfbox[c]];
9 e6 [2 {$ L, F' mno.text = arrfbox[c];
& s6 l0 c n# a0 \! yfbox[c] = no;2 _8 q8 G- y: Q& j* a
}
/ L* p5 m% z% S) l1 \0 e6 ffor(c = 0; c < arrtbox.length; c++) {
$ b; e% {* \5 h0 Q% F/ Mvar no = new option();/ v1 {1 ~4 Q, h% ^8 M4 `9 ?
no.value = arrlookup[arrtbox[c]];/ M2 L1 D; w- k3 |% [
no.text = arrtbox[c];
3 h, T7 q! Z: T7 V: z" @tbox[c] = no;
4 K4 U1 a; `- S5 L' D( A0 W }: c2 R- P* v, n4 s
}
3 b: P5 U1 J1 c+ Y& S, E4 \</script>
1 J+ h1 P( O/ H4 h* `</body>
- T' z" O$ r# @2 q: A9 @) M- a, K |
|