<!--#include file="Inc.asp"-->
<!--#include file="ydzq.asp"-->
<!--#include file="../gb2312.asp"-->
<%call head()
Call saycardd("每日签到")
about=request.form("about")
If about="" Then Call Error("签到内空不能为空！<br/><a href=""qian.asp?sid="&sid&"&amp;saytk="&saytk&""">返回每日签到</a>")
'-------------默认参数
if qianjb="" or Isnumeric(qianjb)=False then
qianjb=30
end if

if qiansjb="" or Isnumeric(qiansjb)=False then
qiansjb=230
end if
'-------------默认参数

dim signIn,signCi
set rs=server.createobject("adodb.recordset")
rs.open "select signIn,signCi from Users where ID = " & myid,conn,1,2
signIn = rs("signIn")
signCi = rs("signCi")

if signCi = 0 then
signIn = (date() - 1)
end if

dim chaDay
chaDay = DateDiff("d", signIn, date())

if chaDay = 0 then
  rs.close
  set rs=Nothing
Call Error("你今天已经签到过了！<br/><a href=""qian.asp?sid="&sid&"&amp;saytk="&saytk&""">返回每日签到</a>")

elseif chaDay = 1 then
  rs("signIn") = date()
  rs("signCi") = rs("signCi") + 1
else
  rs("signIn") = date()
  rs("signCi") = 1
end if
rs.update

Response.write "签到成功，"

dim gCent
if rs("signCi") mod 7 = 0 then
  gCent = abs(qiansjb)
  Response.write "恭喜获得"&abs(qiansjb)&"金币！"
else
  gCent = abs(qianjb)
  Response.write "恭喜获得"&abs(qianjb)&"金币！"
end if

Response.write "连续7天签到就可获得额外"&qiansjb&"金币的奖励！"&chr(13)
if rs("signCi") > 1 then
Response.write "<br/>您已经连续签到"&rs("signCi")&"天。"&chr(13)
end if


id=request.querystring("id")
logo=request.form("logo")

dim qianconn
set qianconn=Createobject("ADODB.Connection")
qianconn.ConnectionString="DBQ="& server.mappath("/shujuku/chajianshujuku/qian/saytk_qian")& ";DRIVER={Microsoft Access Driver (*.mdb)};"
qianconn.open

                set rs=server.createobject("adodb.recordset")
                sql="select * from qian"
                 rs.open sql,qianconn,3,3
                 rs.addnew
                 rs("about")=Left(about,50)
				 rs("txt")=myni
                 rs("userid")=myid
				 rs("op")=logo
				 rs("times")=date()
                 rs.update
                 rs.close


rs.close
set rs=nothing

'加币
conn.execute("update Users Set myjb = myjb + "&gCent&" where ID="&myid)
conn.close
set conn=Nothing
qianconn.close
set qianconn=Nothing

response.write "<br/><a href=""qian.asp?sid="&sid&"&amp;saytk="&saytk&""">返回每日签到</a>"&chr(13)
%>
<!--#include file="fanhui.asp"-->
<%call headsay()%>