<%
Set Conn=Server.CreateObject("ADODB.Connection")
'ConnStr="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password='';Initial Catalog=chinasdjy;Data Source=M"
'ConnStr="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=hy;Password=CZZXZC;Initial Catalog=hy;Data Source=(local)"


ConnStr="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=blueyrr;Password='gannima123';Initial Catalog=hiseshipingjiaoyou;Data Source=(local)"


Conn.Open Connstr


''''''''判断服务器时间'''''''''''''''

set upday=conn.execute("select upday from system ")

upsql="update [system] set upday="&day(now())
'response.Write(upsql)


if upday("upday")<>day(now()) then

conn.execute(upsql)

'''''''''''''''''''重置状态''''''''''''

conn.execute("update user_info set pm=0,mx=0,tj=0")

'''''''''''''''''''''''''''''''''''''

''''''''服务到期自动删除'''''''''''''


conn.execute("delete from fw where dq<getdate()")


''''''''删除结束'''''''''''''''''''''

''''''''排名服务'''''''''''''''''''''
set pm1=conn.execute("select uid from fw where fwid=3")
do while not pm1.eof

conn.execute("update user_info set pm=1 where userid="&pm1("uid"))

pm1.movenext
loop
'''''''''明星会员''''''''''''''''''''

set mx1=conn.execute("select uid from fw where fwid=6")
do while not mx1.eof
conn.execute("update user_info set mx=1 where userid="&mx1("uid"))
mx1.movenext
loop

'''''''''''''''推荐会员''''''''''''''''''''''''''''

set tj1=conn.execute("select uid from fw where fwid=4")
do while not tj1.eof
conn.execute("update user_info set tj=1 where userid="&tj1("uid"))
tj1.movenext
loop



'''''''''''''''''''''''''''''''''''''






end if
'''''''''''''''''''

Function ReplaceBadChar(strChar)
    If strChar = "" Or IsNull(strChar) Then
        ReplaceBadChar = ""
        Exit Function
    End If
    Dim strBadChar, arrBadChar, tempChar, i
    strBadChar = "',^,&,?,(,),<,>,[,],{,},/,\,;,:," & Chr(34) & "," & Chr(0) & ""
    arrBadChar = Split(strBadChar, ",")
    tempChar = strChar
    For i = 0 To UBound(arrBadChar)
        tempChar = Replace(tempChar, arrBadChar(i), "")
    Next
    ReplaceBadChar = tempChar
End Function

function convert(str)
    str=replace(str,"'","’")
    str=replace(str,"""","&quot;")
    str=replace(str," ","&nbsp;")
    str=replace(str,"<","&lt;")
    str=replace(str,">","&gt;")
    str=replace(str,chr(13),"<br>")
    convert=str
End function

function inconvert(str)
   if str<>"" and not isnull(str) then
    str=replace(str,"’","'")
    str=replace(str,"&quot;","""")
    str=replace(str,"&nbsp;"," ")
    str=replace(str,"&lt;","<")
    str=replace(str,"&gt;",">")
    str=replace(str,"<br>",chr(13))
    inconvert=str
	end if
End function
%>

<%
Sub BackInfo(GotoFile)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>操作成功</title>
<link href="../style.css" rel="stylesheet" type="text/css">
<meta HTTP-EQUIV=refresh Content='1;url=<%=GotoFile%>'>
</head>

<table border="0" cellspacing="0" width="100%" cellpadding="0" height="418" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td width="100%" height="418" valign="middle" align="center" class="STYLE4">
<b>恭喜，您信息已经提交成功！<a href="<%=GotoFile%>"><font color="#996633">返回</font></a></b></td>
</tr>
</table>
</body>
</html>
<%
End Sub

Sub rsclose()
  rs.close
  set rs=nothing
End Sub

Sub dbclose()
  conn.close
  set conn=nothing
End Sub
%>

