📄 workthings_manage.asp
字号:
<%response.expires=0%>
<!--#include file="../asp/sqlstr.asp"-->
<%
'session.abandon
'Server.ScriptTimeOut=500
function opendb(DBPath,sessionname,dbsort)
dim conn
'if not isobject(session(sessionname)) then
Set conn=Server.CreateObject("ADODB.Connection")
'if dbsort="accessdsn" then conn.Open "DSN=" & DBPath
'if dbsort="access" then conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
'if dbsort="sqlserver" then conn.Open "DSN=" & DBPath & ";uid=wsw;pwd=wsw"
DBPath1=server.mappath("../db/jzud-oa.asa")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath1
set session(sessionname)=conn
'end if
set opendb=session(sessionname)
end function
%>
<!--#include file="../asp/bgsub.asp"-->
<!--#include file="setpopedom.asp"-->
<%
function strlength(inputstr)
dim length,i
length=0
for i=1 to len(inputstr)
if asc(mid(inputstr,i,1))<0 then
length=length+2
else
length=length+1
end if
next
strlength=length
end function
oabusyname=request.cookies("oabusyname")
oabusyusername=request.cookies("oabusyusername")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
if oabusyusername="" then
response.write("<script language=""javascript"">")
response.write("window.top.location.href='default.asp';")
response.write("</script>")
response.end
end if
errstr=getpopedom("allow_manage_workthings",oabusyusername)
if errstr<>"" then
response.redirect "../asp/disperrorinfo.asp?errorinfo="&errstr
response.end
end if
%>
<html>
<head>
<meta http-equiv="expires" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/css.css">
<title>Crackgo办公系统</title>
</head>
<body topmargin="5" leftmargin="5">
<%
%>
<center>
<table align="center">
<tr>
<td><b>办公用品管理</b> </td>
</tr>
</table>
</center>
<%
%>
<br>
<center>
<%
newworkthings=replace(trim(request.form("newworkthings")),"'","’")
oldworkthings=replace(trim(request.form("oldworkthings")),"'","‘")
if request.form("auditingflag")="yes" then
auditingflag="true"
else
auditingflag="false"
end if
id=request.form("id")
if request("submit")="增加" and newworkthings<>"" then
if strlength(newworkthings)>20 then
response.write("<font color=""red"">办公用品名称不能超过10个汉字!</font>")
else
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
sql="select * from workthings_type where workthingsname='" & newworkthings&"'"
rs.open sql,conn,1
if not rs.eof and not rs.bof then
%>
<font color=red><%=userlevel%>已经存在,请换名重试!</font><br>
<%
else
sql = "Insert Into workthings_type (workthingsname,auditingflag) Values('" & newworkthings &"',"&auditingflag& ")"
conn.Execute sql
%>
<font color=red><%=userlevel%>增加成功!</font>
<%
end if
end if
end if
'---------------------------------------------------
if request("submit")="删除" then
set conn=opendb("oabusy","conn","accessdsn")
sql="delete from workthings_type where autoid="&id
sql1="delete from workthings_userthings where workthingsid="&id
conn.execute(sql)
conn.execute(sql1)
%>
<font color=red><%=userlevel%>删除成功!</font>
<%
end if
'---------------------------------------------------
if request("submit")="修改" and newworkthings<>"" then
if strlength(newworkthings)>20 then
response.write("<font color=""red"">办公用品名称不能超过10个汉字!</font>")
else
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
sql="select * from workthings_type where workthingsname='" &newworkthings&"' and autoid<>"&id
rs.open sql,conn,1
if not rs.eof and not rs.bof then
%>
<font color=red><%=userlevel%>已经存在,请换名重试!</font><br>
<%
else
sql = "update workthings_type set workthingsname='" & newworkthings & "',auditingflag="&auditingflag&" where autoid=" & id
conn.Execute sql
%>
<font color=red>修改成功!</font>
<%
end if
end if
end if
%>
<table border="1" cellspacing="0" cellpadding="5" bordercolorlight="#808080" bordercolordark="#D4D0C8" width="400">
<%
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
sql="select * from workthings_type"
rs.open sql,conn,1
while not rs.eof and not rs.bof
%>
<tr>
<form method="post" action="workthings_manage.asp">
<td align="right">
<input type="submit" name="submit" value="删除">
</td>
<td align="right">
<input type="hidden" name="oldworkthings" value="<%=rs("workthingsname")%>">
<input type="hidden" name="id" value=<%=rs("autoid")%>>
<input type="text" name="newworkthings" value="<%=rs("workthingsname")%>" maxlength="20">
<%
if rs("auditingflag") then'审核标志
%>
<input type="checkbox" name="auditingflag" value="yes" checked>需要审核
<%
else
%>
<input type="checkbox" name="auditingflag" value="yes">需要审核
<%
end if
%>
</td>
<td align="right"><input type="submit" name="submit" value="修改"></td>
</form>
</tr>
<%
rs.movenext
wend
set rs=nothing
conn.close
set conn=nothing
%>
</table>
<form method="post" action="workthings_manage.asp">
<input type="text" name="newworkthings" maxlength="20">
<input type="checkbox" name="auditingflag" value="yes">需要审核
<input type="submit" name="submit" value="增加">
</form>
</center>
<%
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -