<%if session("user")="" then
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"window.close();</SCRIPT>"
response.end
end if
if session("id")="" then 
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"window.close()';</SCRIPT>"
response.end
end If
url=Request.ServerVariables("HTTP_REFERER")
%>
<!--#include file="conn/conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>保存银两-<%=webname%></title>
</head>

<body>

<%
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open "select * from [snsn_user] where [Username]='"&session("user")&"'",conn,1,3
stay_min=datediff("n",rs("logindate"),now())

'倍率加分
Set rs1= Server.CreateObject("ADODB.Recordset") 
sql="select * from snsn_zy where zy='"&rs("zy")&"' and dj="&rs("dj")
rs1.open sql,conn,1,3
newtime=stay_min*rs1("jiadian")
if newtime>0 then
rs("jifen")=rs("jifen")+newtime
rs("logindate")=now()
rs.Update
session("jifen")=rs("jifen")
if left(stay_min,1)="." then
stay_min="0"&stay_min
end if
if left(newtime,1)="." then
newtime="0"&newtime
end if
end if
%>
<script language="javascript">
alert("保存成功!!!\n您在站内停留了<%=stay_min%>分钟，获得<%=newtime%>点积分！")
//window.close()
<%if newtime>0 then%>
//window.opener.location.reload(); 
this.location.href='<%=url%>';
<%end if%>
</script>

</body>
</html>
