<!-- #include file="data.asp" -->
<script language="javascript">
function back()
{
window.history.back();
window.history.back();
}
</script>
<%
id=Request("id")
'response.write id & "<br>"
Set rseditPrcs_user2 = Server.CreateObject("Adodb.RecordSet")
rseditPrcs_user2.open "Select * from flow_process where id=" & id,conn,3,3
'response.write rseditPrcs_user2("Prcs_user") & "<br>"
if(Request.form("ManSelected") <> "")then
Set rseditPrcs_user = Server.CreateObject("Adodb.RecordSet")
rseditPrcs_user.open "Select * from flow_process where id=" & Request.form("StepId"),conn,3,3
rseditPrcs_user("Prcs_user") = Request.form("ManSelected")
rseditPrcs_user.update
Response.write "<script>back()</script>"
end if
%>
<html>
<link href="css/style.css" rel="stylesheet" type="text/css">
<title>请选择人员</title></head>
<body background="images/mainSkinBG.gif">
<table width="100%" leftmargin="0" topmargin="0">
<tr><td align=left><img src="Images/guanli_right.gif" width="380" height="81"></td> </tr>
</table>
<%
Set rsdept = Server.CreateObject("Adodb.RecordSet")
rsdept.open "Select * from dept",conn,3,3
Set rsMan = Server.CreateObject("Adodb.RecordSet")
rsMan.open "Select * from user",conn,3,3
%>
<script language = "JavaScript">
var onecount;
onecount=0;
man = new Array();
<%
CountLinkAction = 0
do while not rsMan.eof
%>
man[<%=CountLinkAction%>] = new Array("<%= trim(rsMan("name"))%>","<%= trim(rsMan("part"))%>");
<%
CountLinkAction = CountLinkAction + 1
rsMan.movenext
loop
rsMan.close
set rsMan=nothing
%>
onecount=<%=CountLinkAction%>;
function changelocation(locationid)
{
if(locationid == "all")
{//select all part
document.form1.selectlei2.length = 0;
document.form1.selectlei2.options[document.form1.selectlei2.length] = new Option("所有人员","all");
var i;
for (i=0;i < onecount; i++)
{// onecount is all man count
document.form1.selectlei2.options[document.form1.selectlei2.length] = new Option(man[i][0], man[i][1]);
}
}
else
{
document.form1.selectlei2.length = 0;
var i,flag;
flag = 0;
for (i=0;i < onecount; i++)
{// onecount is all man count
if (man[i][1] == locationid)
{ //locationid is part's name and the selectlei2's length is changeing
if(flag == 0)
{
document.form1.selectlei2.options[document.form1.selectlei2.length] = new Option("所有人员","all");
flag =1;
}
document.form1.selectlei2.options[document.form1.selectlei2.length] = new Option(man[i][0], man[i][0]);
}
}
}
}
function changelocation2(locationid)
{//第二个 select中单击后为第三个select赋值
var i;
var x;
var Sign = 0;
if(locationid == "all")
{ for(i=1;i < document.form1.selectlei2.length;i++)
{ var oOption = document.createElement("OPTION");
oOption.text = document.form1.selectlei2.options[i].text;
oOption.value = document.form1.selectlei2.options[i].value;
if(document.form1.selectlei3.length > 0)
{ for(x=0;x < document.form1.selectlei3.length;x++)
{ if(document.form1.selectlei3.options[x].text == oOption.text)
{
Sign = 1;
break;
}
}
if(Sign == 0)
{document.form1.selectlei3.options.add(oOption);
//Sign = 1;
}
}
else
{ document.form1.selectlei3.options.add(oOption);
}
}
}
else
{ var oOption = document.createElement("OPTION");
oOption.text = document.form1.selectlei2.options[document.form1.selectlei2.selectedIndex].text;
oOption.value = document.form1.selectlei2.options[document.form1.selectlei2.selectedIndex].value;
if(document.form1.selectlei3.length > 0)
{ for(x=0;x < document.form1.selectlei3.length;x++)
{
if(document.form1.selectlei3.options[x].text == oOption.text)
{
Sign = 1;
break;
}
}
if(Sign == 0)
{
document.form1.selectlei3.options.add(oOption);
//Sign = 1;
}
}
else
{
document.form1.selectlei3.options.add(oOption);
}
}
}
function ChangeSelectlei3()
{//第三个 select中单击后删除单击项
document.form1.selectlei3.remove(document.form1.selectlei3.selectedIndex);
}
function Select()
{
// var myArgument = new Array();
// myArgument = window.dialogArguments;
//var parameter = myArgument[0];//该步骤的id
//alert(window.dialogArguments);
var IntcboLg=document.form1.selectlei3.length;
var strcboValue='';
var strcboText='';
for (var i=0;i<IntcboLg;i++ )
{//开始取第三个select的值
if (strcboValue=='')
{
strcboValue=strcboValue+document.form1.selectlei3.options(i).value;
strcboText=strcboText+document.form1.selectlei3.options(i).text;
}else
{
strcboValue=strcboValue+','+document.form1.selectlei3.options(i).value;
strcboText=strcboText+','+document.form1.selectlei3.options(i).text;
}
}
if (strcboValue!=''){
var Strreturn=strcboValue+'#'+strcboText;
//strcboValue//部门
//strcboText//姓名
//window.returnValue=Strreturn//windows返回值
document.form1.StepId.value = <%=id%>
document.form1.ManSelected.value = strcboText;
document.form1.submit();
//window.history.back();
window.close();
}
}
</script>
<table width="688" border=0 cellspacing="0" cellpadding="0" align="center">
<tr><td colspan="3"><img src="images/table_top.gif" width="688" height="24"></td></tr>
<tr><td width="8" background="images/table_left.gif"></td><td width="669" align="center">
<form name="form1" method="post" action="WorkFlowStepManSelected.asp">
<table width="380" align="center" cellpadding="5" cellspacing="1" >
<tr><td width="33%" align="center">部门</td><td width="33%" align="center">人员</td><td align="center">您所选人员</td></tr>
<tr><td align="center">
<select name="selectlei" style="width:120px" multiple size="15" onChange="changelocation(document.form1.selectlei.options[document.form1.selectlei.selectedIndex].value)">
<option value="all">所有部门</option>
<% do while not rsdept.eof and not rsdept.bof %>
<option value="<%=rsdept("dept")%>"><%=rsdept("dept")%></option>
<% rsdept.movenext
loop
%>
</select>
</td><td align="center">
<select name="selectlei2" style="width:120px" multiple size="15" id="selectlei2" onChange="changelocation2(document.form1.selectlei2.options[document.form1.selectlei2.selectedIndex].value)"></select>
</td><td align="center">
<select name="selectlei3" style="width:120px" multiple size="15" id="selectlei3" onChange="ChangeSelectlei3()">
<% selectedman = split(rseditPrcs_user2("Prcs_user"),",")
for i_selected =0 to Ubound(selectedman)
%>
<option value="<%=selectedman(i_selected)%>"><%=selectedman(i_selected)%></option>
<%Next%>
</select></td></tr>
<tr><td colspan="3" align="center"><input type="hidden" name="ManSelected" value=""></td></tr>
<tr><td colspan="3" align="center"><input type="hidden" name="StepId" value=""></td></tr>
<tr><td colspan="3" align="center"><input name="Submit" type="button" class="button" value="确 定" onclick="Select()"> <input type="button" class="button" name="back" value="返回" onClick="javascript:window.history.back();"></td></tr>
</table>
</form>
<td width="11" background="images/table_right.gif"></td>
</tr>
<tr>
<td colspan="3"><img src="images/table_bottom.gif" width="688" height="12"></td>
</tr>
</table>
</body>
</html>
公元二零零五年五月二十四日,我在此注册博客成功,第一个感觉,速度比较慢,希望我能变得喜欢它.