📄 managelog.asp
字号:
<%dim ThisKey
ThisKey = "i"
%>
<!--#include file="../conn.asp"-->
<!--#include file="../dbtools.asp"-->
<%
session("empid")=request.Cookies("oabusyuserid")
LoginID=trim(session("EmpId"))
if LoginID="" then LoginID=0
ID=trim(request("ID"))
Department=trim(request("Department"))
WriteID=trim(request("WriteID"))
StartTime=GetTableValue ("tblWatch","StartTime","ID",ID)
EndTime=GetTableValue ("tblWatch","EndTime","ID",ID)
Set oconn=Server.CreateObject("ADODB.Connection")
DBPath1=server.mappath("../../db/#sdoa.asa")
oconn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath1
if trim(request("todo"))="delete" and trim(request("SelectID"))<>"" and isnumeric(trim(request("SelectID"))) then
oConn.execute "delete from tblWatchlog where ID="& trim(request("SelectID"))
end if
maxmessage=20
currentpage=request("page")
if currentpage="" then
currentpage=1
end if
if Department="" then Department=0
if WriteID="" then WriteID=0
Set oconn=Server.CreateObject("ADODB.Connection")
DBPath1=server.mappath("../../db/#sdoa.asa")
oconn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath1
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select ID,Department,WriteID,WriteName,Title,Body,Times from tblWatchLog where ID>0 and Department="& Department &" and WriteID="& WriteID &" and Times>=#"& StartTime &"# and Times<=#"& EndTime &"#"
sql=sql& " order by Title"
rs.pagesize=maxmessage
rs.open sql,oConn,1,1
totalpage=rs.pagecount
totalmessage=rs.recordcount
if totalmessage<>0 then
rs.AbsolutePage=currentpage
arrMsg=rs.getrows(maxmessage)
end if
rs.close
%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="main.css">
</HEAD>
<BODY BGCOLOR="#FFFFFF" leftmargin=20 topmargin=5>
<BR>
<%
response.write " 检索到的值班记录日志 共" & totalmessage & "条/" & totalpage & "页,每页"& maxmessage &"条"
if totalpage>0 then
response.write ",第" & currentpage & "页 "
end if
if totalpage>1 then
if currentpage>1 then%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Department=<%=Department%>&WriteID=<%=WriteID%>&title=<%=title%>&page=<%=currentpage-1%>">上页</a>
<%
end if
if currentpage+1<=totalpage then%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?Department=<%=Department%>&WriteID=<%=WriteID%>&title=<%=title%>&page=<%=currentpage+1%>">下页</a>
<%
end if
end if
%>
<%
if isempty(arrMsg) then
response.write "<tr><td colspan=4><BR><BR>暂时没有检索到任何记录。</td></tr>"
else
for i = 0 to UBound(arrMsg,2)
%>
<div align=center>
<table border=1 cellpadding=3 cellspacing=1 width="95%" bgcolor=#EEEEEE bordercolordark="#FFFFFF" bordercolorlight="#999999">
<tr>
<td width=80>填写用户:</td>
<td><%=trim(arrMsg(3,i))%></td>
<td width=80>安排部门:</td>
<td><%=GetTableValue("dept","dept","ID",arrMsg(1,i))%></td>
</tr>
<tr>
<td>记录填写时间</td>
<td colspan=3><%=arrmsg(6,i)%></td>
</tr>
<tr>
<td>记录日志主题</td>
<td colspan=3><%=arrMsg(4,i)%></td>
</tr>
<tr>
<td>记录内容描述</td>
<td colspan=3>
<%=replace(replace(server.htmlencode(arrMsg(5,i)&""),chr(13),"<br>")," "," ")%>
</td>
</tr>
<tr>
<td colspan=4 align=right>
<a href="ManageLog.asp?id=<%=id%>&Department=<%=department%>&writeid=<%=writeID%>&todo=delete&selectID=<%=trim(arrMsg(0,i))%>" onclick="return CheckDelete();"><img src="images/delete.gif" border=0></a>
</td>
</tr>
</table><BR>
</div>
<%
next
end if
%>
<BR>
<INPUT TYPE="button" name="cmdreturn" value="返 回" class="font9boldwhite" onclick="javascript:history.back(-1);">
<BR><BR><BR>
</BODY>
</HTML>
<script language=javascript>
function CheckDelete()
{
// document.NewsForm.cmdDelete.value !=""
return confirm("确实删除吗?");
}
</script>
<%
Function GetTableValue(TableName,Field,ValueField,Value)
if TableName<>"" and Value<>"" then
Set oconn=Server.CreateObject("ADODB.Connection")
DBPath1=server.mappath("../../db/#sdoa.asa")
oconn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath1
Set RsTmp = Server.Createobject("Adodb.recordset")
strSql = "Select "& Field &" from "& TableName &" where "& ValueField &"="& Value &""
Rstmp.open strSql,oConn,1,1
If not Rstmp.eof then
GetTableValue=trim(Rstmp(Field))
else
GetTableValue=""
end if
Rstmp.close
'set RsTmp = Nothing
else
GetTableValue=""
end if
End Function
%>
<script language=javascript>
function CheckDelete()
{
return confirm("确实删除吗?");
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -