<%@ halaman import="java.util.Date,yava.fileapp.*,java.sql.*;"
contentType="text/html;charset=GB2312" pageEncoding="GB2312"
%>
<gaya>
.f9{ ukuran font:9pt; }
.bgc{ warna latar:#AECAF9; warna: #0033FF }
.buttons{font-family:Arial; ukuran font:13px; berat font: tebal; warna latar belakang:#6796E4; warna:putih; batas atas: solid 2px #AACAFB;
batas bawah: solid 1px #4E7DC1;
perbatasan-kiri: solid 1px #AECAF9;
perbatasan-kanan: solid 1px #5679BD;
bantalan:1 piksel;
margin:0 piksel;}
</gaya>
<BAHASA SKRIP="JavaScript">
<!--
fungsi rv()
{
var val="";
untuk(i=0;i<combo_box.list2.length;i++){
val+=","+combo_box.list2[i].value;
}
if(val.charAt(0)==","){
val=val.substr(1,val.panjang);
}
pembuka.form1.frecname.value=val;
mandiri.dekat();
}
//-->
</SKRIP>
<tubuh leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<jsp:useBean id="pengguna" scope="sesi" class="yava.fileapp.UserBean" />
<%
CDataSource ds=CDataSource baru(); //数据联结Kacang实例
java.sql.Connection samb=ds.getConnection();
java.sql.Pernyataan stmt=null;
java.sql.ResultSet rs=null;
CDataCheck dc=CDataCheck baru();
%>
<%
String sqlu="PILIH t1.fno, t1.fname, t2.fname AS fdept FROM tuser t1 LEFT OUTER JOIN TDept t2 ON t1.fdept = t2.fno diurutkan berdasarkan t2.fname";
stmt=sambungan.createStatement();
rs=stmt.executeQuery(sqlu);
%>
<bahasa skrip='Javascript'>
arr = Array baru();
<% ke dalam suhu=0;
while(rs.next())
{
%>
arr[<%=temp%>]=Array baru("<%=rs.getString("fname")%>","<%=rs.getString("fdept")%>");
<%
suhu = suhu + 1;
}
%>
suhu=<%=temp%>;
fungsi UbahLokasi(id){
document.combo_box.city.length=0; //初始化第2级菜单的长度,下标从0开始
var saya = 0;
document.combo_box.city.options[0]=Opsi baru('-------','');
untuk(i=0;i<temp;i++){
if(arr[i][1]==id){//如果相等,证明在第2级里面有输入第1级组织的子集,arr[总数目][部门]
document.combo_box.city.options[document.combo_box.city.length] = Opsi baru(arr[i][0], arr[i][0]);
}
}
}
</skrip>
<nama formulir="combo_box">
<tabel border="0" cellpacing="0" cellpadding="0" height="210" width="59">
<tr tinggi="24">
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>部门选择</font></td>
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>人名选择</font></td>
<td bgcolor="#336699" class="buttons" align=center nowrap><font color=#ffffff>添加/移除</font></td>
<td bgcolor="#336699" class="buttons" align=center><font color=#ffffff>最终人</font></td>
</tr>
<tr>
<td>
<pilih beberapa id=prov name="prov" onchange="ChangeLocation(combo_box.prov.options[combo_box.prov.selectedIndex].text);" style="lebar:150;tinggi:200" kelas="bgc">
<option value="0">请选择部门 ---></option>
<%
String sqld="PILIH * DARI tdept";
stmt=sambungan.createStatement();
rs=stmt.executeQuery(sqld);
while(rs.next())
{
%>
<option name="<%=rs.getString("fno")%>"><%=rs.getString("fname")%></option>
<%
}
%>
</pilih>
</td>
<td>
<pilih beberapa id=city style="width:150;height:200" class="bgc">
</pilih>
</td>
<td nowrap align="center" class="bgc">
<input type="button" onClick="move(this.form.list2,this.form.city)" value="<<" class="buttons">
<input type="button" onClick="move(this.form.city,this.form.list2)" value=">>" class="buttons">
</td>
<td>
<pilih beberapa ukuran="10" name="list2" style="width:150;height:200" class="bgc">
</pilih>
</td>
</tr>
<tr kelas="bgc">
<td colspan="4" align="center"><input type="button" name="button1" class="buttons" value="选好了!" onclick="rv();"></td >
</tr>
</tabel>
</form>
<skrip bahasa="JavaScript">
//人名移动
fungsi pindah(fbox, tbox) {
var arrFbox = Array baru();
var arrTbox = Array baru();
var arrLookup = Array baru();
var saya;
untuk (i = 0; i < tbox.options.length; i++) {
arrLookup[tbox.options[i].text] = tbox.options[i].value;
arrTbox[i] = tbox.options[i].teks;
}
var fPanjang = 0;
var tPanjang = arrTbox.panjang;
untuk(i = 0; i < fbox.options.length; i++) {
arrLookup[fbox.options[i].text] = fbox.options[i].value;
if (fbox.options[i].selected && fbox.options[i].value != "") {
arrTbox[tLength] = fbox.options[i].teks;
tPanjang++;
}
kalau tidak {
arrFbox[fLength] = fbox.options[i].teks;
fPanjang++;
}
}
arrFbox.sort();
arrTbox.sort();
fbox.panjang = 0;
tbox.panjang = 0;
var c;
untuk(c = 0; c < arrFbox.length; c++) {
var no = Opsi baru();
tidak.nilai = arrLookup[arrFbox[c]];
no.teks = arrFbox[c];
fbox[c] = tidak;
}
untuk(c = 0; c < arrTbox.length; c++) {
var no = Opsi baru();
tidak.nilai = arrLookup[arrTbox[c]];
no.teks = arrTbox[c];
kotakt[c] = tidak;
}
}
</skrip>
</tubuh>