📄 class_public.asp
字号:
<%
'====================================================================
'= CnwyAsp 请假信息管理系统
'= 河南省宝丰县第二高级中学 文 三(2) 班
'= 作者:王铮(Cnwy)QQ32940696
'= Copyright (c) 2005 Cnwy Wang All Rights Reserved.
'=-------------------------------------------------------------------
'= 文件名称:class_public.asp
'= 摘 要:共用类文件
'=-------------------------------------------------------------------
'= 开始编写日期:2005-08-26
'= 编写完成日期:
'= 最后修改日期
'====================================================================
%>
<%
Class CnwyAsp_Public
Public checks,checkn
Public title,url,mailpage,adminpage,online,maildx,vacpage,duty,turn,vacl
private sub class_initialize()
call connopen()
dim rs,sql
sql="select * from CnwyAsp_config where id=1"
set rs=conn.execute(sql)
title=rs("title")
url=rs("url")
mailpage=rs("mailpage")
adminpage=rs("mailpage")
maildx=rs("maildx")*1024
vacpage=rs("vacpage")
duty=rs("duty")
vacl=rs("vaclim")
turn=rs("turn")
online=rs("online")
rs.close
set rs=nothing
end sub
Public Function indexpage() '首页随机数字生成
dim num
call connopen()
Randomize
num = Int(7999 * Rnd + 2000)
session("check")=num
if request.cookies("user")<>"" then
sql="update CnwyAsp_admin set online=false where user='"&request.cookies("user")&"'"
conn.execute(sql)
with response
.Cookies("pass")=""
.Cookies("name")=""
.Cookies("master")=""
.Cookies("type")=""
.cookies("user")=""
end with
end if
call connclose()
End Function
public property let checkss(ByVal strvar)
dim strarray
checks=strvar
strarray=array(" ","@","#","!","%","^","&","*","=","<",">","?","~","'","$","(",")","+",".",",","'","""")
for i=0 to ubound(strarray)
checks=replace(checks,strarray(i),"")
next
end property
public property get checkstr
checkstr=trim(lcase(checks))
end property
Public property let checkstrvar(ByVal strvar)
dim strarray,arraynum
strarray=array(" ","@","#","!","%","^","&","*","=","<",">","?","~","'","$","(",")","+",".",",","'","""")
checkn=0
arraynum=ubound(strarray)
for i=0 to arraynum
checkn=instr(strvar,strarray(i))+checkn
next
End property
public property get checknumer
checknumer=checkn
end property
Public Function errinfo(info) '错误消息函数
With Response
.Write("<script language='javascript'>")
.Write("alert('"&info&"');")
.Write("window.location.href('index.asp');")
.Write("</script>")
End With
End Function
Public Function massage(info)
With Response
.Write("<script language='javascript'>")
.Write("alert('"&info&"');")
.Write("history.go(-1);")
.Write("</script>")
End With
End function
Public Function pagelist(path,num,pagenum,page)
dim firstpage,finalpage,lastpage,nextpage,sel
dim str,str1
str="javascript:document.cnwy.cnwy.value="
str1=";document.cnwy.submit();"
firstpage=str&"1"&str1
finalpage=str&pagenum&str1
nextpage=str&page+1&str1
lastpage=str&page-1&str1
with response
.write("<table width='0' border='0' cellpadding='0' cellspacing='0'><form name='cnwy' method='post' action='"&path&"'>")&vbcrlf
.write("<tr> <td width='170'>共"&num&"条信息 共"&pagenum&"页 当前第"&page&"页</td>") &vbcrlf
if pagenum=1 then
.write("<td width='170'>|首页|上一页|下一页|末页|</td>")&vbcrlf
elseif page=1 and pagenum>1 then
.write("<td width='170'>|首页|上一页|<a href="&nextpage&">下一页</a>|<a href="&finalpage&">末页</a>|</td>")&vbcrlf
elseif asc(page)=asc(pagenum) then
.write("<td width='170'>|<a href="&firstpage&">首页</a>|<a href="&lastpage&">上一页</a>|下一页|末页|</td>")&vbcrlf
else
.write("<td width='170'>|<a href="&firstpage&">首页</a>|<a href="&lastpage&">上一页</a>|<a href="&nextpage&">下一页</a>|<a href="&finalpage&">末页</a>|</td>")&vbcrlf
end if
.write("<td width='40'>转到:</td><td width='68'><select name='cnwy' onChange='submit();'>") &vbcrlf
for i=1 to pagenum
if clng(i)=clng(page) then
sel="selected"
else
sel=""
end if
.write("<option value='"&i&"' "&sel&">第"&i&"页</option>")&vbcrlf
next
.write("</select></td></tr></form></table>")&vbcrlf
end with
End Function
End Class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -