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

📄 selectguest.asp

📁 功能齐全的oa系统
💻 ASP
字号:
<%option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/Page.asp" -->
<%
Response.Expires = -1
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "Cache-Control","no-cache,must-revalidate"

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(conn)

If Request.Form.Count > 0 Then

	StrRoleIDs = Request.Form("ITEM")
  if StrRoleIDs = "" then
%>
<script language=javascript>
    alert("没有选择客户,请重新选择!")
    window.history.back();
</script>
<%
    Response.End
 end if
	
	
	StrSQL = "Select Gname From T_CRM_Guest Where ID = " & StrRoleIDs
	ArrList = C.List(1,0,StrSQL)
	StrRoleName=ArrList(0,i)

%>
<script language=javascript>
	window.opener.ChangeRole("<%=StrRoleIDs%>","<%=StrRoleName%>")
	window.close()
</script>
<%
End If

StrRoleIDs = Request.QueryString("IDs")


Function IsChecked(ID)
	'Dim i
	'For i = LBound(ArrRole) To UBound(ArrRole)
		If Cint(StrRoleIDs)=ID Then
			IsChecked = True
			Exit Function
		End If
	'Next
	IsChecked = False
End Function

IntPageNo	= Request.QueryString("PageNo")
IntPageSize = 12

StrSQL = "Select ID,Gname From t_CRM_Guest"

Set ObjRS = conn.Execute(StrSQL)
If ObjRS.EOF Then
  Response.Write "<body background='../../../images/bg_1.gif'><table border=0 height='100%' width='100%'><tr><td valign=middle align=center>目前没有任何客户信息<td></tr></table></body>"  
  Response.End
End if

ArrList = C.List(IntPageNo,IntPageSize,StrSQL)	'使用List()函数获得列表数组
IntPageCount = C.GetPageCount()					        '使用GetPageCount()函数获得总页码
IntRows = C.GetRows()							              '使用GetRows()获得总返回的行数
IntCols = C.GetCols()	

conn.Close
Set conn = Nothing

Sub Main
%>
<form method="POST" action="SelectGuest.asp">
	<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=Ltr name=ITEMTR>
		<td><input type=radio name=ITEM id=<%=ArrList(0,i)%> value=<%=ArrList(0,i)%>></td>
	<td><%=ArrList(1,i)%></td>
	</tr>
<%
	Next		
%>
	</table>
<%PageFooter IntPageCount,"PageNo"%>
	<input type="submit" class=Button value="提  交" name="B1">
	</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)
{
	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 + -