修改2:
以前实现了显示是否需要签收,下面的代码新建为一个独立的asp文件,文件名当然为LiRecive.asp(在上面的"点这里现在签收"代码中链接到这里了)
<%@language=vbscript codepage=936 %>
<%
Option Explicit
Response.Buffer = True
%>
<!--#include file="../conn.asp"-->
<!--#include file="../inc/function.asp"-->
<%
dim LoginTF
If CheckUserLogined() = true Then
LoginTF=true
else
response.redirect "../user/login.asp"
End If
dim MYArticleID,MYuserID,MYsql,MYrs,OldUnsignedItems,OldReceived
MYArticleID = Trim(request("ArticleID"))
MYuserID=Trim(request("userID"))
MYsql="select UnsignedItems from PE_User where UserID=" & MYuserID '从“用户表”中取需签收的文章ID串
Set MYrs = server.CreateObject("adodb.recordset")
MYrs.open MYsql, Conn, 1, 1
OldUnsignedItems=MYrs("UnsignedItems")
set MYrs=nothing
Set MYrs = server.CreateObject("adodb.recordset")
MYsql="select Received from PE_Article where ArticleID=" & MYArticleID '从Article表中取需已签收的用户名串
MYrs.open MYsql, Conn, 1, 1
OldReceived=MYrs("Received")
set MYrs=nothing
' response.write OldUnsignedItems & jianArr(OldUnsignedItems,MYArticleID,",")
'response.write jiaArr(OldReceived,UserName,"|")
'这里去掉“用户表”中的需签收的文章ID
MYsql="update PE_User set UnsignedItems=" & sqlstr(jianArr(OldUnsignedItems,MYArticleID,",")) & " where UserID=" & MYuserID
application.lock
conn.execute(MYsql)
application.unlock
application.lock
'然后将PE_Article表中的已签收的用户加上
MYsql="update PE_Article set Received=" & sqlstr(jiaArr(OldReceived,UserName,"|")) & " where ArticleID=" & MYArticleID
conn.execute(MYsql)
application.unlock
Response.Redirect Request.ServerVariables("HTTP_REFERER")
'获取来源地址,就是上一个页面的地址.
Call CloseConn
'这样就实现了在文章显示界面可以直接点击完成签收,方便多了.