📄 task.asp
字号:
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/connection.asp"-->
<HTML>
<HEAD>
<TITLE> 任务列表 </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../CSS/main.css">
<meta http-equiv="Refresh" content="200">
<script language="javascript">
window.document.focus();
</script>
</HEAD>
<%
LoginID=trim(session("LoginID"))
if LoginID="" then LoginID=0
UserName=GetTableValue ("tblUser","Name","ID",LoginID)
Department = GetTableValue ("tblUser","Department","ID",LoginID)
nBulletin=GetBulletin (LoginID,Now(),Department)
nGetTask2=GetTask2 (LoginID,date()-1)
nTotal=cint(nBulletin)+cint(nMailInbox_n)+cint(nGetTask2)+cint(nGetTask)+cint(nGetDocument)+cint(nGetMeeting)
if nTotal="" then nTotal=0
%>
<body>
<div align=center>
<table border=0 width="100%" bgcolor=#CCCCFF cellpadding=3 cellspacing=1>
<tr bgcolor=#9999FF>
<td width="28%">任务名</td>
<td width="22%">件数</td>
<td width="28%">任务名</td>
<td width="22%">件数</td>
</tr>
<tr bgcolor=#FFFFFF>
<td>单位公告</td>
<td><a href="../Bulletin/Index.asp" target="FrmMain"><font color=red><%=cint(nBulletin)%> 件</font></a></td>
<td>任务列表</td>
<td><a href="../task/index.asp" target="FrmMain"><font color=red><%=cint(nGetTask2)%> 件</font></a></td>
</tr>
<tr bgcolor=#FFFFFF>
<td align=right colspan=4><a href="javascript:window.close();">[关闭窗口]</a></td>
</tr>
</table>
</div>
</BODY>
</HTML>
<!--#include file="../inc/connclose.asp"-->
<%
Private Function GetBulletin (byval LoginID,byval NowDate,byval Department)
set RsTmp=Server.CreateObject("ADODB.RecordSet")
sql="select * from tblBulletin where FromID<>"& LoginID &" and (ToID<>'' or ToAll=1 or toDepartment="& Department &" ) Order by ID desc"
Rstmp.open sql,Conn
nCount=0
while not RsTmp.eof
toAll=trim(RsTmp("ToAll"))
toDepartment=trim(RsTmp("toDepartment"))
strHaveRead=trim(RsTmp("HaveRead"))
arrHaveRead=split(strHaveRead,",")
bHave=false
for i=0 to ubound(arrHaveRead)
if trim(LoginID)=trim(arrHaveRead(i)) then
bHave=true
exit for
end if
next
strToID=trim(RsTmp("ToID"))
arrToID=split(strToID,",")
dim bToID
bToID=false
for k=0 to ubound(arrToID)
if trim(LoginID)=trim(arrToID(k)) then
bToID=true
exit for
end if
next
if (bToID=true or Toall="1" or toDepartment=trim(Department)) and (bHave=false) then
nCount=nCount+1
end if
RsTmp.movenext
wend
GetBulletin=nCount
Rstmp.close
set Rstmp=nothing
end Function
Private Function GetTask2 (byval SelectID,byval NowDate)
set Rstmp=Server.CreateObject("ADODB.RecordSet")
sql="select Count(*) as nTotal from tblPlan where class=2 and StartTime>'"& cdate(NowDate)-1 &"' and Finish=0 and UserID="& SelectID
'response.write sql
Rstmp.open sql,Conn
if trim(rsTmp("nTotal"))<>"0" then
set Rstmp1=Server.CreateObject("ADODB.RecordSet")
sql="select EndTime from tblPlan where class=2 and StartTime>'"& cdate(NowDate)-1 &"' and Finish=0 and UserID="& SelectID&" order by EndTime"
Rstmp1.open sql,Conn
if not rstmp1.eof then
EndDate=trim(Rstmp1("EndTime"))
else
EndDate=date()
end if
Rstmp1.close
set Rstmp1=nothing
GetTask2= trim(rsTmp("nTotal"))
else
GetTask2=0
end if
Rstmp.close
set Rstmp=nothing
end function
Function GetTableValue(TableName,Field,ValueField,Value)
if TableName<>"" and Value<>"" then
Set RsTmp = Server.Createobject("Adodb.recordset")
strSql = "Select "& Field &" from "& TableName &" where "& ValueField &"='"& Value &"'"
Rstmp.open strSql,Conn,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 + -