📄 selectaccount.asp
字号:
<%option explicit%>
<%
Response.Expires = -1
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "Cache-Control","no-cache,must-revalidate"
%>
<!-- #include virtual="DataEnvi.asp" -->
<!-- #include virtual="Page.asp" -->
<%
Dim ObjDB,StrSQL
Dim IntPageCount,IntPageNo,IntPageSize
Dim C,ArrList,i,j,IntRows,IntCols
Dim StrRoleIDs,StrRoleName,ObjRS
Dim ArrRole
Set ObjDB = Server.CreateObject("Adodb.Connection")
OpenDB ObjDB
Set C = Server.CreateObject ("CMS2003.DBhandle")
C.Init(ObjDB)
If Request.Form.Count > 0 Then
StrRoleIDs = Request.Form("ITEM")
StrRoleIDs = Replace(StrRoleIDs," ","")
StrSQL = "Select TrueName From t_OA_SYS_Account_Character Where AccountID In (" & StrRoleIDs & ")"
ObjRS = C.List(1,0,StrSQL)
For i = 0 To C.GetRows()
StrRoleName = StrRoleName & ObjRS(0,i) & "\n"
Next
%>
<script language=javascript>
window.opener.ChangeAccount("<%=StrRoleIDs%>","<%=StrRoleName%>")
window.close()
</script>
<%
End If
StrRoleIDs = Request.QueryString("IDs")
ArrRole = Split(StrRoleIDs,",")
Function IsChecked(ID)
Dim i
For i = LBound(ArrRole) To UBound(ArrRole)
If Cint(ArrRole(i))=ID Then
IsChecked = True
Exit Function
End If
Next
IsChecked = False
End Function
IntPageNo = Request.QueryString("PageNo")
IntPageSize = 12
StrSQL = "Select AccountID,TrueName,Des From t_OA_SYS_Account_Character"
ArrList = C.List(1,0,StrSQL) '使用List()函数获得列表数组
IntPageCount = C.GetPageCount() '使用GetPageCount()函数获得总页码
IntRows = C.GetRows() '使用GetRows()获得总返回的行数
IntCols = C.GetCols() '使用GetCols()获得总返回的列数
ObjDB.Close
Set ObjDB = Nothing
%>
<%'==================================================================%>
<%Sub Main%>
<%'------------------------------------------------------------------%>
<form method="POST" action="" id=form1 name=form1>
<table class=Ltable cellspacing=1 cellpadding=3>
<tr class=LHtr>
<td width=1%></td>
<td width=99%>角色</td>
</tr>
<%
For i = 0 To IntRows
%>
<tr class=L<%If IsChecked(ArrList(0,i)) Then Response.Write "S"%>tr name=ITEMTR id=<%=ArrList(0,i)%>>
<td><input type=checkbox <%If IsChecked(ArrList(0,i)) Then Response.Write " checked "%> name=ITEM id=<%=ArrList(0,i)%> value=<%=ArrList(0,i)%>></td>
<td><%=ArrList(1,i)%></td>
</tr>
<%
Next
%>
</table>
<input type="submit" value="提交" name="B1"></td>
</form>
<%'------------------------------------------------------------------%>
<%End Sub%>
<%'==================================================================%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="<%=Application("ROOTPATH")%>Templet/Main.css">
<script language=javascript>
function DocOnclick(){
if(!document.all)return;
if (event.srcElement.name=="ITEM") {
srcID = event.srcElement.id
if(srcID==0)
SelectAll(event.srcElement.checked)
else
SelectTr(srcID,1)
return
}
if (event.srcElement.parentElement.name=="ITEMTR")
SelectTr(event.srcElement.parentElement.id,2)
}
function SelectTr(ID,Type){
var IsOn = false
for(i=0;i<document.all("ITEM").length;i++){
if(document.all("ITEM")(i).id==ID){
if(Type==1)
IsOn = document.all("ITEM")(i).checked
else{
IsOn = !document.all("ITEM")(i).checked
document.all("ITEM")(i).click();
}
}
}
for(i=0;i<document.all.length;i++){
if(document.all[i].name=="ITEMTR")
if(document.all[i].id==ID){
if(IsOn)
document.all[i].className="LStr";
else
document.all[i].className="Ltr";
}
}
}
function SelectAll(IsOn){
for(i=0;i<document.all.length;i++){
if(document.all[i].name=="ITEMTR")
if(IsOn)
document.all[i].className="LStr";
else
document.all[i].className="Ltr";
if(document.all[i].name=="ITEM")
document.all[i].checked=IsOn;
}
}
function getItems(){
var Items = new Array()
//alert(document.all("ITEM").length)
for(var i=0;i<document.all("ITEM").length;i++){
if(document.all("ITEM")(i).checked)
Items[Items.length] = document.all("ITEM")(i).id
}
return Items
}
document.onclick = DocOnclick
//document.ondblclick = DocDBclick
function CheckForm(theForm){
//检查空
for(var i=0;i<theForm.length;i++){
if(theForm[i].Check==1){
if(theForm[i].value==""){
doAlert(1,theForm[i].Show+"不能为空")
theForm[i].focus()
return false
}
}
if(theForm[i].Check==3){
if(theForm[i].value!=theForm(theForm[i].To).value){
doAlert(1,theForm[i].Show)
theForm[i].focus()
return false
}
}
}
return true
}
function doAlert(intType,strMessage){
var strTemp;
var strVersion;
var varReturn;
strVersion = navigator.appVersion;
strTemp ="<%=Application("RootPath")%>Dialog/alertwindow.asp?intType=" + intType +"&strMessage="+strMessage + "&R=" + Math.random();
if(strVersion.indexOf("MSIE 5")!=0 && strVersion.indexOf("MSIE 5")!=-1)
varReturn = window.showModalDialog(strTemp,"Dialog Arguments Value","dialogHeight: 220px; dialogWidth: 300px; center: Yes; help: No; resizable: No; status: no;scroll=no");
else{
varReturn = window.showModalDialog(strTemp,"Dialog Arguments Value","dialogHeight: 220px; dialogWidth: 300px; center: Yes; help: No; resizable: no; status: no;scroll=no");
}
return varReturn;
}
function DocDBclick(){
if(!document.all)return;
if (event.srcElement.parentElement.name=="ITEMTR")
parent.frmToolbar.doViewOne(event.srcElement.parentElement.id)
}
function doBack(){
window.history.go(-1)
}
function doList(){
parent.frmToolbar.doList()
}
function InputDate(Field)
{
//alert(event.clientX)
//alert(event.clientY)
window.dateField = Field
var winX = event.screenX
var winY = event.screenY - 250
if(winX<0)winX=winX+230;
calendar = window.open('/include/SelectDate.htm','cal','Left=' + winX + ',Top=' + winY + ',WIDTH=230,HEIGHT=230')
}
</script>
</head>
<body topmargin="0" leftmargin="0" topmargin="0">
<%Main%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -