📄 officemain.asp
字号:
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/connection.asp"-->
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../CSS/main.css">
</HEAD>
<%
LoginID=trim(session("LoginID"))
if LoginID="" then LoginID=0
UserName=GetTableValue ("tblUser","Name","ID",LoginID)
Department = GetTableValue ("tblUser","Department","ID",LoginID)
%>
<BODY BGCOLOR="#FFFFFF">
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="50%"> </td>
<td> </td>
</tr>
<tr align="center">
<td>
<table width="245" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../images/t_zxdwgg.gif" width="245" height="20"></td>
</tr>
<tr>
<td>
<table width="245" border="0" cellspacing="1" cellpadding="0" height="50" bgcolor="#000000">
<tr bgcolor="#FFFFFF">
<td><font color="#000066"><%=GetBulletin (LoginID,Now(),Department)%></font></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td>
<table width="245" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../images/t_zxrwlb.gif" width="245" height="20"></td>
</tr>
<tr>
<td>
<table width="245" border="0" cellspacing="1" cellpadding="1" bgcolor="#000000">
<tr bgcolor="#FFFFFF">
<td height="50"><font color="#000066"> <%=GetTask2 (LoginID,date()-5)%></font></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr align="center">
<td> </td>
<td> </td>
</tr>
</table>
</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"
'sql="select count(*) as nTotal from tblBulletin where (ToID="& LoginID &" or ToAll=1 or toDepartment="& Department &" ) and Times>'"&NowDate-10&"'"
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
if nCount<>"0" then
GetBulletin="您的单位公告箱里有 <font color=red>"& nCount &"</font> 条新记录。<a href=""../Bulletin/index.asp"" >点击查看>></a>"
else
GetBulletin="您的单位公告箱里暂时为空。"
end if
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="我们将检查5天内的任务情况!<BR>您的任务栏里有 <font color=red>"& trim(rsTmp("nTotal")) &"</font> 条新任务。<a href=""../Task/index.asp?SelectDate="&EndDate&""" >点击查看>></a>"
else
GetTask2="今天您的任务栏暂时为空。"
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 + -