<!-- #include file=../../inc/BBSsetup.asp -->
<!-- #include file=../../inc/Board_Popfun.asp -->
<!-- #include file=../../inc/Ubbcode.asp -->
<!-- #include file=../../inc/Constellation2.asp -->
<!-- #include file=../inc/bbsmanage_Fun.asp -->
<%
DEF_BBS_HomeUrl = "../../"
server.scriptTimeOut = 99999
Rem -------------------------------------------------------
Rem ------------重新计算用户农历生日-----------------------
Rem -------------------------------------------------------
initDatabase
UpdateNongLi
CloseDatabase

Function UpdateNongLi()

	If CheckSupervisorUserName = 0 or GBL_UserID = 0 Then Exit Function
	If Request.Form("SureFlag") <> "E72ksiOkw2" Then
		%>
			<p><form action=UpdateUserNongLi.asp method=post>
			<b><font color=ff0000 class=RedFont>确定此操作吗?<br>
			<br>
			<input type=hidden name=SureFlag value="E72ksiOkw2">
			
			<input type=submit value=确定进行 class=fmbtn>
			</form>
		<%
	Else
		Dim NowID,EndFlag,Temp
		NowID = 0
		EndFlag = 0
		Dim Rs,SQL,GetData,n
	
		Dim RecordCount,CountIndex
		SQL = "Select count(*) from [LeadBBS_User]"
		Set Rs = Con.ExeCute(SQL)
		If Rs.Eof Then
			RecordCount = 0
		Else
			RecordCount = Rs(0)
			If isNull(RecordCount) Then RecordCount = 0
		End If
		Rs.Close
		Set Rs = Nothing
		If RecordCount < 1 Then RecordCount = 1
		CountIndex = 0
		%>
		<p style="font-size:9pt">下面开始重新生成用户农历生日，共有<%=RecordCount%>个用户待更新
	
		<table width="400" border="0" cellspacing="1" cellpadding="1">
			<tr> 
				<td bgcolor=000000>
		<table width="400" border="0" cellspacing="0" cellpadding="1">
			<tr> 
				<td bgcolor=ffffff height=9><img src=../../images/vote.gif width=0 height=16 id=img1 name=img1 align=absmiddle></td></tr></table>
		</td></tr></table> <span id=txt1 name=txt1 style="font-size:9pt">0</span><span style="font-size:9pt">%</span>
		<%
		Response.Flush
		Do while EndFlag = 0
			SQL = "Select ID,birthday from LeadBBS_User where ID>" & NowID & " order by id ASC"
			Set Rs = Con.ExeCute(SQL)
			GBL_DBNum = GBL_DBNum + 1
			If Rs.Eof Then
				EndFlag = 1
				Rs.Close
				Set Rs = Nothing
				Exit Do
			Else
				GetData = Rs.GetRows(-1)
				Rs.Close
				Set Rs = Nothing
			End If
			For N = 0 to Ubound(GetData,2)
				NowID = GetData(0,n)
				SQL = RestoreTime(cCur("0" & GetData(1,n)))
				If isTrueDate(SQL) Then
					Temp = cCur(Left(SQL,4))
					If Temp > 1950 and Temp < 2050 Then
						SQL = GetTimeValue(ConvertToNongLi(SQL))
						If SQL = "" Then SQL = 0
						Con.ExeCute("Update LeadBBS_User Set NongLiBirth=" & SQL & " where ID=" & NowID)
					Else
						Con.ExeCute("Update LeadBBS_User Set NongLiBirth=0 where ID=" & NowID)
					End If
				End If
				CountIndex = CountIndex + 1
				If (CountIndex mod 100) = 0 Then
					Response.Write "<script>img1.width=" & Fix((CountIndex/RecordCount) * 400) & ";" & VbCrLf
					Response.Write "txt1.innerHTML=""" & FormatNumber(CountIndex/RecordCount*100,4,-1) & """;" & VbCrLf
					Response.Write "img1.title=""(" & CountIndex & ")"";</script>" & VbCrLf
					Response.Flush
				End If
			Next
		Loop
		%>
		<script>img1.width=400;
		txt1.innerHTML="100";</script>
		<%
	End If

End Function
%>完成