|
  
- UID
- 1
- 帖子
- 738
- 精华
- 28
- 积分
- 14397
- 金币
- 2484
- 威望
- 1647
- 贡献
- 1432
|
<%@ page import="java.util.date,yava.fileapp.*,java.sql.*;"
2 W& V" J* M! A c pageencoding="gb2312"# q5 Z( c" l' y
%>0 R' F, N# a. Q3 a
<style>
, z5 }) W5 Z9 B; |# U$ H$ d8 X; a.f9{ font-size:9pt; }! Z& p6 A! b6 ?5 h
.bgc{ background-color:#aecaf9; color: #0033ff } j. L! M/ B. F R. c
.buttons{font-family:arial; font-size:13px; font-weight:bold; background-color:#6796e4; color:white; border-top: solid 2px #aacafb;' M% p4 `+ q' }# [) U( x" d
border-bottom: solid 1px #4e7dc1;& ?: j& f/ p8 m
border-left: solid 1px #aecaf9;& P1 q0 o: z5 V# ]. ?
border-right: solid 1px #5679bd;
% Z" r& P9 Z1 h) V) s: l padding:1px;
( [$ d- e" m. H8 q5 o0 J6 p J- \, f margin:0px;}5 [# ^. Z* a( r/ m% r+ G
</style># h& M- w0 d4 Y, ~/ v
<script language="javascript">& n% K! z8 z+ y0 @
<!-- s& ?* c" t2 q+ e0 `8 o+ Q
function rv()* A! M* l* B" D0 Y% w
{& V# K! Y8 ~! _* u* W+ a; C1 q: Q
var val="";
/ q9 C W, | W/ e- i1 x$ f+ z for(i=0;i<combo_box.list2.length;i++){; I& M3 g& x x' o: h" ]
val+=","+combo_box.list2.value;; M4 V1 n K ~. J
}
' H8 \, g( N( o. v0 d if(val.charat(0)==","){
* \: ~1 h1 N4 \! s! i# W val=val.substr(1,val.length);
. k' X1 I% g$ R1 {3 [; F0 t }; Y$ j3 c! \0 q7 Q, b" ?. S% C7 |
opener.form1.frecname.value=val;% {+ o* m1 T- R9 L" q9 S7 H8 d
self.close();
* e% X: I& T# v* X}
# O2 D/ \! H( `( y; I/ ], R//-->0 q' n$ ?) _4 @1 N. j+ j& m4 a2 w% ?/ l
</script>2 c4 S4 t. P+ ]- ]/ x- g
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
4 x+ x6 O( \0 e6 M+ H' ?<jsp:usebean id="user" scope="session" class="yava.fileapp.userbean" />
% l4 t4 s# ?3 o- G) @, h<%9 {6 _) O2 m$ m$ ^9 H' H* n3 C
cdatasource ds=new cdatasource(); //数据联结bean实例3 U1 G+ b$ ^. a9 R1 F
java.sql.connection conn=ds.getconnection();
' |1 F. f6 x' `5 G, B java.sql.statement stmt=null;
* B9 i" l; z4 K3 A U& J6 p java.sql.resultset rs=null;
) o2 d6 C; {: ]7 C, {5 x4 W cdatacheck dc=new cdatacheck();
' F1 `, I% k) [ S5 x0 R%>- v: A1 v2 K" M/ w2 j! b
<%
/ p1 L+ O$ f0 Lstring 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";
7 |8 o9 W0 w" estmt=conn.createstatement();
* [2 P& s4 c8 M( ~3 s8 J" trs=stmt.executequery(sqlu);
$ a) i6 R5 j, k8 A8 Z" x%>
6 \1 @' w* ~6 K9 o, Y( W, r8 o<script language='javascript'>7 \# W4 t' ?! K* o; E3 |* \4 r
arr = new array();' o% u: ]$ D* c6 _. [9 e
<% int temp=0;
. [) }* W( L# U- U' }while(rs.next())( P+ s' t# X' E5 [
{9 k* H3 S- X l
%>& U9 r7 K( E. L. Z! g8 ~* E
arr[<%=temp%>]=new array("<%=rs.getstring("fname")%>","<%=rs.getstring("fdept")%>");6 y2 g3 e1 s) A
<%
% A& c& e$ O: P" X. J* ptemp = temp + 1;
1 c0 T! w; U' W* s5 s5 Z+ }}
! b7 K) s d: }6 X, \! r( q, I%> f* n$ L ^4 u3 u1 V! J
temp=<%=temp%>;& ]1 p- b1 f4 s
function changelocation(id){ ' s" w" _- _4 }1 b8 O* I
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
' r0 J2 U3 W( Q) Y/ i4 L& Gvar i = 0; 6 l$ @- z0 b& ~4 x. n: [1 t ]7 x
document.combo_box.city.options[0]=new option('-------','');
2 f8 z9 Q! S' E: w1 v, X9 Mfor(i=0;i<temp;i++){ ; ~# ~ S& Z3 }4 r: U) M
if(arr[1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
8 @0 y8 k% J4 e( Z- K' p" udocument.combo_box.city.options[document.combo_box.city.length] = new option(arr[0], arr[0]);
+ z- X+ K# Q& I+ E}
' X6 u r4 c+ l. ~, S}
4 B- @7 _, p0 k: G; ?3 Q+ g# b- D2 q}
2 d2 j: _) K5 j. \+ E1 e</script>9 {% X% r( N- e. t8 {( |9 c# I
' H) c3 O( o4 g( _0 O0 s<form name="combo_box">
! @$ B$ M( d5 `% I# N* b; m<table border="0" cellspacing="0" cellpadding="0" height="210" width="59">0 d) @9 i" l. ~0 v& E
<tr height="24">0 j2 l! ?4 _2 e6 m' ~
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
$ C; X/ V. w- `& i6 Q <td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>, }5 f, T& N. Y( ~. Y# A- P
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>/ m3 M c+ f6 @
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>- {8 ]2 b9 ^7 w" i c3 B( ~; a( g9 B5 f
</tr>
5 l8 V( t4 J7 l' K4 @ <tr>
3 i9 f& O9 ]7 t! H1 S4 J! ~9 j5 k* z( @ <td>8 h% q1 Z: c7 ]- N- Z" C8 X
<select multiple id=prov name="prov" style="width:150;height:200" class="bgc"> R: | E. r& P5 J/ c5 T# W
<option value="0">请选择部门 ---></option>
2 Z$ {! t! h4 f! U1 c+ s<%: f) ~( v1 y" w* @
string sqld="select * from tdept";0 z+ F+ Y2 O7 K8 p* b
stmt=conn.createstatement();( |- U! P; E# K% ^/ h2 N8 G
rs=stmt.executequery(sqld);
( `; Y3 z5 w2 Ywhile(rs.next())
! T( n4 o% o, D6 P{. m3 Y' _( L- w
%>
+ }! j; u. u% s3 L1 d3 w0 H0 P <option name="<%=rs.getstring("fno")%>"><%=rs.getstring("fname")%></option>
* A: m; G2 d1 t% L6 `+ q F<%
% Z( |% p& \3 K. i* K# k5 R! S0 r}' N# K' a3 A- n8 t9 p" Z* X
%>
+ \" [4 u% T. p+ u% N3 k </select>. T' c8 n* z/ _2 q9 ^$ A6 |6 S
</td>
! V0 q% E/ S0 e1 N1 e <td>( W! N; v, N* \* g
<select multiple id=city style="width:150;height:200" class="bgc">
# w1 r! u. H* |* D8 S) ^ </select>3 ~" D0 h# u* D6 C! `2 [' n0 r
</td>% d' N/ h( X6 j4 Z1 {6 K4 I- a
<td nowrap align="center" class="bgc">4 y3 G. V# p ^4 \, Q* k
<input type="button" value="<<" class="buttons">. Y( m7 e! h* |
<input type="button" value=">>" class="buttons">
6 }8 e% t. l$ V# }</td>6 r' n& P$ w9 M& E( H
<td>
. Z( f2 b, F+ R8 F# ^4 |8 [ <select multiple size="10" name="list2" style="width:150;height:200" class="bgc">0 p1 ~2 }# H0 x M3 s3 D. a. B
</select>
0 ^! ?8 W6 `. }2 E/ N' ?</td>
0 P6 u! a, r) Q4 T0 }; o </tr>
T% p. Q3 C) ~ <tr class="bgc"> " g+ E6 M9 @" h) y/ N* E4 r
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" ></td>
$ q$ C+ t9 H- P+ h5 _. s </tr>
) I3 q( r3 ?6 t2 R6 b, ~, K* V2 }</table>" e3 V8 s0 `0 l5 Q* T8 [
</form>! j* l3 T2 j0 G5 q
<script language="javascript">
+ N) q r7 Y% n& I5 l6 G//人名移动( _$ Q' c6 b% H% F
function move(fbox, tbox) {4 g# ~, }3 S' R2 R
var arrfbox = new array();3 U* X& s& V: `! H0 F9 D; J" a
var arrtbox = new array();- {& F% Y: |& v" Q+ I
var arrlookup = new array();
7 u0 r& k+ L0 \9 }8 avar i;. U$ D( ~5 i+ j, B9 B1 u
for (i = 0; i < tbox.options.length; i++) {- ?; P9 A9 h& R: z+ x
arrlookup[tbox.options.text] = tbox.options.value;
4 Q; V2 `' D- b* d$ Earrtbox = tbox.options.text;
! ?! i, D2 m& t' }}8 Q8 l7 h- Q! T4 \! l( z
var flength = 0; V2 |2 o0 Y9 C* g% L2 C2 o
var tlength = arrtbox.length;, }3 k: c, c; ~. D# S
for(i = 0; i < fbox.options.length; i++) {# h$ @1 E3 m+ {: z* V
arrlookup[fbox.options.text] = fbox.options.value;* u$ M! n% \& I. g
if (fbox.options.selected && fbox.options.value != "") {2 F% w& u* A0 ^% N8 Z: R
arrtbox[tlength] = fbox.options.text;3 c6 t0 {2 W, ?% q) F0 L
tlength++;
# x4 k7 s8 F8 D. [. c5 K" z}
7 {2 g3 D$ w% ?/ oelse {3 a8 o2 F9 r4 s9 a9 K/ M% E/ q% ?; e4 c
arrfbox[flength] = fbox.options.text;
. A! b F9 u/ F+ @! Q7 gflength++;' ], K X, Q |4 e. n; Q
}
j" `8 @+ K4 \) d}
6 B8 Y1 u { t& E) karrfbox.sort();9 `3 d! I; F3 C. @& ^2 v
arrtbox.sort();
5 E1 b+ ~6 T! w2 |5 X5 }
% [/ l& e2 J; g" d& Dfbox.length = 0;/ {- q- x4 g( m; M
tbox.length = 0;' k: a B, Z! q9 q
var c;
: _' Y1 ~6 X2 ~: jfor(c = 0; c < arrfbox.length; c++) {
1 |* _3 L7 v5 n! L# Q! Avar no = new option();* I+ W+ n `, S5 |4 H) ~
no.value = arrlookup[arrfbox[c]];
; L9 f& | G2 l8 o" x A: D Pno.text = arrfbox[c];6 K: p5 a4 I0 d& v$ E( g8 v) n
fbox[c] = no;
# L8 D2 L* L8 \0 \, {( F" p}/ C6 P6 N, P w U0 ?1 A% E6 a
for(c = 0; c < arrtbox.length; c++) { m5 T* a4 ]% J O& c; P
var no = new option();
( Z( ^9 \8 H) zno.value = arrlookup[arrtbox[c]];
9 f# k! b Z& N0 c2 _* @% ?( t; nno.text = arrtbox[c];
! i" E1 [9 \- `# Ftbox[c] = no;
+ ]- ]5 i7 d" ?. V }8 H$ T' f, y- D' e1 R
}
6 t. g+ h( W2 T+ b, E0 G3 L# r</script>, \% j( X: A$ u& M
</body>
$ {1 g: ~' G# f) O$ f |
|