📄 class_manage.asp
字号:
<%
'====================================================================
'= CnwyAsp 请假信息管理系统
'= 河南省宝丰县第二高级中学 文 三(2) 班
'= 作者:王铮(Cnwy)QQ32940696
'= Copyright (c) 2005 Cnwy Wang All Rights Reserved.
'=-------------------------------------------------------------------
'= 文件名称:Class_manage.asp
'= 摘 要:假条信息操作类文件
'=-------------------------------------------------------------------
'= 开始编写日期:2005-08-31
'= 编写完成日期:
'= 最后修改日期
'====================================================================
%>
<%
Class CnwyAsp_Manage
public web
private sub class_initialize()
end sub
public function system() '系统参数设置调用的方法
dim title,url,mailpage,adminpage,online,vacpage,maildx,duty,trun,vacl
dim Cnwy_public,sql,rs,info
set Cnwy_public=new CnwyAsp_public
call connopen()
title=trim(request.form("title"))
url=trim(request.form("url"))
mailpage=request.form("mailpage")
adminpage=request.form("adminpage")
online=request.form("online")
vacpage=request.form("vacpage")
maildx=request.form("maildx")
duty=request.form("duty")
turn=request.form("turn")
vacl=request.form("vaclimit")
if title="" or url="" or mailpage="" or adminpage="" or online="" or vacpage="" or maildx="" or vacl="" then
info="您填写的信息不完整.请返回重新填写."
elseif len(title)>20 then
info="您的系统名称不能超过20"
elseif not isnumeric(mailpage) or not isnumeric(adminpage) or not isnumeric(online) or not isnumeric(vacpage) or not isnumeric(maildx) or not isnumeric(vacl) then
info="对不起页数,和信箱大小必须为数字."
elseif len(mailpage)>2 or len(adminpage)>2 or len(online)>2 or len(vacpage)>2 then
info="分页数字位数不能超过2位."
elseif maildx =<0 then
info="信箱的大小不能设置为0KB."
elseif vacl<0 then
info="对不起越假时间限制不能设置为小于0的数字."
else
sql="update CnwyAsp_config set title='"&title&"',url='"&url&"',mailpage='"&mailpage&"',adminpage='"&adminpage&"'"
sql=sql&",online='"&online&"',vacpage='"&vacpage&"',maildx='"&maildx&"',vaclim='"&vacl&"',duty="&duty&",turn="&turn&" where id=1"
conn.execute(sql)
info="恭喜您修改系统参数成功."
end if
Cnwy_public.massage(info)
set Cnwy_public=nothing
call connclose()
end function
public function Sduty()
dim shenpi(6),shenhe(6),master
dim errnum1,errnum2,errnum3,errnum4,errnum5,errnum6,erruser2,erruser3,erruser4,erruser5,erruser6
dim Cnwy_public,rs,sql
set Cnwy_public=new CnwyAsp_public
call connopen
for i=0 to 6
shenpi(i)=request.form("shenpi"&i)
shenhe(i)=request.form("shenhe"&i)
if shenpi(i)="" or shenhe(i)="" then
errnum1=1
exit for
end if
next
for i=0 to 6
Cnwy_public.checkstrvar=shenpi(i)
if Cnwy_public.checknumer<>0 then
errnum2=Cnwy_public.checknumer
exit for
end if
next
for i=0 to 6
Cnwy_public.checkstrvar=shenpi(i)
if Cnwy_public.checknumer<>0 then
errnum2=Cnwy_public.checknumer
erruser2=shenpi(i)
exit for
else
Cnwy_public.checkstrvar=shenhe(i)
if Cnwy_public.checknumer<>0 then
errnum2=Cnwy_public.checknumer
erruser(i)=shenhe(i)
exit for
end if
end if
next
for i=0 to 6
sql="select * from CnwyAsp_admin where user='"&shenpi(i)&"'"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
errnum3=1
erruser3=shenpi(i)
exit for
else
master=rs("master")
if instr(master,"B")=0 then
errnum4=1
erruser4=shenpi(i)
exit for
end if
end if
next
for i=0 to 6
sql="select * from CnwyAsp_admin where user='"&shenhe(i)&"'"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
errnum5=1
erruser5=shenhe(i)
exit for
else
master=rs("master")
if instr(master,"C")=0 then
errnum6=1
erruser6=shenhe(i)
exit for
end if
end if
next
if errnum1<>0 then
info="相关信息填写不完整请返回进行填写."
elseif errnum2<>0 then
info="您提交的用户:"&erruser2&"中含有非法字符."
elseif errnum3<>0 then
info="您提交的审批用户:"&erruser3&"不存在."
elseif errnum4<>0 then
info="您提交的用户:"&erruser4&"没有审批的权限."
elseif errnum5<>0 then
info="您提交的审核用户:"&erruser5&"不存在."
elseif errnum6<>0 then
info="您提交的用户:"&erruser6&"没有审核的权限."
else
for i=0 to 6
sql="update CnwyAsp_duty set shenpi='"&shenpi(i)&"',shenhe='"&shenhe(i)&"' where id="&i+1&""
conn.execute(sql)
next
info="修改值班列表成功"
end if
Cnwy_public.massage(info)
call connclose()
set Cnwy_public=nothing
end function
public function framexg()
dim submit,frame,newname,info
dim sql,Cnwy_public
set Cnwy_public=new CnwyAsp_public
call connopen()
submit=request.form("submit")
frame=request.form("frame")
newname=trim(request.form("name"))
if submit="增加" or submit="修改" then
if newname="" then
info="新的机构名不能为空."
elseif submit="增加" then
sql="insert into CnwyAsp_Frame (Framework) values ('"&newname&"')"
conn.execute(sql)
info="增加新机名为["&newname&"]构成功"
elseif submit="修改" then
sql="update CnwyAsp_Frame set framework='"&newname&"' where framework='"&frame&"'"
conn.execute(sql)
info="修改机构名称成功."
end if
elseif submit="删除" then
sql="delete * from CnwyAsp_Frame where framework='"&frame&"'"
conn.execute(sql)
info="删除机构名为["&frame&"]的机构"
end if
Cnwy_public.massage(info)
set Cnwy_public=nothing
call connclose()
end function
public function vacadd()
dim bxadmin,bxdate,sj,sjr,qjr,tlimit,timetype,vctype,frame,reason,temp,id,min
dim Cnwy_public,rs,sql,Cnwy_user
set Cnwy_public=new CnwyAsp_public
set Cnwy_user=new CnwyAsp_user
Cnwy_user.checkmaster(0)
Cnwy_user.checkmaster(2)
call connopen
bxadmin=request.cookies("user")
bxdate=now()
id=request.querystring("id")
sj=request.form("sj")
sjr=trim(request.form("sjr"))
qjr=trim(request.form("qjr"))
tlimit=trim(request.form("tlimit"))
timetype=request.form("timetype")
vctype=request.form("type")
frame=request.form("frame")
reason=trim(request.form("reason"))
if sj="true" and sj="" then
info="既然您选择的是稍假请填写稍假人."
elseif qjr="" or tlimit="" or reason="" then
info="请把信息填写网完整."
elseif len(qjr)>4 or len(sjr)>4 then
info="你输入的中文姓名不正确."
elseif not isnumeric(tlimit) then
info="期限必须为数字."
elseif len(reason)>255 then
info="您写的原因超过了规定的255个字符."
else
set rs=server.createobject("adodb.recordset")
if id<>"" then
sql="select * from CnwyAsp_vacation where id="&id
rs.open sql,conn,1,3
else
sql="select * from CnwyAsp_vacation"
rs.open sql,conn,1,3
rs.addnew
end if
if timetype="minute" then
min=tlimit
elseif timetype="hour" then
min=tlimit*60
elseif timetype="day" then
min=tlimit*1440
elseif timetype="week" then
min=tlimit*10080
elseif timetype="mouth" then
min=tlimit*43200
elseif timetype="year" then
min=tlimit*525600
end if
rs("bxadmin")=bxadmin
rs("bxdate")=bxdate
rs("vactype")=vctype
rs("qjren")=qjr
rs("shaojia")=sj
rs("shaojiar")=sjr
rs("reason")=reason
rs("tlimit")=tlimit
rs("timetype")=timetype
rs("frame")=frame
rs("vaczt")="等待审批"
rs("search")=min
rs("back")=false
rs.update
temp=rs.Bookmark
rs.Bookmark=temp
info="编号为["&rs("id")&"]的假条成功修改或记录请您等待审批."
rs.close
set rs=nothing
end if
Cnwy_public.massage(info)
call connclose()
set Cnwy_public=nothing
set Cnwy_user=nothing
end function
public function vachandle(Byval ty,pass) '0 审批(包括pass的值0代表通过审批和1代表不通过审批),1代表审核启用,2代表审核作废,3修改
dim Cnwy_public,Cnwy_user,id,rs,sql,adminre,overtime
set Cnwy_user=new CnwyAsp_user
set Cnwy_public=new CnwyAsp_public
id=request.querystring("id")
if not isnumeric(id) then
Cnwy_public.massage("ID只能是数字不能是其他字符.")
end if
call connopen()
if ty=0 then
adminre=request.form("readmin")
Cnwy_user.checkmaster(0)
Cnwy_user.checkmaster(3)
if adminre="" then
info="管理员回复不能为空."
elseif len(adminre)>25 then
info="管理员的回复不能超过25个字符."
else
sql="select * from CnwyAsp_Vacation where id="&id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,2,3
if not rs.eof and not rs.bof then
if rs("pass")=false then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -