⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 userlist.asp

📁 具有计划、任务、通告、公文、员工档案、等网络办公功能
💻 ASP
字号:
<!-- #include file="../conn_lr.asp"-->
<%
oabusyname=request.cookies("oabusyname")
oabusyusername=request.cookies("oabusyusername")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
if oabusyusername="" then 
	response.write("<script language=""javascript"">")
	response.write("window.top.location.href='../../default.asp';")
	response.write("</script>")
	response.end
end if
%>
<html><head>
<title>选择用户</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">

<%  
		SET rs=Server.CreateObject("ADODB.RecordSet")
	if Session("alllist")=""  then

		rs.open "select name,userdept from [userinf] order by id desc ",Session("conn"),1,1
		j=0
		while not rs.eof
			temp=temp & "my_array[" & j & "]='" & rs("userdept") & "';"
			temp=temp & "my_array[" & j+1 & "]='" & rs("name") & "';" 
			temp2=temp2 & "<option value='" & rs("name") &  "'>" & rs("name") & "</option>"
			rs.movenext
			j=j+2
		wend
		rs.close
		Session("temp2")=temp2
		Session("alllist")=temp
	end if
%>


<script language=JavaScript1.2>

function selectuser(){
        if(document.user.T2.value=="")
         window.returnValue="";
        else
          window.returnValue = document.user.T2.value+"*"+document.user.T3.value;
	window.close();
}	 
function button3_onclick()
{
	top.close();
}
function button5_onclick()
{
 var str1;
 str1="";
 var j;
 j=1;
 for(i=0;i<select2.options.length;i++)
     {
      if(j=="1")
        {
        str1=select2.item(i).text;
        }
       else
        {
        str1=str1+","+select2.item(i).text;
        }
        j=j+1;                  
    }
top.returnValue=str1+"*"+"<%=request("to")%>";
top.close();
}

function cmdadd_onclick() 
{
 if (select1.selectedIndex != -1)
   {
    for(i=select1.options.length-1;i>=0;i--)
       {
	 if (select1.item(i).selected)
           {
            if(checkname(select1.item(i).value))
              {
	       var namesel=window.Option.create(select1.item(i).text,select1.item(i).value);
               <%if request("muilt")<>"yes" then response.write("cmdclr_onclick();")%>select2.add(namesel);
              }
           }
	}
   }
   <% if request("muilt")<>"yes" then response.write("button5_onclick();")%>
}

function cmdaddall_onclick() 
{    for(i=0;i<=select1.options.length-1;i++)
       {
            if(checkname(select1.item(i).value))
              {
	       var namesel=window.Option.create(select1.item(i).text,select1.item(i).value);
               <%if request("muilt")<>"yes" then response.write("cmdclr_onclick();")%>select2.add(namesel);
              }
	}
};




function cmdclr_onclick()
{
if(select2.options.length>=0)
{
  for(i=select2.options.length-1;i>=0;i--)
     {
     select2.remove(i);
     }
}
}
function cmddel_onclick()

{
if(select2.options.length>=0)
{
  for(i=select2.options.length-1;i>=0;i--)
     {
      if(select2.item(i).selected)
        {
         select2.remove(i);
        }
     }
}
}



function checkname(user_id)
{
 for(c=0;c<window.select2.options.length;c++)
  {
    if(window.select2.item(c).value==user_id)
      {
	return false;
	break;
      }
  }
  return true;
}

function cmddel_onclick1()
{
if(select1.options.length>=0)
{
  for(i=select1.options.length-1;i>=0;i--)
     {
     select1.remove(i);
     }
}
}

function addusers(str)
{
cmddel_onclick1();//清空
var my_array = new Array();
<%=Session("alllist")%>
  for(i=0;i<my_array.length;i=i+2)
       {
	 if ((my_array[i]==str) || (str==''))
           {
	if (check(my_array[i+1])){
		var namesel=window.Option.create(my_array[i+1],my_array[i+1]);
         select1.add(namesel);}
           }
    }
}

function check(user_id)
{
 for(c=0;c<window.select1.options.length;c++)
  {
    if(window.select1.item(c).value==user_id)
      {
	return false;
	break;
      }
  }
  return true;
}

</script>
<meta content="MSHTML 5.50.4807.2300" name=GENERATOR>

</head>
<body   class=p1  bgcolor=buttonface tonload='addusers("");' style="scroll:none;border:none;background:none;" leftmargin="0" topmargin="0" >

  <select class=p1 id=select1 
style="Z-INDEX: 112; LEFT: 5px; 
WIDTH: 152px; POSITION: absolute; TOP: 7px; HEIGHT: 200px" 
multiple size=2 name=select1  
 <% if request("muilt")<>"yes" then response.write("onchange='cmdadd_onclick()'") else response.write("onDblClick='return cmdadd_onclick()'") %>
