回 帖 发 新 帖 刷新版面

主题:我遇到了很大的困难,请各位朋友帮帮忙吗!

我是一名学生,我有一些关于ASP的程序看不懂,想请你帮忙看看,可以忙。帮我讲讲
程序
5.1  提醒用户有新文档或是回复文档到来的处理
决定是否弹出窗口用语音来提醒用户的程序
<%
'所接收的文件不是回复文件时,如果没回复就弹出窗口
'打开文档数据库,读出接收人是本人的或本部门所有人的并reid为0而且公文发布时间比用户建立时间晚的文档记录
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
sql="select * from senddate where reid=0 and (recipientusername=" & sqlstr(oabusyusername) & " or (recipientusername='所有人' and recipientuserdept=" & sqlstr(oabusyuserdept) & ")) and inputdate>#" & joindate & "#"
rs.open sql,conn,1
while not rs.bof and not rs.eof
'打开文档数据库,读出发送人是本人并reid等于接收文档的id的记录
set conn=opendb("oabusy","conn","accessdsn")
set rs1=server.createobject("adodb.recordset")
sql="select * from senddate where sender=" & sqlstr(oabusyusername) & " and reid=" & rs("id")
rs1.open sql,conn,1
'如果无记录就弹出窗口并终止程序
if rs1.eof or rs1.bof then
%>
<SCRIPT language=JavaScript>                   
window.open('popdate.asp?id=<%=rs("id")%>','NewWin1','scrollbars=yes,width=700,height=400');       </script>
<%
response.end
end if
'循环
rs.movenext
wend
'所接收的文件是回复文件时,如果没看就弹出窗口
'打开文档数据库,读出接收人是本人的或本部门所有人的并reid不为0的公文记录
set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("adodb.recordset")
sql="select * from senddate where reid<>0 and (recipientusername=" & sqlstr(oabusyusername) & " or (recipientusername='所有人' and recipientuserdept=" & sqlstr(oabusyuserdept) & "))"
rs.open sql,conn,1
while not rs.bof and not rs.eof
'打开已看文档数据库,读出用户名是本人并senddateid等于接收文档的id,且havesee为“yes”的记录
set conn=opendb("oabusy","conn","accessdsn")
set rs1=server.createobject("adodb.recordset")
sql="select * from seesenddate where havesee='yes' and username=" & sqlstr(oabusyusername) & " and senddateid=" & rs("id")
rs1.open sql,conn,1
'如果无记录就弹出窗口并终止程序
if rs1.eof or rs1.bof then
%>
<SCRIPT language=JavaScript>
window.open("popredate.asp?id=<%=rs("id")%>",'NewWin1','scrollbars=yes,width=700,height=400');     
</script>
<%
response.end
end if
'循环
rs.movenext
wend
%>
5.2  语音提醒用户有新文档来到的界面实现程序popdate.asp
<%
if request("submit")="回复" then
sender=request("sender")
recipientusername=request("recipientusername")
reid=request("reid")
title=request("title")
content=request("content")
set conn=opendb("oabusy","conn","accessdsn")
sql="Insert into senddate (title,content,sender,recipientusername,reid) values ("
sql=sql & sqlstr(title) & ","
sql=sql & sqlstr(content) & ","
sql=sql & sqlstr(sender) & ","
sql=sql & sqlstr(recipientusername) & ","
sql=sql & reid & ")"
conn.Execute sql
%>
<SCRIPT language=JavaScript>
window.close();
opener.location.reload();
</script>
<%
set conn=opendb("oabusy","conn","accessdsn")
Set rs=Server.CreateObject("ADODB.recordset")
sql="select * from senddate where id=" & request("id")
rs.open sql,conn,1
%>
[发布日期:<%=rs("inputdate")%>][发送人所在部门:
<%
set conn=opendb("oabusy","conn","accessdsn")
Set rs1=Server.CreateObject("ADODB.recordset")
sql="select userdept,name from userinf where username=" & sqlstr(rs("sender"))
rs1.open sql,conn,1
%>
<%=rs1("userdept")%>
发送者:<%=rs1("name")%>]
<%=keepformat(rs("content"))%>
5.3  语音提醒有回复文档来到的页面处理程序
poppredate.asp
<%
if request("submit")="我已经看过" then
id=request("id")
set conn=opendb("oabusy","conn","accessdsn")
sql="Insert into seesenddate (senddateid,username,havesee) values ("
sql=sql & id & ","
sql=sql & sqlstr(oabusyusername) & ","
sql=sql & sqlstr("yes") & ")"
conn.Execute sql
%>
<SCRIPT language=JavaScript>                   
window.close();
opener.location.reload();
</script>
<%
set conn=opendb("oabusy","conn","accessdsn")
Set rs=Server.CreateObject("ADODB.recordset")
sql="select * from senddate where id=" & request("id")
rs.open sql,conn,1
%>
<%=rs("title")%>
[回复时间:<%=rs("inputdate")%>]
[回复人所在部门:
<%
set conn=opendb("oabusy","conn","accessdsn")
Set rs1=Server.CreateObject("ADODB.recordset")
sql="select userdept,name from userinf where username=" & sqlstr(rs("sender"))
rs1.open sql,conn,1
%>
<%=rs1("userdept")%>回复者:<%=rs1("name")%>
<%=keepformat(rs("content"))%>
<%
'打开数据库,显示id=rs("reid")的记录
set conn=opendb("oabusy","conn","accessdsn")
Set rs2=Server.CreateObject("ADODB.recordset")
sql="select * from senddate where id=" & rs("reid")
rs2.open sql,conn,1
if not rs2.eof and not rs2.bof then
%>
<%=rs2("title")%>
<%
if rs2("filename")<>"" then
%>
<%=keepformat(rs2("content"))%>
[color=FF00FF][/color]

回复列表 (共1个回复)

沙发

你这样写这么多代码,别人很难帮上什么忙,都吓跑了
你最好把你不懂的做一下注释!

我来回复

您尚未登录,请登录后再回复。点此登录或注册