<!--#include file="../inc/index_conn.asp"-->
<!--#include file="../config.asp"-->
<!--#include file="checklogin.asp"-->
<%



'程序开发：58天网络科技 
'官方主页：http://www.58day.com







id=request.QueryString("id")
Set rs11=server.createobject("ADODB.RECORDSET")
rs11.open "select * from jieshou where pid='"&id&"' and start='2'",conn,1,3
if (rs11.eof) then
    Response.Write("<script>alert('对不起,此信息状态已发生变化!');window.location.href='MyMission.asp';</script>")
	response.End()
else

Set rs1=server.createobject("ADODB.RECORDSET")
rs1.open "select * from zhongxin where pid='"&id&"'",conn,1,3
if not (rs1.eof) then
  rs1("start")="3"
  rs1.update 
end if
fbprice=rs1("price")
fauser=rs1("username")

set rs1=nothing
Set rs=server.createobject("ADODB.RECORDSET")


		 
	  rs.open "Select * From jieshou where pid='"&id&"'" ,conn,1,3  
	    if not (rs.eof) then
		rs("start")="3"
		    	rs("timetongguo")=now()
    	rs.update
		user=rs("username")
		price=rs("price")
    	'rs.close
		
		 num=filepath&year(now)&right("0"&month(now),2)&right("0"&day(now),2)&hour(now)&minute(now)&second(now)
'------------卖家交易记录
 	 Set rsr=server.createobject("ADODB.RECORDSET")
	  rsr.open "Select * From record " ,conn,1,3  
	    rsr.addnew
		rsr("username")=session("useridname")
    	rsr("num")=num
		rsr("class")="淘宝区任务"
		rsr("content")=" 【"&fauser&"】你通过了参加者【"&user&"】的"&fbprice&"元任务申请，任务ID：【"&id&"】 "
		rsr("price")=0
		rsr("jiegou")="已通过"
    	rsr.update
    	rsr.close	
'------------买家交易记录
    Set rsj=server.createobject("ADODB.RECORDSET")
	  rsj.open "Select * From record " ,conn,1,3  
	    rsj.addnew
		rsj("username")=rs("username")
    	rsj("num")=num
		rsj("class")="淘宝区任务"
		rsj("content")=" 【"& session("useridname") &"】通过了【"&user&"】的"&fbprice&"元任务申请，任务ID：【"&id&"】 "
		'----------参与者【前台操作记录】中显示的返还金钱（不进入用户数据表）
		rsj("price")=0
		rsj("jiegou")="已通过"
    	rsj.update
    	rsj.close
rs.close
       Response.Write("<script>alert('您已经通过了该申请！\n请等待或主动联系买家做任务！');window.location.href='MyMission.asp';</script>")
end if
end if
set rs=nothing
conn.close
set conn=nothing
rs1.close
set rs1=nothing
rs11.close
set rs11=nothing
%>
