📄 class_manage.asp
字号:
if pass=0 then
rs("pass")=true
rs("back")=true
rs("vaczt")="已审批"
rs("passadmin")=request.cookies("user")
rs("passdate")=now()
rs("npassre")=adminre
info="恭喜您成功审批编号为["&id&"]的请假信息"
elseif pass=1 then
rs("back")=true
rs("passadmin")=request.cookies("user")
rs("passdate")=now()
rs("vaczt")="未审批"
rs("npassre")=adminre
info="恭喜您成功返回编号为["&id&"]的请假信息"
end if
rs.update
rs.close
else
info="此假条已经被审批,您无权再次进行操作."
end if
else
info="你操作的假条不存在,或者已经作废."
end if
end if
elseif ty=1 then
Cnwy_user.checkmaster(0)
Cnwy_user.checkmaster(4)
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")=true and rs("teststart")=false then
rs("teststart")=true
rs("testb")=now()
rs("testbadmin")=request.cookies("user")
rs("vacstart")=now()
rs("vaczt")="已经启用"
if rs("timetype")="mintue" then
overtime=dateadd("n",rs("tlimit"),now())
elseif rs("timetype")="hour" then
overtime=dateadd("h",rs("tlimit"),now())
elseif rs("timetype")="day" then
overtime=dateadd("d",rs("tlimit"),now())
elseif rs("timetype")="week" then
overtime=dateadd("ww",rs("tlimit"),now())
elseif rs("timetype")="mouth" then
overtime=dateadd("m",rs("tlimit"),now())
elseif rs("timetype")="year" then
overtime=dateadd("yyyy",rs("tlimit"),now())
end if
rs("vacover")=overtime
rs.update
rs.close
info="恭喜您成功启用编号为["&id&"]的请假信息记录."
else
info="您操作的假条已经被审启用或者未被审批."
end if
else
info="你操作的请假信息不存在."
end if
elseif ty=2 then
Cnwy_user.checkmaster(0)
Cnwy_user.checkmaster(4)
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("teststart")=true and rs("testover")=false then
rs("teste")=now()
rs("testover")=true
rs("testeadmin")=request.cookies("user")
if datediff("n",rs("vacover"),now())=<Cnwy_public.vacl then
rs("yjtime")=0
rs("vaczt")="按时归来"
else
rs("yjtime")=datediff("n",rs("vacover"),now())-Cnwy_public.vacl
rs("vaczt")="超越期限"
end if
rs.update
rs.close
info="恭喜您成功使编号为["&id&"]的请假信息作废."
else
info="您操作的假条已作废或者没有起用."
end if
else
info="您操作的信息不存在."
end if
end if
Cnwy_public.massage(info)
call connclose()
set Cnwy_public=nothing
end function
public function Annunceaction()
dim id,sql,rs,fso,fli,str,Cnwy_public
dim tilte,Announce,info,bnum,onum,Annstr,flin
set Cnwy_public=new CnwyAsp_public
call connopen()
id=request.querystring("id")
title=request.form("title")
Announce=request.form("Announce")
flin=replace(now(),"-","")
flin=replace(flin," ","")
flin=replace(flin,":","")
flin="Announce/"&flin&".html"
if title="" or Announce="" then
info="公告的主题和内容不能为空"
elseif len(title)>25 then
info="公告的主题不能超过25个字符."
else
if id<>"" then
sql="select * from CnwyAsp_Announce where id="&id
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,2,3
flin=rs("path")
else
sql="select * from CnwyAsp_Announce"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,2,3
rs.ADDNEW
end if
rs("title")=title
rs("date")=now()
rs("user")=request.cookies("user")
rs("Announce")=Announce
rs("path")=flin
rs.update
rs.close
set fso=server.createobject("scripting.filesystemobject")
set fli=fso.opentextfile(server.mappath("readAnn.htm"),1)
str=fli.readall
fli.close
str=replace(str,"$title$",Cnwy_public.title)
str=replace(str,"$CnwyAsptitle$",title)
str=replace(str,"$CnwyAspuser$",request.cookies("user"))
str=replace(str,"$CnwyAspdate$",now())
str=replace(str,"$CnwyAspAnnounce$",Announce)
str=replace(str,"$CnwyAspUser$",Cnwy_public.title)
set cfli=fso.CreateTextFile(server.mappath(flin),true)
cfli.write(str)
set cfli=nothing
set fso=nothing
info="恭喜你增加或修改的公告成功."
end if
Cnwy_public.massage(info)
set Cnwy_public=nothing
call connclose()
end function
public function AnnDel()
dim id,rs,sql,fli,fso,path
dim Cnwy_public
Call connopen()
set Cnwy_public=new CnwyAsp_public
id=request.querystring("id")
if not isnumeric(id) then
Cnwy_public.massage("请您正确方式访问此页面.")
end if
sql="select * from CnwyAsp_Announce where id="&id
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,2,3
path=rs("path")
set fso=server.createobject("scripting.filesystemobject")
set fli=fso.getfile(server.mappath(path))
fli.delete
set fso=nothing
set fli=nothing
rs.delete
rs.update
rs.close
set rs=nothing
Cnwy_public.massage("删除ID为"&id&"的公告成功!")
Call connclose()
end function
public function search(Byval pagen,Byval html,Byval color,Byval href)
dim qjqx,sjlx,jtzt,tj,tjcx,lx,timelx,from,t,submit,dx,hou
dim Cnwy_public,info,sql,page,path,i
set Cnwy_public=new CnwyAsp_public
on error resume next
call connopen()
dx=trim(request.querystring("dx"))
qjqx=request.querystring("qjqx")
sjlx=trim(request.querystring("sjlx"))
jtzt=trim(request.querystring("jtzt"))
tj=trim(request.querystring("tj"))
tjcx=trim(request.querystring("tjcx"))
lx=trim(request.querystring("lx"))
timelx=trim(request.querystring("timelx"))
from=request.querystring("from")
t=request.querystring("to")
submit=request.querystring("submit")
page=request.form("cnwy")
path=request.servervariables("PATH_INFO")
hou=request.ServerVariables("QUERY_STRING")
path=path&"?"&hou
sql="select * from CnwyAsp_Vacation where"
i=0
if info<>"" then
Cnwy_public.massage(info)
end if
if jtzt<>"no" then
sql=sql&" vaczt='"&jtzt&"'"
end if
if tj<>"no" then
if jtzt="no" then
sql=sql&" "&tj&"='"&tjcx&"'"
else
sql=sql&" and "&tj&"='"&tjcx&"'"
end if
end if
if lx<>"no" then
if jtzt="no" and tj="no" then
sql=sql&" vactype='"&lx&"'"
else
sql=sql&" and vactype='"&lx&"'"
end if
end if
if timelx<>"no" then
if jtzt="no" and tj="no" and lx="no" then
sql=sql&" "&timelx&" between #"&from&"# and #"&t&"#"
else
sql=sql&" and "&timelx&" between #"&from&"# and #"&t&"#"
end if
end if
if qjqx<>"" then
if sjlx="minute" then
qjqx=qjqx
elseif sjlx="hour" then
qjqx=qjqx*60
elseif sjlx="day" then
qjqx=qjqx*1440
elseif sjlx="week" then
qjqx=qjqx*10080
elseif sjlx="mouth" then
qjqx=qjqx*43200
elseif sjlx="year" then
qjqx=qjqx*525600
end if
if jtzt="no" and tj="no" and lx="no" and timelx="no" then
sql=sql&" search"&dx&qjqx&""
else
sql=sql&" and search"&dx&qjqx&""
end if
end if
if page="" then
page=1
end if
sql=sql&" order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof or rs.bof then
Cnwy_public.massage("您查询的信息不存在.")
else
with response
.write("<table width='0' border='1' align='center' cellpadding='0' cellspacing='0' bordercolor='"&color&"'>")
.write(html)
.write("<tr><td width='60'><div align='center'>假条编号</div></td><td width='80'><div align='center'>请假人</div></td><td width='60'><div align='center'>请假类型</div></td><td width='140'><div align='center'>假条提交时间</div></td><td width='120'><div align='center'>假条状态</div></td><td width='77'><div align='center'>查看操作</div></td></tr>")
rs.movefirst
rs.pagesize=pagen
rs.absolutepage=page
do while not rs.eof and i<rs.pagesize
.write("<tr><td ><div align='center'>"&rs("id")&"</div></td><td ><div align='center'>"&rs("qjren")&"</div></td><td ><div align='center'>"&rs("vactype")&"</div></td><td><div align='center'>"&rs("bxdate")&"</div></td><td><div align='center'>"&rs("vaczt")&"</div></td><td>"&replace(href,"$id$",rs("id"))&"[查看操作]</a></td></tr>")
i=i+1
rs.movenext
loop
.write("<tr><td colspan='6' with='520'><div align='center'>")
Cnwy_public.pagelist path,rs.recordcount,rs.pagecount,page
.write("</div></td></tr></table>")
end with
rs.close
set rs=nothing
end if
call connclose()
set Cnwy_public=nothing
end function
End class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -