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

📄 function.asp

📁 25175学生档案管理系统是一款学校学生档案管理系统.提供丰富的查询、登记、修改功能等。界面美观、时尚
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%

Dim outcom
Sub sqllist(sql,colnum,strFileName,formaction)
	PurviewChecked=False
	if request("page")<>"" then
		currentPage=cint(request("page"))
	else
		currentPage=1
	end If
	set rs=server.createobject("adodb.recordset")
	
	rs.open sql,conn,3,2
	if rs.eof and rs.bof then
		response.write "<tr><td width='100%' height='100' align='center' colspan='"&colnum&"' class=""main_info"">当前列表为空</td></tr></form></TABLE>"
	Else
		response.write "<form name=""del"" method=""Post"" action="""&formaction&""">"
		pagedw="条记录"
		totalPut=rs.recordcount

		if currentpage<1 Then currentpage=1
		if (currentpage-1)*MaxPerPage>totalput then
			if (totalPut mod MaxPerPage)=0 then
				currentpage= totalPut \ MaxPerPage
			else
				currentpage= totalPut \ MaxPerPage + 1
			end if
		end If
		if currentPage<>1 then
			if (currentPage-1)*MaxPerPage<totalPut then
				rs.move  (currentPage-1)*MaxPerPage
				dim bookmark
				bookmark=rs.bookmark				
			else
				currentPage=1
			end If
		end If
		outcom=True
	end If
End Sub


Sub showdelpages()
response.write "<tr><td class=""art_info2"" align=""center"">"& vbcrlf & _
		"<input name=""chkAll"" class=""chek"" type=""checkbox"" id=""chkAll"" " & _
		"onclick=CheckAll(this.form) value=""checkbox"" style="" border: 0px;width:15px;"">"& vbcrlf & _
		"</td>"& vbcrlf & _
		"<td colspan="&colnum-1&"><label for=""chkAll"" style=""float:left;""><span>全选</span></label>"& vbcrlf & _
		"<div class=""but_del"">&nbsp;&nbsp;<a href=""#"" onclick=""ConfirmDel('del');"" class=""butt""><span>删除</span></a></div>"& vbcrlf & _
		"</td></tr>"& vbcrlf & _
		"<tr><td colspan="&colnum&" align=""left"" style=""padding-left:10px;"">"& vbcrlf
'showpage strFileName,totalput,MaxPerPage,true,false,pagedw
response.write "<script language=""JavaScript"">"& vbcrlf & _
	"var pg = new showPages('pg');"& vbcrlf & _
	"pg.pageCount ="&totalput \ MaxPerPage+1&";  // 定义总页数(必要)"& vbcrlf & _
	"pg.totalput ="&totalput&";  // "& vbcrlf & _
	"pg.MaxPerPage ="&MaxPerPage&"; "& vbcrlf & _
	"//pg.argName = 'p';  // 定义参数名"& vbcrlf & _
	"pg.printHtml(2);"& vbcrlf & _
	"</script>"& vbcrlf & _
	"</td></tr>"& vbcrlf
End Sub

'================================================================
'搜索语句构造
'Sql_Lists 搜索列名
'Sql_tables 操作表名
'Sql_Condition 条件
'Sql_Sortings 排序
'Sql_Orders 0为顺序 1为倒序
'Sql_Additional 分组group by
'================================================================
Function Sqlinfo(Sql_Lists,Sql_tables,Sql_Conditions,Sql_Sortings,Sql_Orders,Sql_Additional)
	Sqlinfo="select " & Sql_Lists
	If Sql_Lists="" Then Sqlinfo=" select " & "*"
	If Sql_tables="" Then
		Sqlinfo="errors!"
		Exit Function 
	Else 
		Sqlinfo = Sqlinfo & " from " & Sql_tables
	End If
	If Sql_Conditions <> "" Then Sqlinfo = Sqlinfo & " where " & Sql_Conditions
	If Sql_Additional <> "" Then Sqlinfo = Sqlinfo & " group by " & Sql_Additional
	If Sql_Sortings <> "" Then
		Sqlinfo = Sqlinfo & " order by " & Sql_Sortings
		If Sql_Orders = 1 Then
			Sqlinfo = Sqlinfo & " desc "
		Else
			Sqlinfo = Sqlinfo & " "
		End If 
	End If 
End Function 
Function websyss(infoid)
	Set rsinfoid = server.CreateObject("adodb.recordset")
	sql="select * from websys where id=1"
	rsinfoid.Open sql,Conn,1,1
	If Not rsinfoid.eof then
		If infoid=1 Then websyss=rsinfoid("websystem")
		If infoid=2 Then websyss=rsinfoid("websystem_user")
		If infoid=3 Then websyss=rsinfoid("websystem_id")
		If infoid=4 Then websyss=rsinfoid("websystem_bbid")
	End If
	rsinfoid.close
End Function

Sub sqldel(Sql_tables,Sql_Conditions)
Dim temp_Conditions
temp_Conditions=""
If Sql_Conditions="" Then
	temp_Conditions="id in ("&id&")"
elseIf Sql_Conditions<>"" And Len(Replace(Sql_Conditions,"=",""))=Len(Sql_Conditions) Then
	temp_Conditions = "id in ("&Sql_Conditions&")"
elseIf Sql_Conditions<>"" And ( Len(Replace(Sql_Conditions,"=",""))<>Len(Sql_Conditions) Or  Len(Replace(Sql_Conditions,"<",""))<>Len(Sql_Conditions) Or  Len(Replace(Sql_Conditions,">",""))<>Len(Sql_Conditions) Or Len(Replace(Sql_Conditions,"(",""))<>Len(Sql_Conditions)  ) Then
	temp_Conditions = Sql_Conditions
End If
If temp_Conditions<>"" Then temp_Conditions = "where " & temp_Conditions
set dels=conn.execute("delete from "&Sql_tables& " " & temp_Conditions )
set dels=Nothing 
End Sub 

Sub isn(strinfo,backinfo,strtype)
select Case strtype
	Case 1
	If len(strinfo)=0 Then errormsg backinfo&"为空!"
	Case 2
	If Not IsNumeric(strinfo) Then errormsg backinfo&"错误!"
	Case 3
	If strinfo="0" Then errormsg backinfo&"为空!"
End select
End Sub

'================================================================
'提示
'================================================================
sub main_errormsg(errmsg)
	response.write " "& vbcrlf &_
	"<CENTER><div class=""msg"">"& vbcrlf &_
	"<H3>"&errmsg&"</H3>"& vbcrlf &_
	"<H3>请 <a href='javascript:history.go(-1)'><U><B>返回上一页</B></U></a> 或者 <a href=""javascript:window.location='index.asp';""><U><B>返回首页</B></U></a> &nbsp;</H3><BR><BR></div></CENTER>"& vbcrlf
end Sub
Dim comurl
If Request.ServerVariables("HTTP_REFERER")<>"" Then Comeurl=Request.ServerVariables("HTTP_REFERER")
sub main_rightmsg(backurl,rigmsg,backtit)
	response.write "<meta HTTP-EQUIV=REFRESH CONTENT='3; URL="&backurl&"'>"& vbcrlf &_
	"<CENTER><div class=""msg1 suc"">"& vbcrlf &_
	"<H3>"&rigmsg&"</H3>"& vbcrlf &_
	"<H3>三秒钟后将跳转到<A HREF="""&backurl&"""><B>"&backtit&"</B></A></H3><BR><BR>"& vbcrlf &_
	"<H3>自定义操作:</H3>"& vbcrlf &_
	"<H3>&nbsp;&nbsp;&nbsp;&nbsp;<a href="""&backurl&"""><U>立刻转到<B>"&backtit&"</B></U></a></H3>"& vbcrlf &_
	"<H3>&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:history.go(-1)'><U><B>返回上一页</B></U></a></H3>"& vbcrlf &_
	"<H3>&nbsp;&nbsp;&nbsp;&nbsp;<a href=""javascript:window.location='index.asp';""><U><B>返回首页</B></U></a> &nbsp;</H3>"& vbcrlf &_
	"<BR><BR></div></CENTER>"& vbcrlf
end Sub

sub errormsg(errmsg)
	response.write "<link href=""images/css.css"" type=""text/css"" rel=""stylesheet"" /><meta http-equiv=""Content-Type"" content=""text/html; charset=bg2312"" />"& vbcrlf &_
	"<table width=""50%"" border=""1"" align=""center"" class=""msg err""><tr>"& vbcrlf &_
	"<th>操作出错:</th>"& vbcrlf &_
	"<tr><td><ul class=""infos"">"& Replace(errmsg,"|","<li>") & vbcrlf &_
	"<li><a href='javascript:history.go(-1)'><B>返回上一页</B></a></li></ul></td></tr></table>"& vbcrlf &_
	response.end
end Sub

sub rightmsg(backurl,rigmsg)
		If backurl="" Then backurl=Comeurl
		'自动返回前一页(也可根据backurl设定)
		response.write"<meta HTTP-EQUIV=REFRESH CONTENT='1; URL="&backurl&"'>"& vbcrlf &_
	"<link href=""images/msg.css"" type=""text/css"" rel=""stylesheet"" /><meta http-equiv=""Content-Type"" content=""text/html; charset=bg2312"" />"& vbcrlf &_
		"<table width=""50%"" border=""1"" align=""center"" class=""msg suc""><tr>"& vbcrlf &_
	"<th>操作成功:(1秒后自动返回)</th>"& vbcrlf &_
	"<tr><td><ul class=""infos"">"&Replace(rigmsg,"|","<li>") & vbcrlf &_
	"<li><a href='javascript:history.go(-1)'><B>返回上一页</B></a></li></ul></td></tr></table>"& vbcrlf
	response.end
end Sub


'================================================================
'搜索语句执行 返回记录集为数组
'================================================================
Dim connopens
Function connopen(sql)
	Set rs_web = server.CreateObject("adodb.recordset")
	rs_web.Open sql,Conn,1,1
	If Not rs_web.eof Then 
		connopen = rs_web.GetRows()
	Else
		connopen=0
	End If 
	rs_web.close
	Set rs_web = nothing 
End Function

'================================================================
'过滤危险字符
'================================================================
Function op(strvalue,strtext,strdefault)
	op=""
	op="<option value="""&strvalue&""" "
	If Int(strdefault)=Int(strvalue) Then op=op & " selected "
	op=op&">"&strtext&"</option>"
End Function

Function che(Str) 
If Isnull(Str) Then 
	che = "" 
	Exit Function 
End If 
Str = Replace(Str,Chr(0),"") 
Str = Replace(Str,"<","&lt;") 
Str = Replace(Str,">","&gt;") 
Str = Replace(Str, "script", "") 
Str = Replace(Str, "SCRIPT", "") 
Str = Replace(Str, "Script", "") 
Str = Replace(Str, "script", "") 
Str = Replace(Str, "object", "") 
Str = Replace(Str, "OBJECT", "") 
Str = Replace(Str, "Object", "") 
Str = Replace(Str, "object", "") 
Str = Replace(Str, "applet", "") 
Str = Replace(Str, "APPLET", "") 

⌨️ 快捷键说明

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