📄 groupmember.asp
字号:
<!--#include file="../function/connect.asp"-->
<!--#include file="../function/function.asp"-->
<%
if request("client_id")<>"" then
Group_ID=request("Group_ID")
client_id=request("client_id")
client_ids=split(client_id,",")
strsql="delete from GroupMembers where Group_ID=" & Group_ID
objconn.execute strsql
for i=0 to ubound(client_ids)
if client_ids(i)<>"" then
strsql="insert into GroupMembers(Group_ID,client_ID,Creator) values('"
strsql=strsql & Group_ID & "','"
strsql=strsql & client_ids(i) & "','"
strsql=strsql & session("loginuser") & "')"
objconn.execute strsql
end if
next
end if
%>
<html>
<head>
<title>分组管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../cssD.css" rel=stylesheet>
</head>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
// Compare two options within a list by VALUES
function compareOptionValues(a, b)
{
// Radix 10: for numeric values
// Radix 36: for alphanumeric values
var sA = parseInt( a.value, 36 );
var sB = parseInt( b.value, 36 );
return sA - sB;
}
// Compare two options within a list by TEXT
function compareOptionText(a, b)
{
// Radix 10: for numeric values
// Radix 36: for alphanumeric values
var sA = parseInt( a.text, 36 );
var sB = parseInt( b.text, 36 );
return sA - sB;
}
// Dual list move function
function moveDualList( srcList, destList, moveAll )
{
// Do nothing if nothing is selected
if ( ( srcList.selectedIndex == -1 ) && ( moveAll == false ) )
{
return;
}
newDestList = new Array( destList.options.length );
var len = 0;
for( len = 0; len < destList.options.length; len++ )
{
if ( destList.options[ len ] != null )
{
newDestList[ len ] = new Option( destList.options[ len ].text, destList.options[ len ].value, destList.options[ len ].defaultSelected, destList.options[ len ].selected );
}
}
for( var i = 0; i < srcList.options.length; i++ )
{
if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )
{
// Statements to perform if option is selected
// Incorporate into new list
newDestList[ len ] = new Option( srcList.options[i].text, srcList.options[i].value, srcList.options[i].defaultSelected, srcList.options[i].selected );
len++;
}
}
// Sort out the new destination list
newDestList.sort( compareOptionValues ); // BY VALUES
//newDestList.sort( compareOptionText ); // BY TEXT
// Populate the destination with the items from the new array
for ( var j = 0; j < newDestList.length; j++ )
{
if ( newDestList[ j ] != null )
{
destList.options[ j ] = newDestList[ j ];
}
}
// Erase source list selected elements
for( var i = srcList.options.length - 1; i >= 0; i-- )
{
if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )
{
// Erase Source
//srcList.options[i].value = "";
//srcList.options[i].text = "";
srcList.options[i] = null;
}
}
} // End of moveDualList()
// End -->
</script>
<script>
function getPValue(srcList)
{
var reValue="";
for( var i = srcList.options.length - 1; i >= 0; i-- )
{
if ( srcList.options[i] != null)
{
reValue=reValue + "," + srcList.options[i].value;
}
}
if(reValue.indexOf(",")==0){
reValue=reValue.substr(1,reValue.length-1)
}
document.GG.client_id.value=reValue;
document.GG.submit();
}
</script>
<table border="1" bordercolordark=#FFFFFF bordercolorlight=#000000 cellpadding="0" cellspacing="0" align="center">
<form name="GG" action="groupMember.asp" method="post">
<tr height="22" class="tablehead" align="center">
<td width="25%">选择客户</td>
<td width="25%">操作</td>
<td width="25%">已选择客户</td>
</tr>
<tr align="center">
<td width="25%">
<select multiple size="25" style="width:100" name="listLeft" class="input">
<%
strsql="select * from clients where client_owner='" & session("loginuser") & "' or IsPublic=1"
Set objRs = Server.CreateObject("adodb.recordset")
objRs.Open strsql,objConn,1,1
if not objrs.eof then
do while not objrs.eof
%>
<option value="<%=objrs.fields("client_id")%>"><%=objrs.fields("client_name")%></option>
<%
objrs.movenext
loop
end if
%>
</select>
</td>
<td width="25%">
<input name="Add >>" type="button" style="width:90" onClick="moveDualList( this.form.listLeft, this.form.listRight, false )" value="右移 >>" class="button">
<br> <input name="Add <<" type="button" style="width:90" onClick="moveDualList( this.form.listRight, this.form.listLeft, false )" value="左移 <<" class="button">
<br> <input name="Add All >>" type="button" style="width:90" onClick="moveDualList( this.form.listLeft, this.form.listRight, true )" value="全部 >>" class="button">
<br> <input name="Add All <<" type="button" style="width:90" onClick="moveDualList( this.form.listRight, this.form.listLeft, true )" value="全部 <<" class="button">
<br><br><br> <input name="button1" type="button" style="width:90" onClick="getPValue(this.form.listRight);" value=" 确定 " class="button">
<br> <input name="button2" type="button" style="width:90" onClick="location.href='G_member.asp?Group_ID=<%=request("Group_ID")%>';" value=" 返回 " class="button">
</td>
<td width="25%">
<select multiple size="25" style="width:100" name="listRight" class="input">
<%
strsql="select * from clients c,GroupMembers g where c.client_id=g.client_ID and g.Group_ID=" & request("Group_ID")
Set objRs = Server.CreateObject("adodb.recordset")
objRs.Open strsql,objConn,1,1
if not objrs.eof then
do while not objrs.eof
%>
<option value="<%=objrs.fields("client_id")%>"><%=objrs.fields("client_name")%></option>
<%
objrs.movenext
loop
end if
%>
</select>
</td>
</tr>
<input type="hidden" name="client_id">
<input type="hidden" name="Group_ID" value="<%=request("Group_ID")%>">
</form>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -