📄 watch_detail.asp
字号:
<!--#include file="../conn.asp"-->
<!--#include file="../dbtools.asp"-->
<%
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
%>
<%
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 * from userinf where username='" & oabusyusername&"'"
rs.open sql,oconn,1
allow_human_manage=rs("allow_human_manage")
oconn.close
set oconn=nothing
set rs=nothing
if allow_human_manage<>"yes" then
response.write("<font color=red size=""+1"">对不起,需要人员管理权限!</font>")
response.end
end if
%>
<HTML>
<HEAD>
<TITLE> </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="main.css">
</HEAD>
<%
'**************
Set oconn=Server.CreateObject("ADODB.Connection")
DBPath1=server.mappath("../../db/#sdoa.asa")
oconn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath1
'****************
session("empid")=request.Cookies("oabusyuserid")
LoginID=trim(session("EmpId"))
if LoginID="" then response.end
selectdate=trim(request("SelectDate"))
if selectdate="" then selectdate=date()
ID=trim(request("ID"))
SelectID=trim(request("SelectID"))
todo=trim(request("todo"))
if todo="delete" and SelectID<>"" and isnumeric(SelectID) then
oConn.execute "delete from tblwatch where ID="& SelectID
response.write "<font color=red>记录已删除!<a href=""watch_index.asp?selectDate="&selectDate&""">[返回]</a></font>"
oConn.close
response.end
end if
%>
<BODY BGCOLOR="#FFFFFF">
<div align=center>
<table border=1 cellpadding=3 cellspacing=0 width="90%" bgcolor=#EEEEEE bordercolordark="#FFFFFF" bordercolorlight="#999999"><tr><td>
<INPUT TYPE="button" name="cmdreturn" value="返 回" class="font9boldwhite" onclick="javascript:history.back(-1);">
</td></tr></table>
<%
Set Rs = Server.Createobject("Adodb.recordset")
sql="select * from tblwatch where ID="& ID
rs.open sql,oConn
if not rs.eof then
%>
<div align="center">
<table border=1 cellpadding=3 cellspacing=1 width="90%" bgcolor=#EEEEEE bordercolordark="#FFFFFF" bordercolorlight="#999999">
<tr bgcolor=#CCCCCC><td colspan=4 align=center>
<%=trim(rs("WatchName"))%>
<%if cdate(trim(rs("StartTime")))<=now() and cdate(trim(rs("EndTime")))>=now() then%>
<font color=red><b><%="("&trim(rs("StartTime"))&"——"&trim(rs("EndTime"))&")"%></b></font>
<%else%>
<b><%="("&trim(rs("StartTime"))&"——"&trim(rs("EndTime"))&")"%></b>
<%end if%>
<a href="watch_detail.asp?todo=delete&selectdate=<%=selectdate%>&SelectID=<%=trim(rs("ID"))%>" onclick="return CheckDelete();">-->删除该记录</a>
</td></tr>
<tr>
<td nowrap width="15%">部门:</td>
<td>
<%if trim(rs("Department"))<>"" then%>
<%=GetTableValue("dept","dept","ID",trim(rs("Department")))%>
<%end if%>
</td>
<td nowrap width="15%">填写安排:</td>
<td>
<%if trim(rs("CreateName"))<>"" then%>
<%=trim(rs("CreateName"))%>
<%end if%>
</td>
</tr>
<tr>
<td nowrap width=60>填写时间:</td>
<td colspan=3>
<%if trim(rs("Times"))<>"" then%>
<%=trim(rs("Times"))%>
<%end if%>
</td>
</tr>
<tr>
<td nowrap>值班内容:</td>
<td colspan=3><%=replace(replace(server.htmlencode(trim(rs("body"))&""),chr(13),"<br>")," "," ")%> </td>
</tr>
</table>
</div><BR>
<%
end if
rs.close
set rs=nothing
%>
</table>
<INPUT TYPE="hidden" name="OrderID" value="<%=LoginID%>">
<INPUT TYPE="hidden" name="watchID" value="<%=watchID%>">
</form>
</div>
</BODY>
</HTML>
<script language=javascript>
function CheckDelete()
{
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
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -