📄 refresh.asp
字号:
<!--#include file="../inc/connection.asp"-->
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Refresh" content="200">
</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)
nMailInbox_n = GetMailIn (LoginID,0,0)
nGetTask2=GetTask2 (LoginID,date()-1)
nGetTask=GetTask (LoginID,date(), "0")
nGetDocument=GetDocument (LoginID,Department)
nGetMeeting=GetMeeting (LoginID, date(),Department)
nTotal=cint(nBulletin)+cint(nMailInbox_n)+cint(nGetTask2)+cint(nGetTask)+cint(nGetDocument)+cint(nGetMeeting)
if nTotal="" then nTotal=0
%>
<!--BODY BGCOLOR="#FFFFFF" <%if nTotal>0 then response.write "onload=""OpenWindow('Task.asp','TaskWindow')"""%>-->
<BODY BGCOLOR="#FFFFFF" <%if nTotal>0 then response.write "onload=""OpenWindow('task.asp','TaskWindow');"""%>>
</BODY>
</HTML>
<script language="JavaScript">
function OpenWindow(url,windowname)
{
window.open(url,windowname,'left=150,top=120,height=230,width=420,toolbar=no,menubar=no,scrollbars=yes')
}
</script>
<!--#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
Function GetMailIn(ToID, Status, Isread)
'isRead 0代表未读,1代表已读 Status 0代表正常 1代表已发入垃圾箱 2代表彻底删除
Set Rstmp = Server.CreateObject("ADODB.RecordSet")
intMail=0
strSql = "Select count(id) as intNumber from tblMailIn where ToID ="&ToID &" and Status="& status &" And Isread="& Isread
RsTmp.Open strSql,Conn
if not Rstmp.eof then
intMail=Rstmp("intNumber")
end if
Rstmp.close
set Rstmp = nothing
GetMailIn=IntMail
End Function
Private Function GetTask (byval SelectID,byval NowDate, nClass)
set Rstmp=Server.CreateObject("ADODB.RecordSet")
sql="select Count(*) as nTotal from tblPlan where class="& nClass &" and StartTime>'"& cdate(NowDate)-1 &"' and Finish=0 and UserID="& SelectID
'response.write sql
Rstmp.open sql,Conn
select case trim(nClass)
case "0"
if trim(rsTmp("nTotal"))<>"0" then
GetTask= trim(rsTmp("nTotal"))
else
GetTask=0
end if
case "1"
GetTask= trim(rsTmp("nTotal"))
case "2"
if trim(rsTmp("nTotal"))<>"0" then
GetTask= trim(rsTmp("nTotal"))
else
GetTask=0
end if
end select
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
Private Function GetMeeting(byval LoginID, byval NowTime,byval Department)
set rstmp=Server.CreateObject("ADODB.RecordSet")
sql="select ID,JoinID,JoinEvery,JoinDepartment,StartTime,HaveRead from tblMeetingOrder where Starttime>='"& NowTime &"' and EndTime>='"& now() &"'"
rstmp.open sql,Conn,1,1
bHave=false
hNumber=0
while not rstmp.eof
if trim(rstmp("JoinEvery"))="1" then
bHave=true
end if
arrJoinID=split(trim(rstmp("JoinID")),",")
for i=0 to ubound(arrJoinID)
if trim(arrJoinID(i))=trim(LoginID) then
bHave=true
exit for
end if
next
if trim(rstmp("JoinDepartment"))=trim(Department) then
bHave=true
end if
strHaveRead=trim(rstmp("HaveRead"))
arrHaveRead=split(strHaveRead,",")
bHaveRead=false
for j=0 to ubound(arrHaveRead)
if trim(LoginID)=trim(arrHaveRead(j)) then
bHaveRead=true
exit for
end if
next
if bHave and (not bHaveRead) then
bNumber=bNumber+1
GetMeeting= bNumber
exit function
end if
rstmp.movenext
wend
if (not bHave) or (bHave and bHaveRead) then
GetMeeting=0
end if
rstmp.close
set rstmp=nothing
end function
Private Function GetDocument(byval LoginID, byval Department)
set rstmp=server.createobject("adodb.recordset")
sql="select count(*) as nCount from tblDoc where pigeonhole=0 and CurrentID="& LoginID
rstmp.open sql,Conn
if not rstmp.eof then
nCount=trim(rstmp("nCount"))
end if
rstmp.close
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from tblDoc where (ReadIDs<>'' or ReadEvery=1 or ReadDepartment="& Department &" ) Order by ID desc"
rs.open sql,Conn
nCount=cint(nCount)
while not rs.eof
ReadEvery=trim(rs("ReadEvery"))
ReadDepartment=trim(rs("ReadDepartment"))
strHaveRead=trim(rs("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
strReadIDs=trim(rs("ReadIDs"))
arrReadIDs=split(strReadIDs,",")
dim bReadIDs
bReadIDs=false
for k=0 to ubound(arrReadIDs)
if trim(LoginID)=trim(arrReadIDs(k)) then
bReadIDs=true
exit for
end if
next
if (bReadIDs=true or ReadEvery="1" or ReadDepartment=trim(Department)) and (bHave=false) and trim(rs("pigeonhole"))="0" then
nCount=nCount+1
end if
rs.movenext
wend
rs.close
GetDocument=nCount
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -