<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../Conn.asp"-->
<!--#include file="TaskConfig.asp"-->
<!--#include file="../HSK_Cls/HSK.MemberCls.asp"-->
<!--#include file="../HSK_Cls/HSK.Label.CommonCls.asp"-->
<%
Dim KSCls
Set KSCls = New IndexCls
KSCls.Run()
Set KSCls = Nothing

Class IndexCls
	Private HSK, KSUser
	
	Private Sub Class_Initialize()
		Set KSUser = New UserCls
		Set HSK = CreateObject("ASP_AiCaiBa.AiCaiBa")
		Set HSK = HSK.AiCaiBa (TaskConfig,1005)
	End Sub
	
	Private Sub Class_Terminate()
		Call CloseConn()
		Set KSUser=Nothing
		HSK.Class_Terminate()
		Set HSK=Nothing
	End Sub
		
	Public Sub Run()
		Dim LoginTF
		LoginTF=Cbool(KSUser.UserLoginChecked)
		IF LoginTF=false  Then
			GCls.ComeUrl=GCls.GetUrl()
			Response.Redirect("/user/login/")
			Exit Sub
		End If
		
		Dim RefreshTime: RefreshTime = 2 	'设置防刷新时间,如果不开启请填写0  可自行修改
		If RefreshTime > 0 Then
			If DateDiff("s", Session("RefreshTime"), Now()) <= RefreshTime Then
				Response.Write "<META http-equiv=Content-Type content=text/html; chaRset=gb2312><meta HTTP-EQUIV=REFRESH CONTENT=" & RefreshTime & "><p align=center><br><br><br><font color=#ff0000><b>为了防止用户恶意刷新，本页面启用了防刷新机制，请不要在" & RefreshTime & "秒内连续刷新本页面<br><br>正在打开页面，请稍后……</b></font></p>"
				Response.End
			End If
			Session("RefreshTime") = Now()
		End If
		
		Call HSK.CheckTask()
			'超时没发货，将自动设发货
	Conn.Execute("UPDate KS_U_sxyrw Set KS_DeliveryDate=GetDate(), KS_Status=3 WHERE (KS_Status = 2) AND (KS_BuyUserName IS NOT NULL) AND (KS_BuyShopName IS NOT NULL) AND DATEDIFF(" & DataPart_S & ", KS_PayDate, " & SqlNowString & ") > " & Delivery_OverTime)
		Dim Template,KSR
		FCls.RefreshType = "Index"   
		Set KSR = New Refresh
		Template = KSR.LoadTemplate("Template/刷客列表栏目页.html")
		Template = KSR.KSLabelReplaceAll(Template)
		Set KSR = Nothing
		Call HSK.InitialSearch()
		Call HSK.InitialTemplate(Template)
	End Sub
		
End Class
%>