>
<%=Session("temp2")%>
  </select>
  <select class=p1 id=select2 
style="Z-INDEX: 112; LEFT: 228px; WIDTH: 149px; POSITION: absolute; TOP: 7px; HEIGHT: 200px" 
multiple size=2 name=select2>

  </select>
    
<input title="全部选择" background="<%=Session("vtabletitlebackcolor")%>" language=javascript onMouseOver="this.className='coolbar'" onMouseOut="this.className='coolBarflat1'"  onMouseDown="this.className='coolBardown'" class=coolBarflat1  id=cmdaddall style="Z-INDEX: 103; LEFT: 172px; WIDTH: 45px; POSITION: absolute; TOP: 30px; HEIGHT: 21px" onClick="return cmdaddall_onclick()" <%if request("muilt")<>"yes" then response.write("disabled")%> type=button value=">>" name=button5>
<input title="选择" background="<%=Session("vtabletitlebackcolor")%>" language=javascript onMouseOver="this.className='coolbar'" onMouseOut="this.className='coolBarflat1'"  onMouseDown="this.className='coolBardown'" class=coolBarflat1  id=cmdadd    style="Z-INDEX: 103; LEFT: 172px; WIDTH: 45px; POSITION: absolute; TOP: 70px;  HEIGHT: 21px" onClick="return cmdadd_onclick()" type=button value=">" name=button1>
<input title="删除" background="<%=Session("vtabletitlebackcolor")%>" language=javascript onMouseOver="this.className='coolbar'" onMouseOut="this.className='coolBarflat1'"  onMouseDown="this.className='coolBardown'" class=coolBarflat1  id=cmddel    style="Z-INDEX: 103; LEFT: 172px; WIDTH: 45px; POSITION: absolute; TOP: 110px; HEIGHT: 21px" onClick="return cmddel_onclick()" type=button value="<" name=button2>
<input title="全部删除" background="<%=Session("vtabletitlebackcolor")%>" language=javascript onMouseOver="this.className='coolbar'" onMouseOut="this.className='coolBarflat1'"  onMouseDown="this.className='coolBardown'" class=coolBarflat1  id=cmdclr    style="Z-INDEX: 103; LEFT: 172px; WIDTH: 45px; POSITION: absolute; TOP: 150px; HEIGHT: 21px" onClick="return cmdclr_onclick()" type=button value="<<" name=button4>

<hr style="Z-INDEX: 103; LEFT: 170px; WIDTH: 47px; POSITION: absolute; TOP: 60px; HEIGHT: 1px" noshade>
<hr style="Z-INDEX: 103; LEFT: 170px; WIDTH: 47px; POSITION: absolute; TOP: 100px; HEIGHT: 1px" noshade>
<hr style="Z-INDEX: 103; LEFT: 170px; WIDTH: 47px; POSITION: absolute; TOP: 140px; HEIGHT: 1px" noshade>




<hr style="Z-INDEX: 103; LEFT: 300px; WIDTH: 1px; POSITION: absolute; TOP: 197px; HEIGHT: 25px" noshade>
<button background="<%=Session("vtabletitlebackcolor")%>" language=javascript onMouseOver="this.className='coolbar'" onMouseOut="this.className='coolBarflat1'"  onMouseDown="this.className='coolBardown'" class=coolBarflat1   style="Z-INDEX: 108; LEFT: 240px; WIDTH: 55px; POSITION: absolute; TOP: 199px; HEIGHT: 21px" onClick="return button5_onclick()" >确定</button> 
<button background="<%=Session("vtabletitlebackcolor")%>" language=javascript onMouseOver="this.className='coolbar'" onMouseOut="this.className='coolBarflat1'"  onMouseDown="this.className='coolBardown'" class=coolBarflat1   style="Z-INDEX: 108; LEFT: 305px; WIDTH: 55px; POSITION: absolute; TOP: 199px; HEIGHT: 21px" onClick="return button3_onclick()" ><img src=../images/cancel.gif width=16 height=14 align="absmiddle">取消</button> 
<select class=p1 id=bmid 
style="Z-INDEX: 108; font-size:12px;LEFT: 5px; WIDTH: 151px; POSITION: absolute; TOP: 198px; HEIGHT: 25px" 
onChange=addusers(this.value); size=1 name=bm>
<option value="" >所有部门</option>
<%	
	rs.open "select DISTINCT userdept from userinf",Session("conn"),1,1
	while not rs.eof
		response.write("<option ")
		if rs("userdept")=oabusyuserdept then response.write(" selected ")
		response.write(" value='" & rs("userdept") & "'>"  & rs("userdept") & "</option>")
		rs.movenext
	wend
	rs.close
	set rs=nothing
	

%>
</select>
<script language=javascript>
addusers(bmid.value);
</script>

</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -